changeset 5061:e808627bd16f

Renamed projects.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 08 Mar 2012 19:24:17 +0100
parents 4ed4295ce15f
children 5e9f38419819
files graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/AssignRegisters.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/ResolveDataFlow.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/Location.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/LocationMap.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/LocationUtil.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/MoveResolver.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/ComputeLinearScanOrder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/ControlFlowOptimizer.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/EdgeMoveOptimizer.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Range.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/debug/package-info.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/InstructionPrinter.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/package-info.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/graph/MergeableState.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/graph/PostOrderNodeIterator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/graph/package-info.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/package-info.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BoxingEliminationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ConvertDeoptimizeToGuardPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/DeadCodeEliminationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ExpandBoxingNodesPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/FloatingReadPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/GlobalValueNumberingPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IdentifyBoxingPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InsertStateAfterPlaceholderPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/Phase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/PhasePlan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/PhiStampPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ReadEliminationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SafepointPollingEliminationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/BlockClosure.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/SchedulePhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/UnscheduleNodes.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64Backend.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRLowerable.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64MethodEndStub.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirAssembler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PostOrderBlockIterator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypesPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/ScheduledNodeIterator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/ArrayMap.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/BitMap2D.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/BlockWorkList.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/GraphOrder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/IntList.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/Util.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugConfig.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpScope.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugMetric.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugTimer.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValue.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/MetricImpl.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/TimerCloseable.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/TimerImpl.java graal/com.oracle.graal.examples/src/examples/HelloWorld.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/BitMap.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraalInternalError.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraphEvent.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraphEventLog.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeBitMap.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeFlood.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInfo.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInputList.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInputsIterable.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeList.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeMap.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeSuccessorList.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeSuccessorsIterable.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeUsagesList.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeWorkList.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/VerificationError.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/FilteredNodeIterable.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterable.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterator.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicate.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicates.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/PredicatedProxyNodeIterator.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/package-info.java graal/com.oracle.graal.graph/test/com/oracle/graal/graph/test/TestNode.java graal/com.oracle.graal.graph/test/com/oracle/graal/graph/test/TypedNodeIteratorTest.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/Compiler.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilerImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilerObject.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotProxy.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/Logger.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/LoggingProxy.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/package-info.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ArrayWriteBarrier.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/FieldWriteBarrier.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/package-info.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotConstantPool.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotExceptionHandler.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodData.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodDataAccessor.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodUnresolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotNoProfilingInfo.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRegisterConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotSignature.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeUnresolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/TemplateFlag.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/CompilationServer.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/InvocationSocket.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/Remote.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/ReplacingStreams.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/package-info.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopySnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/UnsafeSnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64TailcallOp.java graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrScope.java graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeLookupSwitch.java graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeStream.java graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeSwitch.java graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeTableSwitch.java graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/Bytecodes.java graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/Bytes.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/ConvertJTT.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_0.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_anewarray.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_areturn.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_arraylength.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_athrow.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_baload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_bastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_caload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_castore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2f.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dadd.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_daload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp07.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp08.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp09.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp10.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ddiv.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dmul.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_drem.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dreturn.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2d.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fadd.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_faload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp07.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp08.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp09.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp10.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fdiv.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fmul.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fneg.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_frem.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_freturn.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fsub.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_b.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_c.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_d.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_f.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_i.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_l.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_s.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_z.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2b.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2c.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2d.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2f.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2l.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2s.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iaload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iand.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iconst.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifgt.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifle.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iflt.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifne.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_4.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_imul.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ineg.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_instanceof.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokeinterface.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokestatic.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokevirtual.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ior.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ireturn.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishl.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishr.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_isub.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iushr.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ixor.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2d.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2f.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_laload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_land.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lcmp.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_0.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lmul.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lneg.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lor.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lreturn.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshl.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshr.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lsub.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lushr.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lxor.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_new.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_newarray.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putfield.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putstatic.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_saload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_sastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch4.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload0.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore0.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_anewarray.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_arraylength.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow0.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_baload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_bastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_caload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_castore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast3.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast4.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast5.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast6.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_daload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_dastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_faload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_fastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_getfield.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_iaload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_iastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokespecial01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_irem.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_laload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_lastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_lrem.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_monitorenter.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_multianewarray.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_newarray.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_putfield.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_saload.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_sastore.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_1.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_00.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_07.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_08.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_09.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_10.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_11.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Locals.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Finally01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Finally02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_AIOOBE_00.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_CCE_00.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_00.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InNested.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_NPE_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_convert01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_count.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_dead01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_demo01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_idea.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_invoke01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_life.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_series.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_trees01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6186134.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6196102.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6753639.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6850611.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6959129.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test7005594.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/Class_getName.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_setOut.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/Thread_setName.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/UnsafeAccess01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Boxed_TYPE_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Bridge_method01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/ClassLoader_loadClass01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_Literal01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_asSubclass01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getComponentType01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getInterfaces01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSuperClass01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isArray01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInterface01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isPrimitive01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Double_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Double_toString.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Float_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Float_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Float_03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_abs.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_cos.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log10.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_pow.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sin.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sqrt.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_tan.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_equals01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_getClass01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_hashCode01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/ProcessEnvironment_init.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/StringCoding_Scale.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_valueOf01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/System_identityHashCode01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/DegeneratedLoop.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop07.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop08.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop09.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop11.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop12.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop13.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop14.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopInline.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopNewInstance.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopPhi.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopSwitch01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BC_invokevirtual2.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigByteParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigDoubleParams02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigInterfaceParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigLongParams02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigParamsAlignment.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigShortParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigVirtualParams01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/Bubblesort.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/Fibonacci.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/Matrix01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/ReferenceMap01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/StrangeFrames.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/String_format01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/String_format02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_String01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_boolean01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_byte01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_char01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_double01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_float01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_int01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_long01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_short01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayCopy01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayLength01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_16.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_4.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_16.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_4.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_16.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_4.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_16.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_4.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C16.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C24.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C32.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BlockSkip01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Conditional01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Cast01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_InstanceOf01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Math01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/LLE_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/List_reorder_bug.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Convert01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Double01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Float01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/TypeCastElem.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Loop01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getBoolean01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getByte01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getChar01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getDouble01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getFloat01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getInt01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLength01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLong01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getShort01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setBoolean01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setByte01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setChar01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setDouble01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setFloat01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setInt01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setLong01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setShort01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredField01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredMethod01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance06.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance07.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_getType01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_except01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_virtual01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getParameterTypes01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getReturnType01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Reflection_getCallerClass01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_contended01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_notowner01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_currentThread01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_holdsLock01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isAlive01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted04.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted05.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join03.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new02.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_setPriority01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_sleep01.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_yield01.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64LIRInstruction.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SlowPath.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInsertionBuffer.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRXirInstruction.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueUtil.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/Block.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/BlockMap.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/CFGVerifier.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/ControlFlowGraph.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/Loop.java graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/GraalRuntime.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractStateSplit.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AnchorNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BooleanNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSplitNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EndNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LocalNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopEndNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ReturnNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ScheduledNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueUtil.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ArithmeticNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatAddNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatArithmeticNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatDivNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatMulNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatSubNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatingNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerAddNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerSubNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LogicNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NormalizeCompareNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NullCheckNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AbstractCallNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/Access.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AccessNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxingMethodPool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingAccessNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LookupSwitchNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadHubNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SafeAccessNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SafeReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SafeWriteNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/TableSwitchNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteMemoryCheckpointNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessMonitorNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewObjectArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewTypeArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeCheckNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Canonicalizable.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeAnalyzable.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeField.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeOp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRLowerable.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Lowerable.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Simplifiable.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/SimplifierTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/BoxedVirtualObjectNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/util/ComputeImmediateDominator.java graal/com.oracle.graal.nodes/src/com/oracle/graal/util/NodeIterators.java graal/com.oracle.graal.nodes/src/com/oracle/graal/util/TreeIterators.java graal/com.oracle.graal.nodes/test/test/com/oracle/graal/nodes/Main.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BasicIdealGraphPrinter.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/DoubleSnippets.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/FloatSnippets.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/NodeClassSnippets.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippet.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetsInterface.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ArrayHeaderSizeNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64MathIntrinsicOp.java graal/com.oracle.graal.snippets/test/test/com/oracle/graal/snippets/package-info.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/BoxingEliminationTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/ConditionTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/DegeneratedLoopsTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/EscapeAnalysisTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/FloatingReadTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalRuntimeAccess.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphScheduleTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/IfBoxingEliminationTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/IfCanonicalizerTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeExceptionTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/MonitorTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/NestedLoopTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/PhiCreationTests.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/ScalarTypeSystemTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/StraighteningTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeSystemTest.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/AssignRegisters.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/ResolveDataFlow.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/Location.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/LocationMap.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/LocationUtil.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/MoveResolver.java graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/ComputeLinearScanOrder.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/ControlFlowOptimizer.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/EdgeMoveOptimizer.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/Range.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/debug/package-info.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/InstructionPrinter.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/package-info.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/graph/MergeableState.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/graph/PostOrderNodeIterator.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/graph/package-info.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/package-info.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/BoxingEliminationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ConvertDeoptimizeToGuardPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/DeadCodeEliminationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ExpandBoxingNodesPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/FloatingReadPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/GlobalValueNumberingPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/IdentifyBoxingPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/InsertStateAfterPlaceholderPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/Phase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/PhasePlan.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/PhiStampPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ReadEliminationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/SafepointPollingEliminationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/schedule/BlockClosure.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/schedule/SchedulePhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/schedule/UnscheduleNodes.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64Backend.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRLowerable.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64MethodEndStub.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirAssembler.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/types/PostOrderBlockIterator.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypesPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/types/ScheduledNodeIterator.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/ArrayMap.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/BitMap2D.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/BlockWorkList.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/GraphOrder.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/IntList.java graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/Util.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/Debug.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugConfig.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugDumpScope.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugMetric.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugTimer.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/DebugValue.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/MetricImpl.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/TimerCloseable.java graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/TimerImpl.java graal/com.oracle.max.graal.examples/src/examples/HelloWorld.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/BitMap.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/GraalInternalError.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/Graph.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/GraphEvent.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/GraphEventLog.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/Node.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeBitMap.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeClass.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeFlood.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeInfo.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeInputList.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeInputsIterable.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeList.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeMap.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeSuccessorList.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeSuccessorsIterable.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeUsagesList.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeWorkList.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/VerificationError.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/FilteredNodeIterable.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterable.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterator.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicate.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicates.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/PredicatedProxyNodeIterator.java graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/package-info.java graal/com.oracle.max.graal.graph/test/com/oracle/graal/graph/test/TestNode.java graal/com.oracle.max.graal.graph/test/com/oracle/graal/graph/test/TypedNodeIteratorTest.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/Compiler.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/CompilerImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/CompilerObject.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotProxy.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/Logger.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/LoggingProxy.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/package-info.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ArrayWriteBarrier.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/FieldWriteBarrier.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/package-info.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotConstantPool.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotExceptionHandler.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethod.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodData.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodDataAccessor.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodUnresolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotNoProfilingInfo.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRegisterConfig.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotSignature.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotType.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeUnresolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/TemplateFlag.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/CompilationServer.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/InvocationSocket.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/Remote.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/ReplacingStreams.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/package-info.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopySnippets.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/UnsafeSnippets.java graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64TailcallOp.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/BciBlockMapping.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/JsrScope.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeLookupSwitch.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeStream.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeSwitch.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeTableSwitch.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/Bytecodes.java graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/Bytes.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/ConvertJTT.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_0.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_anewarray.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_areturn.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_arraylength.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_athrow.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_baload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_bastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_caload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_castore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2f.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dadd.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_daload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp07.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp08.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp09.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp10.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ddiv.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dmul.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_drem.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dreturn.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2d.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fadd.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_faload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp07.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp08.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp09.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp10.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fdiv.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fmul.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fneg.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_frem.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_freturn.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fsub.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_b.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_c.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_d.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_f.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_i.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_l.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_s.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_z.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2b.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2c.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2d.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2f.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2l.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2s.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iaload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iand.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iconst.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifgt.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifle.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iflt.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifne.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_4.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_imul.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ineg.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_instanceof.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokeinterface.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokestatic.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokevirtual.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ior.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ireturn.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishl.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishr.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_isub.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iushr.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ixor.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2d.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2f.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_laload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_land.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lcmp.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_0.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lmul.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lneg.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lor.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lreturn.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshl.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshr.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lsub.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lushr.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lxor.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_new.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_newarray.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putfield.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putstatic.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_saload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_sastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch4.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload0.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore0.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_anewarray.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_arraylength.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow0.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_baload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_bastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_caload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_castore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast3.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast4.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast5.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast6.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_daload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_dastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_faload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_fastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_getfield.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_iaload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_iastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokespecial01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_irem.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_laload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_lastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_lrem.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_monitorenter.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_multianewarray.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_newarray.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_putfield.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_saload.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_sastore.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_1.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_00.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_07.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_08.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_09.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_10.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_11.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Locals.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Finally01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Finally02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_AIOOBE_00.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_CCE_00.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_00.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InNested.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_NPE_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_convert01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_count.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_dead01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_demo01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_idea.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_invoke01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_life.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_series.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_trees01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6186134.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6196102.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6753639.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6850611.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6959129.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test7005594.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/Class_getName.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_setOut.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/Thread_setName.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/UnsafeAccess01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Boxed_TYPE_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Bridge_method01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/ClassLoader_loadClass01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_Literal01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_asSubclass01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getComponentType01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getInterfaces01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSuperClass01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isArray01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInterface01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isPrimitive01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Double_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Double_toString.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Float_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Float_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Float_03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_abs.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_cos.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log10.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_pow.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sin.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sqrt.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_tan.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_equals01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_getClass01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_hashCode01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/ProcessEnvironment_init.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/StringCoding_Scale.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_valueOf01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/System_identityHashCode01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/DegeneratedLoop.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop07.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop08.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop09.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop11.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop12.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop13.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop14.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopInline.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopNewInstance.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopPhi.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopSwitch01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BC_invokevirtual2.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigByteParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigDoubleParams02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigInterfaceParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigLongParams02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigParamsAlignment.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigShortParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigVirtualParams01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/Bubblesort.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/Fibonacci.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/Matrix01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/ReferenceMap01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/StrangeFrames.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/String_format01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/String_format02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_String01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_boolean01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_byte01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_char01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_double01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_float01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_int01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_long01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_short01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayCopy01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayLength01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_16.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_4.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_16.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_4.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_16.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_4.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_16.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_4.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C16.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C24.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C32.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BlockSkip01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Conditional01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Cast01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_InstanceOf01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Math01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/LLE_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/List_reorder_bug.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Convert01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Double01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Float01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/TypeCastElem.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Loop01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getBoolean01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getByte01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getChar01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getDouble01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getFloat01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getInt01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLength01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLong01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getShort01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setBoolean01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setByte01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setChar01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setDouble01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setFloat01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setInt01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setLong01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setShort01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredField01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredMethod01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance06.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance07.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_getType01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_except01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_virtual01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getParameterTypes01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getReturnType01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Reflection_getCallerClass01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_contended01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_notowner01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_currentThread01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_holdsLock01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isAlive01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted04.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted05.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join03.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new02.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_setPriority01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_sleep01.java graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_yield01.java graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64LIRInstruction.java graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SlowPath.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/FrameMap.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIR.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRInsertionBuffer.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRXirInstruction.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LabelRef.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/StandardOp.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/ValueUtil.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/Variable.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/Block.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/BlockMap.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/CFGVerifier.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/ControlFlowGraph.java graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/Loop.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/cri/GraalRuntime.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/AbstractStateSplit.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/AnchorNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/BooleanNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ControlSplitNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/EndNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FixedNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FrameState.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/IfNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/Invoke.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/LocalNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/LoopEndNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/PiNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ReturnNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ScheduledNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ValueUtil.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ArithmeticNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatAddNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatArithmeticNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatDivNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatMulNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatSubNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatingNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerAddNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerSubNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/LogicNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/NormalizeCompareNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/NullCheckNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/AbstractCallNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/Access.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/AccessNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/BoxingMethodPool.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingAccessNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/LookupSwitchNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/ReadHubNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SafeAccessNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SafeReadNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SafeWriteNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/TableSwitchNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/WriteMemoryCheckpointNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessMonitorNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewObjectArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewTypeArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/TypeCheckNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/Canonicalizable.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeAnalyzable.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeField.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeOp.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/LIRLowerable.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/Lowerable.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/Simplifiable.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/SimplifierTool.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/virtual/BoxedVirtualObjectNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectFieldNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/util/ComputeImmediateDominator.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/util/NodeIterators.java graal/com.oracle.max.graal.nodes/src/com/oracle/graal/util/TreeIterators.java graal/com.oracle.max.graal.nodes/test/test/com/oracle/graal/nodes/Main.java graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/BasicIdealGraphPrinter.java graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/DoubleSnippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/FloatSnippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/NodeClassSnippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/Snippet.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/Snippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/SnippetsInterface.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/nodes/ArrayHeaderSizeNode.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64MathIntrinsicOp.java graal/com.oracle.max.graal.snippets/test/test/com/oracle/graal/snippets/package-info.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/BoxingEliminationTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/ConditionTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/DegeneratedLoopsTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/EscapeAnalysisTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/FloatingReadTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/GraalRuntimeAccess.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/GraphScheduleTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/IfBoxingEliminationTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/IfCanonicalizerTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/InvokeExceptionTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/InvokeTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/MonitorTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/NestedLoopTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/PhiCreationTests.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/ScalarTypeSystemTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/StraighteningTest.java graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/TypeSystemTest.java
diffstat 2108 files changed, 106668 insertions(+), 106668 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/AssignRegisters.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.simple;
+
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.alloc.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+public abstract class AssignRegisters {
+    public final LIR lir;
+    public final FrameMap frameMap;
+
+    public AssignRegisters(LIR lir, FrameMap frameMap) {
+        this.lir = lir;
+        this.frameMap = frameMap;
+    }
+
+    private CiBitMap curRegisterRefMap;
+    private CiBitMap curFrameRefMap;
+
+    public void execute() {
+        ValueProcedure useProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return use(value); } };
+        ValueProcedure defProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return def(value); } };
+        ValueProcedure setReferenceProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return setReference(value); } };
+
+        Debug.log("==== start assign registers ====");
+        for (int i = lir.linearScanOrder().size() - 1; i >= 0; i--) {
+            Block block = lir.linearScanOrder().get(i);
+            Debug.log("start block %s", block);
+
+            curRegisterRefMap = frameMap.initRegisterRefMap();
+            curFrameRefMap = frameMap.initFrameRefMap();
+
+            // Put all values live at the end of the block into the reference map.
+            locationsForBlockEnd(block).forEachLocation(setReferenceProc);
+
+            for (int j = block.lir.size() - 1; j >= 0; j--) {
+                LIRInstruction op = block.lir.get(j);
+                Debug.log("  op %d %s", op.id(), op);
+
+                op.forEachOutput(defProc);
+                op.forEachTemp(defProc);
+                op.forEachState(useProc);
+                op.forEachAlive(useProc);
+
+                if (op.info != null) {
+                    Debug.log("    registerRefMap: %s  frameRefMap: %s", curRegisterRefMap, curFrameRefMap);
+                    op.info.finish(new CiBitMap(curRegisterRefMap), new CiBitMap(curFrameRefMap), frameMap);
+
+                    if (op instanceof LIRXirInstruction) {
+                        LIRXirInstruction xir = (LIRXirInstruction) op;
+                        if (xir.infoAfter != null) {
+                            xir.infoAfter.finish(new CiBitMap(curRegisterRefMap), new CiBitMap(curFrameRefMap), frameMap);
+                        }
+                    }
+                }
+
+                // Process input operands after assigning the reference map, so that input operands that are used
+                // for the last time at this instruction are not part of the reference map.
+                op.forEachInput(useProc);
+            }
+            Debug.log("end block %s", block);
+        }
+        Debug.log("==== end assign registers ====");
+    }
+
+    private CiValue use(CiValue value) {
+        Debug.log("    use %s", value);
+        if (isLocation(value)) {
+            CiValue location = asLocation(value).location;
+            frameMap.setReference(location, curRegisterRefMap, curFrameRefMap);
+            return location;
+        } else {
+            frameMap.setReference(value, curRegisterRefMap, curFrameRefMap);
+            return value;
+        }
+    }
+
+    private CiValue def(CiValue value) {
+        Debug.log("    def %s", value);
+        if (isLocation(value)) {
+            CiValue location = asLocation(value).location;
+            frameMap.clearReference(location, curRegisterRefMap, curFrameRefMap);
+            return location;
+        } else {
+            frameMap.clearReference(value, curRegisterRefMap, curFrameRefMap);
+            return value;
+        }
+    }
+
+    private CiValue setReference(CiValue value) {
+        Debug.log("    setReference %s", value);
+        frameMap.setReference(asLocation(value).location, curRegisterRefMap, curFrameRefMap);
+        return value;
+    }
+
+    protected abstract LocationMap locationsForBlockEnd(Block block);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.simple;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.lir.ValueUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+public class DataFlowAnalysis {
+    private final LIR lir;
+    private final RiRegisterConfig registerConfig;
+
+    public DataFlowAnalysis(LIR lir, RiRegisterConfig registerConfig) {
+        this.lir = lir;
+        this.registerConfig = registerConfig;
+    }
+
+    public void execute() {
+        numberInstructions();
+        backwardDataFlow();
+    }
+
+
+    private List<Block> blocks() {
+        return lir.linearScanOrder();
+    }
+
+    private int numVariables() {
+        return lir.numVariables();
+    }
+
+    private boolean isAllocatableRegister(CiValue value) {
+        return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+    }
+
+
+    private int[] definitions;
+    private BitSet[] blockLiveIn;
+    private Block[] opIdBlock;
+    private Object[] opIdKilledValues;
+
+
+    public BitSet liveIn(Block block) {
+        return blockLiveIn[block.getId()];
+    }
+    private void setLiveIn(Block block, BitSet liveIn) {
+        blockLiveIn[block.getId()] = liveIn;
+    }
+
+    private Block blockOf(int opId) {
+        return opIdBlock[opId >> 1];
+    }
+    private void setBlockOf(int opId, Block block) {
+        opIdBlock[opId >> 1] = block;
+    }
+
+    private Object killedValues(int opId) {
+        return opIdKilledValues[opId];
+    }
+    private void setKilledValues(int opId, Object killedValues) {
+        opIdKilledValues[opId] = killedValues;
+    }
+
+    public void forEachKilled(LIRInstruction op, boolean end, ValueProcedure proc) {
+        Object entry = killedValues(op.id() + (end ? 1 : 0));
+        if (entry == null) {
+            // Nothing to do
+        } else if (entry instanceof CiValue) {
+            CiValue newValue = proc.doValue((CiValue) entry, null, null);
+            assert newValue == entry : "procedure does not allow to change values";
+        } else {
+            CiValue[] values = (CiValue[]) entry;
+            for (int i = 0; i < values.length; i++) {
+                if (values[i] != null) {
+                    CiValue newValue = proc.doValue(values[i], null, null);
+                    assert newValue == values[i] : "procedure does not allow to change values";
+                }
+            }
+        }
+    }
+
+    public int definition(Variable value) {
+        return definitions[value.index];
+    }
+
+    /**
+     * Numbers all instructions in all blocks. The numbering follows the {@linkplain ComputeLinearScanOrder linear scan order}.
+     */
+    private void numberInstructions() {
+        ValueProcedure defProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return setDef(value); } };
+
+        int numInstructions = 0;
+        for (Block block : blocks()) {
+            numInstructions += block.lir.size();
+        }
+        opIdBlock = new Block[numInstructions];
+        opIdKilledValues = new Object[numInstructions << 1];
+        definitions = new int[numVariables()];
+
+        curOpId = 0;
+        for (Block block : blocks()) {
+            for (LIRInstruction op : block.lir) {
+                op.setId(curOpId);
+                setBlockOf(curOpId, block);
+
+                op.forEachTemp(defProc);
+                op.forEachOutput(defProc);
+
+                curOpId += 2; // numbering of lirOps by two
+            }
+        }
+        assert curOpId == numInstructions << 1;
+    }
+
+    private CiValue setDef(CiValue value) {
+        if (isVariable(value)) {
+            assert definitions[asVariable(value).index] == 0 : "Variable defined twice";
+            definitions[asVariable(value).index] = curOpId;
+        }
+        return value;
+    }
+
+
+    private BitSet variableLive;
+    private BitSet registerLive;
+    private int curOpId;
+
+    private void backwardDataFlow() {
+        ValueProcedure inputProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return use(value, curOpId); } };
+        ValueProcedure aliveProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return use(value, curOpId + 1); } };
+        ValueProcedure tempProc =     new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return def(value, true); } };
+        ValueProcedure outputProc =   new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return def(value, false); } };
+
+        blockLiveIn = new BitSet[blocks().size()];
+        registerLive = new BitSet();
+
+        Debug.log("==== start backward data flow analysis ====");
+        for (int i = blocks().size() - 1; i >= 0; i--) {
+            Block block = blocks().get(i);
+            Debug.log("start block %s  loop %s", block, block.getLoop());
+
+            variableLive = new BitSet();
+            for (Block sux : block.getSuccessors()) {
+                BitSet suxLive = liveIn(sux);
+                if (suxLive != null) {
+                    Debug.log("  sux %s  suxLive: %s", sux, suxLive);
+                    variableLive.or(suxLive);
+                }
+            }
+
+            assert registerLive.isEmpty() : "no fixed register must be alive before processing a block";
+
+            for (int j = block.lir.size() - 1; j >= 0; j--) {
+                LIRInstruction op = block.lir.get(j);
+                curOpId = op.id();
+                Debug.log("  op %d %s  variableLive: %s  registerLive: %s", curOpId, op, variableLive, registerLive);
+
+                op.forEachOutput(outputProc);
+                op.forEachTemp(tempProc);
+                op.forEachState(aliveProc);
+                op.forEachAlive(aliveProc);
+                op.forEachInput(inputProc);
+            }
+
+            assert registerLive.isEmpty() : "no fixed register must be alive after processing a block";
+            assert liveIn(block) == null;
+            setLiveIn(block, variableLive);
+
+            if (block.isLoopHeader()) {
+                Debug.log("  loop header, propagating live set to loop blocks  variableLive: %s", variableLive);
+                // All variables that are live at the beginning of a loop are also live the whole loop.
+                // This is guaranteed by the SSA form.
+                for (Block loop : block.getLoop().blocks) {
+                    BitSet loopLiveIn = liveIn(loop);
+                    assert loopLiveIn != null : "All loop blocks must have been processed before the loop header";
+                    loopLiveIn.or(variableLive);
+                    Debug.log("    block %s  loopLiveIn %s", loop, loopLiveIn);
+                }
+            }
+
+            Debug.log("end block %s  variableLive: %s", block, variableLive);
+        }
+        Debug.log("==== end backward data flow analysis ====");
+    }
+
+    private CiValue use(CiValue value, int killOpId) {
+        Debug.log("    use %s", value);
+        if (isVariable(value)) {
+            int variableIdx = asVariable(value).index;
+            assert definitions[variableIdx] < curOpId;
+            if (!variableLive.get(variableIdx)) {
+                Debug.log("      set live variable %d", variableIdx);
+                variableLive.set(variableIdx);
+                kill(value, killOpId);
+            }
+
+        } else if (isAllocatableRegister(value)) {
+            int regNum = asRegister(value).number;
+            if (!registerLive.get(regNum)) {
+                Debug.log("      set live register %d", regNum);
+                registerLive.set(regNum);
+                kill(value, killOpId);
+            }
+        }
+        return value;
+    }
+
+    private CiValue def(CiValue value, boolean isTemp) {
+        Debug.log("    def %s", value);
+        if (isVariable(value)) {
+            int variableIdx = asVariable(value).index;
+            assert definitions[variableIdx] == curOpId;
+            if (variableLive.get(variableIdx)) {
+                Debug.log("      clear live variable %d", variableIdx);
+                assert !isTemp : "temp variable cannot be used after the operation";
+                variableLive.clear(variableIdx);
+            } else {
+                // Variable has never been used, so kill it immediately after the definition.
+                kill(value, curOpId + 1);
+            }
+
+        } else if (isAllocatableRegister(value)) {
+            int regNum = asRegister(value).number;
+            if (registerLive.get(regNum)) {
+                Debug.log("      clear live register %d", regNum);
+                assert !isTemp : "temp variable cannot be used after the operation";
+                registerLive.clear(regNum);
+            } else {
+                // Register has never been used, so kill it immediately after the definition.
+                kill(value, curOpId + 1);
+            }
+        }
+        return value;
+    }
+
+    private void kill(CiValue value, int opId) {
+        if (opId < 0) {
+            return;
+        }
+        if (isVariable(value)) {
+            int defOpId = definitions[asVariable(value).index];
+            assert defOpId > 0 && defOpId <= opId;
+
+            Block defBlock = blockOf(defOpId);
+            Block useBlock = blockOf(opId);
+
+            if (useBlock.getLoop() != null && useBlock.getLoop() != defBlock.getLoop()) {
+                // This is a value defined outside of the loop it is currently used in.  Therefore, it is live the whole loop
+                // and is not killed by the current instruction.
+                Debug.log("      no kill because use in %s, definition in %s", useBlock.getLoop(), defBlock.getLoop());
+                return;
+            }
+        }
+        Debug.log("      kill %s at %d", value, opId);
+
+        Object entry = killedValues(opId);
+        if (entry == null) {
+            setKilledValues(opId, value);
+        } else if (entry instanceof CiValue) {
+            setKilledValues(opId, new CiValue[] {(CiValue) entry, value});
+        } else {
+            CiValue[] killed = (CiValue[]) entry;
+            for (int i = 0; i < killed.length; i++) {
+                if (killed[i] == null) {
+                    killed[i] = value;
+                    return;
+                }
+            }
+            int oldLen = killed.length;
+            killed = Arrays.copyOf(killed, oldLen * 2);
+            setKilledValues(opId, killed);
+            killed[oldLen] = value;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,614 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.simple;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
+import com.oracle.graal.alloc.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+public class LinearScanAllocator {
+    private final LIR lir;
+    private final FrameMap frameMap;
+
+    private final DataFlowAnalysis dataFlow;
+
+    public LinearScanAllocator(LIR lir, FrameMap frameMap) {
+        this.lir = lir;
+        this.frameMap = frameMap;
+
+        this.dataFlow = new DataFlowAnalysis(lir, frameMap.registerConfig);
+        this.blockBeginLocations = new LocationMap[lir.linearScanOrder().size()];
+        this.blockEndLocations = new LocationMap[lir.linearScanOrder().size()];
+        this.moveResolver = new MoveResolverImpl(lir, frameMap);
+
+        this.variableLastUse = new int[lir.numVariables()];
+    }
+
+    private class MoveResolverImpl extends MoveResolver {
+        public MoveResolverImpl(LIR lir, FrameMap frameMap) {
+            super(lir, frameMap);
+        }
+
+        @Override
+        protected CiValue scratchRegister(Variable spilled) {
+            GraalInternalError.shouldNotReachHere("needs working implementation");
+
+            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+            CiRegister[] availableRegs = categorizedRegs.get(spilled.flag);
+            for (CiRegister reg : availableRegs) {
+                if (curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null) {
+                    return reg.asValue(spilled.kind);
+                }
+            }
+            throw new CiBailout("No register found");
+        }
+    }
+
+    private class ResolveDataFlowImpl extends ResolveDataFlow {
+        public ResolveDataFlowImpl(LIR lir, MoveResolver moveResolver, DataFlowAnalysis dataFlow) {
+            super(lir, moveResolver, dataFlow);
+        }
+
+        @Override
+        protected LocationMap locationsForBlockBegin(Block block) {
+            return beginLocationsFor(block);
+        }
+
+        @Override
+        protected LocationMap locationsForBlockEnd(Block block) {
+            return endLocationsFor(block);
+        }
+    }
+
+    private class AssignRegistersImpl extends AssignRegisters {
+        public AssignRegistersImpl(LIR lir, FrameMap frameMap) {
+            super(lir, frameMap);
+        }
+
+        @Override
+        protected LocationMap locationsForBlockEnd(Block block) {
+            return endLocationsFor(block);
+        }
+    }
+
+
+    private int maxRegisterNum() {
+        return frameMap.target.arch.registers.length;
+    }
+
+    private boolean isAllocatableRegister(CiValue value) {
+        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+    }
+
+
+    private final LocationMap[] blockBeginLocations;
+
+    private LocationMap beginLocationsFor(Block block) {
+        return blockBeginLocations[block.getId()];
+    }
+    private void setBeginLocationsFor(Block block, LocationMap locations) {
+        blockBeginLocations[block.getId()] = locations;
+    }
+
+    private final LocationMap[] blockEndLocations;
+
+    private LocationMap endLocationsFor(Block block) {
+        return blockEndLocations[block.getId()];
+    }
+    private void setEndLocationsFor(Block block, LocationMap locations) {
+        blockEndLocations[block.getId()] = locations;
+    }
+
+    private final int[] variableLastUse;
+
+    private int lastUseFor(Variable variable) {
+        return variableLastUse[variable.index];
+    }
+
+    private void setLastUseFor(Variable variable, int lastUse) {
+        variableLastUse[variable.index] = lastUse;
+    }
+
+    private MoveResolver moveResolver;
+    private LocationMap curLocations;
+    private CiValue[] curInRegisterState;
+    private CiValue[] curOutRegisterState;
+    private BitSet curLiveIn;
+    private LIRInstruction curOp;
+
+    /**
+     * The spill slot for a variable, if the variable has ever been spilled.
+     */
+    private LocationMap canonicalSpillLocations;
+
+    /**
+     * The register that a variable got assigned at its definition, and so it should get that register when reloading after spilling.
+     */
+    private LocationMap hintRegisterLocations;
+
+    public void execute() {
+        assert LIRVerifier.verify(true, lir, frameMap);
+
+        dataFlow.execute();
+        IntervalPrinter.printBeforeAllocation("Before register allocation", lir, frameMap.registerConfig, dataFlow);
+
+        allocate();
+
+        IntervalPrinter.printAfterAllocation("After linear scan allocation", lir, frameMap.registerConfig, dataFlow, blockEndLocations);
+
+        ResolveDataFlow resolveDataFlow = new ResolveDataFlowImpl(lir, moveResolver, dataFlow);
+        resolveDataFlow.execute();
+        frameMap.finish();
+
+        IntervalPrinter.printAfterAllocation("After resolve data flow", lir, frameMap.registerConfig, dataFlow, blockEndLocations);
+        assert RegisterVerifier.verify(lir, frameMap);
+
+        AssignRegisters assignRegisters = new AssignRegistersImpl(lir, frameMap);
+        assignRegisters.execute();
+
+        Debug.dump(lir, "After register asignment");
+        assert LIRVerifier.verify(false, lir, frameMap);
+    }
+
+    private void allocate() {
+        ValueProcedure recordUseProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return recordUse(value); } };
+        ValueProcedure killNonLiveProc =  new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return killNonLive(value); } };
+        ValueProcedure unblockProc =      new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return unblock(value); } };
+        ValueProcedure killProc =         new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return kill(value); } };
+        ValueProcedure blockProc =        new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return block(value); } };
+        ValueProcedure useProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, mode, flags); } };
+        ValueProcedure defProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return def(value, mode, flags); } };
+
+        Debug.log("==== start linear scan allocation ====");
+        canonicalSpillLocations = new LocationMap(lir.numVariables());
+        hintRegisterLocations = new LocationMap(lir.numVariables());
+        curInRegisterState = new CiValue[maxRegisterNum()];
+        curOutRegisterState = new CiValue[maxRegisterNum()];
+        for (Block block : lir.linearScanOrder()) {
+            Debug.log("start block %s %s", block, block.getLoop());
+
+            Arrays.fill(curOutRegisterState, null);
+            if (block.getDominator() != null) {
+                LocationMap dominatorState = endLocationsFor(block.getDominator());
+                curLocations = new LocationMap(dominatorState);
+                // Clear out all variables that are not live at the begin of this block
+                curLiveIn = dataFlow.liveIn(block);
+                curLocations.forEachLocation(killNonLiveProc);
+                assert checkInputState(block);
+            } else {
+                curLocations = new LocationMap(lir.numVariables());
+            }
+            Debug.log(logCurrentState());
+
+            for (int opIdx = 0; opIdx < block.lir.size(); opIdx++) {
+                LIRInstruction op = block.lir.get(opIdx);
+                curOp = op;
+
+                Debug.log("  op %d %s", op.id(), op);
+
+                System.arraycopy(curOutRegisterState, 0, curInRegisterState, 0, curOutRegisterState.length);
+
+                // Unblock fixed registers that are only used for inputs in curOutRegisterState.
+                dataFlow.forEachKilled(op, false, unblockProc);
+                // Block fixed registers defined by this instruction in curOutRegisterState.
+                op.forEachTemp(blockProc);
+                op.forEachOutput(blockProc);
+
+                op.forEachInput(recordUseProc);
+                op.forEachAlive(recordUseProc);
+
+                moveResolver.init(block.lir, opIdx);
+                // Process Alive before Input because they are more restricted and the same variable can be Alive and Input.
+                op.forEachAlive(useProc);
+                op.forEachInput(useProc);
+
+                dataFlow.forEachKilled(op, false, killProc);
+
+                if (op.hasCall()) {
+                    spillCallerSaveRegisters();
+                }
+                if (op instanceof StandardOp.PhiLabelOp) {
+                    assert opIdx == 0;
+                    phiRegisterHints(block);
+                }
+
+                op.forEachOutput(defProc);
+                op.forEachTemp(defProc);
+
+                // Fixed temp and output registers can evict variables from their assigned register, allocate new location for them.
+                fixupEvicted();
+                // State values are the least critical and can get the leftover registers (or stack slots if no more register available).
+                op.forEachState(useProc);
+
+                if (opIdx == 0) {
+                    assert !moveResolver.hasMappings() : "cannot insert spill moves before label";
+                    setBeginLocationsFor(block, new LocationMap(curLocations));
+                }
+                moveResolver.resolve();
+
+                dataFlow.forEachKilled(op, true, unblockProc);
+                dataFlow.forEachKilled(op, true, killProc);
+
+                curOp = null;
+            }
+
+            assert endLocationsFor(block) == null;
+            setEndLocationsFor(block, curLocations);
+
+            logCurrentState();
+            Debug.log("end block %s", block);
+        }
+
+        moveResolver.finish();
+        Debug.log("==== end linear scan allocation ====");
+    }
+
+    private CiValue killNonLive(CiValue value) {
+        assert isLocation(value);
+        if (!curLiveIn.get(asLocation(value).variable.index)) {
+            return null;
+
+        } else if (isAllocatableRegister(asLocation(value).location)) {
+            int regNum = asRegister(asLocation(value).location).number;
+            assert curOutRegisterState[regNum] == null;
+            curOutRegisterState[regNum] = value;
+        }
+        return value;
+    }
+
+    private CiValue unblock(CiValue value) {
+        if (isAllocatableRegister(value)) {
+            Debug.log("    unblock register %s", value);
+            int regNum = asRegister(value).number;
+            assert curOutRegisterState[regNum] == value;
+            curOutRegisterState[regNum] = null;
+        }
+        return value;
+    }
+
+    private CiValue kill(CiValue value) {
+        if (isVariable(value)) {
+            Location location = curLocations.get(asVariable(value));
+            Debug.log("    kill location %s", location);
+            if (isRegister(location.location)) {
+                int regNum = asRegister(location.location).number;
+                if (curOutRegisterState[regNum] == location) {
+                    curOutRegisterState[regNum] = null;
+                }
+            }
+            curLocations.clear(asVariable(value));
+        }
+        return value;
+    }
+
+
+    private CiValue block(CiValue value) {
+        if (isAllocatableRegister(value)) {
+            Debug.log("    block %s", value);
+            int regNum = asRegister(value).number;
+            assert curOutRegisterState[regNum] == null || curOutRegisterState[regNum] instanceof Location;
+            curOutRegisterState[regNum] = value;
+        }
+        return value;
+    }
+
+    private void spillCallerSaveRegisters() {
+        Debug.log("    spill caller save registers in curInRegisterState %s", Arrays.toString(curInRegisterState));
+        for (CiRegister reg : frameMap.registerConfig.getCallerSaveRegisters()) {
+            CiValue in = curInRegisterState[reg.number];
+            if (in != null && isLocation(in)) {
+                spill(asLocation(in));
+            }
+        }
+    }
+
+    private CiValue recordUse(CiValue value) {
+        if (isVariable(value)) {
+            assert lastUseFor(asVariable(value)) <= curOp.id();
+            setLastUseFor(asVariable(value), curOp.id());
+
+        }
+        return value;
+    }
+
+    private CiValue use(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        assert mode == OperandMode.Input || mode == OperandMode.Alive;
+        if (isVariable(value)) {
+            // State values are not recorded beforehand because it does not matter if they are spilled. Still, it is necessary to record them as used now.
+            recordUse(value);
+
+            Location curLoc = curLocations.get(asVariable(value));
+            if (isStackSlot(curLoc.location) && flags.contains(OperandFlag.Stack)) {
+                Debug.log("    use %s %s: use current stack slot %s", mode, value, curLoc.location);
+                return curLoc;
+            }
+            if (isRegister(curLoc.location)) {
+                int regNum = asRegister(curLoc.location).number;
+                assert curInRegisterState[regNum] == curLoc;
+                if (mode == OperandMode.Input || curOutRegisterState[regNum] == curLoc) {
+                    Debug.log("    use %s %s: use current register %s", mode, value, curLoc.location);
+                    return curLoc;
+                }
+            }
+
+            Debug.log("    use %s %s", mode, value);
+
+            Location newLoc = allocateRegister(asVariable(value), mode, flags);
+            if (newLoc != curLoc) {
+                moveResolver.add(curLoc, newLoc);
+            }
+            return newLoc;
+        } else {
+            assert !isAllocatableRegister(value) || curInRegisterState[asRegister(value).number] == value;
+        }
+        return value;
+    }
+
+    private static final EnumSet<OperandFlag> SPILL_FLAGS = EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+
+    private CiValue def(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        assert mode == OperandMode.Temp || mode == OperandMode.Output;
+        if (isVariable(value)) {
+            Debug.log("    def %s %s", mode, value);
+            assert curLocations.get(asVariable(value)) == null;
+
+            Location newLoc = allocateRegister(asVariable(value), mode, flags);
+            return newLoc;
+        }
+        return value;
+    }
+
+
+    private void fixupEvicted() {
+        for (int i = 0; i < curInRegisterState.length; i++) {
+            CiValue in = curInRegisterState[i];
+            CiValue out = curOutRegisterState[i];
+
+            if (in != null && in != out && isLocation(in) && curLocations.get(asLocation(in).variable) == in) {
+                Debug.log("    %s was evicted by %s, need to allocate new location", in, out);
+                Location oldLoc = asLocation(in);
+                Location newLoc = allocateRegister(oldLoc.variable, OperandMode.Alive, SPILL_FLAGS);
+                assert oldLoc != newLoc;
+                moveResolver.add(oldLoc, newLoc);
+            }
+
+
+        }
+    }
+
+
+    private void phiRegisterHints(Block block) {
+        Debug.log("    phi register hints for %s", block);
+        CiValue[] phiDefinitions = ((StandardOp.PhiLabelOp) block.lir.get(0)).getPhiDefinitions();
+        for (Block pred : block.getPredecessors()) {
+            CiValue[] phiInputs = ((StandardOp.PhiJumpOp) pred.lir.get(pred.lir.size() - 1)).getPhiInputs();
+
+            for (int i = 0; i < phiDefinitions.length; i++) {
+                CiValue phiDefinition = phiDefinitions[i];
+                CiValue phiInput = phiInputs[i];
+
+                if (isVariable(phiDefinition)) {
+                    Location hintResult = processRegisterHint(asVariable(phiDefinition), OperandMode.Output, phiInput);
+                    if (hintResult != null) {
+                        phiDefinitions[i] = hintResult;
+                    }
+                }
+            }
+        }
+    }
+
+    private Location processRegisterHint(Variable variable, OperandMode mode, CiValue registerHint) {
+        if (registerHint == null) {
+            return null;
+        }
+        Debug.log("      try registerHint for %s %s: %s", mode, variable, registerHint);
+        CiRegister hint = null;
+        if (isRegister(registerHint)) {
+            hint = asRegister(registerHint);
+        } else if (isLocation(registerHint) && isRegister(asLocation(registerHint).location)) {
+            hint = asRegister(asLocation(registerHint).location);
+        }
+        if (hint != null && hint.isSet(variable.flag) && isFree(hint, mode)) {
+            return selectRegister(hint, variable, mode);
+        }
+        return null;
+    }
+
+    private Location allocateRegister(final Variable variable, final OperandMode mode, EnumSet<OperandFlag> flags) {
+        if (flags.contains(OperandFlag.RegisterHint)) {
+            CiValue hintResult = curOp.forEachRegisterHint(variable, mode, new ValueProcedure() {
+                @Override
+                public CiValue doValue(CiValue registerHint) {
+                    return processRegisterHint(variable, mode, registerHint);
+                }
+            });
+            if (hintResult != null) {
+                return asLocation(hintResult);
+            }
+        }
+
+        CiValue hintResult = processRegisterHint(variable, mode, hintRegisterLocations.get(variable));
+        if (hintResult != null) {
+            return asLocation(hintResult);
+        }
+
+        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+        CiRegister[] availableRegs = categorizedRegs.get(variable.flag);
+
+        Location bestSpillCandidate = null;
+        for (CiRegister reg : availableRegs) {
+            if (isFree(reg, mode)) {
+                return selectRegister(reg, variable, mode);
+            } else {
+                Location spillCandidate = spillCandidate(reg);
+                if (betterSpillCandidate(spillCandidate, bestSpillCandidate)) {
+                    bestSpillCandidate = spillCandidate;
+                }
+            }
+        }
+
+        if (flags.contains(OperandFlag.Stack) && betterSpillCandidate(curLocations.get(variable), bestSpillCandidate)) {
+            return selectSpillSlot(variable);
+        }
+
+        if (bestSpillCandidate == null) {
+            // This should not happen as long as all LIR instructions have fulfillable register constraints. But be safe in product mode and bail out.
+            assert false;
+            throw new GraalInternalError("No register available");
+        }
+
+        spill(bestSpillCandidate);
+
+        return selectRegister(asRegister(bestSpillCandidate.location), variable, mode);
+    }
+
+    private void spill(Location value) {
+        Location newLoc = spillLocation(value.variable);
+        Debug.log("      spill %s to %s", value, newLoc);
+        if (!(curOp instanceof StandardOp.PhiLabelOp)) {
+            moveResolver.add(value, newLoc);
+        }
+        curLocations.put(newLoc);
+
+        CiRegister reg = asRegister(value.location);
+        assert curInRegisterState[reg.number] == value;
+        curInRegisterState[reg.number] = null;
+        if (curOutRegisterState[reg.number] == value) {
+            curOutRegisterState[reg.number] = null;
+        }
+    }
+
+    private boolean isFree(CiRegister reg, OperandMode mode) {
+        switch (mode) {
+            case Input:  return curInRegisterState[reg.number] == null;
+            case Alive:  return curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null;
+            case Temp:   return curOutRegisterState[reg.number] == null;
+            case Output: return curOutRegisterState[reg.number] == null;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private Location spillCandidate(CiRegister reg) {
+        CiValue in = curInRegisterState[reg.number];
+        CiValue out = curOutRegisterState[reg.number];
+        if (in == out && in != null && isLocation(in) && lastUseFor(asLocation(in).variable) < curOp.id()) {
+            return asLocation(in);
+        }
+        return null;
+    }
+
+    private boolean betterSpillCandidate(Location loc, Location compare) {
+        if (loc == null) {
+            return false;
+        }
+        if (compare == null) {
+            return true;
+        }
+        if (canonicalSpillLocations.get(loc.variable) != null && canonicalSpillLocations.get(compare.variable) == null) {
+            return true;
+        }
+        return dataFlow.definition(loc.variable) < dataFlow.definition(compare.variable);
+    }
+
+    private Location spillLocation(Variable variable) {
+        Location result = canonicalSpillLocations.get(variable);
+        if (result == null) {
+            result = new Location(variable, frameMap.allocateSpillSlot(variable.kind));
+            canonicalSpillLocations.put(result);
+        }
+        return result;
+    }
+
+    private Location selectRegister(CiRegister reg, Variable variable, OperandMode mode) {
+        assert isFree(reg, mode);
+
+        Location loc = new Location(variable, reg.asValue(variable.kind));
+        if (mode == OperandMode.Input || mode == OperandMode.Alive) {
+            curInRegisterState[reg.number] = loc;
+        }
+        curOutRegisterState[reg.number] = loc;
+        curLocations.put(loc);
+        recordUse(variable);
+        if (hintRegisterLocations.get(variable) == null) {
+            hintRegisterLocations.put(loc);
+        }
+
+        Debug.log("      selected register %s", loc);
+        return loc;
+    }
+
+    private Location selectSpillSlot(Variable variable) {
+        Location loc = spillLocation(variable);
+        curLocations.put(loc);
+        recordUse(variable);
+
+        Debug.log("      selected spill slot %s", loc);
+        return loc;
+    }
+
+    private boolean checkInputState(final Block block) {
+        final BitSet liveState = new BitSet();
+        curLocations.forEachLocation(new ValueProcedure() {
+            @Override
+            public CiValue doValue(CiValue value) {
+                liveState.set(asLocation(value).variable.index);
+
+                for (Block pred : block.getPredecessors()) {
+                    LocationMap predState = endLocationsFor(pred);
+                    if (predState != null) {
+                        assert predState.get(asLocation(value).variable) != null;
+                    } else {
+                        assert block.isLoopHeader();
+                    }
+                }
+                return value;
+            }
+        });
+        assert liveState.equals(curLiveIn);
+        return true;
+    }
+
+
+    private String logCurrentState() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append("  current lcoations: ");
+        curLocations.forEachLocation(new ValueProcedure() {
+            @Override
+            public CiValue doValue(CiValue value) {
+                sb.append(value).append(" ");
+                return value;
+            }
+        });
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/ResolveDataFlow.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.simple;
+
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.alloc.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.StandardOp.*;
+import com.oracle.graal.lir.cfg.*;
+
+public abstract class ResolveDataFlow {
+    public final LIR lir;
+    public final MoveResolver moveResolver;
+    public final DataFlowAnalysis dataFlow;
+
+    public ResolveDataFlow(LIR lir, MoveResolver moveResolver, DataFlowAnalysis dataFlow) {
+        this.lir = lir;
+        this.moveResolver = moveResolver;
+        this.dataFlow = dataFlow;
+    }
+
+    private LocationMap curFromLocations;
+
+    public void execute() {
+        ValueProcedure locMappingProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return locMapping(value); } };
+
+        Debug.log("==== start resolve data flow ====");
+        for (Block toBlock : lir.linearScanOrder()) {
+            PhiLabelOp phiDefs = null;
+            if (toBlock.lir.get(0) instanceof PhiLabelOp) {
+                phiDefs = (PhiLabelOp) toBlock.lir.get(0);
+            }
+
+            for (Block fromBlock : toBlock.getPredecessors()) {
+                Debug.log("start edge %s -> %s", fromBlock, toBlock);
+                findInsertPos(fromBlock, toBlock);
+
+                LocationMap toLocations = locationsForBlockBegin(toBlock);
+                curFromLocations = locationsForBlockEnd(fromBlock);
+                if (toLocations != curFromLocations) {
+                    toLocations.forEachLocation(locMappingProc);
+                }
+
+                if (phiDefs != null) {
+                    PhiJumpOp phiInputs = (PhiJumpOp) fromBlock.lir.get(fromBlock.lir.size() - 1);
+                    phiMapping(phiInputs.getPhiInputs(), phiDefs.getPhiDefinitions());
+                    phiInputs.markResolved();
+                }
+
+                moveResolver.resolve();
+                Debug.log("end edge %s -> %s", fromBlock, toBlock);
+            }
+
+            if (phiDefs != null) {
+                // Phi functions are resolved with moves now, so delete them.
+                phiDefs.markResolved();
+            }
+        }
+        moveResolver.finish();
+        Debug.log("==== end resolve data flow ====");
+    }
+
+    private CiValue locMapping(CiValue value) {
+        Location to = asLocation(value);
+        Location from = curFromLocations.get(to.variable);
+        if (value != from && from != null) {
+            moveResolver.add(from, to);
+        }
+        return value;
+    }
+
+    private void phiMapping(CiValue[] inputs, CiValue[] outputs) {
+        assert inputs.length == outputs.length;
+        for (int i = 0; i < inputs.length; i++) {
+            if (inputs[i] != outputs[i]) {
+                moveResolver.add(inputs[i], asLocation(outputs[i]));
+            }
+        }
+    }
+
+    private void findInsertPos(Block fromBlock, Block toBlock) {
+        assert fromBlock.getSuccessors().contains(toBlock) && toBlock.getPredecessors().contains(fromBlock);
+
+        if (fromBlock.numberOfSux() == 1) {
+            List<LIRInstruction> instructions = fromBlock.lir;
+            LIRInstruction instr = instructions.get(instructions.size() - 1);
+            assert instr instanceof StandardOp.JumpOp : "block does not end with an unconditional jump";
+            moveResolver.init(instructions, instructions.size() - 1);
+            Debug.log("  insert at end of %s before %d", fromBlock, instructions.size() - 1);
+
+        } else if (toBlock.numberOfPreds() == 1) {
+            moveResolver.init(toBlock.lir, 1);
+            Debug.log("  insert at beginning of %s before %d", toBlock, 1);
+
+        } else {
+            GraalInternalError.shouldNotReachHere("Critical edge not split");
+        }
+    }
+
+    protected abstract LocationMap locationsForBlockBegin(Block block);
+    protected abstract LocationMap locationsForBlockEnd(Block block);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,466 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.simple;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
+import com.oracle.graal.alloc.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+public class SpillAllAllocator {
+    private final LIR lir;
+    private final FrameMap frameMap;
+
+    private final DataFlowAnalysis dataFlow;
+
+    public SpillAllAllocator(LIR lir, FrameMap frameMap) {
+        this.lir = lir;
+        this.frameMap = frameMap;
+
+        this.dataFlow = new DataFlowAnalysis(lir, frameMap.registerConfig);
+        this.blockLocations = new LocationMap[lir.linearScanOrder().size()];
+        this.moveResolver = new MoveResolverImpl(lir, frameMap);
+    }
+
+    private class MoveResolverImpl extends MoveResolver {
+        public MoveResolverImpl(LIR lir, FrameMap frameMap) {
+            super(lir, frameMap);
+        }
+
+        @Override
+        protected CiValue scratchRegister(Variable spilled) {
+            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+            CiRegister[] availableRegs = categorizedRegs.get(spilled.flag);
+            for (CiRegister reg : availableRegs) {
+                if (curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null) {
+                    return reg.asValue(spilled.kind);
+                }
+            }
+            throw new CiBailout("No register found");
+        }
+    }
+
+    private class ResolveDataFlowImpl extends ResolveDataFlow {
+        public ResolveDataFlowImpl(LIR lir, MoveResolver moveResolver, DataFlowAnalysis dataFlow) {
+            super(lir, moveResolver, dataFlow);
+        }
+
+        @Override
+        protected LocationMap locationsForBlockBegin(Block block) {
+            assert block.numberOfPreds() > 0 && block.getDominator() != null;
+            return locationsFor(block.getDominator());
+        }
+
+        @Override
+        protected LocationMap locationsForBlockEnd(Block block) {
+            return locationsFor(block);
+        }
+    }
+
+    private class AssignRegistersImpl extends AssignRegisters {
+        public AssignRegistersImpl(LIR lir, FrameMap frameMap) {
+            super(lir, frameMap);
+        }
+
+        @Override
+        protected LocationMap locationsForBlockEnd(Block block) {
+            return locationsFor(block);
+        }
+    }
+
+
+    private int maxRegisterNum() {
+        return frameMap.target.arch.registers.length;
+    }
+
+    private boolean isAllocatableRegister(CiValue value) {
+        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+    }
+
+
+    private final LocationMap[] blockLocations;
+
+    private LocationMap locationsFor(Block block) {
+        return blockLocations[block.getId()];
+    }
+    private void setLocationsFor(Block block, LocationMap locations) {
+        blockLocations[block.getId()] = locations;
+    }
+
+    private MoveResolver moveResolver;
+    private LocationMap curStackLocations;
+    private LocationMap curRegisterLocations;
+    private Object[] curInRegisterState;
+    private Object[] curOutRegisterState;
+    private BitSet curLiveIn;
+    private LIRInstruction curInstruction;
+
+    public void execute() {
+        assert LIRVerifier.verify(true, lir, frameMap);
+
+        dataFlow.execute();
+        IntervalPrinter.printBeforeAllocation("Before register allocation", lir, frameMap.registerConfig, dataFlow);
+
+        allocate();
+
+        IntervalPrinter.printAfterAllocation("After spill all allocation", lir, frameMap.registerConfig, dataFlow, blockLocations);
+
+        ResolveDataFlow resolveDataFlow = new ResolveDataFlowImpl(lir, moveResolver, dataFlow);
+        resolveDataFlow.execute();
+        frameMap.finish();
+
+        IntervalPrinter.printAfterAllocation("After resolve data flow", lir, frameMap.registerConfig, dataFlow, blockLocations);
+        assert RegisterVerifier.verify(lir, frameMap);
+
+        AssignRegisters assignRegisters = new AssignRegistersImpl(lir, frameMap);
+        assignRegisters.execute();
+
+        Debug.dump(lir, "After register asignment");
+        assert LIRVerifier.verify(false, lir, frameMap);
+    }
+
+    private void allocate() {
+        ValueProcedure killNonLiveProc =  new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return killNonLive(value); } };
+        ValueProcedure killBeginProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return kill(value, false); } };
+        ValueProcedure killEndProc =      new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return kill(value, true); } };
+        ValueProcedure killLocationProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return killLocation(value); } };
+        ValueProcedure blockProc =        new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return block(value); } };
+        ValueProcedure loadProc =         new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return load(value, mode, flags); } };
+        ValueProcedure spillProc =        new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return spill(value, mode, flags); } };
+        ValueProcedure useSlotProc =      new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return useSlot(value); } };
+
+        Debug.log("==== start spill all allocation ====");
+        curInRegisterState = new Object[maxRegisterNum()];
+        curOutRegisterState = new Object[maxRegisterNum()];
+        curRegisterLocations = new LocationMap(lir.numVariables());
+        for (Block block : lir.linearScanOrder()) {
+            Debug.log("start block %s %s", block, block.getLoop());
+            assert checkEmpty(curOutRegisterState);
+
+            if (block.getDominator() != null) {
+                LocationMap dominatorState = locationsFor(block.getDominator());
+                curStackLocations = new LocationMap(dominatorState);
+                // Clear out all variables that are not live at the begin of this block
+                curLiveIn = dataFlow.liveIn(block);
+                curStackLocations.forEachLocation(killNonLiveProc);
+                assert checkInputState(block);
+            } else {
+                curStackLocations = new LocationMap(lir.numVariables());
+            }
+            Debug.log(logCurrentState());
+
+            for (int opIdx = 0; opIdx < block.lir.size(); opIdx++) {
+                LIRInstruction op = block.lir.get(opIdx);
+                curInstruction = op;
+                Debug.log("  op %d %s", op.id(), op);
+
+                assert curRegisterLocations.checkEmpty();
+
+                System.arraycopy(curOutRegisterState, 0, curInRegisterState, 0, curOutRegisterState.length);
+
+                // Block fixed registers that are defined by this instruction, so that they are no longer available for normal allocation.
+                op.forEachTemp(blockProc);
+                op.forEachOutput(blockProc);
+
+                moveResolver.init(block.lir, opIdx);
+                // Process Alive before Input because they are more restricted and the same variable can be Alive and Input.
+                op.forEachAlive(loadProc);
+                op.forEachInput(loadProc);
+                moveResolver.resolve();
+                op.forEachState(useSlotProc);
+
+                dataFlow.forEachKilled(op, false, killBeginProc);
+                assert !op.hasCall() || checkNoCallerSavedRegister() : "caller saved register in use accross call site";
+
+                moveResolver.init(block.lir, opIdx + 1);
+                op.forEachTemp(spillProc);
+                op.forEachOutput(spillProc);
+                moveResolver.resolve();
+
+                dataFlow.forEachKilled(op, true, killEndProc);
+                curRegisterLocations.forEachLocation(killLocationProc);
+
+                assert curRegisterLocations.checkEmpty();
+                curInstruction = null;
+            }
+            assert checkEmpty(curOutRegisterState);
+            assert locationsFor(block) == null;
+            setLocationsFor(block, curStackLocations);
+
+            logCurrentState();
+            Debug.log("end block %s", block);
+        }
+
+        moveResolver.finish();
+        Debug.log("==== end spill all allocation ====");
+    }
+
+    private CiValue killNonLive(CiValue value) {
+        assert isLocation(value);
+        if (!curLiveIn.get(asLocation(value).variable.index)) {
+            return null;
+        }
+        return value;
+    }
+
+    private CiValue kill(CiValue value, boolean end) {
+        if (isVariable(value)) {
+            Debug.log("    kill variable %s", value);
+
+            Variable variable = asVariable(value);
+            curStackLocations.clear(variable);
+
+            Location loc = curRegisterLocations.get(variable);
+            if (loc != null) {
+                killLocation(loc);
+                curRegisterLocations.clear(variable);
+
+                Debug.log("      location %s", loc);
+                assert isAllocatableRegister(loc.location);
+
+                int regNum = asRegister(loc.location).number;
+                if (curOutRegisterState[regNum] == loc) {
+                    curOutRegisterState[regNum] = null;
+                }
+            }
+
+        } else if (isAllocatableRegister(value)) {
+            Debug.log("    kill register %s", value);
+            int regNum = asRegister(value).number;
+            assert curOutRegisterState[regNum] == null || curOutRegisterState[regNum] instanceof LIRInstruction && curInstruction != null;
+
+            if (end || curOutRegisterState[regNum] != curInstruction) {
+                curOutRegisterState[regNum] = null;
+            }
+
+        } else {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+        return value;
+    }
+
+    private CiValue killLocation(CiValue value) {
+        Debug.log("    kill location %s", value);
+        assert isAllocatableRegister(asLocation(value).location);
+
+        int regNum = asRegister(asLocation(value).location).number;
+        if (curOutRegisterState[regNum] == value) {
+            curOutRegisterState[regNum] = null;
+        }
+        return null;
+    }
+
+    private CiValue block(CiValue value) {
+        if (isAllocatableRegister(value)) {
+            Debug.log("    block %s", value);
+            int regNum = asRegister(value).number;
+            assert curInstruction != null;
+            assert curOutRegisterState[regNum] == null || curOutRegisterState[regNum] instanceof LIRInstruction;
+            curOutRegisterState[regNum] = curInstruction;
+        }
+        return value;
+    }
+
+    private CiValue load(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        assert mode == OperandMode.Input || mode == OperandMode.Alive;
+        if (flags.contains(OperandFlag.Stack)) {
+            return useSlot(value);
+        }
+        if (isVariable(value)) {
+            Debug.log("    load %s", value);
+            Location regLoc = curRegisterLocations.get(asVariable(value));
+            if (regLoc != null) {
+                // This variable has already been processed before.
+                Debug.log("      found location %s", regLoc);
+            } else {
+                regLoc = allocateRegister(asVariable(value), curInRegisterState, mode == OperandMode.Alive ? curOutRegisterState : null, mode, flags);
+                Location stackLoc = curStackLocations.get(asVariable(value));
+                assert stackLoc != null;
+                moveResolver.add(stackLoc, regLoc);
+            }
+            return regLoc;
+        } else {
+            assert !isAllocatableRegister(value) || curInRegisterState[asRegister(value).number] instanceof LIRInstruction;
+            return value;
+        }
+    }
+
+    private CiValue spill(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        assert mode == OperandMode.Temp || mode == OperandMode.Output;
+        if (flags.contains(OperandFlag.Stack)) {
+            return defSlot(value);
+        }
+        if (isVariable(value)) {
+            Debug.log("    spill %s", value);
+            assert curStackLocations.get(asVariable(value)) == null;
+            Location regLoc = allocateRegister(asVariable(value), null, curOutRegisterState, mode, flags);
+            if (mode == OperandMode.Output) {
+                Location stackLoc = new Location(asVariable(value), frameMap.allocateSpillSlot(value.kind));
+                curStackLocations.put(stackLoc);
+                moveResolver.add(regLoc, stackLoc);
+            }
+            return regLoc;
+        } else {
+            assert !isAllocatableRegister(value) || curOutRegisterState[asRegister(value).number] == curInstruction && curInstruction != null;
+            return value;
+        }
+    }
+
+    private CiValue useSlot(CiValue value) {
+        if (isVariable(value)) {
+            Debug.log("    useSlot %s", value);
+            Location stackLoc = curStackLocations.get(asVariable(value));
+            assert stackLoc != null;
+            Debug.log("      slot %s", stackLoc);
+            return stackLoc;
+        } else {
+            return value;
+        }
+    }
+
+    private CiValue defSlot(CiValue value) {
+        if (isVariable(value)) {
+            Debug.log("    assignSlot %s", value);
+            Location stackLoc = new Location(asVariable(value), frameMap.allocateSpillSlot(value.kind));
+            assert curStackLocations.get(asVariable(value)) == null;
+            curStackLocations.put(stackLoc);
+            Debug.log("      slot %s", stackLoc);
+            return stackLoc;
+        } else {
+            return value;
+        }
+    }
+
+    private Location allocateRegister(final Variable variable, final Object[] inRegisterState, final Object[] outRegisterState, OperandMode mode, EnumSet<OperandFlag> flags) {
+        if (flags.contains(OperandFlag.RegisterHint)) {
+            CiValue result = curInstruction.forEachRegisterHint(variable, mode, new ValueProcedure() {
+                @Override
+                public CiValue doValue(CiValue registerHint) {
+                    Debug.log("      registerHint %s", registerHint);
+                    CiRegister hint = null;
+                    if (isRegister(registerHint)) {
+                        hint = asRegister(registerHint);
+                    } else if (isLocation(registerHint) && isRegister(asLocation(registerHint).location)) {
+                        hint = asRegister(asLocation(registerHint).location);
+                    }
+                    if (hint != null && hint.isSet(variable.flag) && isFree(hint, inRegisterState, outRegisterState)) {
+                        return selectRegister(hint, variable, inRegisterState, outRegisterState);
+                    }
+                    return null;
+                }
+            });
+
+            if (result != null) {
+                return asLocation(result);
+            }
+        }
+
+        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+        CiRegister[] availableRegs = categorizedRegs.get(variable.flag);
+
+        for (CiRegister reg : availableRegs) {
+            if (isFree(reg, inRegisterState, outRegisterState)) {
+                return selectRegister(reg, variable, inRegisterState, outRegisterState);
+            }
+
+        }
+        throw new CiBailout("No register found");
+    }
+
+    private static boolean isFree(CiRegister reg, Object[] inRegisterState, Object[] outRegisterState) {
+        return (inRegisterState == null || inRegisterState[reg.number] == null) && (outRegisterState == null || outRegisterState[reg.number] == null);
+    }
+
+    private Location selectRegister(CiRegister reg, Variable variable, Object[] inRegisterState, Object[] outRegisterState) {
+        Location loc = new Location(variable, reg.asValue(variable.kind));
+        if (inRegisterState != null) {
+            inRegisterState[reg.number] = loc;
+        }
+        if (outRegisterState != null) {
+            outRegisterState[reg.number] = loc;
+        }
+        assert curRegisterLocations.get(variable) == null;
+        curRegisterLocations.put(loc);
+        Debug.log("      selected register %s", loc);
+        return loc;
+    }
+
+    private boolean checkInputState(final Block block) {
+        final BitSet liveState = new BitSet();
+        curStackLocations.forEachLocation(new ValueProcedure() {
+            @Override
+            public CiValue doValue(CiValue value) {
+                liveState.set(asLocation(value).variable.index);
+
+                for (Block pred : block.getPredecessors()) {
+                    LocationMap predState = locationsFor(pred);
+                    if (predState != null) {
+                        assert predState.get(asLocation(value).variable) == value;
+                    } else {
+                        assert block.isLoopHeader();
+                    }
+                }
+                return value;
+            }
+        });
+        assert liveState.equals(curLiveIn);
+        return true;
+    }
+
+    private boolean checkNoCallerSavedRegister() {
+        for (CiRegister reg : frameMap.registerConfig.getCallerSaveRegisters()) {
+            assert curOutRegisterState[reg.number] == null || curOutRegisterState[reg.number] == curInstruction : "caller saved register in use accross call site";
+        }
+        return true;
+    }
+
+    private static boolean checkEmpty(Object[] array) {
+        for (Object o : array) {
+            assert o == null;
+        }
+        return true;
+    }
+
+
+    private String logCurrentState() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append("  curVariableLocations: ");
+        curStackLocations.forEachLocation(new ValueProcedure() {
+            @Override
+            public CiValue doValue(CiValue value) {
+                sb.append(value).append(" ");
+                return value;
+            }
+        });
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.util;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.alloc.simple.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+public final class IntervalPrinter {
+
+    public static void printBeforeAllocation(String label, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow) {
+        if (Debug.isDumpEnabled()) {
+            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, null);
+            Debug.dump(lir, label);
+            Debug.dump(printer.execute(), label);
+        }
+    }
+
+    public static void printAfterAllocation(String label, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
+        if (Debug.isDumpEnabled()) {
+            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, blockEndLocations);
+            Debug.dump(lir, label);
+            Debug.dump(printer.execute(), label);
+        }
+    }
+
+
+    public static class Range {
+        public final int from;
+        public final int to;
+
+        public Range(int from, int to) {
+            this.from = from;
+            this.to = to;
+        }
+    }
+
+    public static class UsePosition {
+        public final int pos;
+        public final String kind;
+
+        public UsePosition(int pos, String kind) {
+            this.pos = pos;
+            this.kind = kind;
+        }
+    }
+
+    public static class Interval {
+        public final String name;
+        public final String description;
+        public final String variable;
+        public final String type;
+        public final List<Range> ranges;
+        public final List<UsePosition> uses;
+
+        protected final int orderNum;
+        protected int lastTo;
+
+        public Interval(int orderNum, String name, String description, String variable, String type) {
+            this.orderNum = orderNum;
+            this.name = name;
+            this.description = description;
+            this.variable = variable;
+            this.type = type;
+            this.ranges = new ArrayList<>();
+            this.uses = new ArrayList<>();
+        }
+    }
+
+
+    private final LIR lir;
+    private final RiRegisterConfig registerConfig;
+    private final DataFlowAnalysis dataFlow;
+    private final LocationMap[] blockEndLocations;
+    private final Variable[] variables;
+    private final Map<String, Interval> intervals;
+
+    private IntervalPrinter(LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
+        this.lir = lir;
+        this.registerConfig = registerConfig;
+        this.dataFlow = dataFlow;
+        this.blockEndLocations = blockEndLocations;
+        this.variables = new Variable[lir.numVariables()];
+        this.intervals = new HashMap<>();
+    }
+
+    private boolean isAllocatableRegister(CiValue value) {
+        return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+    }
+
+    private int curOpId;
+    private String curUseKind;
+
+    public Interval[] execute() {
+        ValueProcedure varProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return var(value); } };
+
+        for (Block block : lir.linearScanOrder()) {
+            for (LIRInstruction op : block.lir) {
+                op.forEachOutput(varProc);
+            }
+        }
+
+        ValueProcedure useProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, mode, flags); } };
+        ValueProcedure defProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return def(value, flags); } };
+
+        intervals.put("call", new Interval(-2, "call", "", "call", "hasCall"));
+        intervals.put("st", new Interval(-1, "st", "", "st", "hasState"));
+
+        for (int i = lir.linearScanOrder().size() - 1; i >= 0; i--) {
+            Block block = lir.linearScanOrder().get(i);
+
+            curOpId = block.getLastLirInstructionId() + 2;
+            for (Block sux : block.getSuccessors()) {
+                BitSet suxIn = dataFlow.liveIn(sux);
+                for (int idx = suxIn.nextSetBit(0); idx >= 0; idx = suxIn.nextSetBit(idx + 1)) {
+                    if (blockEndLocations != null) {
+                        out(blockEndLocations[block.getId()].get(variables[idx]));
+                    } else {
+                        out(variables[idx]);
+                    }
+                }
+            }
+
+            for (int j = block.lir.size() - 1; j >= 0; j--) {
+                LIRInstruction op = block.lir.get(j);
+                if (op.id() >= 0) {
+                    curOpId = op.id();
+                } else {
+                    curOpId = (curOpId - 1) | 1;
+                }
+
+                op.forEachOutput(defProc);
+                op.forEachTemp(defProc);
+                op.forEachInput(useProc);
+                op.forEachAlive(useProc);
+                curUseKind = "L";
+                op.forEachState(useProc);
+                curUseKind = null;
+
+                if (op.hasCall()) {
+                    intervals.get("call").ranges.add(new Range(curOpId, curOpId + 1));
+                }
+                if (op.info != null) {
+                    intervals.get("st").ranges.add(new Range(curOpId, curOpId + 1));
+                }
+            }
+
+            for (Interval interval : intervals.values()) {
+                if (interval.lastTo != 0) {
+                    interval.ranges.add(new Range(block.getFirstLirInstructionId(), interval.lastTo));
+                    interval.lastTo = 0;
+                }
+            }
+        }
+
+        Interval[] intervalsArray = intervals.values().toArray(new Interval[0]);
+        Arrays.sort(intervalsArray, new Comparator<Interval>() {
+            @Override
+            public int compare(Interval o1, Interval o2) {
+                return o1.orderNum - o2.orderNum;
+            }
+        });
+        return intervalsArray;
+    }
+
+    public CiValue var(CiValue value) {
+        if (isLocation(value)) {
+            variables[asLocation(value).variable.index] = asLocation(value).variable;
+        } else if (isVariable(value)) {
+            variables[asVariable(value).index] = asVariable(value);
+        }
+        return value;
+    }
+
+    private Interval findInterval(CiValue value) {
+        Interval interval;
+        if (isLocation(value)) {
+            Interval parent = findInterval(asLocation(value).variable);
+            String name = "v" + asLocation(value).variable.index + ":" + asLocation(value).location;
+            String description = isStackSlot(asLocation(value).location) ? "stack" : "";
+            interval = new Interval(asLocation(value).variable.index * 2 + 1001, name, description, parent.name, value.kind.javaName);
+
+        } else if (isVariable(value)) {
+            interval = new Interval(asVariable(value).index * 2 + 1000, value.toString(), "", value.toString(), value.kind.javaName);
+
+        } else if (isAllocatableRegister(value)) {
+            interval = new Interval(asRegister(value).number, asRegister(value).toString(), "", asRegister(value).toString(), "fixed");
+
+        } else {
+            return null;
+        }
+
+        Interval existing = intervals.get(interval.name);
+        if (existing != null) {
+            return existing;
+        }
+        intervals.put(interval.name, interval);
+        return interval;
+    }
+
+    private String useKind(EnumSet<OperandFlag> flags) {
+        if (curUseKind != null) {
+            return curUseKind;
+        } else if (flags.contains(OperandFlag.Stack)) {
+            return "S";
+        } else {
+            return "M";
+        }
+    }
+
+    private CiValue use(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        Interval interval = findInterval(value);
+        if (interval != null) {
+            if (interval.uses.size() == 0 || interval.uses.get(interval.uses.size() - 1).pos != curOpId) {
+                interval.uses.add(new UsePosition(curOpId, useKind(flags)));
+            }
+            if (interval.lastTo == 0) {
+                interval.lastTo = curOpId + (mode == OperandMode.Alive ? 1 : 0);
+            }
+        }
+        return value;
+    }
+
+    private CiValue def(CiValue value, EnumSet<OperandFlag> flags) {
+        Interval interval = findInterval(value);
+        if (interval != null) {
+            interval.uses.add(new UsePosition(curOpId, useKind(flags)));
+            if (interval.lastTo == 0) {
+                interval.ranges.add(new Range(curOpId, curOpId + 1));
+            } else {
+                interval.ranges.add(new Range(curOpId, interval.lastTo));
+            }
+            interval.lastTo = 0;
+        }
+        return value;
+    }
+
+    private CiValue out(CiValue value) {
+        Interval interval = findInterval(value);
+        if (interval != null) {
+            interval.lastTo = curOpId;
+        }
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/Location.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.util;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.lir.*;
+
+public class Location extends CiValue {
+    private static final long serialVersionUID = -1786677729152726126L;
+
+    public final Variable variable;
+    public final CiValue location;
+
+    public Location(Variable variable, CiValue location) {
+        super(variable.kind);
+        this.variable = variable;
+        this.location = location;
+
+        assert variable.kind == location.kind;
+    }
+
+    @Override
+    public String toString() {
+        return variable + "[" + location + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/LocationMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.util;
+
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+
+public class LocationMap {
+    private final Location[] locations;
+
+    public LocationMap(int numVariables) {
+        locations = new Location[numVariables];
+    }
+
+    public LocationMap(LocationMap template) {
+        locations = Arrays.copyOf(template.locations, template.locations.length);
+    }
+
+    public Location get(Variable variable) {
+        assert locations[variable.index] == null || locations[variable.index].variable == variable;
+        return locations[variable.index];
+    }
+
+    public void put(Location location) {
+        locations[location.variable.index] = location;
+    }
+
+    public void clear(Variable variable) {
+        locations[variable.index] = null;
+    }
+
+    public void forEachLocation(ValueProcedure proc) {
+        for (int i = 0; i < locations.length; i++) {
+            if (locations[i] != null) {
+                CiValue newValue = proc.doValue(locations[i], null, null);
+                assert newValue == null || asLocation(newValue).variable == locations[i].variable;
+                locations[i] = (Location) newValue;
+            }
+        }
+    }
+
+    public boolean checkEmpty() {
+        for (int i = 0; i < locations.length; i++) {
+            assert locations[i] == null;
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/LocationUtil.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.util;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.lir.*;
+
+public class LocationUtil extends ValueUtil {
+
+    public static boolean isLocation(CiValue value) {
+        assert value != null;
+        return value instanceof Location;
+    }
+
+    public static Location asLocation(CiValue value) {
+        assert value != null;
+        return (Location) value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/MoveResolver.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.util;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+
+public abstract class MoveResolver {
+    private final LIR lir;
+    private final FrameMap frameMap;
+    private final int[] registersBlocked;
+    private final Map<CiValue, Integer> valuesBlocked;
+    private final List<CiValue> mappingFrom;
+    private final List<Location> mappingTo;
+    private final LIRInsertionBuffer insertionBuffer;
+    private int insertPos;
+
+    public MoveResolver(LIR lir, FrameMap frameMap) {
+        this.lir = lir;
+        this.frameMap = frameMap;
+
+        registersBlocked = new int[frameMap.target.arch.registers.length];
+        valuesBlocked = new HashMap<>();
+
+        mappingFrom = new ArrayList<>();
+        mappingTo = new ArrayList<>();
+        insertionBuffer = new LIRInsertionBuffer();
+        insertPos = -1;
+
+        assert checkEmpty();
+    }
+
+    public void init(List<LIRInstruction> newInsertList, int newInsertPos) {
+        assert checkEmpty();
+
+        if (insertionBuffer.lirList() != newInsertList) {
+            // Block changed, so append insertionBuffer because it is bound to a specific block
+            finish();
+            insertionBuffer.init(newInsertList);
+        }
+        insertPos = newInsertPos;
+
+        assert checkValid();
+    }
+
+    public void add(CiValue from, Location to) {
+        assert checkValid();
+        assert isLocation(from) || isConstant(from);
+        assert from != to;
+
+        Debug.log("mr    add mapping from %s to %s", from, to);
+        mappingFrom.add(from);
+        mappingTo.add(to);
+
+        assert checkValid();
+    }
+
+    public boolean hasMappings() {
+        return mappingFrom.size() > 0;
+    }
+
+    public void resolve() {
+        assert checkValid();
+
+        if (mappingFrom.size() == 1) {
+            // If there is only one mapping, it is trivial that this mapping is safe to resolve.
+            Debug.log("mr    resolve  mappings: %d", mappingFrom.size());
+            insertMove(mappingFrom.get(0), mappingTo.get(0));
+            mappingFrom.remove(0);
+            mappingTo.remove(0);
+        } else if (mappingFrom.size() > 1) {
+            Debug.log("mr    resolve  mappings: %d", mappingFrom.size());
+            doResolve();
+        }
+        insertPos = -1;
+
+        assert checkEmpty();
+    }
+
+    public void finish() {
+        assert checkEmpty();
+
+        if (insertionBuffer.initialized()) {
+            insertionBuffer.finish();
+        }
+
+        assert !insertionBuffer.initialized() : "must be uninitialized now";
+        assert checkEmpty();
+    }
+
+
+    private void doResolve() {
+        // Block all registers and stack slots that are used as inputs of a move.
+        // When a register is blocked, no move to this register is emitted.
+        // This is necessary for detecting cycles in moves.
+        for (CiValue from : mappingFrom) {
+            block(from);
+        }
+
+        while (mappingFrom.size() > 0) {
+            boolean processed = false;
+            for (int i = mappingFrom.size() - 1; i >= 0; i--) {
+                CiValue from = mappingFrom.get(i);
+                Location to = mappingTo.get(i);
+
+                if (safeToProcessMove(from, to)) {
+                    insertMove(from, to);
+                    unblock(from);
+                    mappingFrom.remove(i);
+                    mappingTo.remove(i);
+                    processed = true;
+                }
+            }
+
+            if (!processed) {
+                // No move could be processed because there is a cycle in the move list
+                // (e.g., r1 -> r2, r2 -> r1), so one location must be spilled.
+                spill();
+            }
+        }
+    }
+
+    private void spill() {
+        Location spillCandidate = null;
+        int exchangeCandidate = -1;
+        int exchangeOther = -1;
+
+        for (int i = mappingFrom.size() - 1; i >= 0; i--) {
+            CiValue from = mappingFrom.get(i);
+            Location to = mappingTo.get(i);
+            assert !safeToProcessMove(from, to) : "would not be in this code otherwise";
+
+            if (isConstant(from)) {
+                continue;
+            }
+            CiValue fromLoc = asLocation(from).location;
+
+            // Check if we can insert an exchange to save us from spilling.
+            if (isRegister(fromLoc) && isRegister(to) && asRegister(fromLoc) != asRegister(to) && blockedCount(to) == 1) {
+                for (int j = mappingFrom.size() - 1; j >= 0; j--) {
+                    CiValue possibleOther = mappingFrom.get(j);
+                    if (isLocation(possibleOther)) {
+                        if (asLocation(possibleOther).location == to.location) {
+                            assert exchangeCandidate == -1 : "must not find twice because of blocked check above";
+                            exchangeCandidate = i;
+                            exchangeOther = j;
+                        } else if (i != j && asLocation(possibleOther).location == fromLoc) {
+                            // From is read multiple times, so exchange would be too complicated.
+                            exchangeCandidate = -1;
+                            break;
+                        }
+                    }
+                }
+            }
+
+            if (exchangeCandidate != -1) {
+                // Already found a result, no need to search further
+                break;
+            }
+            if (spillCandidate == null || isStackSlot(spillCandidate.location)) {
+                // this interval cannot be processed now because target is not free
+                spillCandidate = asLocation(from);
+            }
+        }
+
+        if (exchangeCandidate != -1) {
+            Location from = asLocation(mappingFrom.get(exchangeCandidate));
+            Location to = mappingTo.get(exchangeCandidate);
+            Location other = asLocation(mappingFrom.get(exchangeOther));
+
+            Location newOther = new Location(other.variable, from.variable);
+            mappingFrom.set(exchangeOther, newOther);
+
+            insertExchange(newOther, to);
+            unblock(to);
+            mappingFrom.remove(exchangeCandidate);
+            mappingTo.remove(exchangeCandidate);
+
+        } else {
+            assert spillCandidate != null : "no location for spilling found";
+
+            Location spillLocation = new Location(spillCandidate.variable, frameMap.allocateSpillSlot(spillCandidate.kind));
+            insertMove(spillCandidate, spillLocation);
+
+            for (int i = mappingFrom.size() - 1; i >= 0; i--) {
+                if (mappingFrom.get(i) == spillCandidate) {
+                    mappingFrom.set(i, spillLocation);
+                    unblock(spillCandidate);
+                    block(spillLocation);
+                }
+            }
+            assert blockedCount(spillCandidate) == 0 : "register must be unblocked after spilling";
+        }
+    }
+
+    private void block(CiValue value) {
+        if (isLocation(value)) {
+            CiValue location = asLocation(value).location;
+            if (isRegister(location)) {
+                registersBlocked[asRegister(location).number]++;
+            } else {
+                Integer count = valuesBlocked.get(location);
+                valuesBlocked.put(location, count == null ? 1 : count + 1);
+            }
+        }
+    }
+
+    private void unblock(CiValue value) {
+        if (isLocation(value)) {
+            assert blockedCount(asLocation(value)) > 0;
+            CiValue location = asLocation(value).location;
+            if (isRegister(location)) {
+                registersBlocked[asRegister(location).number]--;
+            } else {
+                Integer count = valuesBlocked.remove(location);
+                if (count > 1) {
+                    valuesBlocked.put(location, count - 1);
+                }
+            }
+        }
+    }
+
+    private int blockedCount(Location value) {
+        CiValue location = asLocation(value).location;
+        if (isRegister(location)) {
+            return registersBlocked[asRegister(location).number];
+        } else {
+            Integer count = valuesBlocked.get(location);
+            return count == null ? 0 : count;
+        }
+    }
+
+    private boolean safeToProcessMove(CiValue from, Location to) {
+        int count = blockedCount(to);
+        return count == 0 || (count == 1 && isLocation(from) && asLocation(from).location == to.location);
+    }
+
+    private void insertExchange(Location from, Location to) {
+        Debug.log("mr      XCHG %s, %s", from, to);
+        // TODO (cwimmer) create XCHG instruction and use it here
+        insertionBuffer.append(insertPos, null);
+        throw GraalInternalError.unimplemented();
+    }
+
+    private void insertMove(CiValue src, Location dst) {
+        if (isStackSlot(dst.location) && isLocation(src) && isStackSlot(asLocation(src).location)) {
+            // Move between two stack slots. We need a temporary registers. If the allocator can give
+            // us a free register, we need two moves: src->scratch, scratch->dst
+            // If the allocator cannot give us a free register (it returns a Location in this case),
+            // we need to spill the scratch register first, so we need four moves in total.
+
+            CiValue scratch = scratchRegister(dst.variable);
+
+            Location scratchSaved = null;
+            CiValue scratchRegister = scratch;
+            if (isLocation(scratch)) {
+                scratchSaved = new Location(asLocation(scratch).variable, frameMap.allocateSpillSlot(scratch.kind));
+                insertMove(scratch, scratchSaved);
+                scratchRegister = asLocation(scratch).location;
+            }
+            assert isRegister(scratchRegister);
+
+            Location scratchLocation = new Location(dst.variable, scratchRegister);
+            insertMove(src, scratchLocation);
+            insertMove(scratchLocation, dst);
+
+            if (scratchSaved != null) {
+                insertMove(scratchSaved, asLocation(scratch));
+            }
+
+        } else {
+            Debug.log("mr      MOV %s -> %s", src, dst);
+            insertionBuffer.append(insertPos, lir.spillMoveFactory.createMove(dst,  src));
+        }
+    }
+
+    /**
+     * Provides a register that can be used by the move resolver. If the returned value is a
+     * {@link CiRegisterValue}, the register can be overwritten without precautions. If the
+     * returned value is a {@link Location}, it needs to be spilled and rescued itself.
+     */
+    protected abstract CiValue scratchRegister(Variable spilled);
+
+    private boolean checkEmpty() {
+        assert insertPos == -1;
+        assert mappingFrom.size() == 0 && mappingTo.size() == 0;
+        for (int registerBlocked : registersBlocked) {
+            assert registerBlocked == 0;
+        }
+        assert valuesBlocked.size() == 0;
+        return true;
+    }
+
+    private boolean checkValid() {
+        assert insertPos != -1;
+        for (int registerBlocked : registersBlocked) {
+            assert registerBlocked == 0;
+        }
+        assert mappingFrom.size() == mappingTo.size();
+        assert insertionBuffer.initialized() && insertPos != -1;
+
+        for (int i = 0; i < mappingTo.size(); i++) {
+            CiValue from = mappingFrom.get(i);
+            Location to = mappingTo.get(i);
+
+            assert from.kind.stackKind() == to.kind;
+
+            for (int j = i + 1; j < mappingTo.size(); j++) {
+                Location otherTo = mappingTo.get(j);
+                assert to != otherTo && to.variable != otherTo.variable && to.location != otherTo.location : "Cannot write to same location twice";
+            }
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.alloc.util;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+public final class RegisterVerifier {
+    private final FrameMap frameMap;
+
+    /**
+     * All blocks that must be processed.
+     */
+    private final List<Block> workList;
+
+    /**
+     * Saved information of previous check.
+     * <br>
+     * State mapping: mapping from registers and stack slots ({@link CiRegister} and {@link Integer} stack slot offsets) to the
+     * value that is currently contained in there ({@link Location} for operands that were variables; {@link CiRegisterValue} or
+     * {@link CiStackSlot} for operands that used fixed registers or stack slots).
+     */
+    private final Map<Object, CiValue>[] blockStates;
+
+    private void addToWorkList(Block block) {
+        if (!workList.contains(block)) {
+            workList.add(block);
+        }
+    }
+
+    private Map<Object, CiValue> stateFor(Block block) {
+        return blockStates[block.getId()];
+    }
+
+    private void setStateFor(Block block, Map<Object, CiValue> savedState) {
+        blockStates[block.getId()] = savedState;
+    }
+
+    private static Map<Object, CiValue> copy(Map<Object, CiValue> inputState) {
+        return new HashMap<>(inputState);
+    }
+
+    public static boolean verify(LIR lir, FrameMap frameMap) {
+        RegisterVerifier verifier = new RegisterVerifier(lir, frameMap);
+        verifier.verify(lir.cfg.getStartBlock());
+        return true;
+    }
+
+    @SuppressWarnings("unchecked")
+    private RegisterVerifier(LIR lir, FrameMap frameMap) {
+        this.frameMap = frameMap;
+        this.workList = new LinkedList<>();
+        this.blockStates = new Map[lir.linearScanOrder().size()];
+    }
+
+    private Map<Object, CiValue> curInputState;
+
+    private void verify(Block startBlock) {
+        ValueProcedure useProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, flags); } };
+        ValueProcedure tempProc =   new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return temp(value); } };
+        ValueProcedure outputProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return output(value); } };
+
+        curInputState = new HashMap<>();
+        setStateFor(startBlock, curInputState);
+        addToWorkList(startBlock);
+
+        Debug.log("==== start verify register allocation ====");
+        do {
+            Block block = workList.remove(0);
+
+            // Must copy state because it is modified.
+            curInputState = copy(stateFor(block));
+            Debug.log("start block %s %s", block, block.getLoop());
+            Debug.log(logCurrentState());
+
+            for (LIRInstruction op : block.lir) {
+                Debug.log("  op %d %s", op.id(), op);
+
+                op.forEachInput(useProc);
+                if (op.hasCall()) {
+                    invalidateRegisters();
+                }
+                op.forEachAlive(useProc);
+                op.forEachState(useProc);
+                op.forEachTemp(tempProc);
+                op.forEachOutput(outputProc);
+            }
+
+            for (Block succ : block.getSuccessors()) {
+                processSuccessor(succ);
+            }
+
+            Debug.log("end block %s", block);
+        } while (!workList.isEmpty());
+        Debug.log("==== end verify register allocation ====");
+    }
+
+    private void processSuccessor(Block succ) {
+        Map<Object, CiValue> savedState = stateFor(succ);
+        if (savedState == null) {
+            // Block was not processed before, so set initial inputState.
+            Debug.log("  successor %s: initial visit", succ);
+            setStateFor(succ, copy(curInputState));
+            addToWorkList(succ);
+
+        } else {
+            // This block was already processed before.
+            // Check if new inputState is consistent with savedState.
+            Debug.log("  successor %s: state present", succ);
+            Iterator<Map.Entry<Object, CiValue>> iter = savedState.entrySet().iterator();
+            while (iter.hasNext()) {
+                Map.Entry<Object, CiValue> entry = iter.next();
+                CiValue savedValue = entry.getValue();
+                CiValue inputValue = curInputState.get(entry.getKey());
+
+                if (savedValue != inputValue) {
+                    // Current inputState and previous savedState assume a different value in this register.
+                    // Assume that this register is invalid and remove it from the saved state.
+                    Debug.log("    invalidating %s because it is inconsistent with %s", savedValue, inputValue);
+                    iter.remove();
+                    // Must re-visit this block.
+                    addToWorkList(succ);
+                }
+            }
+        }
+    }
+
+    private void invalidateRegisters() {
+        // Invalidate all caller save registers at calls.
+        Iterator<Object> iter = curInputState.keySet().iterator();
+        while (iter.hasNext()) {
+            Object value1 = iter.next();
+            if (value1 instanceof CiRegister && frameMap.registerConfig.getAttributesMap()[((CiRegister) value1).number].isCallerSave) {
+                Debug.log("    remove caller save register %s", value1);
+                iter.remove();
+            }
+        }
+    }
+
+    /**
+     * Gets the mapping key for a value. The key should be as narrow as possible, e.g., it should not
+     * include the kind of the value because we do not want to distinguish between the same register with
+     * different kinds.
+     */
+    private Object key(CiValue value) {
+        if (isLocation(value)) {
+            return key(asLocation(value).location);
+        } else if (isRegister(value)) {
+            return asRegister(value);
+        } else if (isStackSlot(value)) {
+            return Integer.valueOf(frameMap.offsetForStackSlot(asStackSlot(value)));
+        } else {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private boolean isIgnoredRegister(CiValue value) {
+        return isRegister(value) && !frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+    }
+
+    private CiValue use(CiValue value, EnumSet<OperandFlag> flags) {
+        if (!isConstant(value) && value != CiValue.IllegalValue && !isIgnoredRegister(value)) {
+            CiValue actual = curInputState.get(key(value));
+            if (actual == null && flags.contains(OperandFlag.Uninitialized)) {
+                // OK, since uninitialized values are allowed explicitly.
+            } else if (value != actual) {
+                Debug.log("Error in register allocation: %s != %s for key %s", value, actual, key(value));
+                Debug.log(logCurrentState());
+                throw GraalInternalError.shouldNotReachHere();
+            }
+        }
+        return value;
+    }
+
+    private CiValue temp(CiValue value) {
+        if (!isConstant(value) && value != CiValue.IllegalValue && !isIgnoredRegister(value)) {
+            Debug.log("    temp %s -> remove key %s", value, key(value));
+            curInputState.remove(key(value));
+        }
+        return value;
+    }
+
+    private CiValue output(CiValue value) {
+        if (value != CiValue.IllegalValue && !isIgnoredRegister(value)) {
+            Debug.log("    output %s -> set key %s", value, key(value));
+            curInputState.put(key(value), value);
+        }
+        return value;
+    }
+
+
+    private String logCurrentState() {
+        ArrayList<Object> keys = new ArrayList<>(curInputState.keySet());
+        Collections.sort(keys, new Comparator<Object>() {
+            @Override
+            public int compare(Object o1, Object o2) {
+                if (o1 instanceof CiRegister) {
+                    if (o2 instanceof CiRegister) {
+                        return ((CiRegister) o1).number - ((CiRegister) o2).number;
+                    } else {
+                        return -1;
+                    }
+                } else {
+                    if (o2 instanceof CiRegister) {
+                        return 1;
+                    } else {
+                        return ((Integer) o1).intValue() - ((Integer) o2).intValue();
+                    }
+                }
+            }
+        });
+
+        StringBuilder sb = new StringBuilder("    state: ");
+        for (Object key : keys) {
+            sb.append(key).append("=").append(curInputState.get(key)).append(" ");
+        }
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,283 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+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.graal.alloc.simple.*;
+import com.oracle.graal.compiler.alloc.*;
+import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
+import com.oracle.graal.compiler.schedule.*;
+import com.oracle.graal.compiler.target.*;
+import com.oracle.graal.compiler.types.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+
+public class GraalCompiler {
+
+    /**
+     * The target that this compiler has been configured for.
+     */
+    public final CiTarget target;
+
+    /**
+     * The runtime that this compiler has been configured for.
+     */
+    public final GraalRuntime runtime;
+
+    /**
+     * The XIR generator that lowers Java operations to machine operations.
+     */
+    public final RiXirGenerator xir;
+
+    /**
+     * The backend that this compiler has been configured for.
+     */
+    public final Backend backend;
+
+    public GraalCompiler(GraalRuntime runtime, CiTarget target, Backend backend, RiXirGenerator xirGen) {
+        this.runtime = runtime;
+        this.target = target;
+        this.xir = xirGen;
+        this.backend = backend;
+    }
+
+    public CiTargetMethod compileMethod(RiResolvedMethod method, int osrBCI, PhasePlan plan) {
+        return compileMethod(method, new StructuredGraph(method), osrBCI, plan);
+    }
+
+    public CiTargetMethod compileMethod(final RiResolvedMethod method, final StructuredGraph graph, int osrBCI, final PhasePlan plan) {
+        if (osrBCI != -1) {
+            throw new CiBailout("No OSR supported");
+        }
+
+        return Debug.scope(createScopeName(method), new Object[] {graph, method, this}, new Callable<CiTargetMethod>() {
+            public CiTargetMethod call() {
+                final CiAssumptions assumptions = GraalOptions.OptAssumptions ? new CiAssumptions() : null;
+                final LIR lir = Debug.scope("FrontEnd", new Callable<LIR>() {
+                    public LIR call() {
+                        return emitHIR(graph, assumptions, plan);
+                    }
+                });
+                final FrameMap frameMap = Debug.scope("BackEnd", lir, new Callable<FrameMap>() {
+                    public FrameMap call() {
+                        return emitLIR(lir, graph, method);
+                    }
+                });
+                return Debug.scope("CodeGen", frameMap, new Callable<CiTargetMethod>() {
+                    public CiTargetMethod call() {
+                        return emitCode(assumptions, method, lir, frameMap);
+                    }
+                });
+            }
+        });
+    }
+
+    private static String createScopeName(RiResolvedMethod method) {
+        if (Debug.isEnabled()) {
+            return String.format("[%s::%s]", createSimpleName(method.holder()), method.name());
+        } else {
+            return null;
+        }
+    }
+
+    private static String createSimpleName(RiResolvedType holder) {
+        String base = holder.name();
+        int slashIndex = base.lastIndexOf('/');
+        if (slashIndex == -1) {
+            slashIndex = 0;
+        }
+        return base.substring(slashIndex + 1, base.length() - 1);
+    }
+
+    /**
+     * Builds the graph, optimizes it.
+     */
+    public LIR emitHIR(StructuredGraph graph, CiAssumptions assumptions, PhasePlan plan) {
+
+        if (graph.start().next() == null) {
+            plan.runPhases(PhasePosition.AFTER_PARSING, graph);
+            new DeadCodeEliminationPhase().apply(graph);
+        } else {
+            Debug.dump(graph, "initial state");
+        }
+
+        new PhiStampPhase().apply(graph);
+
+        if (GraalOptions.ProbabilityAnalysis && graph.start().probability() == 0) {
+            new ComputeProbabilityPhase().apply(graph);
+        }
+
+        if (GraalOptions.Intrinsify) {
+            new IntrinsificationPhase(runtime).apply(graph);
+        }
+
+        if (GraalOptions.PropagateTypes) {
+            if (GraalOptions.OptCanonicalizer) {
+                new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
+            }
+
+            new PropagateTypesPhase(target, runtime, assumptions).apply(graph);
+        }
+
+        if (GraalOptions.Inline && !plan.isPhaseDisabled(InliningPhase.class)) {
+            new InliningPhase(target, runtime, null, assumptions, plan).apply(graph);
+            new DeadCodeEliminationPhase().apply(graph);
+            new PhiStampPhase().apply(graph);
+        }
+
+        if (GraalOptions.OptCanonicalizer) {
+            new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
+        }
+
+        if (GraalOptions.PropagateTypes) {
+            new PropagateTypesPhase(target, runtime, assumptions).apply(graph);
+        }
+
+        plan.runPhases(PhasePosition.HIGH_LEVEL, graph);
+
+        if (GraalOptions.OptLoops) {
+            new SafepointPollingEliminationPhase().apply(graph);
+        }
+
+        if (GraalOptions.EscapeAnalysis && !plan.isPhaseDisabled(EscapeAnalysisPhase.class)) {
+            new EscapeAnalysisPhase(target, runtime, assumptions, plan).apply(graph);
+            new PhiStampPhase().apply(graph);
+            if (GraalOptions.OptCanonicalizer) {
+                new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
+            }
+        }
+
+        if (GraalOptions.OptGVN) {
+            new GlobalValueNumberingPhase().apply(graph);
+        }
+
+        graph.mark();
+        new LoweringPhase(runtime).apply(graph);
+        new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph);
+
+        if (GraalOptions.Lower) {
+            new FloatingReadPhase().apply(graph);
+            if (GraalOptions.OptGVN) {
+                new GlobalValueNumberingPhase().apply(graph);
+            }
+            if (GraalOptions.OptReadElimination) {
+                new ReadEliminationPhase().apply(graph);
+            }
+        }
+        new DeadCodeEliminationPhase().apply(graph);
+
+        plan.runPhases(PhasePosition.MID_LEVEL, graph);
+
+        plan.runPhases(PhasePosition.LOW_LEVEL, graph);
+
+        final SchedulePhase schedule = new SchedulePhase();
+        schedule.apply(graph);
+        Debug.dump(schedule, "final schedule");
+
+        final Block[] blocks = schedule.getCFG().getBlocks();
+        final Block startBlock = schedule.getCFG().getStartBlock();
+        assert startBlock != null;
+        assert startBlock.numberOfPreds() == 0;
+
+        return Debug.scope("ComputeLinearScanOrder", new Callable<LIR>() {
+
+            @Override
+            public LIR call() {
+                ComputeLinearScanOrder clso = new ComputeLinearScanOrder(blocks.length, schedule.getCFG().getLoops().length, startBlock);
+                List<Block> linearScanOrder = clso.linearScanOrder();
+                List<Block> codeEmittingOrder = clso.codeEmittingOrder();
+
+                int z = 0;
+                for (Block b : linearScanOrder) {
+                    b.linearScanNumber = z++;
+                }
+
+                LIR lir = new LIR(schedule.getCFG(), schedule.getNodesFor(), linearScanOrder, codeEmittingOrder);
+                Debug.dump(lir, "After linear scan order");
+                return lir;
+
+            }
+        });
+    }
+
+    public FrameMap emitLIR(final LIR lir, StructuredGraph graph, final RiResolvedMethod method) {
+        final FrameMap frameMap = backend.newFrameMap(runtime.getRegisterConfig(method));
+        final LIRGenerator lirGenerator = backend.newLIRGenerator(graph, frameMap, method, lir, xir);
+
+        Debug.scope("LIRGen", lirGenerator, new Runnable() {
+            public void run() {
+                for (Block b : lir.linearScanOrder()) {
+                    lirGenerator.doBlock(b);
+                }
+
+                Debug.dump(lir, "After LIR generation");
+            }
+        });
+
+        Debug.scope("Allocator", new Runnable() {
+            public void run() {
+                if (GraalOptions.AllocSSA) {
+                    new LinearScanAllocator(lir, frameMap).execute();
+                    // new SpillAllAllocator(context, lir, frameMap).execute();
+                } else {
+                    new LinearScan(target, method, lir, lirGenerator, frameMap).allocate();
+                }
+            }
+        });
+        return frameMap;
+    }
+
+    private TargetMethodAssembler createAssembler(FrameMap frameMap, LIR lir) {
+        AbstractAssembler masm = backend.newAssembler(frameMap.registerConfig);
+        TargetMethodAssembler tasm = new TargetMethodAssembler(target, runtime, frameMap, lir.slowPaths, masm);
+        tasm.setFrameSize(frameMap.frameSize());
+        tasm.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea());
+        return tasm;
+    }
+
+    public CiTargetMethod emitCode(CiAssumptions assumptions, RiResolvedMethod method, LIR lir, FrameMap frameMap) {
+        TargetMethodAssembler tasm = createAssembler(frameMap, lir);
+        lir.emitCode(tasm);
+
+        CiTargetMethod targetMethod = tasm.finishTargetMethod(method, false);
+        if (assumptions != null && !assumptions.isEmpty()) {
+            targetMethod.setAssumptions(assumptions);
+        }
+
+        Debug.dump(lir, "After code generation");
+        Debug.dump(targetMethod, "After code generation");
+        return targetMethod;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler;
+
+/**
+ * This class encapsulates options that control the behavior of the Graal compiler.
+ * The help message for each option is specified by a {@linkplain #helpMap help map}.
+ *
+ * (thomaswue) WARNING: Fields of this class are treated as final by Graal.
+ */
+public final class GraalOptions {
+
+    // Checkstyle: stop
+    private static final boolean ____ = false;
+    // Checkstyle: resume
+
+
+
+
+    public static int     Threads                            = 4;
+    public static boolean Lower                              = true;
+
+    // inlining settings
+    public static boolean Inline                             = true;
+    public static boolean Intrinsify                         = true;
+    public static boolean CacheGraphs                        = ____;
+    public static boolean InlineMonomorphicCalls             = true;
+    public static boolean InlinePolymorphicCalls             = true;
+    public static boolean InlineMegamorphicCalls             = ____;
+    public static int     InliningPolicy                     = 4;
+    public static int     WeightComputationPolicy            = 2;
+    public static int     MaximumTrivialSize                 = 10;
+    public static int     MaximumInlineLevel                 = 30;
+    public static int     MaximumDesiredSize                 = 3000;
+    public static int     MaximumRecursiveInlining           = 1;
+    public static int     SmallCompiledCodeSize              = 2000;
+    public static boolean LimitInlinedProbability            = ____;
+    // WeightBasedInliningPolicy (0)
+    public static boolean ParseBeforeInlining                = ____;
+    public static float   InliningSizePenaltyExp             = 20;
+    public static float   MaximumInlineWeight                = 1.25f;
+    public static float   InliningSizePenalty                = 1;
+    // StaticSizeBasedInliningPolicy (1), MinimumCodeSizeBasedInlining (2),
+    // DynamicSizeBasedInliningPolicy (3)
+    public static int     MaximumInlineSize                  = 35;
+    // GreedySizeBasedInlining (4)
+    public static int     MaximumGreedyInlineSize            = 100;
+    public static int     InliningBonusPerTransferredValue   = 10;
+    // Common options for inlining policies 1 to 4
+    public static float   NestedInliningSizeRatio            = 1f;
+    public static float   BoostInliningForEscapeAnalysis     = 2f;
+    public static float   ProbabilityCapForInlining          = 1f;
+
+    // escape analysis settings
+    public static boolean EscapeAnalysis                     = true;
+    public static int     ForcedInlineEscapeWeight           = 10;
+    public static boolean PrintEscapeAnalysis                = ____;
+
+    // absolute probability analysis
+    public static boolean ProbabilityAnalysis                = true;
+    public static int     LoopFrequencyPropagationPolicy     = -2;
+
+    // profiling information
+    public static int     MatureExecutionsBranch             = 1;
+    public static int     MatureExecutionsPerSwitchCase      = 1;
+    public static int     MatureExecutionsTypeProfile        = 1;
+
+    //rematerialize settings
+    public static float   MinimumUsageProbability            = 0.95f;
+
+    // debugging settings
+    public static int     MethodEndBreakpointGuards          = 0;
+    public static boolean ZapStackOnMethodEntry              = ____;
+    public static boolean StressLinearScan                   = ____;
+    public static boolean DeoptALot                          = ____;
+    public static boolean VerifyPhases                       = true;
+    public static boolean CreateDeoptInfo                    = ____;
+
+    /**
+     * See {@link Filter#Filter(String, Object)}.
+     */
+    public static String  PrintFilter                        = null;
+
+    // printing settings
+    public static boolean PrintLIR                           = ____;
+    public static boolean PrintCFGToFile                     = ____;
+
+    // statistics independent from debug mode
+    public static boolean PrintCompilationStatistics         = ____;
+
+    // Debug settings:
+    public static boolean Debug                              = true;
+    public static boolean SummarizeDebugValues               = ____;
+    public static String Dump                                = null;
+    public static String Meter                               = null;
+    public static String Time                                = null;
+    public static String Log                                 = null;
+    public static String MethodFilter                        = null;
+
+    // Ideal graph visualizer output settings
+    public static boolean PlotOnError                        = ____;
+    public static int     PlotLevel                          = 3;
+    public static boolean PlotSnippets                       = ____;
+    public static int     PrintIdealGraphLevel               = 0;
+    public static boolean PrintIdealGraphFile                = ____;
+    public static String  PrintIdealGraphAddress             = "127.0.0.1";
+    public static int     PrintIdealGraphPort                = 4444;
+
+    // Other printing settings
+    public static boolean PrintQueue                         = ____;
+    public static boolean PrintCompilation                   = ____;
+    public static boolean PrintProfilingInformation          = ____;
+    public static boolean PrintXirTemplates                  = ____;
+    public static boolean PrintIRWithLIR                     = ____;
+    public static boolean PrintAssembly                      = ____;
+    public static boolean PrintCodeBytes                     = ____;
+    public static int     PrintAssemblyBytesPerLine          = 16;
+    public static int     TraceLinearScanLevel               = 0;
+    public static boolean TraceRegisterAllocation            = false;
+    public static int     TraceLIRGeneratorLevel             = 0;
+    public static boolean TraceEscapeAnalysis                = ____;
+    public static int     TraceBytecodeParserLevel           = 0;
+    public static boolean ExitVMOnBailout                    = ____;
+    public static boolean ExitVMOnException                  = true;
+
+    // state merging settings
+    public static boolean AssumeVerifiedBytecode             = true;
+
+    // Code generator settings
+    public static boolean PropagateTypes                     = ____;
+    public static boolean UseBranchPrediction                = true;
+    public static boolean UseExceptionProbability            = true;
+    public static boolean AllowExplicitExceptionChecks       = true;
+    public static boolean OmitHotExceptionStacktrace         = ____;
+    public static boolean GenSafepoints                      = true;
+    public static boolean GenLoopSafepoints                  = true;
+    public static boolean UseTypeCheckHints                  = true;
+    public static boolean InlineVTableStubs                  = ____;
+    public static boolean AlwaysInlineVTableStubs            = ____;
+
+    public static boolean GenAssertionCode                   = ____;
+    public static boolean AlignCallsForPatching              = true;
+    public static boolean ResolveClassBeforeStaticInvoke     = true;
+
+    // Translating tableswitch instructions
+    public static int     SequentialSwitchLimit              = 4;
+    public static int     RangeTestsSwitchDensity            = 5;
+
+    public static boolean DetailedAsserts                    = ____;
+
+    // Runtime settings
+    public static int     ReadPrefetchInstr                  = 0;
+    public static int     StackShadowPages                   = 2;
+
+    // Assembler settings
+    public static boolean CommentedAssembly                  = ____;
+    public static boolean PrintLIRWithAssembly               = ____;
+
+    public static boolean SupportJsrBytecodes                = true;
+
+    public static boolean OptAssumptions                     = true;
+    public static boolean OptReadElimination                 = true;
+    public static boolean OptGVN                             = true;
+    public static boolean OptCanonicalizer                   = true;
+    public static boolean OptLoops                           = ____;
+    public static boolean ScheduleOutOfLoops                 = true;
+    public static boolean OptReorderLoops                    = true;
+    public static boolean OptEliminateGuards                 = true;
+    public static boolean OptImplicitNullChecks              = true;
+    public static boolean OptLivenessAnalysis                = true;
+
+    /**
+     * Flag to turn on SSA-based register allocation, which is currently under development.
+     */
+    public static boolean AllocSSA                           = false;
+
+    static {
+        // turn detailed assertions on when the general assertions are on (misusing the assert keyword for this)
+        assert (DetailedAsserts = true) == true;
+        assert (CommentedAssembly = true) == true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/ComputeLinearScanOrder.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,322 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.compiler.alloc;
+
+import java.util.*;
+
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+
+public final class ComputeLinearScanOrder {
+
+    private int numBlocks; // total number of blocks (smaller than maxBlockId)
+
+    List<Block> linearScanOrder; // the resulting list of blocks in correct order
+    List<Block> codeEmittingOrder;
+
+    final BitMap visitedBlocks; // used for recursive processing of blocks
+    final BitMap activeBlocks; // used for recursive processing of blocks
+    final BitMap dominatorBlocks; // temporary BitMap used for computation of dominator
+    final int[] forwardBranches; // number of incoming forward branches for each block
+    final List<Block> workList; // temporary list (used in markLoops and computeOrder)
+    final Block[] loopHeaders;
+
+    // accessors for visitedBlocks and activeBlocks
+    void initVisited() {
+        activeBlocks.clearAll();
+        visitedBlocks.clearAll();
+    }
+
+    boolean isVisited(Block b) {
+        return visitedBlocks.get(b.getId());
+    }
+
+    boolean isActive(Block b) {
+        return activeBlocks.get(b.getId());
+    }
+
+    void setVisited(Block b) {
+        assert !isVisited(b) : "already set";
+        visitedBlocks.set(b.getId());
+    }
+
+    void setActive(Block b) {
+        assert !isActive(b) : "already set";
+        activeBlocks.set(b.getId());
+    }
+
+    void clearActive(Block b) {
+        assert isActive(b) : "not already";
+        activeBlocks.clear(b.getId());
+    }
+
+    // accessors for forwardBranches
+    void incForwardBranches(Block b) {
+        forwardBranches[b.getId()]++;
+    }
+
+    int decForwardBranches(Block b) {
+        return --forwardBranches[b.getId()];
+    }
+
+    // accessors for final result
+    public List<Block> linearScanOrder() {
+        return linearScanOrder;
+    }
+
+    public ComputeLinearScanOrder(int maxBlockId, int loopCount, Block startBlock) {
+        loopHeaders = new Block[loopCount];
+
+        visitedBlocks = new BitMap(maxBlockId);
+        activeBlocks = new BitMap(maxBlockId);
+        dominatorBlocks = new BitMap(maxBlockId);
+        forwardBranches = new int[maxBlockId];
+        workList = new ArrayList<>(8);
+
+        countEdges(startBlock, null);
+        computeOrder(startBlock);
+    }
+
+    /**
+     * Traverses the CFG to analyze block and edge info. The analysis performed is:
+     *
+     * 1. Count of total number of blocks.
+     * 2. Count of all incoming edges and backward incoming edges.
+     * 3. Number loop header blocks.
+     * 4. Create a list with all loop end blocks.
+     */
+    void countEdges(Block cur, Block parent) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
+            TTY.println("Counting edges for block B%d%s", cur.getId(), parent == null ? "" : " coming from B" + parent.getId());
+        }
+
+        if (isActive(cur)) {
+            return;
+        }
+
+        // increment number of incoming forward branches
+        incForwardBranches(cur);
+
+        if (isVisited(cur)) {
+            if (GraalOptions.TraceLinearScanLevel >= 3) {
+                TTY.println("block already visited");
+            }
+            return;
+        }
+
+        numBlocks++;
+        setVisited(cur);
+        setActive(cur);
+
+        // recursive call for all successors
+        int i;
+        for (i = cur.numberOfSux() - 1; i >= 0; i--) {
+            countEdges(cur.suxAt(i), cur);
+        }
+
+        clearActive(cur);
+
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
+            TTY.println("Finished counting edges for block B%d", cur.getId());
+        }
+    }
+
+    static int computeWeight(Block cur) {
+
+        // limit loop-depth to 15 bit (only for security reason, it will never be so big)
+        int weight = (cur.getLoopDepth() & 0x7FFF) << 16;
+
+        int curBit = 15;
+
+        // this is necessary for the (very rare) case that two successive blocks have
+        // the same loop depth, but a different loop index (can happen for endless loops
+        // with exception handlers)
+//        if (!cur.isLinearScanLoopHeader()) {
+//            weight |= 1 << curBit;
+//        }
+//        curBit--;
+
+        // loop end blocks (blocks that end with a backward branch) are added
+        // after all other blocks of the loop.
+        if (!cur.isLoopEnd()) {
+            weight |= 1 << curBit;
+        }
+        curBit--;
+
+        // critical edge split blocks are preferred because then they have a greater
+        // probability to be completely empty
+        //if (cur.isCriticalEdgeSplit()) {
+        //    weight |= 1 << curBit;
+        //}
+        //curBit--;
+
+        // exceptions should not be thrown in normal control flow, so these blocks
+        // are added as late as possible
+//        if (!(cur.end() instanceof Throw) && (singleSux == null || !(singleSux.end() instanceof Throw))) {
+//            weight |= 1 << curBit;
+//        }
+//        curBit--;
+//        if (!(cur.end() instanceof Return) && (singleSux == null || !(singleSux.end() instanceof Return))) {
+//            weight |= 1 << curBit;
+//        }
+//        curBit--;
+
+        // exceptions handlers are added as late as possible
+        if (!cur.isExceptionEntry()) {
+            weight |= 1 << curBit;
+        }
+        curBit--;
+
+        // guarantee that weight is > 0
+        weight |= 1;
+
+        assert curBit >= 0 : "too many flags";
+        assert weight > 0 : "weight cannot become negative";
+
+        return weight;
+    }
+
+    private boolean readyForProcessing(Block cur) {
+        // Discount the edge just traveled.
+        // When the number drops to zero, all forward branches were processed
+        if (decForwardBranches(cur) != 0) {
+            return false;
+        }
+
+        assert !linearScanOrder.contains(cur) : "block already processed (block can be ready only once)";
+        assert !workList.contains(cur) : "block already in work-list (block can be ready only once)";
+        return true;
+    }
+
+    private void sortIntoWorkList(Block cur) {
+        assert !workList.contains(cur) : "block already in work list";
+
+        int curWeight = computeWeight(cur);
+
+        // the linearScanNumber is used to cache the weight of a block
+        cur.linearScanNumber = curWeight;
+
+        if (GraalOptions.StressLinearScan) {
+            workList.add(0, cur);
+            return;
+        }
+
+        workList.add(null); // provide space for new element
+
+        int insertIdx = workList.size() - 1;
+        while (insertIdx > 0 && workList.get(insertIdx - 1).linearScanNumber > curWeight) {
+            workList.set(insertIdx, workList.get(insertIdx - 1));
+            insertIdx--;
+        }
+        workList.set(insertIdx, cur);
+
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
+            TTY.println("Sorted B%d into worklist. new worklist:", cur.getId());
+            for (int i = 0; i < workList.size(); i++) {
+                TTY.println(String.format("%8d B%02d  weight:%6x", i, workList.get(i).getId(), workList.get(i).linearScanNumber));
+            }
+        }
+
+        for (int i = 0; i < workList.size(); i++) {
+            assert workList.get(i).linearScanNumber > 0 : "weight not set";
+            assert i == 0 || workList.get(i - 1).linearScanNumber <= workList.get(i).linearScanNumber : "incorrect order in worklist";
+        }
+    }
+
+    private void appendBlock(Block cur) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
+            TTY.println("appending block B%d (weight 0x%06x) to linear-scan order", cur.getId(), cur.linearScanNumber);
+        }
+        assert !linearScanOrder.contains(cur) : "cannot add the same block twice";
+
+        // currently, the linear scan order and code emit order are equal.
+        // therefore the linearScanNumber and the weight of a block must also
+        // be equal.
+        cur.linearScanNumber = linearScanOrder.size();
+        linearScanOrder.add(cur);
+
+        if (cur.isLoopEnd() && cur.isLoopHeader()) {
+            codeEmittingOrder.add(cur);
+        } else {
+            if (!cur.isLoopHeader() || ((LoopBeginNode) cur.getBeginNode()).loopEnds().count() > 1 || !GraalOptions.OptReorderLoops) {
+                codeEmittingOrder.add(cur);
+
+                if (cur.isLoopEnd() && GraalOptions.OptReorderLoops) {
+                    Block loopHeader = loopHeaders[cur.getLoop().index];
+                    if (loopHeader != null) {
+                        codeEmittingOrder.add(loopHeader);
+
+                        for (int i = 0; i < loopHeader.numberOfSux(); i++) {
+                            Block succ = loopHeader.suxAt(i);
+                            if (succ.getLoopDepth() == loopHeader.getLoopDepth()) {
+                                succ.align = true;
+                            }
+                        }
+                    }
+                }
+            } else {
+                loopHeaders[cur.getLoop().index] = cur;
+            }
+        }
+    }
+
+    private void computeOrder(Block startBlock) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
+            TTY.println("----- computing final block order");
+        }
+
+        // the start block is always the first block in the linear scan order
+        linearScanOrder = new ArrayList<>(numBlocks);
+
+        codeEmittingOrder = new ArrayList<>(numBlocks);
+
+        // start processing with standard entry block
+        assert workList.isEmpty() : "list must be empty before processing";
+
+        assert readyForProcessing(startBlock);
+        sortIntoWorkList(startBlock);
+
+        do {
+            Block cur = workList.remove(workList.size() - 1);
+            appendBlock(cur);
+
+            int i;
+            int numSux = cur.numberOfSux();
+            // changed loop order to get "intuitive" order of if- and else-blocks
+            for (i = 0; i < numSux; i++) {
+                Block sux = cur.suxAt(i);
+                if (readyForProcessing(sux)) {
+                    sortIntoWorkList(sux);
+                }
+            }
+        } while (workList.size() > 0);
+    }
+
+    public List<Block> codeEmittingOrder() {
+        return codeEmittingOrder;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/ControlFlowOptimizer.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+import java.util.*;
+
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ * This class performs basic optimizations on the control flow graph after LIR generation.
+ */
+final class ControlFlowOptimizer {
+
+    /**
+     * Performs control flow optimizations on the given LIR graph.
+     * @param ir the LIR graph that should be optimized
+     */
+    public static void optimize(LIR ir) {
+        ControlFlowOptimizer optimizer = new ControlFlowOptimizer(ir);
+        List<Block> code = ir.codeEmittingOrder();
+        //optimizer.reorderShortLoops(code);
+        optimizer.deleteEmptyBlocks(code);
+        ControlFlowOptimizer.deleteUnnecessaryJumps(code);
+        //ControlFlowOptimizer.deleteJumpsToReturn(code);
+    }
+
+    private final LIR ir;
+
+    private ControlFlowOptimizer(LIR ir) {
+        this.ir = ir;
+    }
+/*
+    private void reorderShortLoop(List<LIRBlock> code, LIRBlock headerBlock, int headerIdx) {
+        int i = headerIdx + 1;
+        int maxEnd = Math.min(headerIdx + GraalOptions.MaximumShortLoopSize, code.size());
+        while (i < maxEnd && code.get(i).loopDepth() >= headerBlock.loopDepth()) {
+            i++;
+        }
+
+        if (i == code.size() || code.get(i).loopDepth() < headerBlock.loopDepth()) {
+            int endIdx = i - 1;
+            LIRBlock endBlock = code.get(endIdx);
+
+            if (endBlock.numberOfSux() == 1 && endBlock.suxAt(0) == headerBlock) {
+                // short loop from headerIdx to endIdx found . reorder blocks such that
+                // the headerBlock is the last block instead of the first block of the loop
+
+                for (int j = headerIdx; j < endIdx; j++) {
+                    code.set(j, code.get(j + 1));
+                }
+                code.set(endIdx, headerBlock);
+            }
+        }
+    }*/
+/*
+    private void reorderShortLoops(List<LIRBlock> code) {
+        for (int i = code.size() - 1; i >= 0; i--) {
+            LIRBlock block = code.get(i);
+
+            if (block.isLinearScanLoopHeader()) {
+                reorderShortLoop(code, block, i);
+            }
+        }
+
+        assert verify(code);
+    }*/
+
+    // only blocks with exactly one successor can be deleted. Such blocks
+    // must always end with an unconditional branch to its successor
+    private boolean canDeleteBlock(Block block) {
+        if (block.numberOfSux() != 1 ||
+            block == ir.cfg.getStartBlock() ||
+            block.suxAt(0) == block) {
+            return false;
+        }
+
+        List<LIRInstruction> instructions = block.lir;
+
+        assert instructions.size() >= 2 : "block must have label and branch";
+        assert instructions.get(0) instanceof StandardOp.LabelOp : "first instruction must always be a label";
+        assert instructions.get(instructions.size() - 1) instanceof StandardOp.JumpOp : "last instruction must always be a branch";
+        assert ((StandardOp.JumpOp) instructions.get(instructions.size() - 1)).destination().label() == ((StandardOp.LabelOp) block.suxAt(0).lir.get(0)).getLabel() : "branch target must be the successor";
+
+        // block must have exactly one successor
+
+        return instructions.size() == 2 && instructions.get(instructions.size() - 1).info == null;
+    }
+
+    private void deleteEmptyBlocks(List<Block> code) {
+        int oldPos = 0;
+        int newPos = 0;
+        int numBlocks = code.size();
+
+        assert verify(code);
+        while (oldPos < numBlocks) {
+            Block block = code.get(oldPos);
+
+            if (canDeleteBlock(block)) {
+                // adjust successor and predecessor lists
+                Block other = block.suxAt(0);
+                for (Block pred : block.getPredecessors()) {
+                    Util.replaceAllInList(block, other, pred.getSuccessors());
+                }
+                for (int i = 0; i < other.getPredecessors().size(); i++) {
+                    if (other.getPredecessors().get(i) == block) {
+                        other.getPredecessors().remove(i);
+                        other.getPredecessors().addAll(i, block.getPredecessors());
+                    }
+                }
+                block.getSuccessors().clear();
+                block.getPredecessors().clear();
+                Debug.metric("BlocksDeleted").increment();
+            } else {
+                // adjust position of this block in the block list if blocks before
+                // have been deleted
+                if (newPos != oldPos) {
+                    code.set(newPos, code.get(oldPos));
+                }
+                newPos++;
+            }
+            oldPos++;
+        }
+        assert verify(code);
+        Util.truncate(code, newPos);
+
+        assert verify(code);
+    }
+
+    private static void deleteUnnecessaryJumps(List<Block> code) {
+        // skip the last block because there a branch is always necessary
+        for (int i = code.size() - 2; i >= 0; i--) {
+            Block block = code.get(i);
+            List<LIRInstruction> instructions = block.lir;
+
+            LIRInstruction lastOp = instructions.get(instructions.size() - 1);
+            if (lastOp instanceof StandardOp.JumpOp) {
+                StandardOp.JumpOp lastJump = (StandardOp.JumpOp) lastOp;
+
+                if (lastOp.info == null) {
+                    if (lastJump.destination().label() == ((StandardOp.LabelOp) code.get(i + 1).lir.get(0)).getLabel()) {
+                        // delete last branch instruction
+                        Util.truncate(instructions, instructions.size() - 1);
+
+                    } else {
+                        LIRInstruction prevOp = instructions.get(instructions.size() - 2);
+                        if (prevOp instanceof StandardOp.BranchOp) {
+                            StandardOp.BranchOp prevBranch = (StandardOp.BranchOp) prevOp;
+
+                            if (prevBranch.destination().label() == ((StandardOp.LabelOp) code.get(i + 1).lir.get(0)).getLabel() && prevOp.info == null) {
+                                // eliminate a conditional branch to the immediate successor
+                                prevBranch.negate(lastJump.destination());
+                                Util.truncate(instructions, instructions.size() - 1);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        assert verify(code);
+    }
+
+/*
+    private static void deleteJumpsToReturn(List<LIRBlock> code) {
+        for (int i = code.size() - 1; i >= 0; i--) {
+            LIRBlock block = code.get(i);
+            List<LIRInstruction> curInstructions = block.lir();
+            LIRInstruction curLastOp = curInstructions.get(curInstructions.size() - 1);
+
+            assert curInstructions.get(0).code == StandardOpcode.LABEL : "first instruction must always be a label";
+            if (curInstructions.size() == 2 && curLastOp.code == StandardOpcode.RETURN) {
+                // the block contains only a label and a return
+                // if a predecessor ends with an unconditional jump to this block, then the jump
+                // can be replaced with a return instruction
+                //
+                // Note: the original block with only a return statement cannot be deleted completely
+                // because the predecessors might have other (conditional) jumps to this block.
+                // this may lead to unnecesary return instructions in the final code
+
+                assert curLastOp.info == null : "return instructions do not have debug information";
+                CiValue returnOpr = curLastOp.input(0);
+
+                for (int j = block.numberOfPreds() - 1; j >= 0; j--) {
+                    LIRBlock pred = block.predAt(j);
+                    List<LIRInstruction> predInstructions = pred.lir();
+                    LIRInstruction predLastOp = predInstructions.get(predInstructions.size() - 1);
+
+                    if (predLastOp instanceof LIRBranch) {
+                        LIRBranch predLastBranch = (LIRBranch) predLastOp;
+
+                        if (predLastBranch.destination().label() == block.label() && predLastBranch.code == StandardOpcode.JUMP && predLastBranch.info == null) {
+                            // replace the jump to a return with a direct return
+                            // Note: currently the edge between the blocks is not deleted
+                            predInstructions.set(predInstructions.size() - 1, StandardOpcode.RETURN.create(returnOpr));
+                        }
+                    }
+                }
+            }
+        }
+    }
+*/
+
+    private static boolean verify(List<Block> code) {
+        for (Block block : code) {
+            for (Block sux : block.getSuccessors()) {
+                assert code.contains(sux) : "missing successor from: " + block + "to: " + sux;
+            }
+
+            for (Block pred : block.getPredecessors()) {
+                assert code.contains(pred) : "missing predecessor from: " + block + "to: " + pred;
+            }
+        }
+
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/EdgeMoveOptimizer.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+import java.util.*;
+
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.StandardOp.*;
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ * This class optimizes moves, particularly those that result from eliminating SSA form.
+ *
+ * When a block has more than one predecessor, and all predecessors end with
+ * the {@linkplain #same(LIRInstruction, LIRInstruction) same} sequence of
+ * {@linkplain LIROpcode#Move move} instructions, then these sequences
+ * can be replaced with a single copy of the sequence at the beginning of the block.
+ *
+ * Similarly, when a block has more than one successor, then same sequences of
+ * moves at the beginning of the successors can be placed once at the end of
+ * the block. But because the moves must be inserted before all branch
+ * instructions, this works only when there is exactly one conditional branch
+ * at the end of the block (because the moves must be inserted before all
+ * branches, but after all compares).
+ *
+ * This optimization affects all kind of moves (reg->reg, reg->stack and
+ * stack->reg). Because this optimization works best when a block contains only
+ * a few moves, it has a huge impact on the number of blocks that are totally
+ * empty.
+ */
+final class EdgeMoveOptimizer {
+
+    /**
+     * Optimizes moves on block edges.
+     *
+     * @param blockList a list of blocks whose moves should be optimized
+     */
+    public static void optimize(List<Block> blockList) {
+        EdgeMoveOptimizer optimizer = new EdgeMoveOptimizer();
+
+        // ignore the first block in the list (index 0 is not processed)
+        for (int i = blockList.size() - 1; i >= 1; i--) {
+            Block block = blockList.get(i);
+
+            if (block.numberOfPreds() > 1) {
+                optimizer.optimizeMovesAtBlockEnd(block);
+            }
+            if (block.numberOfSux() == 2) {
+                optimizer.optimizeMovesAtBlockBegin(block);
+            }
+        }
+    }
+
+    private final List<List<LIRInstruction>> edgeInstructionSeqences;
+
+    private EdgeMoveOptimizer() {
+        edgeInstructionSeqences = new ArrayList<>(4);
+    }
+
+    /**
+     * Determines if two operations are both {@linkplain LIROpcode#Move moves}
+     * that have the same {@linkplain LIRInstruction#operand() source} and {@linkplain LIRInstruction#result() destination}
+     * operands and they have the same {@linkplain LIRInstruction#info debug info}.
+     *
+     * @param op1 the first instruction to compare
+     * @param op2 the second instruction to compare
+     * @return {@code true} if {@code op1} and {@code op2} are the same by the above algorithm
+     */
+    private static boolean same(LIRInstruction op1, LIRInstruction op2) {
+        assert op1 != null;
+        assert op2 != null;
+
+        if (op1 instanceof MoveOp && op2 instanceof MoveOp) {
+            MoveOp move1 = (MoveOp) op1;
+            MoveOp move2 = (MoveOp) op2;
+            if (move1.getInput() == move2.getInput() && move1.getResult() == move2.getResult()) {
+                // these moves are exactly equal and can be optimized
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Moves the longest {@linkplain #same common} subsequence at the end all
+     * predecessors of {@code block} to the start of {@code block}.
+     */
+    private void optimizeMovesAtBlockEnd(Block block) {
+        for (Block pred : block.getPredecessors()) {
+            if (pred == block) {
+                // currently we can't handle this correctly.
+                return;
+            }
+        }
+
+        // clear all internal data structures
+        edgeInstructionSeqences.clear();
+
+        int numPreds = block.numberOfPreds();
+        assert numPreds > 1 : "do not call otherwise";
+
+        // setup a list with the LIR instructions of all predecessors
+        for (Block pred : block.getPredecessors()) {
+            assert pred != null;
+            assert pred.lir != null;
+            List<LIRInstruction> predInstructions = pred.lir;
+
+            if (pred.numberOfSux() != 1) {
+                // this can happen with switch-statements where multiple edges are between
+                // the same blocks.
+                return;
+            }
+
+            if (predInstructions.get(predInstructions.size() - 1) instanceof LIRXirInstruction) {
+                return;
+            }
+
+            assert pred.suxAt(0) == block : "invalid control flow";
+            assert predInstructions.get(predInstructions.size() - 1) instanceof StandardOp.JumpOp : "block must end with unconditional jump";
+
+            if (predInstructions.get(predInstructions.size() - 1).info != null) {
+                // can not optimize instructions that have debug info
+                return;
+            }
+
+            // ignore the unconditional branch at the end of the block
+            List<LIRInstruction> seq = predInstructions.subList(0, predInstructions.size() - 1);
+            edgeInstructionSeqences.add(seq);
+        }
+
+        // process lir-instructions while all predecessors end with the same instruction
+        while (true) {
+            List<LIRInstruction> seq = edgeInstructionSeqences.get(0);
+            if (seq.isEmpty()) {
+                return;
+            }
+
+            LIRInstruction op = last(seq);
+            for (int i = 1; i < numPreds; ++i) {
+                List<LIRInstruction> otherSeq = edgeInstructionSeqences.get(i);
+                if (otherSeq.isEmpty() || !same(op, last(otherSeq))) {
+                    return;
+                }
+            }
+
+            // insert the instruction at the beginning of the current block
+            block.lir.add(1, op);
+
+            // delete the instruction at the end of all predecessors
+            for (int i = 0; i < numPreds; i++) {
+                seq = edgeInstructionSeqences.get(i);
+                removeLast(seq);
+            }
+        }
+    }
+
+    /**
+     * Moves the longest {@linkplain #same common} subsequence at the start of all
+     * successors of {@code block} to the end of {@code block} just prior to the
+     * branch instruction ending {@code block}.
+     */
+    private void optimizeMovesAtBlockBegin(Block block) {
+
+        edgeInstructionSeqences.clear();
+        int numSux = block.numberOfSux();
+
+        List<LIRInstruction> instructions = block.lir;
+
+        assert numSux == 2 : "method should not be called otherwise";
+
+        if (instructions.get(instructions.size() - 1) instanceof LIRXirInstruction) {
+            // cannot optimize when last instruction is Xir.
+            return;
+        }
+
+        assert instructions.get(instructions.size() - 1) instanceof StandardOp.JumpOp : "block must end with unconditional jump";
+
+        if (instructions.get(instructions.size() - 1).info != null) {
+            // cannot optimize instructions when debug info is needed
+            return;
+        }
+
+        LIRInstruction branch = instructions.get(instructions.size() - 2);
+        if (!(branch instanceof StandardOp.BranchOp) || branch.info != null) {
+            // not a valid case for optimization
+            // currently, only blocks that end with two branches (conditional branch followed
+            // by unconditional branch) are optimized
+            return;
+        }
+
+        // now it is guaranteed that the block ends with two branch instructions.
+        // the instructions are inserted at the end of the block before these two branches
+        int insertIdx = instructions.size() - 2;
+
+        // setup a list with the lir-instructions of all successors
+        for (int i = 0; i < numSux; i++) {
+            Block sux = block.suxAt(i);
+            List<LIRInstruction> suxInstructions = sux.lir;
+
+            assert suxInstructions.get(0) instanceof StandardOp.LabelOp : "block must start with label";
+
+            if (sux.numberOfPreds() != 1) {
+                // this can happen with switch-statements where multiple edges are between
+                // the same blocks.
+                return;
+            }
+            assert sux.predAt(0) == block : "invalid control flow";
+
+            // ignore the label at the beginning of the block
+            List<LIRInstruction> seq = suxInstructions.subList(1, suxInstructions.size());
+            edgeInstructionSeqences.add(seq);
+        }
+
+        // process LIR instructions while all successors begin with the same instruction
+        while (true) {
+            List<LIRInstruction> seq = edgeInstructionSeqences.get(0);
+            if (seq.isEmpty()) {
+                return;
+            }
+
+            LIRInstruction op = first(seq);
+            for (int i = 1; i < numSux; i++) {
+                List<LIRInstruction> otherSeq = edgeInstructionSeqences.get(i);
+                if (otherSeq.isEmpty() || !same(op, first(otherSeq))) {
+                    // these instructions are different and cannot be optimized .
+                    // no further optimization possible
+                    return;
+                }
+            }
+
+            // insert instruction at end of current block
+            block.lir.add(insertIdx, op);
+            insertIdx++;
+
+            // delete the instructions at the beginning of all successors
+            for (int i = 0; i < numSux; i++) {
+                seq = edgeInstructionSeqences.get(i);
+                removeFirst(seq);
+            }
+        }
+    }
+
+    /**
+     * Gets the first element from a LIR instruction sequence.
+     */
+    private static LIRInstruction first(List<LIRInstruction> seq) {
+        return seq.get(0);
+    }
+
+    /**
+     * Gets the last element from a LIR instruction sequence.
+     */
+    private static LIRInstruction last(List<LIRInstruction> seq) {
+        return seq.get(seq.size() - 1);
+    }
+
+    /**
+     * Removes the first element from a LIR instruction sequence.
+     */
+    private static void removeFirst(List<LIRInstruction> seq) {
+        seq.remove(0);
+    }
+
+    /**
+     * Removes the last element from a LIR instruction sequence.
+     */
+    private static void removeLast(List<LIRInstruction> seq) {
+        seq.remove(seq.size() - 1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,1172 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+
+/**
+ * Represents an interval in the {@linkplain LinearScan linear scan register allocator}.
+ */
+public final class Interval {
+
+    /**
+     * A pair of intervals.
+     */
+    static final class Pair {
+        public final Interval first;
+        public final Interval second;
+        public Pair(Interval first, Interval second) {
+            this.first = first;
+            this.second = second;
+        }
+    }
+
+    /**
+     * A set of interval lists, one per {@linkplain RegisterBinding binding} type.
+     */
+    static final class RegisterBindingLists {
+
+        /**
+         * List of intervals whose binding is currently {@link RegisterBinding#Fixed}.
+         */
+        public Interval fixed;
+
+        /**
+         * List of intervals whose binding is currently {@link RegisterBinding#Any}.
+         */
+        public Interval any;
+
+        public RegisterBindingLists(Interval fixed, Interval any) {
+            this.fixed = fixed;
+            this.any = any;
+        }
+
+        /**
+         * Gets the list for a specified binding.
+         *
+         * @param binding specifies the list to be returned
+         * @return the list of intervals whose binding is {@code binding}
+         */
+        public Interval get(RegisterBinding binding) {
+            if (binding == RegisterBinding.Any) {
+                return any;
+            }
+            assert binding == RegisterBinding.Fixed;
+            return fixed;
+        }
+
+        /**
+         * Sets the list for a specified binding.
+         *
+         * @param binding specifies the list to be replaced
+         * @param a list of intervals whose binding is {@code binding}
+         */
+        public void set(RegisterBinding binding, Interval list) {
+            assert list != null;
+            if (binding == RegisterBinding.Any) {
+                any = list;
+            } else {
+                assert binding == RegisterBinding.Fixed;
+                fixed = list;
+            }
+        }
+
+        /**
+         * Adds an interval to a list sorted by {@linkplain Interval#currentFrom() current from} positions.
+         *
+         * @param binding specifies the list to be updated
+         * @param interval the interval to add
+         */
+        public void addToListSortedByCurrentFromPositions(RegisterBinding binding, Interval interval) {
+            Interval list = get(binding);
+            Interval prev = null;
+            Interval cur = list;
+            while (cur.currentFrom() < interval.currentFrom()) {
+                prev = cur;
+                cur = cur.next;
+            }
+            Interval result = list;
+            if (prev == null) {
+                // add to head of list
+                result = interval;
+            } else {
+                // add before 'cur'
+                prev.next = interval;
+            }
+            interval.next = cur;
+            set(binding, result);
+        }
+
+        /**
+         * Adds an interval to a list sorted by {@linkplain Interval#from() start} positions and
+         * {@linkplain Interval#firstUsage(RegisterPriority) first usage} positions.
+         *
+         * @param binding specifies the list to be updated
+         * @param interval the interval to add
+         */
+        public void addToListSortedByStartAndUsePositions(RegisterBinding binding, Interval interval) {
+            Interval list = get(binding);
+            Interval prev = null;
+            Interval cur = list;
+            while (cur.from() < interval.from() || (cur.from() == interval.from() && cur.firstUsage(RegisterPriority.None) < interval.firstUsage(RegisterPriority.None))) {
+                prev = cur;
+                cur = cur.next;
+            }
+            if (prev == null) {
+                list = interval;
+            } else {
+                prev.next = interval;
+            }
+            interval.next = cur;
+            set(binding, list);
+        }
+
+        /**
+         * Removes an interval from a list.
+         *
+         * @param binding specifies the list to be updated
+         * @param interval the interval to remove
+         */
+        public void remove(RegisterBinding binding, Interval i) {
+            Interval list = get(binding);
+            Interval prev = null;
+            Interval cur = list;
+            while (cur != i) {
+                assert cur != null && cur != Interval.EndMarker : "interval has not been found in list: " + i;
+                prev = cur;
+                cur = cur.next;
+            }
+            if (prev == null) {
+                set(binding, cur.next);
+            } else {
+                prev.next = cur.next;
+            }
+        }
+    }
+
+    /**
+     * Constants denoting the register usage priority for an interval.
+     * The constants are declared in increasing order of priority are
+     * are used to optimize spilling when multiple overlapping intervals
+     * compete for limited registers.
+     */
+    enum RegisterPriority {
+        /**
+         * No special reason for an interval to be allocated a register.
+         */
+        None,
+
+        /**
+         * Priority level for intervals live at the end of a loop.
+         */
+        LiveAtLoopEnd,
+
+        /**
+         * Priority level for intervals that should be allocated to a register.
+         */
+        ShouldHaveRegister,
+
+        /**
+         * Priority level for intervals that must be allocated to a register.
+         */
+        MustHaveRegister;
+
+        public static final RegisterPriority[] VALUES = values();
+
+        /**
+         * Determines if this priority is higher than or equal to a given priority.
+         */
+        public boolean greaterEqual(RegisterPriority other) {
+            return ordinal() >= other.ordinal();
+        }
+
+        /**
+         * Determines if this priority is lower than a given priority.
+         */
+        public boolean lessThan(RegisterPriority other) {
+            return ordinal() < other.ordinal();
+        }
+    }
+
+    /**
+     * Constants denoting whether an interval is bound to a specific register. This models
+     * platform dependencies on register usage for certain instructions.
+     */
+    enum RegisterBinding {
+        /**
+         * Interval is bound to a specific register as required by the platform.
+         */
+        Fixed,
+
+        /**
+         * Interval has no specific register requirements.
+         */
+        Any;
+
+        public static final RegisterBinding[] VALUES = values();
+    }
+
+    /**
+     * Constants denoting the linear-scan states an interval may be in with respect to the
+     * {@linkplain Interval#from() start} {@code position} of the interval being processed.
+     */
+    enum State {
+        /**
+         * An interval that starts after {@code position}.
+         */
+        Unhandled,
+
+        /**
+         * An interval that {@linkplain Interval#covers covers} {@code position} and has an assigned register.
+         */
+        Active,
+
+        /**
+         * An interval that starts before and ends after {@code position} but does not
+         * {@linkplain Interval#covers cover} it due to a lifetime hole.
+         */
+        Inactive,
+
+        /**
+         * An interval that ends before {@code position} or is spilled to memory.
+         */
+        Handled;
+    }
+
+    /**
+     * Constants used in optimization of spilling of an interval.
+     */
+    enum SpillState {
+        /**
+         * Starting state of calculation: no definition found yet.
+         */
+        NoDefinitionFound,
+
+        /**
+         * One definition has already been found. Two consecutive definitions are treated as one
+         * (e.g. a consecutive move and add because of two-operand LIR form).
+         * The position of this definition is given by {@link Interval#spillDefinitionPos()}.
+         */
+        NoSpillStore,
+
+        /**
+         * One spill move has already been inserted.
+         */
+        OneSpillStore,
+
+        /**
+         * The interval should be stored immediately after its definition to prevent
+         * multiple redundant stores.
+         */
+        StoreAtDefinition,
+
+        /**
+         * The interval starts in memory (e.g. method parameter), so a store is never necessary.
+         */
+        StartInMemory,
+
+        /**
+         * The interval has more than one definition (e.g. resulting from phi moves), so stores
+         * to memory are not optimized.
+         */
+        NoOptimization
+    }
+
+    /**
+     * List of use positions. Each entry in the list records the use position and register
+     * priority associated with the use position. The entries in the list are in descending
+     * order of use position.
+     *
+     */
+    public static final class UsePosList {
+        private IntList list;
+
+        /**
+         * Creates a use list.
+         *
+         * @param initialCapacity the initial capacity of the list in terms of entries
+         */
+        public UsePosList(int initialCapacity) {
+            list = new IntList(initialCapacity * 2);
+        }
+
+        private UsePosList(IntList list) {
+            this.list = list;
+        }
+
+        /**
+         * Splits this list around a given position. All entries in this list with a use position greater or equal than
+         * {@code splitPos} are removed from this list and added to the returned list.
+         *
+         * @param splitPos the position for the split
+         * @return a use position list containing all entries removed from this list that have a use position greater or equal
+         *         than {@code splitPos}
+         */
+        public UsePosList splitAt(int splitPos) {
+            int i = size() - 1;
+            int len = 0;
+            while (i >= 0 && usePos(i) < splitPos) {
+                --i;
+                len += 2;
+            }
+            int listSplitIndex = (i + 1) * 2;
+            IntList childList = list;
+            list = IntList.copy(this.list, listSplitIndex, len);
+            childList.setSize(listSplitIndex);
+            UsePosList child = new UsePosList(childList);
+            return child;
+        }
+
+        /**
+         * Gets the use position at a specified index in this list.
+         *
+         * @param index the index of the entry for which the use position is returned
+         * @return the use position of entry {@code index} in this list
+         */
+        public int usePos(int index) {
+            return list.get(index << 1);
+        }
+
+        /**
+         * Gets the register priority for the use position at a specified index in this list.
+         *
+         * @param index the index of the entry for which the register priority is returned
+         * @return the register priority of entry {@code index} in this list
+         */
+        public RegisterPriority registerPriority(int index) {
+            return RegisterPriority.VALUES[list.get((index << 1) + 1)];
+        }
+
+        public void add(int usePos, RegisterPriority registerPriority) {
+            assert list.size() == 0 || usePos(size() - 1) > usePos;
+            list.add(usePos);
+            list.add(registerPriority.ordinal());
+        }
+
+        public int size() {
+            return list.size() >> 1;
+        }
+
+        public void removeLowestUsePos() {
+            list.setSize(list.size() - 2);
+        }
+
+        public void setRegisterPriority(int index, RegisterPriority registerPriority) {
+            list.set(index * 2, registerPriority.ordinal());
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder buf = new StringBuilder("[");
+            for (int i = size() - 1; i >= 0; --i) {
+                if (buf.length() != 1) {
+                    buf.append(", ");
+                }
+                RegisterPriority prio = registerPriority(i);
+                buf.append(usePos(i)).append(" -> ").append(prio.ordinal()).append(':').append(prio);
+            }
+            return buf.append("]").toString();
+        }
+    }
+
+    /**
+     * The {@linkplain CiRegisterValue register} or {@linkplain Variable variable} for this interval prior to register allocation.
+     */
+    public final CiValue operand;
+
+    /**
+     * The {@linkplain OperandPool#operandNumber(CiValue) operand number} for this interval's {@linkplain #operand operand}.
+     */
+    public final int operandNumber;
+
+    /**
+     * The {@linkplain CiRegisterValue register}, {@linkplain CiStackSlot spill slot} or {@linkplain CiAddress address} assigned to this interval.
+     */
+    private CiValue location;
+
+    /**
+     * The stack slot to which all splits of this interval are spilled if necessary.
+     */
+    private CiStackSlot spillSlot;
+
+    /**
+     * The kind of this interval.
+     * Only valid if this is a {@linkplain #xxisVariable() variable}.
+     */
+    private CiKind kind;
+
+    /**
+     * The head of the list of ranges describing this interval. This list is sorted by {@linkplain LIRInstruction#id instruction ids}.
+     */
+    private Range first;
+
+    /**
+     * List of (use-positions, register-priorities) pairs, sorted by use-positions.
+     */
+    private UsePosList usePosList;
+
+    /**
+     * Iterator used to traverse the ranges of an interval.
+     */
+    private Range current;
+
+    /**
+     * Link to next interval in a sorted list of intervals that ends with {@link #EndMarker}.
+     */
+    Interval next;
+
+    /**
+     * The linear-scan state of this interval.
+     */
+    State state;
+
+    private int cachedTo; // cached value: to of last range (-1: not cached)
+
+    /**
+     * The interval from which this one is derived. If this is a {@linkplain #isSplitParent() split parent}, it points to itself.
+     */
+    private Interval splitParent;
+
+    /**
+     * List of all intervals that are split off from this interval. This is only used if this is a {@linkplain #isSplitParent() split parent}.
+     */
+    private List<Interval> splitChildren = Collections.emptyList();
+
+    /**
+     * Current split child that has been active or inactive last (always stored in split parents).
+     */
+    private Interval currentSplitChild;
+
+    /**
+     * Specifies if move is inserted between currentSplitChild and this interval when interval gets active the first time.
+     */
+    private boolean insertMoveWhenActivated;
+
+    /**
+     * For spill move optimization.
+     */
+    private SpillState spillState;
+
+    /**
+     * Position where this interval is defined (if defined only once).
+     */
+    private int spillDefinitionPos;
+
+    /**
+     * This interval should be assigned the same location as the hint interval.
+     */
+    private Interval locationHint;
+
+    void assignLocation(CiValue newLocation) {
+        if (isRegister(newLocation)) {
+            assert this.location == null : "cannot re-assign location for " + this;
+            if (newLocation.kind == CiKind.Illegal && kind != CiKind.Illegal) {
+                this.location = asRegister(newLocation).asValue(kind);
+                return;
+            }
+        } else {
+            assert this.location == null || isRegister(this.location) : "cannot re-assign location for " + this;
+            assert isStackSlot(newLocation);
+            assert newLocation.kind != CiKind.Illegal;
+            assert newLocation.kind == this.kind;
+        }
+        this.location = newLocation;
+    }
+
+    /**
+     * Gets the {@linkplain CiRegisterValue register}, {@linkplain CiStackSlot spill slot} or {@linkplain CiAddress address} assigned to this interval.
+     */
+    public CiValue location() {
+        return location;
+    }
+
+    public CiKind kind() {
+        assert !isRegister(operand) : "cannot access type for fixed interval";
+        return kind;
+    }
+
+    void setKind(CiKind kind) {
+        assert isRegister(operand) || this.kind() == CiKind.Illegal || this.kind() == kind : "overwriting existing type";
+        assert kind == kind.stackKind() || kind == CiKind.Short : "these kinds should have int type registers";
+        this.kind = kind;
+    }
+
+    public Range first() {
+        return first;
+    }
+
+    int from() {
+        return first.from;
+    }
+
+    int to() {
+        if (cachedTo == -1) {
+            cachedTo = calcTo();
+        }
+        assert cachedTo == calcTo() : "invalid cached value";
+        return cachedTo;
+    }
+
+    int numUsePositions() {
+        return usePosList.size();
+    }
+
+    void setLocationHint(Interval interval) {
+        locationHint = interval;
+    }
+
+    boolean isSplitParent() {
+        return splitParent == this;
+    }
+
+    boolean isSplitChild() {
+        return splitParent != this;
+    }
+
+    /**
+     * Gets the split parent for this interval.
+     */
+    public Interval splitParent() {
+        assert splitParent.isSplitParent() : "not a split parent: " + this;
+        return splitParent;
+    }
+
+    /**
+     * Gets the canonical spill slot for this interval.
+     */
+    CiStackSlot spillSlot() {
+        return splitParent().spillSlot;
+    }
+
+    void setSpillSlot(CiStackSlot slot) {
+        assert splitParent().spillSlot == null : "connot overwrite existing spill slot";
+        splitParent().spillSlot = slot;
+    }
+
+    Interval currentSplitChild() {
+        return splitParent().currentSplitChild;
+    }
+
+    void makeCurrentSplitChild() {
+        splitParent().currentSplitChild = this;
+    }
+
+    boolean insertMoveWhenActivated() {
+        return insertMoveWhenActivated;
+    }
+
+    void setInsertMoveWhenActivated(boolean b) {
+        insertMoveWhenActivated = b;
+    }
+
+    // for spill optimization
+    public SpillState spillState() {
+        return splitParent().spillState;
+    }
+
+    int spillDefinitionPos() {
+        return splitParent().spillDefinitionPos;
+    }
+
+    void setSpillState(SpillState state) {
+        assert state.ordinal() >= spillState().ordinal() : "state cannot decrease";
+        splitParent().spillState = state;
+    }
+
+    void setSpillDefinitionPos(int pos) {
+        assert spillDefinitionPos() == -1 : "cannot set the position twice";
+        splitParent().spillDefinitionPos = pos;
+    }
+
+    // returns true if this interval has a shadow copy on the stack that is always correct
+    boolean alwaysInMemory() {
+        return splitParent().spillState == SpillState.StoreAtDefinition || splitParent().spillState == SpillState.StartInMemory;
+    }
+
+    void removeFirstUsePos() {
+        usePosList.removeLowestUsePos();
+    }
+
+    // test intersection
+    boolean intersects(Interval i) {
+        return first.intersects(i.first);
+    }
+
+    int intersectsAt(Interval i) {
+        return first.intersectsAt(i.first);
+    }
+
+    // range iteration
+    void rewindRange() {
+        current = first;
+    }
+
+    void nextRange() {
+        assert this != EndMarker : "not allowed on sentinel";
+        current = current.next;
+    }
+
+    int currentFrom() {
+        return current.from;
+    }
+
+    int currentTo() {
+        return current.to;
+    }
+
+    boolean currentAtEnd() {
+        return current == Range.EndMarker;
+    }
+
+    boolean currentIntersects(Interval it) {
+        return current.intersects(it.current);
+    }
+
+    int currentIntersectsAt(Interval it) {
+        return current.intersectsAt(it.current);
+    }
+
+    /**
+     * Sentinel interval to denote the end of an interval list.
+     */
+    static final Interval EndMarker = new Interval(CiValue.IllegalValue, -1);
+
+    Interval(CiValue operand, int operandNumber) {
+        assert operand != null;
+        this.operand = operand;
+        this.operandNumber = operandNumber;
+        if (isRegister(operand)) {
+            location = operand;
+        } else {
+            assert isIllegal(operand) || isVariable(operand);
+        }
+        this.kind = CiKind.Illegal;
+        this.first = Range.EndMarker;
+        this.usePosList = new UsePosList(4);
+        this.current = Range.EndMarker;
+        this.next = EndMarker;
+        this.cachedTo = -1;
+        this.spillState = SpillState.NoDefinitionFound;
+        this.spillDefinitionPos = -1;
+        splitParent = this;
+        currentSplitChild = this;
+    }
+
+    int calcTo() {
+        assert first != Range.EndMarker : "interval has no range";
+
+        Range r = first;
+        while (r.next != Range.EndMarker) {
+            r = r.next;
+        }
+        return r.to;
+    }
+
+    // consistency check of split-children
+    boolean checkSplitChildren() {
+        if (!splitChildren.isEmpty()) {
+            assert isSplitParent() : "only split parents can have children";
+
+            for (int i = 0; i < splitChildren.size(); i++) {
+                Interval i1 = splitChildren.get(i);
+
+                assert i1.splitParent() == this : "not a split child of this interval";
+                assert i1.kind()  == kind() : "must be equal for all split children";
+                assert i1.spillSlot() == spillSlot() : "must be equal for all split children";
+
+                for (int j = i + 1; j < splitChildren.size(); j++) {
+                    Interval i2 = splitChildren.get(j);
+
+                    assert i1.operand != i2.operand : "same register number";
+
+                    if (i1.from() < i2.from()) {
+                        assert i1.to() <= i2.from() && i1.to() < i2.to() : "intervals overlapping";
+                    } else {
+                        assert i2.from() < i1.from() : "intervals start at same opId";
+                        assert i2.to() <= i1.from() && i2.to() < i1.to() : "intervals overlapping";
+                    }
+                }
+            }
+        }
+
+        return true;
+    }
+
+    public Interval locationHint(boolean searchSplitChild) {
+        if (!searchSplitChild) {
+            return locationHint;
+        }
+
+        if (locationHint != null) {
+            assert locationHint.isSplitParent() : "ony split parents are valid hint registers";
+
+            if (locationHint.location != null && isRegister(locationHint.location)) {
+                return locationHint;
+            } else if (!locationHint.splitChildren.isEmpty()) {
+                // search the first split child that has a register assigned
+                int len = locationHint.splitChildren.size();
+                for (int i = 0; i < len; i++) {
+                    Interval interval = locationHint.splitChildren.get(i);
+                    if (interval.location != null && isRegister(interval.location)) {
+                        return interval;
+                    }
+                }
+            }
+        }
+
+        // no hint interval found that has a register assigned
+        return null;
+    }
+
+    Interval getSplitChildAtOpId(int opId, LIRInstruction.OperandMode mode, LinearScan allocator) {
+        assert isSplitParent() : "can only be called for split parents";
+        assert opId >= 0 : "invalid opId (method cannot be called for spill moves)";
+
+        if (splitChildren.isEmpty()) {
+            assert this.covers(opId, mode) : this + " does not cover " + opId;
+            return this;
+        } else {
+            Interval result = null;
+            int len = splitChildren.size();
+
+            // in outputMode, the end of the interval (opId == cur.to()) is not valid
+            int toOffset = (mode == LIRInstruction.OperandMode.Output ? 0 : 1);
+
+            int i;
+            for (i = 0; i < len; i++) {
+                Interval cur = splitChildren.get(i);
+                if (cur.from() <= opId && opId < cur.to() + toOffset) {
+                    if (i > 0) {
+                        // exchange current split child to start of list (faster access for next call)
+                        Util.atPutGrow(splitChildren, i, splitChildren.get(0), null);
+                        Util.atPutGrow(splitChildren, 0, cur, null);
+                    }
+
+                    // interval found
+                    result = cur;
+                    break;
+                }
+            }
+
+            assert checkSplitChild(result, opId, allocator, toOffset, mode);
+            return result;
+        }
+    }
+
+    private boolean checkSplitChild(Interval result, int opId, LinearScan allocator, int toOffset, LIRInstruction.OperandMode mode) {
+        if (result == null) {
+            // this is an error
+            StringBuilder msg = new StringBuilder(this.toString()).append(" has no child at ").append(opId);
+            if (!splitChildren.isEmpty()) {
+                Interval firstChild = splitChildren.get(0);
+                Interval lastChild = splitChildren.get(splitChildren.size() - 1);
+                msg.append(" (first = ").append(firstChild).append(", last = ").append(lastChild).append(")");
+            }
+            throw new GraalInternalError("Linear Scan Error: %s", msg);
+        }
+
+        if (!splitChildren.isEmpty()) {
+            for (Interval interval : splitChildren) {
+                if (interval != result && interval.from() <= opId && opId < interval.to() + toOffset) {
+                    TTY.println(String.format("two valid result intervals found for opId %d: %d and %d", opId, result.operandNumber, interval.operandNumber));
+                    TTY.println(result.logString(allocator));
+                    TTY.println(interval.logString(allocator));
+                    throw new CiBailout("two valid result intervals found");
+                }
+            }
+        }
+        assert result.covers(opId, mode) : "opId not covered by interval";
+        return true;
+    }
+
+    // returns the last split child that ends before the given opId
+    Interval getSplitChildBeforeOpId(int opId) {
+        assert opId >= 0 : "invalid opId";
+
+        Interval parent = splitParent();
+        Interval result = null;
+
+        assert !parent.splitChildren.isEmpty() : "no split children available";
+        int len = parent.splitChildren.size();
+
+        for (int i = len - 1; i >= 0; i--) {
+            Interval cur = parent.splitChildren.get(i);
+            if (cur.to() <= opId && (result == null || result.to() < cur.to())) {
+                result = cur;
+            }
+        }
+
+        assert result != null : "no split child found";
+        return result;
+    }
+
+    // checks if opId is covered by any split child
+    boolean splitChildCovers(int opId, LIRInstruction.OperandMode mode) {
+        assert isSplitParent() : "can only be called for split parents";
+        assert opId >= 0 : "invalid opId (method can not be called for spill moves)";
+
+        if (splitChildren.isEmpty()) {
+            // simple case if interval was not split
+            return covers(opId, mode);
+
+        } else {
+            // extended case: check all split children
+            int len = splitChildren.size();
+            for (int i = 0; i < len; i++) {
+                Interval cur = splitChildren.get(i);
+                if (cur.covers(opId, mode)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+
+    // Note: use positions are sorted descending . first use has highest index
+    int firstUsage(RegisterPriority minRegisterPriority) {
+        assert isVariable(operand) : "cannot access use positions for fixed intervals";
+
+        for (int i = usePosList.size() - 1; i >= 0; --i) {
+            RegisterPriority registerPriority = usePosList.registerPriority(i);
+            if (registerPriority.greaterEqual(minRegisterPriority)) {
+                return usePosList.usePos(i);
+            }
+        }
+        return Integer.MAX_VALUE;
+    }
+
+    int nextUsage(RegisterPriority minRegisterPriority, int from) {
+        assert isVariable(operand) : "cannot access use positions for fixed intervals";
+
+        for (int i = usePosList.size() - 1; i >= 0; --i) {
+            int usePos = usePosList.usePos(i);
+            if (usePos >= from && usePosList.registerPriority(i).greaterEqual(minRegisterPriority)) {
+                return usePos;
+            }
+        }
+        return Integer.MAX_VALUE;
+    }
+
+    int nextUsageExact(RegisterPriority exactRegisterPriority, int from) {
+        assert isVariable(operand) : "cannot access use positions for fixed intervals";
+
+        for (int i = usePosList.size() - 1; i >= 0; --i) {
+            int usePos = usePosList.usePos(i);
+            if (usePos >= from && usePosList.registerPriority(i) == exactRegisterPriority) {
+                return usePos;
+            }
+        }
+        return Integer.MAX_VALUE;
+    }
+
+    int previousUsage(RegisterPriority minRegisterPriority, int from) {
+        assert isVariable(operand) : "cannot access use positions for fixed intervals";
+
+        int prev = 0;
+        for (int i = usePosList.size() - 1; i >= 0; --i) {
+            int usePos = usePosList.usePos(i);
+            if (usePos > from) {
+                return prev;
+            }
+            if (usePosList.registerPriority(i).greaterEqual(minRegisterPriority)) {
+                prev = usePos;
+            }
+        }
+        return prev;
+    }
+
+    void addUsePos(int pos, RegisterPriority registerPriority) {
+        assert covers(pos, LIRInstruction.OperandMode.Input) : "use position not covered by live range";
+
+        // do not add use positions for precolored intervals because they are never used
+        if (registerPriority != RegisterPriority.None && isVariable(operand)) {
+            if (GraalOptions.DetailedAsserts) {
+                for (int i = 0; i < usePosList.size(); i++) {
+                    assert pos <= usePosList.usePos(i) : "already added a use-position with lower position";
+                    if (i > 0) {
+                        assert usePosList.usePos(i) < usePosList.usePos(i - 1) : "not sorted descending";
+                    }
+                }
+            }
+
+            // Note: addUse is called in descending order, so list gets sorted
+            // automatically by just appending new use positions
+            int len = usePosList.size();
+            if (len == 0 || usePosList.usePos(len - 1) > pos) {
+                usePosList.add(pos, registerPriority);
+            } else if (usePosList.registerPriority(len - 1).lessThan(registerPriority)) {
+                assert usePosList.usePos(len - 1) == pos : "list not sorted correctly";
+                usePosList.setRegisterPriority(len - 1, registerPriority);
+            }
+        }
+    }
+
+    void addRange(int from, int to) {
+        assert from < to : "invalid range";
+        assert first() == Range.EndMarker || to < first().next.from : "not inserting at begin of interval";
+        assert from <= first().to : "not inserting at begin of interval";
+
+        if (first.from <= to) {
+            assert first != Range.EndMarker;
+            // join intersecting ranges
+            first.from = Math.min(from, first().from);
+            first.to = Math.max(to, first().to);
+        } else {
+            // insert new range
+            first = new Range(from, to, first());
+        }
+    }
+
+    Interval newSplitChild(LinearScan allocator) {
+        // allocate new interval
+        Interval parent = splitParent();
+        Interval result = allocator.createDerivedInterval(parent);
+        result.setKind(kind());
+
+        result.splitParent = parent;
+        result.setLocationHint(parent);
+
+        // insert new interval in children-list of parent
+        if (parent.splitChildren.isEmpty()) {
+            assert isSplitParent() : "list must be initialized at first split";
+
+            // Create new non-shared list
+            parent.splitChildren = new ArrayList<>(4);
+            parent.splitChildren.add(this);
+        }
+        parent.splitChildren.add(result);
+
+        return result;
+    }
+
+    /**
+     * Splits this interval at a specified position and returns the remainder as a new <i>child</i> interval
+     * of this interval's {@linkplain #splitParent() parent} interval.
+     * <p>
+     * When an interval is split, a bi-directional link is established between the original <i>parent</i>
+     * interval and the <i>children</i> intervals that are split off this interval.
+     * When a split child is split again, the new created interval is a direct child
+     * of the original parent. That is, there is no tree of split children stored, just a flat list.
+     * All split children are spilled to the same {@linkplain #spillSlot spill slot}.
+     *
+     * @param splitPos the position at which to split this interval
+     * @param allocator the register allocator context
+     * @return the child interval split off from this interval
+     */
+    Interval split(int splitPos, LinearScan allocator) {
+        assert isVariable(operand) : "cannot split fixed intervals";
+
+        // allocate new interval
+        Interval result = newSplitChild(allocator);
+
+        // split the ranges
+        Range prev = null;
+        Range cur = first;
+        while (cur != Range.EndMarker && cur.to <= splitPos) {
+            prev = cur;
+            cur = cur.next;
+        }
+        assert cur != Range.EndMarker : "split interval after end of last range";
+
+        if (cur.from < splitPos) {
+            result.first = new Range(splitPos, cur.to, cur.next);
+            cur.to = splitPos;
+            cur.next = Range.EndMarker;
+
+        } else {
+            assert prev != null : "split before start of first range";
+            result.first = cur;
+            prev.next = Range.EndMarker;
+        }
+        result.current = result.first;
+        cachedTo = -1; // clear cached value
+
+        // split list of use positions
+        result.usePosList = usePosList.splitAt(splitPos);
+
+        if (GraalOptions.DetailedAsserts) {
+            for (int i = 0; i < usePosList.size(); i++) {
+                assert usePosList.usePos(i) < splitPos;
+            }
+            for (int i = 0; i < result.usePosList.size(); i++) {
+                assert result.usePosList.usePos(i) >= splitPos;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Splits this interval at a specified position and returns
+     * the head as a new interval (this interval is the tail).
+     *
+     * Currently, only the first range can be split, and the new interval must not have split positions
+     */
+    Interval splitFromStart(int splitPos, LinearScan allocator) {
+        assert isVariable(operand) : "cannot split fixed intervals";
+        assert splitPos > from() && splitPos < to() : "can only split inside interval";
+        assert splitPos > first.from && splitPos <= first.to : "can only split inside first range";
+        assert firstUsage(RegisterPriority.None) > splitPos : "can not split when use positions are present";
+
+        // allocate new interval
+        Interval result = newSplitChild(allocator);
+
+        // the new interval has only one range (checked by assertion above,
+        // so the splitting of the ranges is very simple
+        result.addRange(first.from, splitPos);
+
+        if (splitPos == first.to) {
+            assert first.next != Range.EndMarker : "must not be at end";
+            first = first.next;
+        } else {
+            first.from = splitPos;
+        }
+
+        return result;
+    }
+
+    // returns true if the opId is inside the interval
+    boolean covers(int opId, LIRInstruction.OperandMode mode) {
+        Range cur = first;
+
+        while (cur != Range.EndMarker && cur.to < opId) {
+            cur = cur.next;
+        }
+        if (cur != Range.EndMarker) {
+            assert cur.to != cur.next.from : "ranges not separated";
+
+            if (mode == LIRInstruction.OperandMode.Output) {
+                return cur.from <= opId && opId < cur.to;
+            } else {
+                return cur.from <= opId && opId <= cur.to;
+            }
+        }
+        return false;
+    }
+
+    // returns true if the interval has any hole between holeFrom and holeTo
+    // (even if the hole has only the length 1)
+    boolean hasHoleBetween(int holeFrom, int holeTo) {
+        assert holeFrom < holeTo : "check";
+        assert from() <= holeFrom && holeTo <= to() : "index out of interval";
+
+        Range cur = first;
+        while (cur != Range.EndMarker) {
+            assert cur.to < cur.next.from : "no space between ranges";
+
+            // hole-range starts before this range . hole
+            if (holeFrom < cur.from) {
+                return true;
+
+                // hole-range completely inside this range . no hole
+            } else {
+                if (holeTo <= cur.to) {
+                    return false;
+
+                    // overlapping of hole-range with this range . hole
+                } else {
+                    if (holeFrom <= cur.to) {
+                        return true;
+                    }
+                }
+            }
+
+            cur = cur.next;
+        }
+
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        String from = "?";
+        String to = "?";
+        if (first != null && first != Range.EndMarker) {
+            from = String.valueOf(from());
+            to = String.valueOf(to());
+        }
+        String locationString = this.location == null ? "" : "@" + this.location;
+        return operandNumber + ":" + operand + (isRegister(operand) ? "" : locationString) + "[" + from + "," + to + "]";
+    }
+
+    /**
+     * Gets the use position information for this interval.
+     */
+    public UsePosList usePosList() {
+        return usePosList;
+    }
+
+    /**
+     * Gets a single line string for logging the details of this interval to a log stream.
+     *
+     * @param allocator the register allocator context
+     */
+    public String logString(LinearScan allocator) {
+        StringBuilder buf = new StringBuilder(100);
+        buf.append(operandNumber).append(':').append(operand).append(' ');
+        if (!isRegister(operand)) {
+            if (location != null) {
+                buf.append("location{").append(location).append("} ");
+            }
+        }
+
+        buf.append("hints{").append(splitParent.operandNumber);
+        Interval hint = locationHint(false);
+        if (hint != null && hint.operandNumber != splitParent.operandNumber) {
+            buf.append(", ").append(hint.operandNumber);
+        }
+        buf.append("} ranges{");
+
+        // print ranges
+        Range cur = first;
+        while (cur != Range.EndMarker) {
+            if (cur != first) {
+                buf.append(", ");
+            }
+            buf.append(cur);
+            cur = cur.next;
+            assert cur != null : "range list not closed with range sentinel";
+        }
+        buf.append("} uses{");
+
+        // print use positions
+        int prev = 0;
+        for (int i = usePosList.size() - 1; i >= 0; --i) {
+            assert prev < usePosList.usePos(i) : "use positions not sorted";
+            if (i != usePosList.size() - 1) {
+                buf.append(", ");
+            }
+            buf.append(usePosList.usePos(i)).append(':').append(usePosList.registerPriority(i));
+            prev = usePosList.usePos(i);
+        }
+        return buf.append("} spill-state{").append(spillState()).append("}").toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.alloc.Interval.RegisterBinding;
+import com.oracle.graal.compiler.alloc.Interval.RegisterBindingLists;
+import com.oracle.graal.compiler.alloc.Interval.State;
+
+/**
+ */
+public class IntervalWalker {
+
+    protected final LinearScan allocator;
+
+    /**
+     * Sorted list of intervals, not live before the current position.
+     */
+    RegisterBindingLists unhandledLists;
+
+    /**
+     * Sorted list of intervals, live at the current position.
+     */
+    RegisterBindingLists activeLists;
+
+    /**
+     * Sorted list of intervals in a life time hole at the current position.
+     */
+    RegisterBindingLists inactiveLists;
+
+    /**
+     * The current interval (taken from the unhandled list) being processed.
+     */
+    protected Interval currentInterval;
+
+    /**
+     * The current position (intercept point through the intervals).
+     */
+    protected int currentPosition;
+
+    /**
+     * The binding of the current interval being processed.
+     */
+    protected RegisterBinding currentBinding;
+
+    /**
+     * Processes the {@linkplain #currentInterval} interval in an attempt to allocate a physical
+     * register to it and thus allow it to be moved to a list of {@linkplain #activeLists active} intervals.
+     *
+     * @return {@code true} if a register was allocated to the {@linkplain #currentInterval} interval
+     */
+    boolean activateCurrent() {
+        return true;
+    }
+
+    void walkBefore(int lirOpId) {
+        walkTo(lirOpId - 1);
+    }
+
+    void walk() {
+        walkTo(Integer.MAX_VALUE);
+    }
+
+    /**
+     * Creates a new interval walker.
+     *
+     * @param allocator the register allocator context
+     * @param unhandledFixed the list of unhandled {@linkplain RegisterBinding#Fixed fixed} intervals
+     * @param unhandledAny the list of unhandled {@linkplain RegisterBinding#Any non-fixed} intervals
+     */
+    IntervalWalker(LinearScan allocator, Interval unhandledFixed, Interval unhandledAny) {
+        this.allocator = allocator;
+
+        unhandledLists = new RegisterBindingLists(unhandledFixed, unhandledAny);
+        activeLists = new RegisterBindingLists(Interval.EndMarker, Interval.EndMarker);
+        inactiveLists = new RegisterBindingLists(Interval.EndMarker, Interval.EndMarker);
+        currentPosition = -1;
+        currentInterval = null;
+        nextInterval();
+    }
+
+    void removeFromList(Interval interval) {
+        if (interval.state == State.Active) {
+            activeLists.remove(RegisterBinding.Any, interval);
+        } else {
+            assert interval.state == State.Inactive : "invalid state";
+            inactiveLists.remove(RegisterBinding.Any, interval);
+        }
+    }
+
+    void walkTo(State state, int from) {
+        assert state == State.Active || state == State.Inactive : "wrong state";
+        for (RegisterBinding binding : RegisterBinding.VALUES) {
+            Interval prevprev = null;
+            Interval prev = (state == State.Active) ? activeLists.get(binding) : inactiveLists.get(binding);
+            Interval next = prev;
+            while (next.currentFrom() <= from) {
+                Interval cur = next;
+                next = cur.next;
+
+                boolean rangeHasChanged = false;
+                while (cur.currentTo() <= from) {
+                    cur.nextRange();
+                    rangeHasChanged = true;
+                }
+
+                // also handle move from inactive list to active list
+                rangeHasChanged = rangeHasChanged || (state == State.Inactive && cur.currentFrom() <= from);
+
+                if (rangeHasChanged) {
+                    // remove cur from list
+                    if (prevprev == null) {
+                        if (state == State.Active) {
+                            activeLists.set(binding, next);
+                        } else {
+                            inactiveLists.set(binding, next);
+                        }
+                    } else {
+                        prevprev.next = next;
+                    }
+                    prev = next;
+                    if (cur.currentAtEnd()) {
+                        // move to handled state (not maintained as a list)
+                        cur.state = State.Handled;
+                        intervalMoved(cur, state, State.Handled);
+                    } else if (cur.currentFrom() <= from) {
+                        // sort into active list
+                        activeLists.addToListSortedByCurrentFromPositions(binding, cur);
+                        cur.state = State.Active;
+                        if (prev == cur) {
+                            assert state == State.Active : "check";
+                            prevprev = prev;
+                            prev = cur.next;
+                        }
+                        intervalMoved(cur, state, State.Active);
+                    } else {
+                        // sort into inactive list
+                        inactiveLists.addToListSortedByCurrentFromPositions(binding, cur);
+                        cur.state = State.Inactive;
+                        if (prev == cur) {
+                            assert state == State.Inactive : "check";
+                            prevprev = prev;
+                            prev = cur.next;
+                        }
+                        intervalMoved(cur, state, State.Inactive);
+                    }
+                } else {
+                    prevprev = prev;
+                    prev = cur.next;
+                }
+            }
+        }
+    }
+
+    void nextInterval() {
+        RegisterBinding binding;
+        Interval any = unhandledLists.any;
+        Interval fixed = unhandledLists.fixed;
+
+        if (any != Interval.EndMarker) {
+            // intervals may start at same position . prefer fixed interval
+            binding = fixed != Interval.EndMarker && fixed.from() <= any.from() ? RegisterBinding.Fixed : RegisterBinding.Any;
+
+            assert binding == RegisterBinding.Fixed && fixed.from() <= any.from() || binding == RegisterBinding.Any && any.from() <= fixed.from() : "wrong interval!!!";
+            assert any == Interval.EndMarker || fixed == Interval.EndMarker || any.from() != fixed.from() || binding == RegisterBinding.Fixed : "if fixed and any-Interval start at same position, fixed must be processed first";
+
+        } else if (fixed != Interval.EndMarker) {
+            binding = RegisterBinding.Fixed;
+        } else {
+            currentInterval = null;
+            return;
+        }
+        currentBinding = binding;
+        currentInterval = unhandledLists.get(binding);
+        unhandledLists.set(binding, currentInterval.next);
+        currentInterval.next = Interval.EndMarker;
+        currentInterval.rewindRange();
+    }
+
+    void walkTo(int toOpId) {
+        assert currentPosition <= toOpId : "can not walk backwards";
+        while (currentInterval != null) {
+            boolean isActive = currentInterval.from() <= toOpId;
+            int opId = isActive ? currentInterval.from() : toOpId;
+
+            if (GraalOptions.TraceLinearScanLevel >= 2 && !TTY.isSuppressed()) {
+                if (currentPosition < opId) {
+                    TTY.println();
+                    TTY.println("walkTo(%d) *", opId);
+                }
+            }
+
+            // set currentPosition prior to call of walkTo
+            currentPosition = opId;
+
+            // call walkTo even if currentPosition == id
+            walkTo(State.Active, opId);
+            walkTo(State.Inactive, opId);
+
+            if (isActive) {
+                currentInterval.state = State.Active;
+                if (activateCurrent()) {
+                    activeLists.addToListSortedByCurrentFromPositions(currentBinding, currentInterval);
+                    intervalMoved(currentInterval, State.Unhandled, State.Active);
+                }
+
+                nextInterval();
+            } else {
+                return;
+            }
+        }
+    }
+
+    private void intervalMoved(Interval interval, State from, State to) {
+        // intervalMoved() is called whenever an interval moves from one interval list to another.
+        // In the implementation of this method it is prohibited to move the interval to any list.
+        if (GraalOptions.TraceLinearScanLevel >= 4 && !TTY.isSuppressed()) {
+            TTY.print(from.toString() + " to " + to.toString());
+            TTY.fillTo(23);
+            TTY.out().println(interval.logString(allocator));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,2100 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+import static com.oracle.max.cri.ci.CiUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.alloc.Interval.RegisterBinding;
+import com.oracle.graal.compiler.alloc.Interval.RegisterPriority;
+import com.oracle.graal.compiler.alloc.Interval.SpillState;
+import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.StandardOp.*;
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ * An implementation of the linear scan register allocator algorithm described
+ * in <a href="http://doi.acm.org/10.1145/1064979.1064998">"Optimized Interval Splitting in a Linear Scan Register Allocator"</a>
+ * by Christian Wimmer and Hanspeter Moessenboeck.
+ */
+public final class LinearScan {
+
+    final CiTarget target;
+    final RiMethod method;
+    final LIR ir;
+    final LIRGenerator gen;
+    final FrameMap frameMap;
+    final RiRegisterAttributes[] registerAttributes;
+    final CiRegister[] registers;
+
+    private static final int INITIAL_SPLIT_INTERVALS_CAPACITY = 32;
+
+    public static class BlockData {
+        /**
+         * Bit map specifying which {@linkplain OperandPool operands} are live upon entry to this block.
+         * These are values used in this block or any of its successors where such value are not defined
+         * in this block.
+         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
+         */
+        public BitMap liveIn;
+
+        /**
+         * Bit map specifying which {@linkplain OperandPool operands} are live upon exit from this block.
+         * These are values used in a successor block that are either defined in this block or were live
+         * upon entry to this block.
+         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
+         */
+        public BitMap liveOut;
+
+        /**
+         * Bit map specifying which {@linkplain OperandPool operands} are used (before being defined) in this block.
+         * That is, these are the values that are live upon entry to the block.
+         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
+         */
+        public BitMap liveGen;
+
+        /**
+         * Bit map specifying which {@linkplain OperandPool operands} are defined/overwritten in this block.
+         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
+         */
+        public BitMap liveKill;
+    }
+
+    public final BlockMap<BlockData> blockData;
+
+    /**
+     * List of blocks in linear-scan order. This is only correct as long as the CFG does not change.
+     */
+    final Block[] sortedBlocks;
+
+    /**
+     * Map from {@linkplain #operandNumber(CiValue) operand numbers} to intervals.
+     */
+    Interval[] intervals;
+
+    /**
+     * The number of valid entries in {@link #intervals}.
+     */
+    int intervalsSize;
+
+    /**
+     * The index of the first entry in {@link #intervals} for a {@linkplain #createDerivedInterval(Interval) derived interval}.
+     */
+    int firstDerivedIntervalIndex = -1;
+
+    /**
+     * Intervals sorted by {@link Interval#from()}.
+     */
+    Interval[] sortedIntervals;
+
+    /**
+     * Map from an instruction {@linkplain LIRInstruction#id id} to the instruction.
+     * Entries should be retrieved with {@link #instructionForId(int)} as the id is
+     * not simply an index into this array.
+     */
+    LIRInstruction[] opIdToInstructionMap;
+
+    /**
+     * Map from an instruction {@linkplain LIRInstruction#id id} to the {@linkplain
+     * Block block} containing the instruction. Entries should be retrieved with
+     * {@link #blockForId(int)} as the id is not simply an index into this array.
+     */
+    Block[] opIdToBlockMap;
+
+    /**
+     * Bit set for each variable that is contained in each loop.
+     */
+    BitMap2D intervalInLoop;
+
+    /**
+     * The variable operands allocated from this pool. The {@linkplain #operandNumber(CiValue) number}
+     * of the first variable operand in this pool is one greater than the number of the last
+     * register operand in the pool.
+     */
+    private final ArrayList<Variable> variables;
+
+    /**
+     * The {@linkplain #operandNumber(CiValue) number} of the first variable operand
+     * {@linkplain #newVariable(CiKind) allocated} from this pool.
+     */
+    private final int firstVariableNumber;
+
+
+    public LinearScan(CiTarget target, RiResolvedMethod method, LIR ir, LIRGenerator gen, FrameMap frameMap) {
+        this.target = target;
+        this.method = method;
+        this.ir = ir;
+        this.gen = gen;
+        this.frameMap = frameMap;
+        this.sortedBlocks = ir.linearScanOrder().toArray(new Block[ir.linearScanOrder().size()]);
+        this.registerAttributes = frameMap.registerConfig.getAttributesMap();
+
+        this.registers = target.arch.registers;
+        this.firstVariableNumber = registers.length;
+        this.variables = new ArrayList<>(ir.numVariables() * 3 / 2);
+        this.blockData = new BlockMap<>(ir.cfg);
+    }
+
+    public static boolean isVariableOrRegister(CiValue value) {
+        return isVariable(value) || isRegister(value);
+    }
+
+
+    /**
+     * Converts an operand (variable or register) to an index in a flat address space covering all the
+     * {@linkplain Variable variables} and {@linkplain CiRegisterValue registers} being processed by this
+     * allocator.
+     */
+    private int operandNumber(CiValue operand) {
+        if (isRegister(operand)) {
+            int number = asRegister(operand).number;
+            assert number < firstVariableNumber;
+            return number;
+        }
+        assert isVariable(operand) : operand;
+        return firstVariableNumber + ((Variable) operand).index;
+    }
+
+    /**
+     * Gets the operand denoted by a given operand number.
+     */
+    private CiValue operandFor(int operandNumber) {
+        if (operandNumber < firstVariableNumber) {
+            assert operandNumber >= 0;
+            return registers[operandNumber].asValue();
+        }
+        int index = operandNumber - firstVariableNumber;
+        Variable variable = variables.get(index);
+        assert variable.index == index;
+        return variable;
+    }
+
+    /**
+     * Gets the number of operands. This value will increase by 1 for new variable.
+     */
+    private int operandSize() {
+        return firstVariableNumber + ir.numVariables();
+    }
+
+    /**
+     * Gets the highest operand number for a register operand. This value will never change.
+     */
+    public int maxRegisterNumber() {
+        return firstVariableNumber - 1;
+    }
+
+
+    static final IntervalPredicate IS_PRECOLORED_INTERVAL = new IntervalPredicate() {
+        @Override
+        public boolean apply(Interval i) {
+            return isRegister(i.operand);
+        }
+    };
+
+    static final IntervalPredicate IS_VARIABLE_INTERVAL = new IntervalPredicate() {
+        @Override
+        public boolean apply(Interval i) {
+            return isVariable(i.operand);
+        }
+    };
+
+    static final IntervalPredicate IS_OOP_INTERVAL = new IntervalPredicate() {
+        @Override
+        public boolean apply(Interval i) {
+            return !isRegister(i.operand) && i.kind()  == CiKind.Object;
+        }
+    };
+
+    /**
+     * Gets an object describing the attributes of a given register according to this register configuration.
+     */
+    RiRegisterAttributes attributes(CiRegister reg) {
+        return registerAttributes[reg.number];
+    }
+
+    void assignSpillSlot(Interval interval) {
+        // assign the canonical spill slot of the parent (if a part of the interval
+        // is already spilled) or allocate a new spill slot
+        if (interval.spillSlot() != null) {
+            interval.assignLocation(interval.spillSlot());
+        } else {
+            CiStackSlot slot = frameMap.allocateSpillSlot(interval.kind());
+            interval.setSpillSlot(slot);
+            interval.assignLocation(slot);
+        }
+    }
+
+    /**
+     * Creates a new interval.
+     *
+     * @param operand the operand for the interval
+     * @return the created interval
+     */
+    Interval createInterval(CiValue operand) {
+        assert isProcessed(operand);
+        assert isLegal(operand);
+        int operandNumber = operandNumber(operand);
+        Interval interval = new Interval(operand, operandNumber);
+        assert operandNumber < intervalsSize;
+        assert intervals[operandNumber] == null;
+        intervals[operandNumber] = interval;
+        return interval;
+    }
+
+    /**
+     * Creates an interval as a result of splitting or spilling another interval.
+     *
+     * @param source an interval being split of spilled
+     * @return a new interval derived from {@code source}
+     */
+    Interval createDerivedInterval(Interval source) {
+        if (firstDerivedIntervalIndex == -1) {
+            firstDerivedIntervalIndex = intervalsSize;
+        }
+        if (intervalsSize == intervals.length) {
+            intervals = Arrays.copyOf(intervals, intervals.length * 2);
+        }
+        intervalsSize++;
+        Variable variable = new Variable(source.kind(), ir.nextVariable(), asVariable(source.operand).flag);
+        assert variables.size() == variable.index;
+        variables.add(variable);
+
+        Interval interval = createInterval(variable);
+        assert intervals[intervalsSize - 1] == interval;
+        return interval;
+    }
+
+    // access to block list (sorted in linear scan order)
+    int blockCount() {
+        assert sortedBlocks.length == ir.linearScanOrder().size() : "invalid cached block list";
+        return sortedBlocks.length;
+    }
+
+    Block blockAt(int index) {
+        assert sortedBlocks[index] == ir.linearScanOrder().get(index) : "invalid cached block list";
+        return sortedBlocks[index];
+    }
+
+    /**
+     * Gets the size of the {@link Block#liveIn} and {@link Block#liveOut} sets for a basic block. These sets do
+     * not include any operands allocated as a result of creating {@linkplain #createDerivedInterval(Interval) derived
+     * intervals}.
+     */
+    int liveSetSize() {
+        return firstDerivedIntervalIndex == -1 ? operandSize() : firstDerivedIntervalIndex;
+    }
+
+    int numLoops() {
+        return ir.cfg.getLoops().length;
+    }
+
+    boolean isIntervalInLoop(int interval, int loop) {
+        return intervalInLoop.at(interval, loop);
+    }
+
+    Interval intervalFor(CiValue operand) {
+        int operandNumber = operandNumber(operand);
+        assert operandNumber < intervalsSize;
+        return intervals[operandNumber];
+    }
+
+    /**
+     * Gets the highest instruction id allocated by this object.
+     */
+    int maxOpId() {
+        assert opIdToInstructionMap.length > 0 : "no operations";
+        return (opIdToInstructionMap.length - 1) << 1;
+    }
+
+    /**
+     * Converts an {@linkplain LIRInstruction#id instruction id} to an instruction index.
+     * All LIR instructions in a method have an index one greater than their linear-scan order predecesor
+     * with the first instruction having an index of 0.
+     */
+    static int opIdToIndex(int opId) {
+        return opId >> 1;
+    }
+
+    /**
+     * Retrieves the {@link LIRInstruction} based on its {@linkplain LIRInstruction#id id}.
+     *
+     * @param opId an instruction {@linkplain LIRInstruction#id id}
+     * @return the instruction whose {@linkplain LIRInstruction#id} {@code == id}
+     */
+    LIRInstruction instructionForId(int opId) {
+        assert isEven(opId) : "opId not even";
+        LIRInstruction instr = opIdToInstructionMap[opIdToIndex(opId)];
+        assert instr.id() == opId;
+        return instr;
+    }
+
+    /**
+     * Gets the block containing a given instruction.
+     *
+     * @param opId an instruction {@linkplain LIRInstruction#id id}
+     * @return the block containing the instruction denoted by {@code opId}
+     */
+    Block blockForId(int opId) {
+        assert opIdToBlockMap.length > 0 && opId >= 0 && opId <= maxOpId() + 1 : "opId out of range";
+        return opIdToBlockMap[opIdToIndex(opId)];
+    }
+
+    boolean isBlockBegin(int opId) {
+        return opId == 0 || blockForId(opId) != blockForId(opId - 1);
+    }
+
+    boolean coversBlockBegin(int opId1, int opId2) {
+        return blockForId(opId1) != blockForId(opId2);
+    }
+
+    /**
+     * Determines if an {@link LIRInstruction} destroys all caller saved registers.
+     *
+     * @param opId an instruction {@linkplain LIRInstruction#id id}
+     * @return {@code true} if the instruction denoted by {@code id} destroys all caller saved registers.
+     */
+    boolean hasCall(int opId) {
+        assert isEven(opId) : "opId not even";
+        return instructionForId(opId).hasCall();
+    }
+
+    /**
+     * Eliminates moves from register to stack if the stack slot is known to be correct.
+     */
+    void changeSpillDefinitionPos(Interval interval, int defPos) {
+        assert interval.isSplitParent() : "can only be called for split parents";
+
+        switch (interval.spillState()) {
+            case NoDefinitionFound:
+                assert interval.spillDefinitionPos() == -1 : "must no be set before";
+                interval.setSpillDefinitionPos(defPos);
+                interval.setSpillState(SpillState.NoSpillStore);
+                break;
+
+            case NoSpillStore:
+                assert defPos <= interval.spillDefinitionPos() : "positions are processed in reverse order when intervals are created";
+                if (defPos < interval.spillDefinitionPos() - 2 || instructionForId(interval.spillDefinitionPos()) instanceof LIRXirInstruction) {
+                    // second definition found, so no spill optimization possible for this interval
+                    interval.setSpillState(SpillState.NoOptimization);
+                } else {
+                    // two consecutive definitions (because of two-operand LIR form)
+                    assert blockForId(defPos) == blockForId(interval.spillDefinitionPos()) : "block must be equal";
+                }
+                break;
+
+            case NoOptimization:
+                // nothing to do
+                break;
+
+            default:
+                throw new CiBailout("other states not allowed at this time");
+        }
+    }
+
+    // called during register allocation
+    void changeSpillState(Interval interval, int spillPos) {
+        switch (interval.spillState()) {
+            case NoSpillStore: {
+                int defLoopDepth = blockForId(interval.spillDefinitionPos()).getLoopDepth();
+                int spillLoopDepth = blockForId(spillPos).getLoopDepth();
+
+                if (defLoopDepth < spillLoopDepth) {
+                    // the loop depth of the spilling position is higher then the loop depth
+                    // at the definition of the interval . move write to memory out of loop
+                    // by storing at definitin of the interval
+                    interval.setSpillState(SpillState.StoreAtDefinition);
+                } else {
+                    // the interval is currently spilled only once, so for now there is no
+                    // reason to store the interval at the definition
+                    interval.setSpillState(SpillState.OneSpillStore);
+                }
+                break;
+            }
+
+            case OneSpillStore: {
+                // the interval is spilled more then once, so it is better to store it to
+                // memory at the definition
+                interval.setSpillState(SpillState.StoreAtDefinition);
+                break;
+            }
+
+            case StoreAtDefinition:
+            case StartInMemory:
+            case NoOptimization:
+            case NoDefinitionFound:
+                // nothing to do
+                break;
+
+            default:
+                throw new CiBailout("other states not allowed at this time");
+        }
+    }
+
+    abstract static class IntervalPredicate {
+        abstract boolean apply(Interval i);
+    }
+
+    private static final IntervalPredicate mustStoreAtDefinition = new IntervalPredicate() {
+        @Override
+        public boolean apply(Interval i) {
+            return i.isSplitParent() && i.spillState() == SpillState.StoreAtDefinition;
+        }
+    };
+
+    // called once before assignment of register numbers
+    void eliminateSpillMoves() {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
+            TTY.println(" Eliminating unnecessary spill moves");
+        }
+
+        // collect all intervals that must be stored after their definition.
+        // the list is sorted by Interval.spillDefinitionPos
+        Interval interval;
+        interval = createUnhandledLists(mustStoreAtDefinition, null).first;
+        if (GraalOptions.DetailedAsserts) {
+            checkIntervals(interval);
+        }
+
+        LIRInsertionBuffer insertionBuffer = new LIRInsertionBuffer();
+        int numBlocks = blockCount();
+        for (int i = 0; i < numBlocks; i++) {
+            Block block = blockAt(i);
+            List<LIRInstruction> instructions = block.lir;
+            int numInst = instructions.size();
+
+            // iterate all instructions of the block. skip the first because it is always a label
+            for (int j = 1; j < numInst; j++) {
+                LIRInstruction op = instructions.get(j);
+                int opId = op.id();
+
+                if (opId == -1) {
+                    MoveOp move = (MoveOp) op;
+                    // remove move from register to stack if the stack slot is guaranteed to be correct.
+                    // only moves that have been inserted by LinearScan can be removed.
+                    assert isVariable(move.getResult()) : "LinearScan inserts only moves to variables";
+
+                    Interval curInterval = intervalFor(move.getResult());
+
+                    if (!isRegister(curInterval.location()) && curInterval.alwaysInMemory()) {
+                        // move target is a stack slot that is always correct, so eliminate instruction
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
+                            TTY.println("eliminating move from interval %d to %d", operandNumber(move.getInput()), operandNumber(move.getResult()));
+                        }
+                        instructions.set(j, null); // null-instructions are deleted by assignRegNum
+                    }
+
+                } else {
+                    // insert move from register to stack just after the beginning of the interval
+                    assert interval == Interval.EndMarker || interval.spillDefinitionPos() >= opId : "invalid order";
+                    assert interval == Interval.EndMarker || (interval.isSplitParent() && interval.spillState() == SpillState.StoreAtDefinition) : "invalid interval";
+
+                    while (interval != Interval.EndMarker && interval.spillDefinitionPos() == opId) {
+                        if (!insertionBuffer.initialized()) {
+                            // prepare insertion buffer (appended when all instructions of the block are processed)
+                            insertionBuffer.init(block.lir);
+                        }
+
+                        CiValue fromLocation = interval.location();
+                        CiValue toLocation = canonicalSpillOpr(interval);
+
+                        assert isRegister(fromLocation) : "from operand must be a register but is: " + fromLocation + " toLocation=" + toLocation + " spillState=" + interval.spillState();
+                        assert isStackSlot(toLocation) : "to operand must be a stack slot";
+
+                        insertionBuffer.append(j + 1, ir.spillMoveFactory.createMove(toLocation, fromLocation));
+
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
+                            CiStackSlot slot = interval.spillSlot();
+                            TTY.println("inserting move after definition of interval %d to stack slot %s at opId %d",
+                                            interval.operandNumber, slot, opId);
+                        }
+
+                        interval = interval.next;
+                    }
+                }
+            } // end of instruction iteration
+
+            if (insertionBuffer.initialized()) {
+                insertionBuffer.finish();
+            }
+        } // end of block iteration
+
+        assert interval == Interval.EndMarker : "missed an interval";
+    }
+
+    private static void checkIntervals(Interval interval) {
+        Interval prev = null;
+        Interval temp = interval;
+        while (temp != Interval.EndMarker) {
+            assert temp.spillDefinitionPos() > 0 : "invalid spill definition pos";
+            if (prev != null) {
+                assert temp.from() >= prev.from() : "intervals not sorted";
+                assert temp.spillDefinitionPos() >= prev.spillDefinitionPos() : "when intervals are sorted by from :  then they must also be sorted by spillDefinitionPos";
+            }
+
+            assert temp.spillSlot() != null : "interval has no spill slot assigned";
+            assert temp.spillDefinitionPos() >= temp.from() : "invalid order";
+            assert temp.spillDefinitionPos() <= temp.from() + 2 : "only intervals defined once at their start-pos can be optimized";
+
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("interval %d (from %d to %d) must be stored at %d", temp.operandNumber, temp.from(), temp.to(), temp.spillDefinitionPos());
+            }
+
+            prev = temp;
+            temp = temp.next;
+        }
+    }
+
+    /**
+     * Numbers all instructions in all blocks. The numbering follows the {@linkplain ComputeLinearScanOrder linear scan order}.
+     */
+    void numberInstructions() {
+        ValueProcedure setVariableProc = new ValueProcedure() {
+            @Override
+            public CiValue doValue(CiValue value) {
+                if (isVariable(value)) {
+                    int variableIdx = asVariable(value).index;
+                    while (variables.size() <= variableIdx) {
+                        variables.add(null);
+                    }
+                    variables.set(variableIdx, asVariable(value));
+                }
+                return value;
+            }
+        };
+
+        // Assign IDs to LIR nodes and build a mapping, lirOps, from ID to LIRInstruction node.
+        int numBlocks = blockCount();
+        int numInstructions = 0;
+        for (int i = 0; i < numBlocks; i++) {
+            numInstructions += blockAt(i).lir.size();
+        }
+
+        // initialize with correct length
+        opIdToInstructionMap = new LIRInstruction[numInstructions];
+        opIdToBlockMap = new Block[numInstructions];
+
+        int opId = 0;
+        int index = 0;
+
+        for (int i = 0; i < numBlocks; i++) {
+            Block block = blockAt(i);
+            blockData.put(block, new BlockData());
+
+            List<LIRInstruction> instructions = block.lir;
+
+            int numInst = instructions.size();
+            for (int j = 0; j < numInst; j++) {
+                LIRInstruction op = instructions.get(j);
+                op.setId(opId);
+
+                opIdToInstructionMap[index] = op;
+                opIdToBlockMap[index] = block;
+                assert instructionForId(opId) == op : "must match";
+
+                op.forEachTemp(setVariableProc);
+                op.forEachOutput(setVariableProc);
+
+                index++;
+                opId += 2; // numbering of lirOps by two
+            }
+        }
+        assert index == numInstructions : "must match";
+        assert (index << 1) == opId : "must match: " + (index << 1);
+
+        if (GraalOptions.DetailedAsserts) {
+            for (int i = 0; i < variables.size(); i++) {
+                assert variables.get(i) != null && variables.get(i).index == i;
+            }
+            assert variables.size() == ir.numVariables();
+        }
+    }
+
+    /**
+     * Computes local live sets (i.e. {@link Block#liveGen} and {@link Block#liveKill}) separately for each block.
+     */
+    void computeLocalLiveSets() {
+        int numBlocks = blockCount();
+        int liveSize = liveSetSize();
+
+        intervalInLoop = new BitMap2D(operandSize(), numLoops());
+
+        // iterate all blocks
+        for (int i = 0; i < numBlocks; i++) {
+            final Block block = blockAt(i);
+            final BitMap liveGen = new BitMap(liveSize);
+            final BitMap liveKill = new BitMap(liveSize);
+
+            List<LIRInstruction> instructions = block.lir;
+            int numInst = instructions.size();
+
+            // iterate all instructions of the block. skip the first because it is always a label
+            assert !instructions.get(0).hasOperands() : "first operation must always be a label";
+            for (int j = 1; j < numInst; j++) {
+                final LIRInstruction op = instructions.get(j);
+
+                ValueProcedure useProc = new ValueProcedure() {
+                    @Override
+                    protected CiValue doValue(CiValue operand) {
+                        if (isVariable(operand)) {
+                            int operandNum = operandNumber(operand);
+                            if (!liveKill.get(operandNum)) {
+                                liveGen.set(operandNum);
+                                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                                    TTY.println("  Setting liveGen for operand %d at instruction %d", operandNum, op.id());
+                                }
+                            }
+                            if (block.getLoop() != null) {
+                                intervalInLoop.setBit(operandNum, block.getLoop().index);
+                            }
+                        }
+
+                        if (GraalOptions.DetailedAsserts) {
+                            verifyInput(block, liveKill, operand);
+                        }
+                        return operand;
+                    }
+                };
+                ValueProcedure stateProc = new ValueProcedure() {
+                    @Override
+                    public CiValue doValue(CiValue operand) {
+                        int operandNum = operandNumber(operand);
+                        if (!liveKill.get(operandNum)) {
+                            liveGen.set(operandNum);
+                            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                                TTY.println("  Setting liveGen for LIR opId %d, operand %d because of state for %s", op.id(), operandNum, op);
+                            }
+                        }
+                        return operand;
+                    }
+                };
+                ValueProcedure defProc = new ValueProcedure() {
+                    @Override
+                    public CiValue doValue(CiValue operand) {
+                        if (isVariable(operand)) {
+                            int varNum = operandNumber(operand);
+                            liveKill.set(varNum);
+                            if (block.getLoop() != null) {
+                                intervalInLoop.setBit(varNum, block.getLoop().index);
+                            }
+                        }
+
+                        if (GraalOptions.DetailedAsserts) {
+                            // fixed intervals are never live at block boundaries, so
+                            // they need not be processed in live sets
+                            // process them only in debug mode so that this can be checked
+                            verifyTemp(liveKill, operand);
+                        }
+                        return operand;
+                    }
+                };
+
+                op.forEachInput(useProc);
+                op.forEachAlive(useProc);
+                // Add uses of live locals from interpreter's point of view for proper debug information generation
+                op.forEachState(stateProc);
+                op.forEachTemp(defProc);
+                op.forEachOutput(defProc);
+            } // end of instruction iteration
+
+            blockData.get(block).liveGen = liveGen;
+            blockData.get(block).liveKill = liveKill;
+            blockData.get(block).liveIn = new BitMap(liveSize);
+            blockData.get(block).liveOut = new BitMap(liveSize);
+
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("liveGen  B%d %s", block.getId(), blockData.get(block).liveGen);
+                TTY.println("liveKill B%d %s", block.getId(), blockData.get(block).liveKill);
+            }
+        } // end of block iteration
+    }
+
+    private void verifyTemp(BitMap liveKill, CiValue operand) {
+        // fixed intervals are never live at block boundaries, so
+        // they need not be processed in live sets
+        // process them only in debug mode so that this can be checked
+        if (isRegister(operand)) {
+            if (isProcessed(operand)) {
+                liveKill.set(operandNumber(operand));
+            }
+        }
+    }
+
+    private void verifyInput(Block block, BitMap liveKill, CiValue operand) {
+        // fixed intervals are never live at block boundaries, so
+        // they need not be processed in live sets.
+        // this is checked by these assertions to be sure about it.
+        // the entry block may have incoming
+        // values in registers, which is ok.
+        if (isRegister(operand) && block != ir.cfg.getStartBlock()) {
+            if (isProcessed(operand)) {
+                assert liveKill.get(operandNumber(operand)) : "using fixed register that is not defined in this block";
+            }
+        }
+    }
+
+    /**
+     * Performs a backward dataflow analysis to compute global live sets (i.e. {@link Block#liveIn} and
+     * {@link Block#liveOut}) for each block.
+     */
+    void computeGlobalLiveSets() {
+        int numBlocks = blockCount();
+        boolean changeOccurred;
+        boolean changeOccurredInBlock;
+        int iterationCount = 0;
+        BitMap liveOut = new BitMap(liveSetSize()); // scratch set for calculations
+
+        // Perform a backward dataflow analysis to compute liveOut and liveIn for each block.
+        // The loop is executed until a fixpoint is reached (no changes in an iteration)
+        do {
+            changeOccurred = false;
+
+            // iterate all blocks in reverse order
+            for (int i = numBlocks - 1; i >= 0; i--) {
+                Block block = blockAt(i);
+
+                changeOccurredInBlock = false;
+
+                // liveOut(block) is the union of liveIn(sux), for successors sux of block
+                int n = block.numberOfSux();
+                if (n > 0) {
+                    // block has successors
+                    if (n > 0) {
+                        liveOut.setFrom(blockData.get(block.suxAt(0)).liveIn);
+                        for (int j = 1; j < n; j++) {
+                            liveOut.setUnion(blockData.get(block.suxAt(j)).liveIn);
+                        }
+                    } else {
+                        liveOut.clearAll();
+                    }
+
+                    if (!blockData.get(block).liveOut.isSame(liveOut)) {
+                        // A change occurred. Swap the old and new live out sets to avoid copying.
+                        BitMap temp = blockData.get(block).liveOut;
+                        blockData.get(block).liveOut = liveOut;
+                        liveOut = temp;
+
+                        changeOccurred = true;
+                        changeOccurredInBlock = true;
+                    }
+                }
+
+                if (iterationCount == 0 || changeOccurredInBlock) {
+                    // liveIn(block) is the union of liveGen(block) with (liveOut(block) & !liveKill(block))
+                    // note: liveIn has to be computed only in first iteration or if liveOut has changed!
+                    BitMap liveIn = blockData.get(block).liveIn;
+                    liveIn.setFrom(blockData.get(block).liveOut);
+                    liveIn.setDifference(blockData.get(block).liveKill);
+                    liveIn.setUnion(blockData.get(block).liveGen);
+                }
+
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    traceLiveness(changeOccurredInBlock, iterationCount, block);
+                }
+            }
+            iterationCount++;
+
+            if (changeOccurred && iterationCount > 50) {
+                throw new CiBailout("too many iterations in computeGlobalLiveSets");
+            }
+        } while (changeOccurred);
+
+        if (GraalOptions.DetailedAsserts) {
+            verifyLiveness(numBlocks);
+        }
+
+        // check that the liveIn set of the first block is empty
+        Block startBlock = ir.cfg.getStartBlock();
+        BitMap liveInArgs = new BitMap(blockData.get(startBlock).liveIn.size());
+        if (!blockData.get(startBlock).liveIn.isSame(liveInArgs)) {
+            if (GraalOptions.DetailedAsserts) {
+                reportFailure(numBlocks);
+            }
+
+            TTY.println("preds=" + startBlock.getPredecessors().size() + ", succs=" + startBlock.getSuccessors().size());
+            TTY.println("startBlock-ID: " + startBlock.getId());
+
+            // bailout of if this occurs in product mode.
+            throw new CiBailout("liveIn set of first block must be empty");
+        }
+    }
+
+    private void reportFailure(int numBlocks) {
+        TTY.println(method.toString());
+        TTY.println("Error: liveIn set of first block must be empty (when this fails, variables are used before they are defined)");
+        TTY.print("affected registers:");
+        TTY.println(blockData.get(ir.cfg.getStartBlock()).liveIn.toString());
+
+        // print some additional information to simplify debugging
+        for (int operandNum = 0; operandNum < blockData.get(ir.cfg.getStartBlock()).liveIn.size(); operandNum++) {
+            if (blockData.get(ir.cfg.getStartBlock()).liveIn.get(operandNum)) {
+                CiValue operand = operandFor(operandNum);
+                TTY.println(" var %d; operand=%s", operandNum, operand.toString());
+
+                for (int j = 0; j < numBlocks; j++) {
+                    Block block = blockAt(j);
+                    if (blockData.get(block).liveGen.get(operandNum)) {
+                        TTY.println("  used in block B%d", block.getId());
+                        for (LIRInstruction ins : block.lir) {
+                            TTY.println(ins.id() + ": " + ins.toString());
+                            LIRDebugInfo info = ins.info;
+                            if (info != null) {
+                                info.forEachState(new ValueProcedure() {
+                                    @Override
+                                    public CiValue doValue(CiValue liveStateOperand) {
+                                        TTY.println("   operand=" + liveStateOperand);
+                                        return liveStateOperand;
+                                    }
+                                });
+                            }
+                        }
+                    }
+                    if (blockData.get(block).liveKill.get(operandNum)) {
+                        TTY.println("  defined in block B%d", block.getId());
+                        for (LIRInstruction ins : block.lir) {
+                            TTY.println(ins.id() + ": " + ins.toString());
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private void verifyLiveness(int numBlocks) {
+        // check that fixed intervals are not live at block boundaries
+        // (live set must be empty at fixed intervals)
+        for (int i = 0; i < numBlocks; i++) {
+            Block block = blockAt(i);
+            for (int j = 0; j <= maxRegisterNumber(); j++) {
+                assert !blockData.get(block).liveIn.get(j) : "liveIn  set of fixed register must be empty";
+                assert !blockData.get(block).liveOut.get(j) : "liveOut set of fixed register must be empty";
+                assert !blockData.get(block).liveGen.get(j) : "liveGen set of fixed register must be empty";
+            }
+        }
+    }
+
+    private void traceLiveness(boolean changeOccurredInBlock, int iterationCount, Block block) {
+        char c = iterationCount == 0 || changeOccurredInBlock ? '*' : ' ';
+        TTY.print("(%d) liveIn%c  B%d ", iterationCount, c, block.getId());
+        TTY.println(blockData.get(block).liveIn.toString());
+        TTY.print("(%d) liveOut%c B%d ", iterationCount, c, block.getId());
+        TTY.println(blockData.get(block).liveOut.toString());
+    }
+
+    void addUse(CiValue operand, int from, int to, RegisterPriority registerPriority, CiKind kind) {
+        if (!isProcessed(operand)) {
+            return;
+        }
+        if (GraalOptions.TraceLinearScanLevel >= 2 && kind == null) {
+            TTY.println(" use %s from %d to %d (%s)", operand, from, to, registerPriority.name());
+        }
+
+        Interval interval = intervalFor(operand);
+        if (interval == null) {
+            interval = createInterval(operand);
+        }
+
+        if (kind != CiKind.Illegal) {
+            interval.setKind(kind);
+        }
+
+        interval.addRange(from, to);
+
+        // Register use position at even instruction id.
+        interval.addUsePos(to & ~1, registerPriority);
+    }
+
+    void addTemp(CiValue operand, int tempPos, RegisterPriority registerPriority, CiKind kind) {
+        if (!isProcessed(operand)) {
+            return;
+        }
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println(" temp %s tempPos %d (%s)", operand, tempPos, RegisterPriority.MustHaveRegister.name());
+        }
+        Interval interval = intervalFor(operand);
+        if (interval == null) {
+            interval = createInterval(operand);
+        }
+
+        if (kind != CiKind.Illegal) {
+            interval.setKind(kind);
+        }
+
+        interval.addRange(tempPos, tempPos + 1);
+        interval.addUsePos(tempPos, registerPriority);
+    }
+
+    boolean isProcessed(CiValue operand) {
+        return !isRegister(operand) || attributes(asRegister(operand)).isAllocatable;
+    }
+
+    void addDef(CiValue operand, int defPos, RegisterPriority registerPriority, CiKind kind) {
+        if (!isProcessed(operand)) {
+            return;
+        }
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println(" def %s defPos %d (%s)", operand, defPos, registerPriority.name());
+        }
+        Interval interval = intervalFor(operand);
+        if (interval != null) {
+
+            if (kind != CiKind.Illegal) {
+                interval.setKind(kind);
+            }
+
+            Range r = interval.first();
+            if (r.from <= defPos) {
+                // Update the starting point (when a range is first created for a use, its
+                // start is the beginning of the current block until a def is encountered.)
+                r.from = defPos;
+                interval.addUsePos(defPos, registerPriority);
+
+            } else {
+                // Dead value - make vacuous interval
+                // also add register priority for dead intervals
+                interval.addRange(defPos, defPos + 1);
+                interval.addUsePos(defPos, registerPriority);
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
+                    TTY.println("Warning: def of operand %s at %d occurs without use", operand, defPos);
+                }
+            }
+
+        } else {
+            // Dead value - make vacuous interval
+            // also add register priority for dead intervals
+            interval = createInterval(operand);
+            if (kind != CiKind.Illegal) {
+                interval.setKind(kind);
+            }
+
+            interval.addRange(defPos, defPos + 1);
+            interval.addUsePos(defPos, registerPriority);
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
+                TTY.println("Warning: dead value %s at %d in live intervals", operand, defPos);
+            }
+        }
+
+        changeSpillDefinitionPos(interval, defPos);
+        if (registerPriority == RegisterPriority.None && interval.spillState().ordinal() <= SpillState.StartInMemory.ordinal()) {
+            // detection of method-parameters and roundfp-results
+            // TODO: move this directly to position where use-kind is computed
+            interval.setSpillState(SpillState.StartInMemory);
+        }
+    }
+
+    /**
+     * Determines the register priority for an instruction's output/result operand.
+     */
+    static RegisterPriority registerPriorityOfOutputOperand(LIRInstruction op) {
+        if (op instanceof MoveOp) {
+            MoveOp move = (MoveOp) op;
+            if (isStackSlot(move.getInput()) && move.getInput().kind != CiKind.Object) {
+                // method argument (condition must be equal to handleMethodArguments)
+                return RegisterPriority.None;
+            }
+        }
+
+        // all other operands require a register
+        return RegisterPriority.MustHaveRegister;
+    }
+
+    /**
+     * Determines the priority which with an instruction's input operand will be allocated a register.
+     */
+    static RegisterPriority registerPriorityOfInputOperand(EnumSet<OperandFlag> flags) {
+        if (flags.contains(OperandFlag.Stack)) {
+            return RegisterPriority.ShouldHaveRegister;
+        }
+        // all other operands require a register
+        return RegisterPriority.MustHaveRegister;
+    }
+
+    /**
+     * Optimizes moves related to incoming stack based arguments.
+     * The interval for the destination of such moves is assigned
+     * the stack slot (which is in the caller's frame) as its
+     * spill slot.
+     */
+    void handleMethodArguments(LIRInstruction op) {
+        if (op instanceof MoveOp) {
+            MoveOp move = (MoveOp) op;
+            if (isStackSlot(move.getInput()) && move.getInput().kind != CiKind.Object) {
+                CiStackSlot slot = (CiStackSlot) move.getInput();
+                if (GraalOptions.DetailedAsserts) {
+                    assert op.id() > 0 : "invalid id";
+                    assert blockForId(op.id()).numberOfPreds() == 0 : "move from stack must be in first block";
+                    assert isVariable(move.getResult()) : "result of move must be a variable";
+
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
+                        TTY.println("found move from stack slot %s to %s", slot, move.getResult());
+                    }
+                }
+
+                Interval interval = intervalFor(move.getResult());
+                interval.setSpillSlot(slot);
+                interval.assignLocation(slot);
+            }
+        }
+    }
+
+    void addRegisterHint(final LIRInstruction op, final CiValue targetValue, OperandMode mode, EnumSet<OperandFlag> flags) {
+        if (flags.contains(OperandFlag.RegisterHint) && isVariableOrRegister(targetValue)) {
+
+            op.forEachRegisterHint(targetValue, mode, new ValueProcedure() {
+                @Override
+                protected CiValue doValue(CiValue registerHint) {
+                    if (isVariableOrRegister(registerHint)) {
+                        Interval from = intervalFor(registerHint);
+                        Interval to = intervalFor(targetValue);
+                        if (from != null && to != null) {
+                            to.setLocationHint(from);
+                            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                                TTY.println("operation at opId %d: added hint from interval %d to %d", op.id(), from.operandNumber, to.operandNumber);
+                            }
+                            return registerHint;
+                        }
+                    }
+                    return null;
+                }
+            });
+        }
+    }
+
+    void buildIntervals() {
+        intervalsSize = operandSize();
+        intervals = new Interval[intervalsSize + INITIAL_SPLIT_INTERVALS_CAPACITY];
+
+        // create a list with all caller-save registers (cpu, fpu, xmm)
+        CiRegister[] callerSaveRegs = frameMap.registerConfig.getCallerSaveRegisters();
+
+        // iterate all blocks in reverse order
+        for (int i = blockCount() - 1; i >= 0; i--) {
+            Block block = blockAt(i);
+            List<LIRInstruction> instructions = block.lir;
+            final int blockFrom = block.getFirstLirInstructionId();
+            int blockTo = block.getLastLirInstructionId();
+
+            assert blockFrom == instructions.get(0).id();
+            assert blockTo == instructions.get(instructions.size() - 1).id();
+
+            // Update intervals for operands live at the end of this block;
+            BitMap live = blockData.get(block).liveOut;
+            for (int operandNum = live.nextSetBit(0); operandNum >= 0; operandNum = live.nextSetBit(operandNum + 1)) {
+                assert live.get(operandNum) : "should not stop here otherwise";
+                CiValue operand = operandFor(operandNum);
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
+                    TTY.println("live in %s to %d", operand, blockTo + 2);
+                }
+
+                addUse(operand, blockFrom, blockTo + 2, RegisterPriority.None, CiKind.Illegal);
+
+                // add special use positions for loop-end blocks when the
+                // interval is used anywhere inside this loop. It's possible
+                // that the block was part of a non-natural loop, so it might
+                // have an invalid loop index.
+                if (block.isLoopEnd() && block.getLoop() != null && isIntervalInLoop(operandNum, block.getLoop().index)) {
+                    intervalFor(operand).addUsePos(blockTo + 1, RegisterPriority.LiveAtLoopEnd);
+                }
+            }
+
+            // iterate all instructions of the block in reverse order.
+            // skip the first instruction because it is always a label
+            // definitions of intervals are processed before uses
+            assert !instructions.get(0).hasOperands() : "first operation must always be a label";
+            for (int j = instructions.size() - 1; j >= 1; j--) {
+                final LIRInstruction op = instructions.get(j);
+                final int opId = op.id();
+
+                // add a temp range for each register if operation destroys caller-save registers
+                if (op.hasCall()) {
+                    for (CiRegister r : callerSaveRegs) {
+                        if (attributes(r).isAllocatable) {
+                            addTemp(r.asValue(), opId, RegisterPriority.None, CiKind.Illegal);
+                        }
+                    }
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
+                        TTY.println("operation destroys all caller-save registers");
+                    }
+                }
+
+                op.forEachOutput(new ValueProcedure() {
+                    @Override
+                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+                        if (isVariableOrRegister(operand)) {
+                            addDef(operand, opId, registerPriorityOfOutputOperand(op), operand.kind.stackKind());
+                            addRegisterHint(op, operand, mode, flags);
+                        }
+                        return operand;
+                    }
+                });
+                op.forEachTemp(new ValueProcedure() {
+                    @Override
+                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+                        if (isVariableOrRegister(operand)) {
+                            addTemp(operand, opId, RegisterPriority.MustHaveRegister, operand.kind.stackKind());
+                            addRegisterHint(op, operand, mode, flags);
+                        }
+                        return operand;
+                    }
+                });
+                op.forEachAlive(new ValueProcedure() {
+                    @Override
+                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+                        if (isVariableOrRegister(operand)) {
+                            RegisterPriority p = registerPriorityOfInputOperand(flags);
+                            addUse(operand, blockFrom, opId + 1, p, operand.kind.stackKind());
+                            addRegisterHint(op, operand, mode, flags);
+                        }
+                        return operand;
+                    }
+                });
+                op.forEachInput(new ValueProcedure() {
+                    @Override
+                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+                        if (isVariableOrRegister(operand)) {
+                            RegisterPriority p = registerPriorityOfInputOperand(flags);
+                            addUse(operand, blockFrom, opId, p, operand.kind.stackKind());
+                            addRegisterHint(op, operand, mode, flags);
+                        }
+                        return operand;
+                    }
+                });
+
+                // Add uses of live locals from interpreter's point of view for proper
+                // debug information generation
+                // Treat these operands as temp values (if the live range is extended
+                // to a call site, the value would be in a register at the call otherwise)
+                op.forEachState(new ValueProcedure() {
+                    @Override
+                    public CiValue doValue(CiValue operand) {
+                        addUse(operand, blockFrom, opId + 1, RegisterPriority.None, operand.kind.stackKind());
+                        return operand;
+                    }
+                });
+
+                // special steps for some instructions (especially moves)
+                handleMethodArguments(op);
+
+            } // end of instruction iteration
+        } // end of block iteration
+
+        // add the range [0, 1] to all fixed intervals.
+        // the register allocator need not handle unhandled fixed intervals
+        for (Interval interval : intervals) {
+            if (interval != null && isRegister(interval.operand)) {
+                interval.addRange(0, 1);
+            }
+        }
+    }
+
+    // * Phase 5: actual register allocation
+
+    private static boolean isSorted(Interval[] intervals) {
+        int from = -1;
+        for (Interval interval : intervals) {
+            assert interval != null;
+            assert from <= interval.from();
+            from = interval.from();
+        }
+        return true;
+    }
+
+    static Interval addToList(Interval first, Interval prev, Interval interval) {
+        Interval newFirst = first;
+        if (prev != null) {
+            prev.next = interval;
+        } else {
+            newFirst = interval;
+        }
+        return newFirst;
+    }
+
+    Interval.Pair createUnhandledLists(IntervalPredicate isList1, IntervalPredicate isList2) {
+        assert isSorted(sortedIntervals) : "interval list is not sorted";
+
+        Interval list1 = Interval.EndMarker;
+        Interval list2 = Interval.EndMarker;
+
+        Interval list1Prev = null;
+        Interval list2Prev = null;
+        Interval v;
+
+        int n = sortedIntervals.length;
+        for (int i = 0; i < n; i++) {
+            v = sortedIntervals[i];
+            if (v == null) {
+                continue;
+            }
+
+            if (isList1.apply(v)) {
+                list1 = addToList(list1, list1Prev, v);
+                list1Prev = v;
+            } else if (isList2 == null || isList2.apply(v)) {
+                list2 = addToList(list2, list2Prev, v);
+                list2Prev = v;
+            }
+        }
+
+        if (list1Prev != null) {
+            list1Prev.next = Interval.EndMarker;
+        }
+        if (list2Prev != null) {
+            list2Prev.next = Interval.EndMarker;
+        }
+
+        assert list1Prev == null || list1Prev.next == Interval.EndMarker : "linear list ends not with sentinel";
+        assert list2Prev == null || list2Prev.next == Interval.EndMarker : "linear list ends not with sentinel";
+
+        return new Interval.Pair(list1, list2);
+    }
+
+    void sortIntervalsBeforeAllocation() {
+        int sortedLen = 0;
+        for (Interval interval : intervals) {
+            if (interval != null) {
+                sortedLen++;
+            }
+        }
+
+        Interval[] sortedList = new Interval[sortedLen];
+        int sortedIdx = 0;
+        int sortedFromMax = -1;
+
+        // special sorting algorithm: the original interval-list is almost sorted,
+        // only some intervals are swapped. So this is much faster than a complete QuickSort
+        for (Interval interval : intervals) {
+            if (interval != null) {
+                int from = interval.from();
+
+                if (sortedFromMax <= from) {
+                    sortedList[sortedIdx++] = interval;
+                    sortedFromMax = interval.from();
+                } else {
+                    // the assumption that the intervals are already sorted failed,
+                    // so this interval must be sorted in manually
+                    int j;
+                    for (j = sortedIdx - 1; j >= 0 && from < sortedList[j].from(); j--) {
+                        sortedList[j + 1] = sortedList[j];
+                    }
+                    sortedList[j + 1] = interval;
+                    sortedIdx++;
+                }
+            }
+        }
+        sortedIntervals = sortedList;
+    }
+
+    void sortIntervalsAfterAllocation() {
+        if (firstDerivedIntervalIndex == -1) {
+            // no intervals have been added during allocation, so sorted list is already up to date
+            return;
+        }
+
+        Interval[] oldList = sortedIntervals;
+        Interval[] newList = Arrays.copyOfRange(intervals, firstDerivedIntervalIndex, intervalsSize);
+        int oldLen = oldList.length;
+        int newLen = newList.length;
+
+        // conventional sort-algorithm for new intervals
+        Arrays.sort(newList, INTERVAL_COMPARATOR);
+
+        // merge old and new list (both already sorted) into one combined list
+        Interval[] combinedList = new Interval[oldLen + newLen];
+        int oldIdx = 0;
+        int newIdx = 0;
+
+        while (oldIdx + newIdx < combinedList.length) {
+            if (newIdx >= newLen || (oldIdx < oldLen && oldList[oldIdx].from() <= newList[newIdx].from())) {
+                combinedList[oldIdx + newIdx] = oldList[oldIdx];
+                oldIdx++;
+            } else {
+                combinedList[oldIdx + newIdx] = newList[newIdx];
+                newIdx++;
+            }
+        }
+
+        sortedIntervals = combinedList;
+    }
+
+    private static final Comparator<Interval> INTERVAL_COMPARATOR = new Comparator<Interval>() {
+
+        public int compare(Interval a, Interval b) {
+            if (a != null) {
+                if (b != null) {
+                    return a.from() - b.from();
+                } else {
+                    return -1;
+                }
+            } else {
+                if (b != null) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+        }
+    };
+
+    public void allocateRegisters() {
+        Interval precoloredIntervals;
+        Interval notPrecoloredIntervals;
+
+        Interval.Pair result = createUnhandledLists(IS_PRECOLORED_INTERVAL, IS_VARIABLE_INTERVAL);
+        precoloredIntervals = result.first;
+        notPrecoloredIntervals = result.second;
+
+        // allocate cpu registers
+        LinearScanWalker lsw = new LinearScanWalker(this, precoloredIntervals, notPrecoloredIntervals, !target.arch.isX86());
+        lsw.walk();
+        lsw.finishAllocation();
+    }
+
+    // * Phase 6: resolve data flow
+    // (insert moves at edges between blocks if intervals have been split)
+
+    // wrapper for Interval.splitChildAtOpId that performs a bailout in product mode
+    // instead of returning null
+    Interval splitChildAtOpId(Interval interval, int opId, LIRInstruction.OperandMode mode) {
+        Interval result = interval.getSplitChildAtOpId(opId, mode, this);
+
+        if (result != null) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("Split child at pos " + opId + " of interval " + interval.toString() + " is " + result.toString());
+            }
+            return result;
+        }
+
+        throw new CiBailout("LinearScan: interval is null");
+    }
+
+    Interval intervalAtBlockBegin(Block block, CiValue operand) {
+        assert isVariable(operand) : "register number out of bounds";
+        assert intervalFor(operand) != null : "no interval found";
+
+        return splitChildAtOpId(intervalFor(operand), block.getFirstLirInstructionId(), LIRInstruction.OperandMode.Output);
+    }
+
+    Interval intervalAtBlockEnd(Block block, CiValue operand) {
+        assert isVariable(operand) : "register number out of bounds";
+        assert intervalFor(operand) != null : "no interval found";
+
+        return splitChildAtOpId(intervalFor(operand), block.getLastLirInstructionId() + 1, LIRInstruction.OperandMode.Output);
+    }
+
+    Interval intervalAtOpId(CiValue operand, int opId) {
+        assert isVariable(operand) : "register number out of bounds";
+        assert intervalFor(operand) != null : "no interval found";
+
+        return splitChildAtOpId(intervalFor(operand), opId, LIRInstruction.OperandMode.Input);
+    }
+
+    void resolveCollectMappings(Block fromBlock, Block toBlock, MoveResolver moveResolver) {
+        assert moveResolver.checkEmpty();
+
+        int numOperands = operandSize();
+        BitMap liveAtEdge = blockData.get(toBlock).liveIn;
+
+        // visit all variables for which the liveAtEdge bit is set
+        for (int operandNum = liveAtEdge.nextSetBit(0); operandNum >= 0; operandNum = liveAtEdge.nextSetBit(operandNum + 1)) {
+            assert operandNum < numOperands : "live information set for not exisiting interval";
+            assert blockData.get(fromBlock).liveOut.get(operandNum) && blockData.get(toBlock).liveIn.get(operandNum) : "interval not live at this edge";
+
+            CiValue liveOperand = operandFor(operandNum);
+            Interval fromInterval = intervalAtBlockEnd(fromBlock, liveOperand);
+            Interval toInterval = intervalAtBlockBegin(toBlock, liveOperand);
+
+            if (fromInterval != toInterval && (fromInterval.location() != toInterval.location())) {
+                // need to insert move instruction
+                moveResolver.addMapping(fromInterval, toInterval);
+            }
+        }
+    }
+
+    static void resolveFindInsertPos(Block fromBlock, Block toBlock, MoveResolver moveResolver) {
+        if (fromBlock.numberOfSux() <= 1) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("inserting moves at end of fromBlock B%d", fromBlock.getId());
+            }
+
+            List<LIRInstruction> instructions = fromBlock.lir;
+            LIRInstruction instr = instructions.get(instructions.size() - 1);
+            if (instr instanceof StandardOp.JumpOp) {
+                // insert moves before branch
+                moveResolver.setInsertPosition(fromBlock.lir, instructions.size() - 1);
+            } else {
+                moveResolver.setInsertPosition(fromBlock.lir, instructions.size());
+            }
+
+        } else {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("inserting moves at beginning of toBlock B%d", toBlock.getId());
+            }
+
+            if (GraalOptions.DetailedAsserts) {
+                assert fromBlock.lir.get(0) instanceof StandardOp.LabelOp : "block does not start with a label";
+
+                // because the number of predecessor edges matches the number of
+                // successor edges, blocks which are reached by switch statements
+                // may have be more than one predecessor but it will be guaranteed
+                // that all predecessors will be the same.
+                for (int i = 0; i < toBlock.numberOfPreds(); i++) {
+                    assert fromBlock == toBlock.predAt(i) : "all critical edges must be broken";
+                }
+            }
+
+            moveResolver.setInsertPosition(toBlock.lir, 1);
+        }
+    }
+
+    /**
+     * Inserts necessary moves (spilling or reloading) at edges between blocks for intervals that
+     * have been split.
+     */
+    void resolveDataFlow() {
+        int numBlocks = blockCount();
+        MoveResolver moveResolver = new MoveResolver(this);
+        BitMap blockCompleted = new BitMap(numBlocks);
+        BitMap alreadyResolved = new BitMap(numBlocks);
+
+        int i;
+        for (i = 0; i < numBlocks; i++) {
+            Block block = blockAt(i);
+
+            // check if block has only one predecessor and only one successor
+            if (block.numberOfPreds() == 1 && block.numberOfSux() == 1) {
+                List<LIRInstruction> instructions = block.lir;
+                assert instructions.get(0) instanceof StandardOp.LabelOp : "block must start with label";
+                assert instructions.get(instructions.size() - 1) instanceof StandardOp.JumpOp : "block with successor must end with unconditional jump";
+
+                // check if block is empty (only label and branch)
+                if (instructions.size() == 2) {
+                    Block pred = block.predAt(0);
+                    Block sux = block.suxAt(0);
+
+                    // prevent optimization of two consecutive blocks
+                    if (!blockCompleted.get(pred.linearScanNumber) && !blockCompleted.get(sux.linearScanNumber)) {
+                        if (GraalOptions.TraceLinearScanLevel >= 3) {
+                            TTY.println(" optimizing empty block B%d (pred: B%d, sux: B%d)", block.getId(), pred.getId(), sux.getId());
+                        }
+                        blockCompleted.set(block.linearScanNumber);
+
+                        // directly resolve between pred and sux (without looking at the empty block between)
+                        resolveCollectMappings(pred, sux, moveResolver);
+                        if (moveResolver.hasMappings()) {
+                            moveResolver.setInsertPosition(block.lir, 1);
+                            moveResolver.resolveAndAppendMoves();
+                        }
+                    }
+                }
+            }
+        }
+
+        for (i = 0; i < numBlocks; i++) {
+            if (!blockCompleted.get(i)) {
+                Block fromBlock = blockAt(i);
+                alreadyResolved.setFrom(blockCompleted);
+
+                int numSux = fromBlock.numberOfSux();
+                for (int s = 0; s < numSux; s++) {
+                    Block toBlock = fromBlock.suxAt(s);
+
+                    // check for duplicate edges between the same blocks (can happen with switch blocks)
+                    if (!alreadyResolved.get(toBlock.linearScanNumber)) {
+                        if (GraalOptions.TraceLinearScanLevel >= 3) {
+                            TTY.println(" processing edge between B%d and B%d", fromBlock.getId(), toBlock.getId());
+                        }
+                        alreadyResolved.set(toBlock.linearScanNumber);
+
+                        // collect all intervals that have been split between fromBlock and toBlock
+                        resolveCollectMappings(fromBlock, toBlock, moveResolver);
+                        if (moveResolver.hasMappings()) {
+                            resolveFindInsertPos(fromBlock, toBlock, moveResolver);
+                            moveResolver.resolveAndAppendMoves();
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    // * Phase 7: assign register numbers back to LIR
+    // (includes computation of debug information and oop maps)
+
+    boolean verifyAssignedLocation(Interval interval, CiValue location) {
+        CiKind kind = interval.kind();
+
+        assert isRegister(location) || isStackSlot(location);
+
+        if (isRegister(location)) {
+            CiRegister reg = asRegister(location);
+
+            // register
+            switch (kind) {
+                case Byte:
+                case Char:
+                case Short:
+                case Jsr:
+                case Object:
+                case Int: {
+                    assert reg.isCpu() : "not cpu register";
+                    break;
+                }
+
+                case Long: {
+                    assert reg.isCpu() : "not cpu register";
+                    break;
+                }
+
+                case Float: {
+                    assert !target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
+                    break;
+                }
+
+                case Double: {
+                    assert !target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
+                    break;
+                }
+
+                default: {
+                    throw GraalInternalError.shouldNotReachHere();
+                }
+            }
+        }
+        return true;
+    }
+
+    static CiStackSlot canonicalSpillOpr(Interval interval) {
+        assert interval.spillSlot() != null : "canonical spill slot not set";
+        return interval.spillSlot();
+    }
+
+    /**
+     * Assigns the allocated location for an LIR instruction operand back into the instruction.
+     *
+     * @param operand an LIR instruction operand
+     * @param opId the id of the LIR instruction using {@code operand}
+     * @param mode the usage mode for {@code operand} by the instruction
+     * @return the location assigned for the operand
+     */
+    private CiValue colorLirOperand(Variable operand, int opId, OperandMode mode) {
+        Interval interval = intervalFor(operand);
+        assert interval != null : "interval must exist";
+
+        if (opId != -1) {
+            if (GraalOptions.DetailedAsserts) {
+                Block block = blockForId(opId);
+                if (block.numberOfSux() <= 1 && opId == block.getLastLirInstructionId()) {
+                    // check if spill moves could have been appended at the end of this block, but
+                    // before the branch instruction. So the split child information for this branch would
+                    // be incorrect.
+                    LIRInstruction instr = block.lir.get(block.lir.size() - 1);
+                    if (instr instanceof StandardOp.JumpOp) {
+                        if (blockData.get(block).liveOut.get(operandNumber(operand))) {
+                            assert false : "can't get split child for the last branch of a block because the information would be incorrect (moves are inserted before the branch in resolveDataFlow)";
+                        }
+                    }
+                }
+            }
+
+            // operands are not changed when an interval is split during allocation,
+            // so search the right interval here
+            interval = splitChildAtOpId(interval, opId, mode);
+        }
+
+        return interval.location();
+    }
+
+    IntervalWalker initComputeOopMaps() {
+        // setup lists of potential oops for walking
+        Interval oopIntervals;
+        Interval nonOopIntervals;
+
+        oopIntervals = createUnhandledLists(IS_OOP_INTERVAL, null).first;
+
+        // intervals that have no oops inside need not to be processed.
+        // to ensure a walking until the last instruction id, add a dummy interval
+        // with a high operation id
+        nonOopIntervals = new Interval(CiValue.IllegalValue, -1);
+        nonOopIntervals.addRange(Integer.MAX_VALUE - 2, Integer.MAX_VALUE - 1);
+
+        return new IntervalWalker(this, oopIntervals, nonOopIntervals);
+    }
+
+    void computeOopMap(IntervalWalker iw, LIRInstruction op, CiBitMap registerRefMap, CiBitMap frameRefMap) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
+            TTY.println("creating oop map at opId %d", op.id());
+        }
+
+        // walk before the current operation . intervals that start at
+        // the operation (i.e. output operands of the operation) are not
+        // included in the oop map
+        iw.walkBefore(op.id());
+
+        // Iterate through active intervals
+        for (Interval interval = iw.activeLists.get(RegisterBinding.Fixed); interval != Interval.EndMarker; interval = interval.next) {
+            CiValue operand = interval.operand;
+
+            assert interval.currentFrom() <= op.id() && op.id() <= interval.currentTo() : "interval should not be active otherwise";
+            assert isVariable(interval.operand) : "fixed interval found";
+
+            // Check if this range covers the instruction. Intervals that
+            // start or end at the current operation are not included in the
+            // oop map, except in the case of patching moves. For patching
+            // moves, any intervals which end at this instruction are included
+            // in the oop map since we may safepoint while doing the patch
+            // before we've consumed the inputs.
+            if (op.id() < interval.currentTo()) {
+                // caller-save registers must not be included into oop-maps at calls
+                assert !op.hasCall() || !isRegister(operand) || !isCallerSave(operand) : "interval is in a caller-save register at a call . register will be overwritten";
+
+                frameMap.setReference(interval.location(), registerRefMap, frameRefMap);
+
+                // Spill optimization: when the stack value is guaranteed to be always correct,
+                // then it must be added to the oop map even if the interval is currently in a register
+                if (interval.alwaysInMemory() && op.id() > interval.spillDefinitionPos() && !interval.location().equals(interval.spillSlot())) {
+                    assert interval.spillDefinitionPos() > 0 : "position not set correctly";
+                    assert interval.spillSlot() != null : "no spill slot assigned";
+                    assert !isRegister(interval.operand) : "interval is on stack :  so stack slot is registered twice";
+                    frameMap.setReference(interval.spillSlot(), registerRefMap, frameRefMap);
+                }
+            }
+        }
+    }
+
+    private boolean isCallerSave(CiValue operand) {
+        return attributes(asRegister(operand)).isCallerSave;
+    }
+
+
+    private void computeDebugInfo(IntervalWalker iw, LIRInstruction op) {
+        assert iw != null : "interval walker needed for debug information";
+        computeDebugInfo(iw, op, op.info);
+
+        if (op instanceof LIRXirInstruction) {
+            LIRXirInstruction xir = (LIRXirInstruction) op;
+            if (xir.infoAfter != null) {
+                computeDebugInfo(iw, op, xir.infoAfter);
+            }
+        }
+    }
+
+
+    private void computeDebugInfo(IntervalWalker iw, final LIRInstruction op, LIRDebugInfo info) {
+        CiBitMap registerRefMap = op.hasCall() ? null : frameMap.initRegisterRefMap();
+        CiBitMap frameRefMap = frameMap.initFrameRefMap();
+        computeOopMap(iw, op, registerRefMap, frameRefMap);
+
+        info.forEachState(new ValueProcedure() {
+            @Override
+            public CiValue doValue(CiValue operand) {
+                int tempOpId = op.id();
+                OperandMode mode = OperandMode.Input;
+                Block block = blockForId(tempOpId);
+                if (block.numberOfSux() == 1 && tempOpId == block.getLastLirInstructionId()) {
+                    // generating debug information for the last instruction of a block.
+                    // if this instruction is a branch, spill moves are inserted before this branch
+                    // and so the wrong operand would be returned (spill moves at block boundaries are not
+                    // considered in the live ranges of intervals)
+                    // Solution: use the first opId of the branch target block instead.
+                    final LIRInstruction instr = block.lir.get(block.lir.size() - 1);
+                    if (instr instanceof StandardOp.JumpOp) {
+                        if (blockData.get(block).liveOut.get(operandNumber(operand))) {
+                            tempOpId = block.suxAt(0).getFirstLirInstructionId();
+                            mode = OperandMode.Output;
+                        }
+                    }
+                }
+
+                // Get current location of operand
+                // The operand must be live because debug information is considered when building the intervals
+                // if the interval is not live, colorLirOperand will cause an assert on failure
+                CiValue result = colorLirOperand((Variable) operand, tempOpId, mode);
+                assert !hasCall(tempOpId) || isStackSlot(result) || !isCallerSave(result) : "cannot have caller-save register operands at calls";
+                return result;
+            }
+        });
+
+        info.finish(registerRefMap, frameRefMap, frameMap);
+    }
+
+    private void assignLocations(List<LIRInstruction> instructions, IntervalWalker iw) {
+        int numInst = instructions.size();
+        boolean hasDead = false;
+
+        for (int j = 0; j < numInst; j++) {
+            final LIRInstruction op = instructions.get(j);
+            if (op == null) { // this can happen when spill-moves are removed in eliminateSpillMoves
+                hasDead = true;
+                continue;
+            }
+
+            ValueProcedure assignProc = new ValueProcedure() {
+                @Override
+                public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+                    if (isVariable(operand)) {
+                        return colorLirOperand((Variable) operand, op.id(), mode);
+                    }
+                    return operand;
+                }
+            };
+
+            op.forEachInput(assignProc);
+            op.forEachAlive(assignProc);
+            op.forEachTemp(assignProc);
+            op.forEachOutput(assignProc);
+
+            if (op.info != null) {
+                // compute reference map and debug information
+                computeDebugInfo(iw, op);
+            }
+
+            // remove useless moves
+            if (op instanceof MoveOp) {
+                MoveOp move = (MoveOp) op;
+                if (move.getInput() == move.getResult()) {
+                    instructions.set(j, null);
+                    hasDead = true;
+                }
+            }
+        }
+
+        if (hasDead) {
+            // iterate all instructions of the block and remove all null-values.
+            int insertPoint = 0;
+            for (int j = 0; j < numInst; j++) {
+                LIRInstruction op = instructions.get(j);
+                if (op != null) {
+                    if (insertPoint != j) {
+                        instructions.set(insertPoint, op);
+                    }
+                    insertPoint++;
+                }
+            }
+            Util.truncate(instructions, insertPoint);
+        }
+    }
+
+    private void assignLocations() {
+        IntervalWalker iw = initComputeOopMaps();
+        for (Block block : sortedBlocks) {
+            assignLocations(block.lir, iw);
+        }
+    }
+
+    public void allocate() {
+
+        Debug.scope("LifetimeAnalysis", new Runnable() {
+
+            public void run() {
+                numberInstructions();
+                printLir("Before register allocation", true);
+                computeLocalLiveSets();
+                computeGlobalLiveSets();
+                buildIntervals();
+                sortIntervalsBeforeAllocation();
+            }
+        });
+
+        Debug.scope("RegisterAllocation", new Runnable() {
+
+            public void run() {
+                printIntervals("Before register allocation");
+                allocateRegisters();
+            }
+        });
+
+        Debug.scope("ResolveDataFlow", new Runnable() {
+            public void run() {
+                resolveDataFlow();
+            }
+        });
+
+        Debug.scope("DebugInfo", new Runnable() {
+
+            public void run() {
+                frameMap.finish();
+
+                printIntervals("After register allocation");
+                printLir("After register allocation", true);
+
+                sortIntervalsAfterAllocation();
+
+                if (GraalOptions.DetailedAsserts) {
+                    verify();
+                }
+
+                eliminateSpillMoves();
+                assignLocations();
+
+                if (GraalOptions.DetailedAsserts) {
+                    verifyIntervals();
+                }
+            }
+        });
+
+        Debug.scope("ControlFlowOptimizations", new Runnable() {
+
+            public void run() {
+                printLir("After register number assignment", true);
+                EdgeMoveOptimizer.optimize(ir.linearScanOrder());
+                ControlFlowOptimizer.optimize(ir);
+                printLir("After control flow optimization", false);
+            }
+        });
+    }
+
+    void printIntervals(String label) {
+        if (GraalOptions.TraceLinearScanLevel >= 1) {
+            int i;
+            TTY.println();
+            TTY.println(label);
+
+            for (Interval interval : intervals) {
+                if (interval != null) {
+                    TTY.out().println(interval.logString(this));
+                }
+            }
+
+            TTY.println();
+            TTY.println("--- Basic Blocks ---");
+            for (i = 0; i < blockCount(); i++) {
+                Block block = blockAt(i);
+                TTY.print("B%d [%d, %d, %s] ", block.getId(), block.getFirstLirInstructionId(), block.getLastLirInstructionId(), block.getLoop());
+            }
+            TTY.println();
+            TTY.println();
+        }
+
+        Debug.dump(Arrays.copyOf(intervals, intervalsSize), label);
+    }
+
+    void printLir(String label, @SuppressWarnings("unused") boolean hirValid) {
+        Debug.dump(ir, label);
+    }
+
+    boolean verify() {
+        // (check that all intervals have a correct register and that no registers are overwritten)
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println(" verifying intervals *");
+        }
+        verifyIntervals();
+
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println(" verifying that no oops are in fixed intervals *");
+        }
+        //verifyNoOopsInFixedIntervals();
+
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println(" verifying that unpinned constants are not alive across block boundaries");
+        }
+        verifyConstants();
+
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println(" verifying register allocation *");
+        }
+        verifyRegisters();
+
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println(" no errors found *");
+        }
+
+        return true;
+    }
+
+    private void verifyRegisters() {
+        RegisterVerifier verifier = new RegisterVerifier(this);
+        verifier.verify(blockAt(0));
+    }
+
+    void verifyIntervals() {
+        int len = intervalsSize;
+
+        for (int i = 0; i < len; i++) {
+            Interval i1 = intervals[i];
+            if (i1 == null) {
+                continue;
+            }
+
+            i1.checkSplitChildren();
+
+            if (i1.operandNumber != i) {
+                TTY.println("Interval %d is on position %d in list", i1.operandNumber, i);
+                TTY.println(i1.logString(this));
+                throw new GraalInternalError("");
+            }
+
+            if (isVariable(i1.operand) && i1.kind()  == CiKind.Illegal) {
+                TTY.println("Interval %d has no type assigned", i1.operandNumber);
+                TTY.println(i1.logString(this));
+                throw new GraalInternalError("");
+            }
+
+            if (i1.location() == null) {
+                TTY.println("Interval %d has no register assigned", i1.operandNumber);
+                TTY.println(i1.logString(this));
+                throw new GraalInternalError("");
+            }
+
+            if (!isProcessed(i1.location())) {
+                TTY.println("Can not have an Interval for an ignored register " + i1.location());
+                TTY.println(i1.logString(this));
+                throw new GraalInternalError("");
+            }
+
+            if (i1.first() == Range.EndMarker) {
+                TTY.println("Interval %d has no Range", i1.operandNumber);
+                TTY.println(i1.logString(this));
+                throw new GraalInternalError("");
+            }
+
+            for (Range r = i1.first(); r != Range.EndMarker; r = r.next) {
+                if (r.from >= r.to) {
+                    TTY.println("Interval %d has zero length range", i1.operandNumber);
+                    TTY.println(i1.logString(this));
+                    throw new GraalInternalError("");
+                }
+            }
+
+            for (int j = i + 1; j < len; j++) {
+                Interval i2 = intervals[j];
+                if (i2 == null) {
+                    continue;
+                }
+
+                // special intervals that are created in MoveResolver
+                // . ignore them because the range information has no meaning there
+                if (i1.from() == 1 && i1.to() == 2) {
+                    continue;
+                }
+                if (i2.from() == 1 && i2.to() == 2) {
+                    continue;
+                }
+                CiValue l1 = i1.location();
+                CiValue l2 = i2.location();
+                if (i1.intersects(i2) && (l1.equals(l2))) {
+                    if (GraalOptions.DetailedAsserts) {
+                        TTY.println("Intervals %d and %d overlap and have the same register assigned", i1.operandNumber, i2.operandNumber);
+                        TTY.println(i1.logString(this));
+                        TTY.println(i2.logString(this));
+                    }
+                    throw new CiBailout("");
+                }
+            }
+        }
+    }
+
+    class CheckProcedure extends ValueProcedure {
+        boolean ok;
+        Interval curInterval;
+
+        @Override
+        protected CiValue doValue(CiValue operand) {
+            if (isRegister(operand)) {
+                if (intervalFor(operand) == curInterval) {
+                    ok = true;
+                }
+            }
+            return operand;
+        }
+    }
+
+    void verifyNoOopsInFixedIntervals() {
+        CheckProcedure checkProc = new CheckProcedure();
+
+        Interval fixedIntervals;
+        Interval otherIntervals;
+        fixedIntervals = createUnhandledLists(IS_PRECOLORED_INTERVAL, null).first;
+        // to ensure a walking until the last instruction id, add a dummy interval
+        // with a high operation id
+        otherIntervals = new Interval(CiValue.IllegalValue, -1);
+        otherIntervals.addRange(Integer.MAX_VALUE - 2, Integer.MAX_VALUE - 1);
+        IntervalWalker iw = new IntervalWalker(this, fixedIntervals, otherIntervals);
+
+        for (int i = 0; i < blockCount(); i++) {
+            Block block = blockAt(i);
+
+            List<LIRInstruction> instructions = block.lir;
+
+            for (int j = 0; j < instructions.size(); j++) {
+                LIRInstruction op = instructions.get(j);
+
+                if (op.info != null) {
+                    iw.walkBefore(op.id());
+                    boolean checkLive = true;
+
+                    // Make sure none of the fixed registers is live across an
+                    // oopmap since we can't handle that correctly.
+                    if (checkLive) {
+                        for (Interval interval = iw.activeLists.get(RegisterBinding.Fixed); interval != Interval.EndMarker; interval = interval.next) {
+                            if (interval.currentTo() > op.id() + 1) {
+                                // This interval is live out of this op so make sure
+                                // that this interval represents some value that's
+                                // referenced by this op either as an input or output.
+                                checkProc.curInterval = interval;
+                                checkProc.ok = false;
+
+                                op.forEachInput(checkProc);
+                                op.forEachAlive(checkProc);
+                                op.forEachTemp(checkProc);
+                                op.forEachOutput(checkProc);
+
+                                assert checkProc.ok : "fixed intervals should never be live across an oopmap point";
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    void verifyConstants() {
+        int numBlocks = blockCount();
+
+        for (int i = 0; i < numBlocks; i++) {
+            Block block = blockAt(i);
+            BitMap liveAtEdge = blockData.get(block).liveIn;
+
+            // visit all operands where the liveAtEdge bit is set
+            for (int operandNum = liveAtEdge.nextSetBit(0); operandNum >= 0; operandNum = liveAtEdge.nextSetBit(operandNum + 1)) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    TTY.println("checking interval %d of block B%d", operandNum, block.getId());
+                }
+                CiValue operand = operandFor(operandNum);
+                assert isVariable(operand) : "value must have variable operand";
+                // TKR assert value.asConstant() == null || value.isPinned() :
+                // "only pinned constants can be alive accross block boundaries";
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,963 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+import static com.oracle.max.cri.ci.CiUtil.*;
+import static com.oracle.graal.alloc.util.LocationUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.alloc.Interval.RegisterBinding;
+import com.oracle.graal.compiler.alloc.Interval.RegisterPriority;
+import com.oracle.graal.compiler.alloc.Interval.SpillState;
+import com.oracle.graal.compiler.alloc.Interval.State;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.StandardOp.*;
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ */
+final class LinearScanWalker extends IntervalWalker {
+
+    private final boolean hasCalleeSavedRegisters;
+
+    private CiRegister[] availableRegs;
+
+    private final int[] usePos;
+    private final int[] blockPos;
+
+    private List<Interval>[] spillIntervals;
+
+    private MoveResolver moveResolver; // for ordering spill moves
+
+
+    // accessors mapped to same functions in class LinearScan
+    int blockCount() {
+        return allocator.blockCount();
+    }
+
+    Block blockAt(int idx) {
+        return allocator.blockAt(idx);
+    }
+
+    Block blockOfOpWithId(int opId) {
+        return allocator.blockForId(opId);
+    }
+
+    LinearScanWalker(LinearScan allocator, Interval unhandledFixedFirst, Interval unhandledAnyFirst, boolean hasCalleeSavedRegisters) {
+        super(allocator, unhandledFixedFirst, unhandledAnyFirst);
+        this.hasCalleeSavedRegisters = hasCalleeSavedRegisters;
+        moveResolver = new MoveResolver(allocator);
+        spillIntervals = Util.uncheckedCast(new List[allocator.registers.length]);
+        for (int i = 0; i < allocator.registers.length; i++) {
+            spillIntervals[i] = new ArrayList<>(2);
+        }
+        usePos = new int[allocator.registers.length];
+        blockPos = new int[allocator.registers.length];
+    }
+
+    void initUseLists(boolean onlyProcessUsePos) {
+        for (CiRegister register : availableRegs) {
+            int i = register.number;
+            usePos[i] = Integer.MAX_VALUE;
+
+            if (!onlyProcessUsePos) {
+                blockPos[i] = Integer.MAX_VALUE;
+                spillIntervals[i].clear();
+            }
+        }
+    }
+
+    void excludeFromUse(Interval i) {
+        CiValue location = i.location();
+        int i1 = asRegister(location).number;
+        if (i1 >= availableRegs[0].number && i1 <= availableRegs[availableRegs.length - 1].number) {
+            usePos[i1] = 0;
+        }
+    }
+
+    void setUsePos(Interval interval, int usePos, boolean onlyProcessUsePos) {
+        if (usePos != -1) {
+            assert usePos != 0 : "must use excludeFromUse to set usePos to 0";
+            int i = asRegister(interval.location()).number;
+            if (i >= availableRegs[0].number && i <= availableRegs[availableRegs.length - 1].number) {
+                if (this.usePos[i] > usePos) {
+                    this.usePos[i] = usePos;
+                }
+                if (!onlyProcessUsePos) {
+                    spillIntervals[i].add(interval);
+                }
+            }
+        }
+    }
+
+    void setBlockPos(Interval i, int blockPos) {
+        if (blockPos != -1) {
+            int reg = asRegister(i.location()).number;
+            if (reg >= availableRegs[0].number && reg <= availableRegs[availableRegs.length - 1].number) {
+                if (this.blockPos[reg] > blockPos) {
+                    this.blockPos[reg] = blockPos;
+                }
+                if (usePos[reg] > blockPos) {
+                    usePos[reg] = blockPos;
+                }
+            }
+        }
+    }
+
+    void freeExcludeActiveFixed() {
+        Interval interval = activeLists.get(RegisterBinding.Fixed);
+        while (interval != Interval.EndMarker) {
+            assert isRegister(interval.location()) : "active interval must have a register assigned";
+            excludeFromUse(interval);
+            interval = interval.next;
+        }
+    }
+
+    void freeExcludeActiveAny() {
+        Interval interval = activeLists.get(RegisterBinding.Any);
+        while (interval != Interval.EndMarker) {
+            assert isRegister(interval.location()) : "active interval must have a register assigned";
+            excludeFromUse(interval);
+            interval = interval.next;
+        }
+    }
+
+    void freeCollectInactiveFixed(Interval current) {
+        Interval interval = inactiveLists.get(RegisterBinding.Fixed);
+        while (interval != Interval.EndMarker) {
+            if (current.to() <= interval.currentFrom()) {
+                assert interval.currentIntersectsAt(current) == -1 : "must not intersect";
+                setUsePos(interval, interval.currentFrom(), true);
+            } else {
+                setUsePos(interval, interval.currentIntersectsAt(current), true);
+            }
+            interval = interval.next;
+        }
+    }
+
+    void freeCollectInactiveAny(Interval current) {
+        Interval interval = inactiveLists.get(RegisterBinding.Any);
+        while (interval != Interval.EndMarker) {
+            setUsePos(interval, interval.currentIntersectsAt(current), true);
+            interval = interval.next;
+        }
+    }
+
+    void freeCollectUnhandled(RegisterBinding kind, Interval current) {
+        Interval interval = unhandledLists.get(kind);
+        while (interval != Interval.EndMarker) {
+            setUsePos(interval, interval.intersectsAt(current), true);
+            if (kind == RegisterBinding.Fixed && current.to() <= interval.from()) {
+                setUsePos(interval, interval.from(), true);
+            }
+            interval = interval.next;
+        }
+    }
+
+    void spillExcludeActiveFixed() {
+        Interval interval = activeLists.get(RegisterBinding.Fixed);
+        while (interval != Interval.EndMarker) {
+            excludeFromUse(interval);
+            interval = interval.next;
+        }
+    }
+
+    void spillBlockUnhandledFixed(Interval current) {
+        Interval interval = unhandledLists.get(RegisterBinding.Fixed);
+        while (interval != Interval.EndMarker) {
+            setBlockPos(interval, interval.intersectsAt(current));
+            interval = interval.next;
+        }
+    }
+
+    void spillBlockInactiveFixed(Interval current) {
+        Interval interval = inactiveLists.get(RegisterBinding.Fixed);
+        while (interval != Interval.EndMarker) {
+            if (current.to() > interval.currentFrom()) {
+                setBlockPos(interval, interval.currentIntersectsAt(current));
+            } else {
+                assert interval.currentIntersectsAt(current) == -1 : "invalid optimization: intervals intersect";
+            }
+
+            interval = interval.next;
+        }
+    }
+
+    void spillCollectActiveAny() {
+        Interval interval = activeLists.get(RegisterBinding.Any);
+        while (interval != Interval.EndMarker) {
+            setUsePos(interval, Math.min(interval.nextUsage(RegisterPriority.LiveAtLoopEnd, currentPosition), interval.to()), false);
+            interval = interval.next;
+        }
+    }
+
+    void spillCollectInactiveAny(Interval current) {
+        Interval interval = inactiveLists.get(RegisterBinding.Any);
+        while (interval != Interval.EndMarker) {
+            if (interval.currentIntersects(current)) {
+                setUsePos(interval, Math.min(interval.nextUsage(RegisterPriority.LiveAtLoopEnd, currentPosition), interval.to()), false);
+            }
+            interval = interval.next;
+        }
+    }
+
+    void insertMove(int operandId, Interval srcIt, Interval dstIt) {
+        // output all moves here. When source and target are equal, the move is
+        // optimized away later in assignRegNums
+
+        int opId = (operandId + 1) & ~1;
+        Block opBlock = allocator.blockForId(opId);
+        assert opId > 0 && allocator.blockForId(opId - 2) == opBlock : "cannot insert move at block boundary";
+
+        // calculate index of instruction inside instruction list of current block
+        // the minimal index (for a block with no spill moves) can be calculated because the
+        // numbering of instructions is known.
+        // When the block already contains spill moves, the index must be increased until the
+        // correct index is reached.
+        List<LIRInstruction> list = opBlock.lir;
+        int index = (opId - list.get(0).id()) >> 1;
+        assert list.get(index).id() <= opId : "error in calculation";
+
+        while (list.get(index).id() != opId) {
+            index++;
+            assert 0 <= index && index < list.size() : "index out of bounds";
+        }
+        assert 1 <= index && index < list.size() : "index out of bounds";
+        assert list.get(index).id() == opId : "error in calculation";
+
+        // insert new instruction before instruction at position index
+        moveResolver.moveInsertPosition(opBlock.lir, index);
+        moveResolver.addMapping(srcIt, dstIt);
+    }
+
+    int findOptimalSplitPos(Block minBlock, Block maxBlock, int maxSplitPos) {
+        int fromBlockNr = minBlock.linearScanNumber;
+        int toBlockNr = maxBlock.linearScanNumber;
+
+        assert 0 <= fromBlockNr && fromBlockNr < blockCount() : "out of range";
+        assert 0 <= toBlockNr && toBlockNr < blockCount() : "out of range";
+        assert fromBlockNr < toBlockNr : "must cross block boundary";
+
+        // Try to split at end of maxBlock. If this would be after
+        // maxSplitPos, then use the begin of maxBlock
+        int optimalSplitPos = maxBlock.getLastLirInstructionId() + 2;
+        if (optimalSplitPos > maxSplitPos) {
+            optimalSplitPos = maxBlock.getFirstLirInstructionId();
+        }
+
+        int minLoopDepth = maxBlock.getLoopDepth();
+        for (int i = toBlockNr - 1; i >= fromBlockNr; i--) {
+            Block cur = blockAt(i);
+
+            if (cur.getLoopDepth() < minLoopDepth) {
+                // block with lower loop-depth found . split at the end of this block
+                minLoopDepth = cur.getLoopDepth();
+                optimalSplitPos = cur.getLastLirInstructionId() + 2;
+            }
+        }
+        assert optimalSplitPos > allocator.maxOpId() || allocator.isBlockBegin(optimalSplitPos) : "algorithm must move split pos to block boundary";
+
+        return optimalSplitPos;
+    }
+
+    int findOptimalSplitPos(Interval interval, int minSplitPos, int maxSplitPos, boolean doLoopOptimization) {
+        int optimalSplitPos = -1;
+        if (minSplitPos == maxSplitPos) {
+            // trivial case, no optimization of split position possible
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("      min-pos and max-pos are equal, no optimization possible");
+            }
+            optimalSplitPos = minSplitPos;
+
+        } else {
+            assert minSplitPos < maxSplitPos : "must be true then";
+            assert minSplitPos > 0 : "cannot access minSplitPos - 1 otherwise";
+
+            // reason for using minSplitPos - 1: when the minimal split pos is exactly at the
+            // beginning of a block, then minSplitPos is also a possible split position.
+            // Use the block before as minBlock, because then minBlock.lastLirInstructionId() + 2 == minSplitPos
+            Block minBlock = allocator.blockForId(minSplitPos - 1);
+
+            // reason for using maxSplitPos - 1: otherwise there would be an assert on failure
+            // when an interval ends at the end of the last block of the method
+            // (in this case, maxSplitPos == allocator().maxLirOpId() + 2, and there is no
+            // block at this opId)
+            Block maxBlock = allocator.blockForId(maxSplitPos - 1);
+
+            assert minBlock.linearScanNumber <= maxBlock.linearScanNumber : "invalid order";
+            if (minBlock == maxBlock) {
+                // split position cannot be moved to block boundary : so split as late as possible
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    TTY.println("      cannot move split pos to block boundary because minPos and maxPos are in same block");
+                }
+                optimalSplitPos = maxSplitPos;
+
+            } else {
+                if (interval.hasHoleBetween(maxSplitPos - 1, maxSplitPos) && !allocator.isBlockBegin(maxSplitPos)) {
+                    // Do not move split position if the interval has a hole before maxSplitPos.
+                    // Intervals resulting from Phi-Functions have more than one definition (marked
+                    // as mustHaveRegister) with a hole before each definition. When the register is needed
+                    // for the second definition : an earlier reloading is unnecessary.
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
+                        TTY.println("      interval has hole just before maxSplitPos, so splitting at maxSplitPos");
+                    }
+                    optimalSplitPos = maxSplitPos;
+
+                } else {
+                    // seach optimal block boundary between minSplitPos and maxSplitPos
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
+                        TTY.println("      moving split pos to optimal block boundary between block B%d and B%d", minBlock.getId(), maxBlock.getId());
+                    }
+
+                    if (doLoopOptimization) {
+                        // Loop optimization: if a loop-end marker is found between min- and max-position :
+                        // then split before this loop
+                        int loopEndPos = interval.nextUsageExact(RegisterPriority.LiveAtLoopEnd, minBlock.getLastLirInstructionId() + 2);
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
+                            TTY.println("      loop optimization: loop end found at pos %d", loopEndPos);
+                        }
+
+                        assert loopEndPos > minSplitPos : "invalid order";
+                        if (loopEndPos < maxSplitPos) {
+                            // loop-end marker found between min- and max-position
+                            // if it is not the end marker for the same loop as the min-position : then move
+                            // the max-position to this loop block.
+                            // Desired result: uses tagged as shouldHaveRegister inside a loop cause a reloading
+                            // of the interval (normally, only mustHaveRegister causes a reloading)
+                            Block loopBlock = allocator.blockForId(loopEndPos);
+
+                            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                                TTY.println("      interval is used in loop that ends in block B%d, so trying to move maxBlock back from B%d to B%d", loopBlock.getId(), maxBlock.getId(), loopBlock.getId());
+                            }
+                            assert loopBlock != minBlock : "loopBlock and minBlock must be different because block boundary is needed between";
+
+                            optimalSplitPos = findOptimalSplitPos(minBlock, loopBlock, loopBlock.getLastLirInstructionId() + 2);
+                            if (optimalSplitPos == loopBlock.getLastLirInstructionId() + 2) {
+                                optimalSplitPos = -1;
+                                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                                    TTY.println("      loop optimization not necessary");
+                                }
+                            } else {
+                                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                                    TTY.println("      loop optimization successful");
+                                }
+                            }
+                        }
+                    }
+
+                    if (optimalSplitPos == -1) {
+                        // not calculated by loop optimization
+                        optimalSplitPos = findOptimalSplitPos(minBlock, maxBlock, maxSplitPos);
+                    }
+                }
+            }
+        }
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("      optimal split position: %d", optimalSplitPos);
+        }
+
+        return optimalSplitPos;
+    }
+
+    // split an interval at the optimal position between minSplitPos and
+    // maxSplitPos in two parts:
+    // 1) the left part has already a location assigned
+    // 2) the right part is sorted into to the unhandled-list
+    void splitBeforeUsage(Interval interval, int minSplitPos, int maxSplitPos) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println("----- splitting interval: ");
+        }
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println(interval.logString(allocator));
+        }
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println("      between %d and %d", minSplitPos, maxSplitPos);
+        }
+
+        assert interval.from() < minSplitPos : "cannot split at start of interval";
+        assert currentPosition < minSplitPos : "cannot split before current position";
+        assert minSplitPos <= maxSplitPos : "invalid order";
+        assert maxSplitPos <= interval.to() : "cannot split after end of interval";
+
+        int optimalSplitPos = findOptimalSplitPos(interval, minSplitPos, maxSplitPos, true);
+
+        assert minSplitPos <= optimalSplitPos && optimalSplitPos <= maxSplitPos : "out of range";
+        assert optimalSplitPos <= interval.to() : "cannot split after end of interval";
+        assert optimalSplitPos > interval.from() : "cannot split at start of interval";
+
+        if (optimalSplitPos == interval.to() && interval.nextUsage(RegisterPriority.MustHaveRegister, minSplitPos) == Integer.MAX_VALUE) {
+            // the split position would be just before the end of the interval
+            // . no split at all necessary
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("      no split necessary because optimal split position is at end of interval");
+            }
+            return;
+        }
+
+        // must calculate this before the actual split is performed and before split position is moved to odd opId
+        boolean moveNecessary = !allocator.isBlockBegin(optimalSplitPos) && !interval.hasHoleBetween(optimalSplitPos - 1, optimalSplitPos);
+
+        if (!allocator.isBlockBegin(optimalSplitPos)) {
+            // move position before actual instruction (odd opId)
+            optimalSplitPos = (optimalSplitPos - 1) | 1;
+        }
+
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("      splitting at position %d", optimalSplitPos);
+        }
+        assert allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 1) : "split pos must be odd when not on block boundary";
+        assert !allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 0) : "split pos must be even on block boundary";
+
+        Interval splitPart = interval.split(optimalSplitPos, allocator);
+
+        splitPart.setInsertMoveWhenActivated(moveNecessary);
+
+        assert splitPart.from() >= currentInterval.currentFrom() : "cannot append new interval before current walk position";
+        unhandledLists.addToListSortedByStartAndUsePositions(RegisterBinding.Any, splitPart);
+
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println("      split interval in two parts (insertMoveWhenActivated: %b)", moveNecessary);
+        }
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.print("      ");
+            TTY.println(interval.logString(allocator));
+            TTY.print("      ");
+            TTY.println(splitPart.logString(allocator));
+        }
+    }
+
+// split an interval at the optimal position between minSplitPos and
+// maxSplitPos in two parts:
+// 1) the left part has already a location assigned
+// 2) the right part is always on the stack and therefore ignored in further processing
+
+    void splitForSpilling(Interval interval) {
+        // calculate allowed range of splitting position
+        int maxSplitPos = currentPosition;
+        int minSplitPos = Math.max(interval.previousUsage(RegisterPriority.ShouldHaveRegister, maxSplitPos) + 1, interval.from());
+
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.print("----- splitting and spilling interval: ");
+            TTY.println(interval.logString(allocator));
+            TTY.println("      between %d and %d", minSplitPos, maxSplitPos);
+        }
+
+        assert interval.state == State.Active : "why spill interval that is not active?";
+        assert interval.from() <= minSplitPos : "cannot split before start of interval";
+        assert minSplitPos <= maxSplitPos : "invalid order";
+        assert maxSplitPos < interval.to() : "cannot split at end end of interval";
+        assert currentPosition < interval.to() : "interval must not end before current position";
+
+        if (minSplitPos == interval.from()) {
+            // the whole interval is never used, so spill it entirely to memory
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
+                TTY.println("      spilling entire interval because split pos is at beginning of interval");
+                TTY.println("      use positions: " + interval.usePosList().size());
+            }
+            assert interval.firstUsage(RegisterPriority.ShouldHaveRegister) > currentPosition : "interval must not have use position before currentPosition";
+
+            allocator.assignSpillSlot(interval);
+            allocator.changeSpillState(interval, minSplitPos);
+
+            // Also kick parent intervals out of register to memory when they have no use
+            // position. This avoids short interval in register surrounded by intervals in
+            // memory . avoid useless moves from memory to register and back
+            Interval parent = interval;
+            while (parent != null && parent.isSplitChild()) {
+                parent = parent.getSplitChildBeforeOpId(parent.from());
+
+                if (isRegister(parent.location())) {
+                    if (parent.firstUsage(RegisterPriority.ShouldHaveRegister) == Integer.MAX_VALUE) {
+                        // parent is never used, so kick it out of its assigned register
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
+                            TTY.println("      kicking out interval %d out of its register because it is never used", parent.operandNumber);
+                        }
+                        allocator.assignSpillSlot(parent);
+                    } else {
+                        // do not go further back because the register is actually used by the interval
+                        parent = null;
+                    }
+                }
+            }
+
+        } else {
+            // search optimal split pos, split interval and spill only the right hand part
+            int optimalSplitPos = findOptimalSplitPos(interval, minSplitPos, maxSplitPos, false);
+
+            assert minSplitPos <= optimalSplitPos && optimalSplitPos <= maxSplitPos : "out of range";
+            assert optimalSplitPos < interval.to() : "cannot split at end of interval";
+            assert optimalSplitPos >= interval.from() : "cannot split before start of interval";
+
+            if (!allocator.isBlockBegin(optimalSplitPos)) {
+                // move position before actual instruction (odd opId)
+                optimalSplitPos = (optimalSplitPos - 1) | 1;
+            }
+
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("      splitting at position %d", optimalSplitPos);
+            }
+            assert allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 1) : "split pos must be odd when not on block boundary";
+            assert !allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 0) : "split pos must be even on block boundary";
+
+            Interval spilledPart = interval.split(optimalSplitPos, allocator);
+            allocator.assignSpillSlot(spilledPart);
+            allocator.changeSpillState(spilledPart, optimalSplitPos);
+
+            if (!allocator.isBlockBegin(optimalSplitPos)) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    TTY.println("      inserting move from interval %d to %d", interval.operandNumber, spilledPart.operandNumber);
+                }
+                insertMove(optimalSplitPos, interval, spilledPart);
+            }
+
+            // the currentSplitChild is needed later when moves are inserted for reloading
+            assert spilledPart.currentSplitChild() == interval : "overwriting wrong currentSplitChild";
+            spilledPart.makeCurrentSplitChild();
+
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
+                TTY.println("      split interval in two parts");
+                TTY.print("      ");
+                TTY.println(interval.logString(allocator));
+                TTY.print("      ");
+                TTY.println(spilledPart.logString(allocator));
+            }
+        }
+    }
+
+    void splitStackInterval(Interval interval) {
+        int minSplitPos = currentPosition + 1;
+        int maxSplitPos = Math.min(interval.firstUsage(RegisterPriority.ShouldHaveRegister), interval.to());
+
+        splitBeforeUsage(interval, minSplitPos, maxSplitPos);
+    }
+
+    void splitWhenPartialRegisterAvailable(Interval interval, int registerAvailableUntil) {
+        int minSplitPos = Math.max(interval.previousUsage(RegisterPriority.ShouldHaveRegister, registerAvailableUntil), interval.from() + 1);
+        splitBeforeUsage(interval, minSplitPos, registerAvailableUntil);
+    }
+
+    void splitAndSpillInterval(Interval interval) {
+        assert interval.state == State.Active || interval.state == State.Inactive : "other states not allowed";
+
+        int currentPos = currentPosition;
+        if (interval.state == State.Inactive) {
+            // the interval is currently inactive, so no spill slot is needed for now.
+            // when the split part is activated, the interval has a new chance to get a register,
+            // so in the best case no stack slot is necessary
+            assert interval.hasHoleBetween(currentPos - 1, currentPos + 1) : "interval can not be inactive otherwise";
+            splitBeforeUsage(interval, currentPos + 1, currentPos + 1);
+
+        } else {
+            // search the position where the interval must have a register and split
+            // at the optimal position before.
+            // The new created part is added to the unhandled list and will get a register
+            // when it is activated
+            int minSplitPos = currentPos + 1;
+            int maxSplitPos = Math.min(interval.nextUsage(RegisterPriority.MustHaveRegister, minSplitPos), interval.to());
+
+            splitBeforeUsage(interval, minSplitPos, maxSplitPos);
+
+            assert interval.nextUsage(RegisterPriority.MustHaveRegister, currentPos) == Integer.MAX_VALUE : "the remaining part is spilled to stack and therefore has no register";
+            splitForSpilling(interval);
+        }
+    }
+
+    boolean allocFreeRegister(Interval interval) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println("trying to find free register for " + interval.logString(allocator));
+        }
+
+        initUseLists(true);
+        freeExcludeActiveFixed();
+        freeExcludeActiveAny();
+        freeCollectInactiveFixed(interval);
+        freeCollectInactiveAny(interval);
+        // freeCollectUnhandled(fixedKind, cur);
+        assert unhandledLists.get(RegisterBinding.Fixed) == Interval.EndMarker : "must not have unhandled fixed intervals because all fixed intervals have a use at position 0";
+
+        // usePos contains the start of the next interval that has this register assigned
+        // (either as a fixed register or a normal allocated register in the past)
+        // only intervals overlapping with cur are processed, non-overlapping invervals can be ignored safely
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("      state of registers:");
+            for (CiRegister register : availableRegs) {
+                int i = register.number;
+                TTY.println("      reg %d: usePos: %d", register.number, usePos[i]);
+            }
+        }
+
+        CiRegister hint = null;
+        Interval locationHint = interval.locationHint(true);
+        if (locationHint != null && locationHint.location() != null && isRegister(locationHint.location())) {
+            hint = asRegister(locationHint.location());
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("      hint register %d from interval %s", hint.number, locationHint.logString(allocator));
+            }
+        }
+        assert interval.location() == null : "register already assigned to interval";
+
+        // the register must be free at least until this position
+        int regNeededUntil = interval.from() + 1;
+        int intervalTo = interval.to();
+
+        boolean needSplit = false;
+        int splitPos = -1;
+
+        CiRegister reg = null;
+        CiRegister minFullReg = null;
+        CiRegister maxPartialReg = null;
+
+        for (int i = 0; i < availableRegs.length; ++i) {
+            CiRegister availableReg = availableRegs[i];
+            int number = availableReg.number;
+            if (usePos[number] >= intervalTo) {
+                // this register is free for the full interval
+                if (minFullReg == null || availableReg == hint || (usePos[number] < usePos[minFullReg.number] && minFullReg != hint)) {
+                    minFullReg = availableReg;
+                }
+            } else if (usePos[number] > regNeededUntil) {
+                // this register is at least free until regNeededUntil
+                if (maxPartialReg == null || availableReg == hint || (usePos[number] > usePos[maxPartialReg.number] && maxPartialReg != hint)) {
+                    maxPartialReg = availableReg;
+                }
+            }
+        }
+
+        if (minFullReg != null) {
+            reg = minFullReg;
+        } else if (maxPartialReg != null) {
+            needSplit = true;
+            reg = maxPartialReg;
+        } else {
+            return false;
+        }
+
+        splitPos = usePos[reg.number];
+        interval.assignLocation(reg.asValue(interval.kind()));
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println("selected register %d", reg.number);
+        }
+
+        assert splitPos > 0 : "invalid splitPos";
+        if (needSplit) {
+            // register not available for full interval, so split it
+            splitWhenPartialRegisterAvailable(interval, splitPos);
+        }
+
+        // only return true if interval is completely assigned
+        return true;
+    }
+
+    CiRegister findLockedRegister(int regNeededUntil, int intervalTo, CiValue ignoreReg, boolean[] needSplit) {
+        int maxReg = -1;
+        CiRegister ignore = isRegister(ignoreReg) ? asRegister(ignoreReg) : null;
+
+        for (CiRegister reg : availableRegs) {
+            int i = reg.number;
+            if (reg == ignore) {
+                // this register must be ignored
+
+            } else if (usePos[i] > regNeededUntil) {
+                if (maxReg == -1 || (usePos[i] > usePos[maxReg])) {
+                    maxReg = i;
+                }
+            }
+        }
+
+        if (maxReg != -1) {
+            if (blockPos[maxReg] <= intervalTo) {
+                needSplit[0] = true;
+            }
+            return availableRegs[maxReg];
+        }
+
+        return null;
+    }
+
+    void splitAndSpillIntersectingIntervals(CiRegister reg) {
+        assert reg != null : "no register assigned";
+
+        for (int i = 0; i < spillIntervals[reg.number].size(); i++) {
+            Interval interval = spillIntervals[reg.number].get(i);
+            removeFromList(interval);
+            splitAndSpillInterval(interval);
+        }
+    }
+
+    // Split an Interval and spill it to memory so that cur can be placed in a register
+    void allocLockedRegister(Interval interval) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println("need to split and spill to get register for " + interval.logString(allocator));
+        }
+
+        // collect current usage of registers
+        initUseLists(false);
+        spillExcludeActiveFixed();
+        //  spillBlockUnhandledFixed(cur);
+        assert unhandledLists.get(RegisterBinding.Fixed) == Interval.EndMarker : "must not have unhandled fixed intervals because all fixed intervals have a use at position 0";
+        spillBlockInactiveFixed(interval);
+        spillCollectActiveAny();
+        spillCollectInactiveAny(interval);
+
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("      state of registers:");
+            for (CiRegister reg : availableRegs) {
+                int i = reg.number;
+                TTY.print("      reg %d: usePos: %d, blockPos: %d, intervals: ", i, usePos[i], blockPos[i]);
+                for (int j = 0; j < spillIntervals[i].size(); j++) {
+                    TTY.print("%d ", spillIntervals[i].get(j).operandNumber);
+                }
+                TTY.println();
+            }
+        }
+
+        // the register must be free at least until this position
+        int firstUsage = interval.firstUsage(RegisterPriority.MustHaveRegister);
+        int regNeededUntil = Math.min(firstUsage, interval.from() + 1);
+        int intervalTo = interval.to();
+        assert regNeededUntil > 0 && regNeededUntil < Integer.MAX_VALUE : "interval has no use";
+
+        CiRegister reg = null;
+        CiRegister ignore = interval.location() != null && isRegister(interval.location()) ? asRegister(interval.location()) : null;
+        for (CiRegister availableReg : availableRegs) {
+            int number = availableReg.number;
+            if (availableReg == ignore) {
+                // this register must be ignored
+            } else if (usePos[number] > regNeededUntil) {
+                if (reg == null || (usePos[number] > usePos[reg.number])) {
+                    reg = availableReg;
+                }
+            }
+        }
+
+        if (reg == null || usePos[reg.number] <= firstUsage) {
+            // the first use of cur is later than the spilling position -> spill cur
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("able to spill current interval. firstUsage(register): %d, usePos: %d", firstUsage, reg == null ? 0 : usePos[reg.number]);
+            }
+
+            if (firstUsage <= interval.from() + 1) {
+                assert false : "cannot spill interval that is used in first instruction (possible reason: no register found) firstUsage=" + firstUsage + ", interval.from()=" + interval.from();
+                // assign a reasonable register and do a bailout in product mode to avoid errors
+                allocator.assignSpillSlot(interval);
+                throw new CiBailout("LinearScan: no register found");
+            }
+
+            splitAndSpillInterval(interval);
+            return;
+        }
+
+        boolean needSplit = blockPos[reg.number] <= intervalTo;
+
+        int splitPos = blockPos[reg.number];
+
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("decided to use register %d", reg.number);
+        }
+        assert splitPos > 0 : "invalid splitPos";
+        assert needSplit || splitPos > interval.from() : "splitting interval at from";
+
+        interval.assignLocation(reg.asValue(interval.kind()));
+        if (needSplit) {
+            // register not available for full interval :  so split it
+            splitWhenPartialRegisterAvailable(interval, splitPos);
+        }
+
+        // perform splitting and spilling for all affected intervals
+        splitAndSpillIntersectingIntervals(reg);
+    }
+
+    boolean noAllocationPossible(Interval interval) {
+
+        if (!hasCalleeSavedRegisters) {
+            // fast calculation of intervals that can never get a register because the
+            // the next instruction is a call that blocks all registers
+            // Note: this does not work if callee-saved registers are available (e.g. on Sparc)
+
+            // check if this interval is the result of a split operation
+            // (an interval got a register until this position)
+            int pos = interval.from();
+            if (isOdd(pos)) {
+                // the current instruction is a call that blocks all registers
+                if (pos < allocator.maxOpId() && allocator.hasCall(pos + 1) && interval.to() > pos + 1) {
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
+                        TTY.println("      free register cannot be available because all registers blocked by following call");
+                    }
+
+                    // safety check that there is really no register available
+                    assert !allocFreeRegister(interval) : "found a register for this interval";
+                    return true;
+                }
+
+            }
+        }
+        return false;
+    }
+
+    void initVarsForAlloc(Interval interval) {
+        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = allocator.frameMap.registerConfig.getCategorizedAllocatableRegisters();
+        availableRegs = categorizedRegs.get(asVariable(interval.operand).flag);
+    }
+
+    static boolean isMove(LIRInstruction op, Interval from, Interval to) {
+        if (op instanceof MoveOp) {
+            MoveOp move = (MoveOp) op;
+            return isVariable(move.getInput()) && isVariable(move.getResult()) && move.getInput() == from.operand && move.getResult() == to.operand;
+        }
+        return false;
+    }
+
+    // optimization (especially for phi functions of nested loops):
+    // assign same spill slot to non-intersecting intervals
+    void combineSpilledIntervals(Interval interval) {
+        if (interval.isSplitChild()) {
+            // optimization is only suitable for split parents
+            return;
+        }
+
+        Interval registerHint = interval.locationHint(false);
+        if (registerHint == null) {
+            // cur is not the target of a move : otherwise registerHint would be set
+            return;
+        }
+        assert registerHint.isSplitParent() : "register hint must be split parent";
+
+        if (interval.spillState() != SpillState.NoOptimization || registerHint.spillState() != SpillState.NoOptimization) {
+            // combining the stack slots for intervals where spill move optimization is applied
+            // is not benefitial and would cause problems
+            return;
+        }
+
+        int beginPos = interval.from();
+        int endPos = interval.to();
+        if (endPos > allocator.maxOpId() || isOdd(beginPos) || isOdd(endPos)) {
+            // safety check that lirOpWithId is allowed
+            return;
+        }
+
+        if (!isMove(allocator.instructionForId(beginPos), registerHint, interval) || !isMove(allocator.instructionForId(endPos), interval, registerHint)) {
+            // cur and registerHint are not connected with two moves
+            return;
+        }
+
+        Interval beginHint = registerHint.getSplitChildAtOpId(beginPos, LIRInstruction.OperandMode.Input, allocator);
+        Interval endHint = registerHint.getSplitChildAtOpId(endPos, LIRInstruction.OperandMode.Output, allocator);
+        if (beginHint == endHint || beginHint.to() != beginPos || endHint.from() != endPos) {
+            // registerHint must be split : otherwise the re-writing of use positions does not work
+            return;
+        }
+
+        assert beginHint.location() != null : "must have register assigned";
+        assert endHint.location() == null : "must not have register assigned";
+        assert interval.firstUsage(RegisterPriority.MustHaveRegister) == beginPos : "must have use position at begin of interval because of move";
+        assert endHint.firstUsage(RegisterPriority.MustHaveRegister) == endPos : "must have use position at begin of interval because of move";
+
+        if (isRegister(beginHint.location())) {
+            // registerHint is not spilled at beginPos : so it would not be benefitial to immediately spill cur
+            return;
+        }
+        assert registerHint.spillSlot() != null : "must be set when part of interval was spilled";
+
+        // modify intervals such that cur gets the same stack slot as registerHint
+        // delete use positions to prevent the intervals to get a register at beginning
+        interval.setSpillSlot(registerHint.spillSlot());
+        interval.removeFirstUsePos();
+        endHint.removeFirstUsePos();
+    }
+
+    // allocate a physical register or memory location to an interval
+    @Override
+    boolean activateCurrent() {
+        Interval interval = currentInterval;
+        boolean result = true;
+
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println("+++++ activating interval " + interval.logString(allocator));
+        }
+
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("      splitParent: %s, insertMoveWhenActivated: %b", interval.splitParent().operandNumber, interval.insertMoveWhenActivated());
+        }
+
+        final CiValue operand = interval.operand;
+        if (interval.location() != null && isStackSlot(interval.location())) {
+            // activating an interval that has a stack slot assigned . split it at first use position
+            // used for method parameters
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("      interval has spill slot assigned (method parameter) . split it before first use");
+            }
+            splitStackInterval(interval);
+            result = false;
+
+        } else {
+            if (interval.location() == null) {
+                // interval has not assigned register . normal allocation
+                // (this is the normal case for most intervals)
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    TTY.println("      normal allocation of register");
+                }
+
+                // assign same spill slot to non-intersecting intervals
+                combineSpilledIntervals(interval);
+
+                initVarsForAlloc(interval);
+                if (noAllocationPossible(interval) || !allocFreeRegister(interval)) {
+                    // no empty register available.
+                    // split and spill another interval so that this interval gets a register
+                    allocLockedRegister(interval);
+                }
+
+                // spilled intervals need not be move to active-list
+                if (!isRegister(interval.location())) {
+                    result = false;
+                }
+            }
+        }
+
+        // load spilled values that become active from stack slot to register
+        if (interval.insertMoveWhenActivated()) {
+            assert interval.isSplitChild();
+            assert interval.currentSplitChild() != null;
+            assert interval.currentSplitChild().operand != operand : "cannot insert move between same interval";
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println("Inserting move from interval %d to %d because insertMoveWhenActivated is set", interval.currentSplitChild().operandNumber, interval.operandNumber);
+            }
+
+            insertMove(interval.from(), interval.currentSplitChild(), interval);
+        }
+        interval.makeCurrentSplitChild();
+
+        return result; // true = interval is moved to active list
+    }
+
+    public void finishAllocation() {
+        // must be called when all intervals are allocated
+        moveResolver.resolveAndAppendMoves();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+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.graal.compiler.*;
+import com.oracle.graal.lir.*;
+
+/**
+ */
+final class MoveResolver {
+
+    private final LinearScan allocator;
+
+    private int insertIdx;
+    private LIRInsertionBuffer insertionBuffer; // buffer where moves are inserted
+
+    private final List<Interval> mappingFrom;
+    private final List<CiValue> mappingFromOpr;
+    private final List<Interval> mappingTo;
+    private boolean multipleReadsAllowed;
+    private final int[] registerBlocked;
+
+    private int registerBlocked(int reg) {
+        return registerBlocked[reg];
+    }
+
+    private void setRegisterBlocked(int reg, int direction) {
+        assert direction == 1 || direction == -1 : "out of bounds";
+        registerBlocked[reg] += direction;
+    }
+
+    void setMultipleReadsAllowed() {
+        multipleReadsAllowed = true;
+    }
+
+    boolean hasMappings() {
+        return mappingFrom.size() > 0;
+    }
+
+    MoveResolver(LinearScan allocator) {
+
+        this.allocator = allocator;
+        this.multipleReadsAllowed = false;
+        this.mappingFrom = new ArrayList<>(8);
+        this.mappingFromOpr = new ArrayList<>(8);
+        this.mappingTo = new ArrayList<>(8);
+        this.insertIdx = -1;
+        this.insertionBuffer = new LIRInsertionBuffer();
+        this.registerBlocked = new int[allocator.registers.length];
+        assert checkEmpty();
+    }
+
+    boolean checkEmpty() {
+        assert mappingFrom.size() == 0 && mappingFromOpr.size() == 0 && mappingTo.size() == 0 : "list must be empty before and after processing";
+        for (int i = 0; i < allocator.registers.length; i++) {
+            assert registerBlocked(i) == 0 : "register map must be empty before and after processing";
+        }
+        assert !multipleReadsAllowed : "must have default value";
+        return true;
+    }
+
+    private boolean verifyBeforeResolve() {
+        assert mappingFrom.size() == mappingFromOpr.size() : "length must be equal";
+        assert mappingFrom.size() == mappingTo.size() : "length must be equal";
+        assert insertIdx != -1 : "insert position not set";
+
+        int i;
+        int j;
+        if (!multipleReadsAllowed) {
+            for (i = 0; i < mappingFrom.size(); i++) {
+                for (j = i + 1; j < mappingFrom.size(); j++) {
+                    assert mappingFrom.get(i) == null || mappingFrom.get(i) != mappingFrom.get(j) : "cannot read from same interval twice";
+                }
+            }
+        }
+
+        for (i = 0; i < mappingTo.size(); i++) {
+            for (j = i + 1; j < mappingTo.size(); j++) {
+                assert mappingTo.get(i) != mappingTo.get(j) : "cannot write to same interval twice";
+            }
+        }
+
+        HashSet<CiValue> usedRegs = new HashSet<>();
+        if (!multipleReadsAllowed) {
+            for (i = 0; i < mappingFrom.size(); i++) {
+                Interval interval = mappingFrom.get(i);
+                if (interval != null) {
+                    boolean unique = usedRegs.add(interval.location());
+                    assert unique : "cannot read from same register twice";
+                }
+            }
+        }
+
+        usedRegs.clear();
+        for (i = 0; i < mappingTo.size(); i++) {
+            Interval interval = mappingTo.get(i);
+            boolean unique = usedRegs.add(interval.location());
+            assert unique : "cannot write to same register twice";
+        }
+
+        usedRegs.clear();
+        for (i = 0; i < mappingFrom.size(); i++) {
+            Interval interval = mappingFrom.get(i);
+            if (interval != null && !isRegister(interval.location())) {
+                usedRegs.add(interval.location());
+            }
+        }
+        for (i = 0; i < mappingTo.size(); i++) {
+            Interval interval = mappingTo.get(i);
+            assert !usedRegs.contains(interval.location()) || interval.location() == mappingFrom.get(i).location() : "stack slots used in mappingFrom must be disjoint to mappingTo";
+        }
+
+        return true;
+    }
+
+    // mark assignedReg and assignedRegHi of the interval as blocked
+    private void blockRegisters(Interval interval) {
+        CiValue location = interval.location();
+        if (isRegister(location)) {
+            int reg = asRegister(location).number;
+            assert multipleReadsAllowed || registerBlocked(reg) == 0 : "register already marked as used";
+            setRegisterBlocked(reg, 1);
+        }
+    }
+
+    // mark assignedReg and assignedRegHi of the interval as unblocked
+    private void unblockRegisters(Interval interval) {
+        CiValue location = interval.location();
+        if (isRegister(location)) {
+            int reg = asRegister(location).number;
+            assert registerBlocked(reg) > 0 : "register already marked as unused";
+            setRegisterBlocked(reg, -1);
+        }
+    }
+
+    /**
+     * Checks if the {@linkplain Interval#location() location} of {@code to} is not blocked
+     * or is only blocked by {@code from}.
+     */
+    private boolean safeToProcessMove(Interval from, Interval to) {
+        CiValue fromReg = from != null ? from.location() : null;
+
+        CiValue reg = to.location();
+        if (isRegister(reg)) {
+            if (registerBlocked(asRegister(reg).number) > 1 || (registerBlocked(asRegister(reg).number) == 1 && reg != fromReg)) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    private void createInsertionBuffer(List<LIRInstruction> list) {
+        assert !insertionBuffer.initialized() : "overwriting existing buffer";
+        insertionBuffer.init(list);
+    }
+
+    private void appendInsertionBuffer() {
+        if (insertionBuffer.initialized()) {
+            insertionBuffer.finish();
+        }
+        assert !insertionBuffer.initialized() : "must be uninitialized now";
+
+        insertIdx = -1;
+    }
+
+    private void insertMove(Interval fromInterval, Interval toInterval) {
+        assert fromInterval.operand != toInterval.operand : "from and to interval equal: " + fromInterval;
+        assert fromInterval.kind() == toInterval.kind() : "move between different types";
+        assert insertIdx != -1 : "must setup insert position first";
+
+        CiValue fromOpr = fromInterval.operand;
+        CiValue toOpr = toInterval.operand;
+
+        insertionBuffer.append(insertIdx, allocator.ir.spillMoveFactory.createMove(toOpr, fromOpr));
+
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("MoveResolver: inserted move from %d (%s) to %d (%s)", fromInterval.operandNumber, fromInterval.location(), toInterval.operandNumber, toInterval.location());
+        }
+    }
+
+    private void insertMove(CiValue fromOpr, Interval toInterval) {
+        assert fromOpr.kind == toInterval.kind() : "move between different types";
+        assert insertIdx != -1 : "must setup insert position first";
+
+        CiValue toOpr = toInterval.operand;
+        insertionBuffer.append(insertIdx, allocator.ir.spillMoveFactory.createMove(toOpr, fromOpr));
+
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.print("MoveResolver: inserted move from constant %s to %d (%s)", fromOpr, toInterval.operandNumber, toInterval.location());
+        }
+    }
+
+    private void resolveMappings() {
+        assert verifyBeforeResolve();
+
+        // Block all registers that are used as input operands of a move.
+        // When a register is blocked, no move to this register is emitted.
+        // This is necessary for detecting cycles in moves.
+        int i;
+        for (i = mappingFrom.size() - 1; i >= 0; i--) {
+            Interval fromInterval = mappingFrom.get(i);
+            if (fromInterval != null) {
+                blockRegisters(fromInterval);
+            }
+        }
+
+        int spillCandidate = -1;
+        while (mappingFrom.size() > 0) {
+            boolean processedInterval = false;
+
+            for (i = mappingFrom.size() - 1; i >= 0; i--) {
+                Interval fromInterval = mappingFrom.get(i);
+                Interval toInterval = mappingTo.get(i);
+
+                if (safeToProcessMove(fromInterval, toInterval)) {
+                    // this interval can be processed because target is free
+                    if (fromInterval != null) {
+                        insertMove(fromInterval, toInterval);
+                        unblockRegisters(fromInterval);
+                    } else {
+                        insertMove(mappingFromOpr.get(i), toInterval);
+                    }
+                    mappingFrom.remove(i);
+                    mappingFromOpr.remove(i);
+                    mappingTo.remove(i);
+
+                    processedInterval = true;
+                } else if (fromInterval != null && isRegister(fromInterval.location())) {
+                    // this interval cannot be processed now because target is not free
+                    // it starts in a register, so it is a possible candidate for spilling
+                    spillCandidate = i;
+                }
+            }
+
+            if (!processedInterval) {
+                // no move could be processed because there is a cycle in the move list
+                // (e.g. r1 . r2, r2 . r1), so one interval must be spilled to memory
+                assert spillCandidate != -1 : "no interval in register for spilling found";
+
+                // create a new spill interval and assign a stack slot to it
+                Interval fromInterval = mappingFrom.get(spillCandidate);
+                Interval spillInterval = allocator.createDerivedInterval(fromInterval);
+                spillInterval.setKind(fromInterval.kind());
+
+                // add a dummy range because real position is difficult to calculate
+                // Note: this range is a special case when the integrity of the allocation is checked
+                spillInterval.addRange(1, 2);
+
+                // do not allocate a new spill slot for temporary interval, but
+                // use spill slot assigned to fromInterval. Otherwise moves from
+                // one stack slot to another can happen (not allowed by LIRAssembler
+                CiStackSlot spillSlot = fromInterval.spillSlot();
+                if (spillSlot == null) {
+                    spillSlot = allocator.frameMap.allocateSpillSlot(spillInterval.kind());
+                    fromInterval.setSpillSlot(spillSlot);
+                }
+                spillInterval.assignLocation(spillSlot);
+
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    TTY.println("created new Interval %s for spilling", spillInterval.operand);
+                }
+
+                // insert a move from register to stack and update the mapping
+                insertMove(fromInterval, spillInterval);
+                mappingFrom.set(spillCandidate, spillInterval);
+                unblockRegisters(fromInterval);
+            }
+        }
+
+        // reset to default value
+        multipleReadsAllowed = false;
+
+        // check that all intervals have been processed
+        assert checkEmpty();
+    }
+
+    void setInsertPosition(List<LIRInstruction> insertList, int insertIdx) {
+        assert this.insertIdx == -1 : "use moveInsertPosition instead of setInsertPosition when data already set";
+
+        createInsertionBuffer(insertList);
+        this.insertIdx = insertIdx;
+    }
+
+    void moveInsertPosition(List<LIRInstruction> newInsertList, int newInsertIdx) {
+        if (insertionBuffer.lirList() != null && (insertionBuffer.lirList() != newInsertList || this.insertIdx != newInsertIdx)) {
+            // insert position changed . resolve current mappings
+            resolveMappings();
+        }
+
+        if (insertionBuffer.lirList() != newInsertList) {
+            // block changed . append insertionBuffer because it is
+            // bound to a specific block and create a new insertionBuffer
+            appendInsertionBuffer();
+            createInsertionBuffer(newInsertList);
+        }
+
+        this.insertIdx = newInsertIdx;
+    }
+
+    void addMapping(Interval fromInterval, Interval toInterval) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("MoveResolver: adding mapping from interval %d (%s) to interval %d (%s)", fromInterval.operandNumber, fromInterval.location(), toInterval.operandNumber, toInterval.location());
+        }
+
+        assert fromInterval.operand != toInterval.operand : "from and to interval equal: " + fromInterval;
+        assert fromInterval.kind() == toInterval.kind();
+        mappingFrom.add(fromInterval);
+        mappingFromOpr.add(CiValue.IllegalValue);
+        mappingTo.add(toInterval);
+    }
+
+    void addMapping(CiValue fromOpr, Interval toInterval) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("MoveResolver: adding mapping from %s to %d (%s)", fromOpr, toInterval.operandNumber, toInterval.location());
+        }
+        assert isConstant(fromOpr) : "only for constants";
+
+        mappingFrom.add(null);
+        mappingFromOpr.add(fromOpr);
+        mappingTo.add(toInterval);
+    }
+
+    void resolveAndAppendMoves() {
+        if (hasMappings()) {
+            resolveMappings();
+        }
+        appendInsertionBuffer();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Range.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+
+/**
+ * Represents a range of integers from a start (inclusive) to an end (exclusive.
+ */
+public final class Range {
+
+    public static final Range EndMarker = new Range(Integer.MAX_VALUE, Integer.MAX_VALUE, null);
+
+    /**
+     * The start of the range, inclusive.
+     */
+    public int from;
+
+    /**
+     * The end of the range, exclusive.
+     */
+    public int to;
+
+    /**
+     * A link to allow the range to be put into a singly linked list.
+     */
+    public Range next;
+
+    boolean intersects(Range r) {
+        return intersectsAt(r) != -1;
+    }
+
+
+    /**
+     * Creates a new range.
+     *
+     * @param from the start of the range, inclusive
+     * @param to the end of the range, exclusive
+     * @param next link to the next range in a linked list
+     */
+    Range(int from, int to, Range next) {
+        this.from = from;
+        this.to = to;
+        this.next = next;
+    }
+
+    int intersectsAt(Range other) {
+        Range r1 = this;
+        Range r2 = other;
+
+        assert r2 != null : "null ranges not allowed";
+        assert r1 != EndMarker && r2 != EndMarker : "empty ranges not allowed";
+
+        do {
+            if (r1.from < r2.from) {
+                if (r1.to <= r2.from) {
+                    r1 = r1.next;
+                    if (r1 == EndMarker) {
+                        return -1;
+                    }
+                } else {
+                    return r2.from;
+                }
+            } else {
+                if (r2.from < r1.from) {
+                    if (r2.to <= r1.from) {
+                        r2 = r2.next;
+                        if (r2 == EndMarker) {
+                            return -1;
+                        }
+                    } else {
+                        return r1.from;
+                    }
+                } else { // r1.from() == r2.from()
+                    if (r1.from == r1.to) {
+                        r1 = r1.next;
+                        if (r1 == EndMarker) {
+                            return -1;
+                        }
+                    } else {
+                        if (r2.from == r2.to) {
+                            r2 = r2.next;
+                            if (r2 == EndMarker) {
+                                return -1;
+                            }
+                        } else {
+                            return r1.from;
+                        }
+                    }
+                }
+            }
+        } while (true);
+    }
+
+    @Override
+    public String toString() {
+        return "[" + from + ", " + to + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.alloc;
+
+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.graal.compiler.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ */
+final class RegisterVerifier {
+
+    LinearScan allocator;
+    List<Block> workList; // all blocks that must be processed
+    ArrayMap<Interval[]> savedStates; // saved information of previous check
+
+    // simplified access to methods of LinearScan
+    Interval intervalAt(CiValue operand) {
+        return allocator.intervalFor(operand);
+    }
+
+    // currently, only registers are processed
+    int stateSize() {
+        return allocator.maxRegisterNumber() + 1;
+    }
+
+    // accessors
+    Interval[] stateForBlock(Block block) {
+        return savedStates.get(block.getId());
+    }
+
+    void setStateForBlock(Block block, Interval[] savedState) {
+        savedStates.put(block.getId(), savedState);
+    }
+
+    void addToWorkList(Block block) {
+        if (!workList.contains(block)) {
+            workList.add(block);
+        }
+    }
+
+    RegisterVerifier(LinearScan allocator) {
+        this.allocator = allocator;
+        workList = new ArrayList<>(16);
+        this.savedStates = new ArrayMap<>();
+
+    }
+
+    void verify(Block start) {
+        // setup input registers (method arguments) for first block
+        Interval[] inputState = new Interval[stateSize()];
+        setStateForBlock(start, inputState);
+        addToWorkList(start);
+
+        // main loop for verification
+        do {
+            Block block = workList.get(0);
+            workList.remove(0);
+
+            processBlock(block);
+        } while (!workList.isEmpty());
+    }
+
+    private void processBlock(Block block) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
+            TTY.println();
+            TTY.println("processBlock B%d", block.getId());
+        }
+
+        // must copy state because it is modified
+        Interval[] inputState = copy(stateForBlock(block));
+
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
+            TTY.println("Input-State of intervals:");
+            TTY.print("    ");
+            for (int i = 0; i < stateSize(); i++) {
+                if (inputState[i] != null) {
+                    TTY.print(" %4d", inputState[i].operandNumber);
+                } else {
+                    TTY.print("   __");
+                }
+            }
+            TTY.println();
+            TTY.println();
+        }
+
+        // process all operations of the block
+        processOperations(block.lir, inputState);
+
+        // iterate all successors
+        for (int i = 0; i < block.numberOfSux(); i++) {
+            Block succ = block.suxAt(i);
+            processSuccessor(succ, inputState);
+        }
+    }
+
+    private void processSuccessor(Block block, Interval[] inputState) {
+        Interval[] savedState = stateForBlock(block);
+
+        if (savedState != null) {
+            // this block was already processed before.
+            // check if new inputState is consistent with savedState
+
+            boolean savedStateCorrect = true;
+            for (int i = 0; i < stateSize(); i++) {
+                if (inputState[i] != savedState[i]) {
+                    // current inputState and previous savedState assume a different
+                    // interval in this register . assume that this register is invalid
+                    if (savedState[i] != null) {
+                        // invalidate old calculation only if it assumed that
+                        // register was valid. when the register was already invalid,
+                        // then the old calculation was correct.
+                        savedStateCorrect = false;
+                        savedState[i] = null;
+
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
+                            TTY.println("processSuccessor B%d: invalidating slot %d", block.getId(), i);
+                        }
+                    }
+                }
+            }
+
+            if (savedStateCorrect) {
+                // already processed block with correct inputState
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
+                    TTY.println("processSuccessor B%d: previous visit already correct", block.getId());
+                }
+            } else {
+                // must re-visit this block
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
+                    TTY.println("processSuccessor B%d: must re-visit because input state changed", block.getId());
+                }
+                addToWorkList(block);
+            }
+
+        } else {
+            // block was not processed before, so set initial inputState
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
+                TTY.println("processSuccessor B%d: initial visit", block.getId());
+            }
+
+            setStateForBlock(block, copy(inputState));
+            addToWorkList(block);
+        }
+    }
+
+    static Interval[] copy(Interval[] inputState) {
+        return inputState.clone();
+    }
+
+    static void statePut(Interval[] inputState, CiValue location, Interval interval) {
+        if (location != null && isRegister(location)) {
+            CiRegister reg = asRegister(location);
+            int regNum = reg.number;
+            if (interval != null) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    TTY.println("        %s = %s", reg, interval.operand);
+                }
+            } else if (inputState[regNum] != null) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
+                    TTY.println("        %s = null", reg);
+                }
+            }
+
+            inputState[regNum] = interval;
+        }
+    }
+
+    static boolean checkState(Interval[] inputState, CiValue reg, Interval interval) {
+        if (reg != null && isRegister(reg)) {
+            if (inputState[asRegister(reg).number] != interval) {
+                throw new GraalInternalError("!! Error in register allocation: register %s does not contain interval %s but interval %s", reg, interval.operand, inputState[asRegister(reg).number]);
+            }
+        }
+        return true;
+    }
+
+    void processOperations(List<LIRInstruction> ops, final Interval[] inputState) {
+        // visit all instructions of the block
+        for (int i = 0; i < ops.size(); i++) {
+            final LIRInstruction op = ops.get(i);
+
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
+                TTY.println(op.toStringWithIdPrefix());
+            }
+
+            ValueProcedure useProc = new ValueProcedure() {
+                @Override
+                public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+                    if (LinearScan.isVariableOrRegister(operand) && allocator.isProcessed(operand)) {
+                        Interval interval = intervalAt(operand);
+                        if (op.id() != -1) {
+                            interval = interval.getSplitChildAtOpId(op.id(), mode, allocator);
+                        }
+
+                        assert checkState(inputState, interval.location(), interval.splitParent());
+                    }
+                    return operand;
+                }
+            };
+
+            ValueProcedure defProc = new ValueProcedure() {
+                @Override
+                public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+                    if (LinearScan.isVariableOrRegister(operand) && allocator.isProcessed(operand)) {
+                        Interval interval = intervalAt(operand);
+                        if (op.id() != -1) {
+                            interval = interval.getSplitChildAtOpId(op.id(), mode, allocator);
+                        }
+
+                        statePut(inputState, interval.location(), interval.splitParent());
+                    }
+                    return operand;
+                }
+            };
+
+            // check if input operands are correct
+            op.forEachInput(useProc);
+            // invalidate all caller save registers at calls
+            if (op.hasCall()) {
+                for (CiRegister r : allocator.frameMap.registerConfig.getCallerSaveRegisters()) {
+                    statePut(inputState, r.asValue(), null);
+                }
+            }
+            op.forEachAlive(useProc);
+            // set temp operands (some operations use temp operands also as output operands, so can't set them null)
+            op.forEachTemp(defProc);
+            // set output operands
+            op.forEachOutput(defProc);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/debug/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+/**
+ * A collection of debugging aids for Graal development.
+ */
+package com.oracle.graal.compiler.debug;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.gen;
+
+import java.util.*;
+import java.util.Map.Entry;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.compiler.gen.LIRGenerator.LockScope;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.virtual.*;
+
+public class DebugInfoBuilder {
+    private final NodeMap<CiValue> nodeOperands;
+
+    public DebugInfoBuilder(NodeMap<CiValue> nodeOperands) {
+        this.nodeOperands = nodeOperands;
+    }
+
+
+    private HashMap<VirtualObjectNode, CiVirtualObject> virtualObjects = new HashMap<>();
+
+    public LIRDebugInfo build(FrameState topState, LockScope locks, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
+        assert virtualObjects.size() == 0;
+        CiFrame frame = computeFrameForState(topState, locks);
+
+        CiVirtualObject[] virtualObjectsArray = null;
+        if (virtualObjects.size() != 0) {
+            // collect all VirtualObjectField instances:
+            IdentityHashMap<VirtualObjectNode, VirtualObjectFieldNode> objectStates = new IdentityHashMap<>();
+            FrameState current = topState;
+            do {
+                for (Node n : current.virtualObjectMappings()) {
+                    VirtualObjectFieldNode field = (VirtualObjectFieldNode) n;
+                    // null states occur for objects with 0 fields
+                    if (field != null && !objectStates.containsKey(field.object())) {
+                        objectStates.put(field.object(), field);
+                    }
+                }
+                current = current.outerFrameState();
+            } while (current != null);
+            // fill in the CiVirtualObject values:
+            // during this process new CiVirtualObjects might be discovered, so repeat until no more changes occur.
+            boolean changed;
+            do {
+                changed = false;
+                IdentityHashMap<VirtualObjectNode, CiVirtualObject> virtualObjectsCopy = new IdentityHashMap<>(virtualObjects);
+                for (Entry<VirtualObjectNode, CiVirtualObject> entry : virtualObjectsCopy.entrySet()) {
+                    if (entry.getValue().values() == null) {
+                        VirtualObjectNode vobj = entry.getKey();
+                        if (vobj instanceof BoxedVirtualObjectNode) {
+                            BoxedVirtualObjectNode boxedVirtualObjectNode = (BoxedVirtualObjectNode) vobj;
+                            entry.getValue().setValues(new CiValue[]{toCiValue(boxedVirtualObjectNode.getUnboxedValue())});
+                        } else {
+                            CiValue[] values = new CiValue[vobj.fieldsCount()];
+                            entry.getValue().setValues(values);
+                            if (values.length > 0) {
+                                changed = true;
+                                ValueNode currentField = objectStates.get(vobj);
+                                assert currentField != null;
+                                do {
+                                    if (currentField instanceof VirtualObjectFieldNode) {
+                                        int index = ((VirtualObjectFieldNode) currentField).index();
+                                        if (values[index] == null) {
+                                            values[index] = toCiValue(((VirtualObjectFieldNode) currentField).input());
+                                        }
+                                        currentField = ((VirtualObjectFieldNode) currentField).lastState();
+                                    } else {
+                                        assert currentField instanceof PhiNode : currentField;
+                                        currentField = ((PhiNode) currentField).valueAt(0);
+                                    }
+                                } while (currentField != null);
+                            }
+                        }
+                    }
+                }
+            } while (changed);
+
+            virtualObjectsArray = virtualObjects.values().toArray(new CiVirtualObject[virtualObjects.size()]);
+            virtualObjects.clear();
+        }
+
+        return new LIRDebugInfo(frame, virtualObjectsArray, pointerSlots, exceptionEdge);
+    }
+
+    private CiFrame computeFrameForState(FrameState state, LockScope locks) {
+        int numLocals = state.localsSize();
+        int numStack = state.stackSize();
+        int numLocks = (locks != null && locks.callerState == state.outerFrameState()) ? locks.stateDepth + 1 : 0;
+
+        CiValue[] values = new CiValue[numLocals + numStack + numLocks];
+        for (int i = 0; i < numLocals; i++) {
+            values[i] = toCiValue(state.localAt(i));
+        }
+        for (int i = 0; i < numStack; i++) {
+            values[numLocals + i] = toCiValue(state.stackAt(i));
+        }
+
+        LockScope nextLock = locks;
+        for (int i = numLocks - 1; i >= 0; i--) {
+            assert locks != null && nextLock.callerState == state.outerFrameState() && nextLock.stateDepth == i;
+
+            CiValue owner = toCiValue(nextLock.monitor.object());
+            CiValue lockData = nextLock.lockData;
+            boolean eliminated = nextLock.monitor.eliminated();
+            values[numLocals + numStack + nextLock.stateDepth] = new CiMonitorValue(owner, lockData, eliminated);
+
+            nextLock = nextLock.outer;
+        }
+
+        CiFrame caller = null;
+        if (state.outerFrameState() != null) {
+            caller = computeFrameForState(state.outerFrameState(), nextLock);
+        } else {
+            if (nextLock != null) {
+                throw new CiBailout("unbalanced monitors: found monitor for unknown frame");
+            }
+        }
+        assert state.bci >= 0 || state.bci == FrameState.BEFORE_BCI;
+        CiFrame frame = new CiFrame(caller, state.method(), state.bci, state.rethrowException(), state.duringCall(), values, state.localsSize(), state.stackSize(), numLocks);
+        return frame;
+    }
+
+    private CiValue toCiValue(ValueNode value) {
+        if (value instanceof VirtualObjectNode) {
+            VirtualObjectNode obj = (VirtualObjectNode) value;
+            CiVirtualObject ciObj = virtualObjects.get(value);
+            if (ciObj == null) {
+                ciObj = CiVirtualObject.get(obj.type(), null, virtualObjects.size());
+                virtualObjects.put(obj, ciObj);
+            }
+            Debug.metric("StateVirtualObjects").increment();
+            return ciObj;
+
+        } else if (value instanceof ConstantNode) {
+            Debug.metric("StateConstants").increment();
+            return ((ConstantNode) value).value;
+
+        } else if (value != null) {
+            Debug.metric("StateVariables").increment();
+            CiValue operand = nodeOperands.get(value);
+            assert operand != null && (operand instanceof Variable || operand instanceof CiConstant);
+            return operand;
+
+        } else {
+            // return a dummy value because real value not needed
+            Debug.metric("StateIllegals").increment();
+            return CiValue.IllegalValue;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/InstructionPrinter.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.gen;
+
+import static com.oracle.graal.compiler.gen.InstructionPrinter.InstructionLineColumn.*;
+
+import com.oracle.max.criutils.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * A {@link ValueVisitor} for {@linkplain #printInstruction(ValueNode) printing}
+ * an {@link FixedWithNextNode} as an expression or statement.
+ */
+public class InstructionPrinter {
+
+
+    /**
+     * The columns printed in a tabulated instruction
+     * {@linkplain InstructionPrinter#printInstructionListing(ValueNode) listing}.
+     */
+    public enum InstructionLineColumn {
+        /**
+         * The instruction's bytecode index.
+         */
+        BCI(2, "bci"),
+
+        /**
+         * The instruction's use count.
+         */
+        USE(7, "use"),
+
+        /**
+         * The instruction as a {@linkplain com.oracle.graal.compiler.util.Util#valueString(com.oracle.graal.compiler.ir.Value) value}.
+         */
+        VALUE(12, "tid"),
+
+        /**
+         * The instruction formatted as an expression or statement.
+         */
+        INSTRUCTION(19, "instr"),
+
+        END(60, "");
+
+        final int position;
+        final String label;
+
+        private InstructionLineColumn(int position, String label) {
+            this.position = position;
+            this.label = label;
+        }
+
+        /**
+         * Prints this column's label to a given stream after padding the stream with '_' characters
+         * until its {@linkplain LogStream#position() position} is equal to this column's position.
+         * @param out the print stream
+         */
+        public void printLabel(LogStream out) {
+            out.fillTo(position + out.indentationLevel(), '_');
+            out.print(label);
+        }
+
+        /**
+         * Prints space characters to a given stream until its {@linkplain LogStream#position() position}
+         * is equal to this column's position.
+         * @param out the print stream
+         */
+        public void advance(LogStream out) {
+            out.fillTo(position + out.indentationLevel(), ' ');
+        }
+    }
+
+    private final LogStream out;
+
+    public InstructionPrinter(LogStream out) {
+        this.out = out;
+    }
+
+    public LogStream out() {
+        return out;
+    }
+
+    /**
+     * Prints a header for the tabulated data printed by {@link #printInstructionListing(ValueNode)}.
+     */
+    public void printInstructionListingHeader() {
+        BCI.printLabel(out);
+        USE.printLabel(out);
+        VALUE.printLabel(out);
+        INSTRUCTION.printLabel(out);
+        END.printLabel(out);
+        out.println();
+    }
+
+    /**
+     * Prints an instruction listing on one line. The instruction listing is composed of the
+     * columns specified by {@link InstructionLineColumn}.
+     *
+     * @param instruction the instruction to print
+     */
+    public void printInstructionListing(ValueNode instruction) {
+        int indentation = out.indentationLevel();
+        out.fillTo(BCI.position + indentation, ' ').
+             print(0).
+             fillTo(USE.position + indentation, ' ').
+             print("0").
+             fillTo(VALUE.position + indentation, ' ').
+             print(ValueUtil.valueString(instruction)).
+             fillTo(INSTRUCTION.position + indentation, ' ');
+        printInstruction(instruction);
+        if (instruction instanceof StateSplit) {
+            out.print("  [state: " + ((StateSplit) instruction).stateAfter() + "]");
+        }
+        out.println();
+    }
+
+    public void printInstruction(ValueNode node) {
+        out.print(node.toString());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,1482 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.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.ci.CiValueUtil.*;
+import static com.oracle.max.cri.util.MemoryBarriers.*;
+import static com.oracle.graal.lir.ValueUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.asm.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.Mark;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.Representation;
+import com.oracle.max.cri.xir.CiXirAssembler.XirConstant;
+import com.oracle.max.cri.xir.CiXirAssembler.XirInstruction;
+import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
+import com.oracle.max.cri.xir.CiXirAssembler.XirOperand;
+import com.oracle.max.cri.xir.CiXirAssembler.XirParameter;
+import com.oracle.max.cri.xir.CiXirAssembler.XirRegister;
+import com.oracle.max.cri.xir.CiXirAssembler.XirTemp;
+import com.oracle.max.cri.xir.*;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.StandardOp.JumpOp;
+import com.oracle.graal.lir.StandardOp.LabelOp;
+import com.oracle.graal.lir.StandardOp.ParametersOp;
+import com.oracle.graal.lir.StandardOp.PhiJumpOp;
+import com.oracle.graal.lir.StandardOp.PhiLabelOp;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+import com.oracle.graal.nodes.PhiNode.PhiType;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.virtual.*;
+
+/**
+ * This class traverses the HIR instructions and generates LIR instructions from them.
+ */
+public abstract class LIRGenerator extends LIRGeneratorTool {
+    protected final Graph graph;
+    protected final RiRuntime runtime;
+    protected final CiTarget target;
+    protected final RiResolvedMethod method;
+    protected final FrameMap frameMap;
+    public final NodeMap<CiValue> nodeOperands;
+
+    protected final LIR lir;
+    protected final XirSupport xirSupport;
+    protected final RiXirGenerator xir;
+    private final DebugInfoBuilder debugInfoBuilder;
+
+    private Block currentBlock;
+    private ValueNode currentInstruction;
+    private ValueNode lastInstructionPrinted; // Debugging only
+    private FrameState lastState;
+
+    /**
+     * Class used to reconstruct the nesting of locks that is required for debug information.
+     */
+    public static class LockScope {
+        /**
+         * Linked list of locks. {@link LIRGenerator#curLocks} is the head of the list.
+         */
+        public final LockScope outer;
+
+        /**
+         * The frame state of the caller of the method performing the lock, or null if the outermost method
+         * performs the lock. This information is used to compute the {@link CiFrame} that this lock belongs to.
+         * We cannot use the actual frame state of the locking method, because it is not unique for a method. The
+         * caller frame states are unique, i.e., all frame states of inlined methods refer to the same caller frame state.
+         */
+        public final FrameState callerState;
+
+        /**
+         * The number of locks already found for this frame state.
+         */
+        public final int stateDepth;
+
+        /**
+         * The monitor enter node, with information about the object that is locked and the elimination status.
+         */
+        public final MonitorEnterNode monitor;
+
+        /**
+         * Space in the stack frame needed by the VM to perform the locking.
+         */
+        public final CiStackSlot lockData;
+
+        public LockScope(LockScope outer, FrameState callerState, MonitorEnterNode monitor, CiStackSlot lockData) {
+            this.outer = outer;
+            this.callerState = callerState;
+            this.monitor = monitor;
+            this.lockData = lockData;
+            if (outer != null && outer.callerState == callerState) {
+                this.stateDepth = outer.stateDepth + 1;
+            } else {
+                this.stateDepth = 0;
+            }
+        }
+    }
+
+    /**
+     * Mapping from blocks to the lock state at the end of the block, indexed by the id number of the block.
+     */
+    private BlockMap<LockScope> blockLocks;
+
+    private BlockMap<FrameState> blockLastState;
+
+    /**
+     * The list of currently locked monitors.
+     */
+    private LockScope curLocks;
+
+
+    public LIRGenerator(Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
+        this.graph = graph;
+        this.runtime = runtime;
+        this.target = target;
+        this.frameMap = frameMap;
+        this.method = method;
+        this.nodeOperands = graph.createNodeMap();
+        this.lir = lir;
+        this.xir = xir;
+        this.xirSupport = new XirSupport();
+        this.debugInfoBuilder = new DebugInfoBuilder(nodeOperands);
+        this.blockLocks = new BlockMap<>(lir.cfg);
+        this.blockLastState = new BlockMap<>(lir.cfg);
+    }
+
+    @Override
+    public CiTarget target() {
+        return target;
+    }
+
+    /**
+     * Returns the operand that has been previously initialized by {@link #setResult()}
+     * with the result of an instruction.
+     * @param node A node that produces a result value.
+     */
+    @Override
+    public CiValue operand(ValueNode node) {
+        if (nodeOperands == null) {
+            return null;
+        }
+        return nodeOperands.get(node);
+    }
+
+    /**
+     * Creates a new {@linkplain Variable variable}.
+     * @param kind The kind of the new variable.
+     * @return a new variable
+     */
+    @Override
+    public Variable newVariable(CiKind kind) {
+        CiKind stackKind = kind.stackKind();
+        switch (stackKind) {
+            case Jsr:
+            case Int:
+            case Long:
+            case Object:
+                return new Variable(stackKind, lir.nextVariable(), CiRegister.RegisterFlag.CPU);
+            case Float:
+            case Double:
+                return new Variable(stackKind, lir.nextVariable(), CiRegister.RegisterFlag.FPU);
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    @Override
+    public CiValue setResult(ValueNode x, CiValue operand) {
+        assert (isVariable(operand) && x.kind() == operand.kind) || (isConstant(operand) && x.kind() == operand.kind.stackKind()) : operand.kind + " for node " + x;
+
+        assert operand(x) == null : "operand cannot be set twice";
+        assert operand != null && isLegal(operand) : "operand must be legal";
+        assert operand.kind.stackKind() == x.kind();
+        assert !(x instanceof VirtualObjectNode);
+        nodeOperands.set(x, operand);
+        return operand;
+    }
+
+    @Override
+    public abstract Variable emitMove(CiValue input);
+
+    public Variable load(CiValue value) {
+        if (!isVariable(value)) {
+            return emitMove(value);
+        }
+        return (Variable) value;
+    }
+
+    public CiValue loadNonConst(CiValue value) {
+        if (isConstant(value) && !canInlineConstant((CiConstant) value)) {
+            return emitMove(value);
+        }
+        return value;
+    }
+
+    public CiValue loadForStore(CiValue value, CiKind storeKind) {
+        if (isConstant(value) && canStoreConstant((CiConstant) value)) {
+            return value;
+        }
+        if (storeKind == CiKind.Byte || storeKind == CiKind.Boolean) {
+            Variable tempVar = new Variable(value.kind, lir.nextVariable(), CiRegister.RegisterFlag.Byte);
+            emitMove(value, tempVar);
+            return tempVar;
+        }
+        return load(value);
+    }
+
+    protected LabelRef getLIRBlock(FixedNode b) {
+        Block result = lir.cfg.blockFor(b);
+        int suxIndex = currentBlock.getSuccessors().indexOf(result);
+        assert suxIndex != -1 : "Block not in successor list of current block";
+
+        return LabelRef.forSuccessor(currentBlock, suxIndex);
+    }
+
+    public LIRDebugInfo state() {
+        assert lastState != null : "must have state before instruction";
+        return stateFor(lastState);
+    }
+
+    public LIRDebugInfo stateFor(FrameState state) {
+        return stateFor(state, null, null);
+    }
+
+    public LIRDebugInfo stateFor(FrameState state, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
+        return debugInfoBuilder.build(state, curLocks, pointerSlots, exceptionEdge);
+    }
+
+    /**
+     * Gets the ABI specific operand used to return a value of a given kind from a method.
+     *
+     * @param kind the kind of value being returned
+     * @return the operand representing the ABI defined location used return a value of kind {@code kind}
+     */
+    public CiValue resultOperandFor(CiKind kind) {
+        if (kind == CiKind.Void) {
+            return IllegalValue;
+        }
+        return frameMap.registerConfig.getReturnRegister(kind).asValue(kind);
+    }
+
+
+    public void append(LIRInstruction op) {
+        assert LIRVerifier.verify(op);
+        if (GraalOptions.PrintIRWithLIR && !TTY.isSuppressed()) {
+            if (currentInstruction != null && lastInstructionPrinted != currentInstruction) {
+                lastInstructionPrinted = currentInstruction;
+                InstructionPrinter ip = new InstructionPrinter(TTY.out());
+                ip.printInstructionListing(currentInstruction);
+            }
+            TTY.println(op.toStringWithIdPrefix());
+            TTY.println();
+        }
+        currentBlock.lir.add(op);
+    }
+
+    public void doBlock(Block block) {
+        if (GraalOptions.PrintIRWithLIR) {
+            TTY.print(block.toString());
+        }
+
+        currentBlock = block;
+        // set up the list of LIR instructions
+        assert block.lir == null : "LIR list already computed for this block";
+        block.lir = new ArrayList<>();
+
+        if (GraalOptions.AllocSSA && block.getBeginNode() instanceof MergeNode) {
+            assert phiValues.isEmpty();
+            MergeNode merge = (MergeNode) block.getBeginNode();
+            for (PhiNode phi : merge.phis()) {
+                if (phi.type() == PhiType.Value) {
+                    CiValue phiValue = newVariable(phi.kind());
+                    setResult(phi, phiValue);
+                    phiValues.add(phiValue);
+                }
+            }
+            append(new PhiLabelOp(new Label(), block.align, phiValues.toArray(new CiValue[phiValues.size()])));
+            phiValues.clear();
+        } else {
+            append(new LabelOp(new Label(), block.align));
+        }
+
+        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
+            TTY.println("BEGIN Generating LIR for block B" + block.getId());
+        }
+
+        curLocks = null;
+        for (Block pred : block.getPredecessors()) {
+            LockScope predLocks = blockLocks.get(pred);
+            if (curLocks == null) {
+                curLocks = predLocks;
+            } else if (curLocks != predLocks && (!pred.isLoopEnd() || predLocks != null)) {
+                throw new CiBailout("unbalanced monitors: predecessor blocks have different monitor states");
+            }
+        }
+
+        if (block == lir.cfg.getStartBlock()) {
+            assert block.getPredecessors().size() == 0;
+            emitPrologue();
+
+        } else {
+            assert block.getPredecessors().size() > 0;
+            FrameState fs = null;
+
+            for (Block pred : block.getPredecessors()) {
+                if (fs == null) {
+                    fs = blockLastState.get(pred);
+                } else if (fs != blockLastState.get(pred)) {
+                    fs = null;
+                    break;
+                }
+            }
+            if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
+                if (fs == null) {
+                    TTY.println("STATE RESET");
+                } else {
+                    TTY.println("STATE CHANGE (singlePred)");
+                    if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
+                        TTY.println(fs.toString(Node.Verbosity.Debugger));
+                    }
+                }
+            }
+            lastState = fs;
+        }
+
+        List<Node> nodes = lir.nodesFor(block);
+        for (int i = 0; i < nodes.size(); i++) {
+            Node instr = nodes.get(i);
+
+            if (GraalOptions.OptImplicitNullChecks) {
+                Node nextInstr = null;
+                if (i < nodes.size() - 1) {
+                    nextInstr = nodes.get(i + 1);
+                }
+
+                if (instr instanceof GuardNode) {
+                    GuardNode guardNode = (GuardNode) instr;
+                    if (guardNode.condition() instanceof NullCheckNode) {
+                        NullCheckNode nullCheckNode = (NullCheckNode) guardNode.condition();
+                        if (!nullCheckNode.expectedNull && nextInstr instanceof Access) {
+                            Access access = (Access) nextInstr;
+                            if (nullCheckNode.object() == access.object() && canBeNullCheck(access.location())) {
+                                //TTY.println("implicit null check");
+                                access.setNullCheck(true);
+                                continue;
+                            }
+                        }
+                    }
+                }
+            }
+            if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
+                TTY.println("LIRGen for " + instr);
+            }
+            FrameState stateAfter = null;
+            if (instr instanceof StateSplit) {
+                stateAfter = ((StateSplit) instr).stateAfter();
+            }
+            if (instr instanceof ValueNode) {
+                try {
+                    doRoot((ValueNode) instr);
+                } catch (Throwable e) {
+                    throw new GraalInternalError(e).addContext(instr);
+                }
+            }
+            if (stateAfter != null) {
+                lastState = stateAfter;
+                assert checkStateReady(lastState);
+                if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
+                    TTY.println("STATE CHANGE");
+                    if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
+                        TTY.println(stateAfter.toString(Node.Verbosity.Debugger));
+                    }
+                }
+            }
+        }
+        if (block.numberOfSux() >= 1 && !endsWithJump(block)) {
+            NodeSuccessorsIterable successors = block.getEndNode().successors();
+            assert successors.isNotEmpty() : "should have at least one successor : " + block.getEndNode();
+
+            emitJump(getLIRBlock((FixedNode) successors.first()), null);
+        }
+
+        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
+            TTY.println("END Generating LIR for block B" + block.getId());
+        }
+
+        blockLocks.put(currentBlock, curLocks);
+        blockLastState.put(block, lastState);
+        currentBlock = null;
+
+        if (GraalOptions.PrintIRWithLIR) {
+            TTY.println();
+        }
+    }
+
+    private boolean checkStateReady(FrameState state) {
+        FrameState fs = state;
+        while (fs != null) {
+            for (ValueNode v : fs.values()) {
+                if (v != null && !(v instanceof VirtualObjectNode)) {
+                    assert operand(v) != null : "Value " + v + " in " + fs + " is not ready!";
+                }
+            }
+            fs =  fs.outerFrameState();
+        }
+        return true;
+    }
+
+    private static boolean endsWithJump(Block block) {
+        if (block.lir.size() == 0) {
+            return false;
+        }
+        LIRInstruction lirInstruction = block.lir.get(block.lir.size() - 1);
+        if (lirInstruction instanceof LIRXirInstruction) {
+            LIRXirInstruction lirXirInstruction = (LIRXirInstruction) lirInstruction;
+            return (lirXirInstruction.falseSuccessor != null) && (lirXirInstruction.trueSuccessor != null);
+        }
+        return lirInstruction instanceof StandardOp.JumpOp;
+    }
+
+    private void doRoot(ValueNode instr) {
+        if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
+            TTY.println("Emitting LIR for instruction " + instr);
+        }
+        currentInstruction = instr;
+
+        Debug.log("Visiting %s", instr);
+        emitNode(instr);
+        Debug.log("Operand for %s = %s", instr, operand(instr));
+    }
+
+    protected void emitNode(ValueNode node) {
+        ((LIRLowerable) node).generate(this);
+    }
+
+    private static boolean canBeNullCheck(LocationNode location) {
+        // TODO: Make this part of CiTarget
+        return !(location instanceof IndexedLocationNode) && location.displacement() < 4096;
+    }
+
+    private void emitPrologue() {
+        CiCallingConvention incomingArguments = frameMap.registerConfig.getCallingConvention(JavaCallee, CiUtil.signatureToKinds(method), target, false);
+
+        CiValue[] params = new CiValue[incomingArguments.locations.length];
+        for (int i = 0; i < params.length; i++) {
+            params[i] = toStackKind(incomingArguments.locations[i]);
+        }
+        append(new ParametersOp(params));
+
+        XirSnippet prologue = xir.genPrologue(null, method);
+        if (prologue != null) {
+            emitXir(prologue, null, null, false);
+        }
+
+        for (LocalNode local : graph.getNodes(LocalNode.class)) {
+            CiValue param = params[local.index()];
+            assert param.kind == local.kind().stackKind();
+            setResult(local, emitMove(param));
+        }
+    }
+
+    @Override
+    public void visitArrayLength(ArrayLengthNode x) {
+        XirArgument array = toXirArgument(x.array());
+        XirSnippet snippet = xir.genArrayLength(site(x, x.array()), array);
+        emitXir(snippet, x, state(), true);
+        operand(x);
+    }
+
+    @Override
+    public void visitCheckCast(CheckCastNode x) {
+        if (x.emitCode()) {
+            XirSnippet snippet = xir.genCheckCast(site(x, x.object()), toXirArgument(x.object()), toXirArgument(x.targetClassInstruction()), x.targetClass(), x.hints(), x.hintsExact());
+            emitXir(snippet, x, state(), true);
+        }
+        // The result of a checkcast is the unmodified object, so no need to allocate a new variable for it.
+        setResult(x, operand(x.object()));
+    }
+
+    @Override
+    public void visitMonitorEnter(MonitorEnterNode x) {
+        CiStackSlot lockData = frameMap.allocateStackBlock(runtime.sizeOfLockData(), false);
+        if (x.eliminated()) {
+            // No code is emitted for eliminated locks, but for proper debug information generation we need to
+            // register the monitor and its lock data.
+            curLocks = new LockScope(curLocks, x.stateAfter().outerFrameState(), x, lockData);
+            return;
+        }
+
+        XirArgument obj = toXirArgument(x.object());
+        XirArgument lockAddress = lockData == null ? null : toXirArgument(emitLea(lockData));
+
+        LIRDebugInfo stateBefore = state();
+        // The state before the monitor enter is used for null checks, so it must not contain the newly locked object.
+        curLocks = new LockScope(curLocks, x.stateAfter().outerFrameState(), x, lockData);
+        // The state after the monitor enter is used for deoptimization, after the monitor has blocked, so it must contain the newly locked object.
+        LIRDebugInfo stateAfter = stateFor(x.stateAfter());
+
+        XirSnippet snippet = xir.genMonitorEnter(site(x, x.object()), obj, lockAddress);
+        emitXir(snippet, x, stateBefore, stateAfter, true, null, null);
+    }
+
+    @Override
+    public void visitMonitorExit(MonitorExitNode x) {
+        if (curLocks == null || curLocks.monitor.object() != x.object() || curLocks.monitor.eliminated() != x.eliminated()) {
+            throw new CiBailout("unbalanced monitors: attempting to unlock an object that is not on top of the locking stack");
+        }
+        if (x.eliminated()) {
+            curLocks = curLocks.outer;
+            return;
+        }
+
+        CiStackSlot lockData = curLocks.lockData;
+        XirArgument obj = toXirArgument(x.object());
+        XirArgument lockAddress = lockData == null ? null : toXirArgument(emitLea(lockData));
+
+        LIRDebugInfo stateBefore = state();
+        curLocks = curLocks.outer;
+
+        XirSnippet snippet = xir.genMonitorExit(site(x, x.object()), obj, lockAddress);
+        emitXir(snippet, x, stateBefore, true);
+    }
+
+    @Override
+    public void visitLoadField(LoadFieldNode x) {
+        RiField field = x.field();
+        LIRDebugInfo info = state();
+        if (x.isVolatile()) {
+            emitMembar(JMM_PRE_VOLATILE_READ);
+        }
+        XirArgument receiver = toXirArgument(x.object());
+        XirSnippet snippet = x.isStatic() ? xir.genGetStatic(site(x, x.object()), receiver, field) : xir.genGetField(site(x, x.object()), receiver, field);
+        emitXir(snippet, x, info, true);
+        if (x.isVolatile()) {
+            emitMembar(JMM_POST_VOLATILE_READ);
+        }
+    }
+
+    @Override
+    public void visitStoreField(StoreFieldNode x) {
+        RiField field = x.field();
+        LIRDebugInfo info = state();
+        if (x.isVolatile()) {
+            emitMembar(JMM_PRE_VOLATILE_WRITE);
+        }
+        XirArgument receiver = toXirArgument(x.object());
+        XirArgument value = toXirArgument(x.value());
+        XirSnippet snippet = x.isStatic() ? xir.genPutStatic(site(x, x.object()), receiver, field, value) : xir.genPutField(site(x, x.object()), receiver, field, value);
+        emitXir(snippet, x, info, true);
+        if (x.isVolatile()) {
+            emitMembar(JMM_POST_VOLATILE_WRITE);
+        }
+    }
+
+    @Override
+    public void visitLoadIndexed(LoadIndexedNode x) {
+        XirArgument array = toXirArgument(x.array());
+        XirArgument index = toXirArgument(x.index());
+        XirSnippet snippet = xir.genArrayLoad(site(x, x.array()), array, index, x.elementKind(), null);
+        emitXir(snippet, x, state(), true);
+    }
+
+    @Override
+    public void visitStoreIndexed(StoreIndexedNode x) {
+        XirArgument array = toXirArgument(x.array());
+        XirArgument index = toXirArgument(x.index());
+        XirArgument value = toXirArgument(x.value());
+        XirSnippet snippet = xir.genArrayStore(site(x, x.array()), array, index, value, x.elementKind(), null);
+        emitXir(snippet, x, state(), true);
+    }
+
+    @Override
+    public void visitNewInstance(NewInstanceNode x) {
+        XirSnippet snippet = xir.genNewInstance(site(x), x.instanceClass());
+        emitXir(snippet, x, state(), true);
+    }
+
+    @Override
+    public void visitNewTypeArray(NewTypeArrayNode x) {
+        XirArgument length = toXirArgument(x.length());
+        XirSnippet snippet = xir.genNewArray(site(x), length, x.elementType().kind(true), null, null);
+        emitXir(snippet, x, state(), true);
+    }
+
+    @Override
+    public void visitNewObjectArray(NewObjectArrayNode x) {
+        XirArgument length = toXirArgument(x.length());
+        XirSnippet snippet = xir.genNewArray(site(x), length, CiKind.Object, x.elementType(), x.exactType());
+        emitXir(snippet, x, state(), true);
+    }
+
+    @Override
+    public void visitNewMultiArray(NewMultiArrayNode x) {
+        XirArgument[] dims = new XirArgument[x.dimensionCount()];
+        for (int i = 0; i < dims.length; i++) {
+            dims[i] = toXirArgument(x.dimension(i));
+        }
+        XirSnippet snippet = xir.genNewMultiArray(site(x), dims, x.type());
+        emitXir(snippet, x, state(), true);
+    }
+
+    @Override
+    public void visitExceptionObject(ExceptionObjectNode x) {
+        XirSnippet snippet = xir.genExceptionObject(site(x));
+        LIRDebugInfo info = state();
+        emitXir(snippet, x, info, true);
+    }
+
+    @Override
+    public void visitReturn(ReturnNode x) {
+        CiValue operand = CiValue.IllegalValue;
+        if (!x.kind().isVoid()) {
+            operand = resultOperandFor(x.kind());
+            emitMove(operand(x.result()), operand);
+        }
+        XirSnippet epilogue = xir.genEpilogue(site(x), method);
+        if (epilogue != null) {
+            emitXir(epilogue, x, null, false);
+            emitReturn(operand);
+        }
+    }
+
+    protected abstract void emitReturn(CiValue input);
+
+    @SuppressWarnings("unused")
+    protected void postGCWriteBarrier(CiValue addr, CiValue newVal) {
+        XirSnippet writeBarrier = xir.genWriteBarrier(toXirArgument(addr));
+        if (writeBarrier != null) {
+            emitXir(writeBarrier, null, null, false);
+        }
+     }
+
+    @SuppressWarnings("unused")
+    protected void preGCWriteBarrier(CiValue addrOpr, boolean patch, LIRDebugInfo info) {
+        // TODO (thomaswue): Implement this.
+    }
+
+
+
+    @Override
+    public void visitMerge(MergeNode x) {
+    }
+
+    @Override
+    public void visitEndNode(EndNode end) {
+        moveToPhi(end.merge(), end);
+    }
+
+    @Override
+    public void visitLoopEnd(LoopEndNode x) {
+        if (GraalOptions.GenLoopSafepoints && x.hasSafepointPolling()) {
+            emitSafepointPoll(x);
+        }
+    }
+
+    private ArrayList<CiValue> phiValues = new ArrayList<>();
+
+    private void moveToPhi(MergeNode merge, EndNode pred) {
+        if (GraalOptions.AllocSSA) {
+            assert phiValues.isEmpty();
+            for (PhiNode phi : merge.phis()) {
+                if (phi.type() == PhiType.Value) {
+                    phiValues.add(operand(phi.valueAt(pred)));
+                }
+            }
+            append(new PhiJumpOp(getLIRBlock(merge), phiValues.toArray(new CiValue[phiValues.size()])));
+            phiValues.clear();
+            return;
+        }
+
+        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
+            TTY.println("MOVE TO PHI from " + pred + " to " + merge);
+        }
+        PhiResolver resolver = new PhiResolver(this);
+        for (PhiNode phi : merge.phis()) {
+            if (phi.type() == PhiType.Value) {
+                ValueNode curVal = phi.valueAt(pred);
+                resolver.move(operand(curVal), operandForPhi(phi));
+            }
+        }
+        resolver.dispose();
+
+        append(new JumpOp(getLIRBlock(merge), null));
+    }
+
+    private CiValue operandForPhi(PhiNode phi) {
+        assert phi.type() == PhiType.Value : "wrong phi type: " + phi;
+        CiValue result = operand(phi);
+        if (result == null) {
+            // allocate a variable for this phi
+            Variable newOperand = newVariable(phi.kind());
+            setResult(phi, newOperand);
+            return newOperand;
+        } else {
+            return result;
+        }
+    }
+
+
+    public void emitSafepointPoll(FixedNode x) {
+        if (!lastState.method().noSafepointPolls()) {
+            XirSnippet snippet = xir.genSafepointPoll(site(x));
+            emitXir(snippet, x, state(), false);
+        }
+    }
+
+    @Override
+    public void emitIf(IfNode x) {
+        assert x.defaultSuccessor() == x.falseSuccessor() : "wrong destination";
+        emitBranch(x.compare(), getLIRBlock(x.trueSuccessor()),  getLIRBlock(x.falseSuccessor()), null);
+    }
+
+    @Override
+    public void emitGuardCheck(BooleanNode comp) {
+        if (comp instanceof NullCheckNode && !((NullCheckNode) comp).expectedNull) {
+            emitNullCheckGuard((NullCheckNode) comp);
+        } else if (comp instanceof ConstantNode && comp.asConstant().asBoolean()) {
+            // True constant, nothing to emit.
+        } else {
+            // Fall back to a normal branch.
+            LIRDebugInfo info = state();
+            LabelRef stubEntry = createDeoptStub(DeoptAction.InvalidateReprofile, info, comp);
+            emitBranch(comp, null, stubEntry, info);
+        }
+    }
+
+    protected abstract void emitNullCheckGuard(NullCheckNode node);
+
+    public void emitBranch(BooleanNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
+        if (node instanceof NullCheckNode) {
+            emitNullCheckBranch((NullCheckNode) node, trueSuccessor, falseSuccessor, info);
+        } else if (node instanceof CompareNode) {
+            emitCompareBranch((CompareNode) node, trueSuccessor, falseSuccessor, info);
+        } else if (node instanceof InstanceOfNode) {
+            emitInstanceOfBranch((InstanceOfNode) node, trueSuccessor, falseSuccessor, info);
+        } else if (node instanceof ConstantNode) {
+            emitConstantBranch(((ConstantNode) node).asConstant().asBoolean(), trueSuccessor, falseSuccessor, info);
+        } else if (node instanceof IsTypeNode) {
+            emitTypeBranch((IsTypeNode) node, trueSuccessor, falseSuccessor, info);
+        } else {
+            throw GraalInternalError.unimplemented(node.toString());
+        }
+    }
+
+    private void emitNullCheckBranch(NullCheckNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
+        Condition cond = node.expectedNull ? Condition.NE : Condition.EQ;
+        emitBranch(operand(node.object()), CiConstant.NULL_OBJECT, cond, false, falseSuccessor, info);
+        if (trueSuccessor != null) {
+            emitJump(trueSuccessor, null);
+        }
+    }
+
+    public void emitCompareBranch(CompareNode compare, LabelRef trueSuccessorBlock, LabelRef falseSuccessorBlock, LIRDebugInfo info) {
+        emitBranch(operand(compare.x()), operand(compare.y()), compare.condition().negate(), !compare.unorderedIsTrue(), falseSuccessorBlock, info);
+        if (trueSuccessorBlock != null) {
+            emitJump(trueSuccessorBlock, null);
+        }
+    }
+
+    private void emitInstanceOfBranch(InstanceOfNode x, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
+        XirArgument obj = toXirArgument(x.object());
+        XirSnippet snippet = xir.genInstanceOf(site(x, x.object()), obj, toXirArgument(x.targetClassInstruction()), x.targetClass(), x.hints(), x.hintsExact());
+        emitXir(snippet, x, info, null, false, x.negated() ? falseSuccessor : trueSuccessor, x.negated() ? trueSuccessor : falseSuccessor);
+    }
+
+    public void emitConstantBranch(boolean value, LabelRef trueSuccessorBlock, LabelRef falseSuccessorBlock, LIRDebugInfo info) {
+        LabelRef block = value ? trueSuccessorBlock : falseSuccessorBlock;
+        if (block != null) {
+            emitJump(block, info);
+        }
+    }
+
+    public void emitTypeBranch(IsTypeNode x, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
+        XirArgument thisClass = toXirArgument(x.objectClass());
+        XirArgument otherClass = toXirArgument(x.type().getEncoding(Representation.ObjectHub));
+        XirSnippet snippet = xir.genTypeBranch(site(x), thisClass, otherClass, x.type());
+        emitXir(snippet, x, info, null, false, trueSuccessor, falseSuccessor);
+        if (trueSuccessor != null) {
+            emitJump(trueSuccessor, null);
+        }
+    }
+
+    @Override
+    public void emitConditional(ConditionalNode conditional) {
+        CiValue tVal = operand(conditional.trueValue());
+        CiValue fVal = operand(conditional.falseValue());
+        setResult(conditional, emitConditional(conditional.condition(), tVal, fVal));
+    }
+
+    public Variable emitConditional(BooleanNode node, CiValue trueValue, CiValue falseValue) {
+        if (node instanceof NullCheckNode) {
+            return emitNullCheckConditional((NullCheckNode) node, trueValue, falseValue);
+        } else if (node instanceof CompareNode) {
+            return emitCompareConditional((CompareNode) node, trueValue, falseValue);
+        } else if (node instanceof InstanceOfNode) {
+            return emitInstanceOfConditional((InstanceOfNode) node, trueValue, falseValue);
+        } else if (node instanceof ConstantNode) {
+            return emitConstantConditional(((ConstantNode) node).asConstant().asBoolean(), trueValue, falseValue);
+        } else {
+            throw GraalInternalError.unimplemented(node.toString());
+        }
+    }
+
+    private Variable emitNullCheckConditional(NullCheckNode node, CiValue trueValue, CiValue falseValue) {
+        Condition cond = node.expectedNull ? Condition.EQ : Condition.NE;
+        return emitCMove(operand(node.object()), CiConstant.NULL_OBJECT, cond, false, trueValue, falseValue);
+    }
+
+    private Variable emitInstanceOfConditional(InstanceOfNode x, CiValue trueValue, CiValue falseValue) {
+        XirArgument obj = toXirArgument(x.object());
+        XirArgument trueArg = toXirArgument(x.negated() ? falseValue : trueValue);
+        XirArgument falseArg = toXirArgument(x.negated() ? trueValue : falseValue);
+        XirSnippet snippet = xir.genMaterializeInstanceOf(site(x, x.object()), obj, toXirArgument(x.targetClassInstruction()), trueArg, falseArg, x.targetClass(), x.hints(), x.hintsExact());
+        return (Variable) emitXir(snippet, null, null, false);
+    }
+
+    private Variable emitConstantConditional(boolean value, CiValue trueValue, CiValue falseValue) {
+        return emitMove(value ? trueValue : falseValue);
+    }
+
+    private Variable emitCompareConditional(CompareNode compare, CiValue trueValue, CiValue falseValue) {
+        return emitCMove(operand(compare.x()), operand(compare.y()), compare.condition(), compare.unorderedIsTrue(), trueValue, falseValue);
+    }
+
+
+    public abstract void emitLabel(Label label, boolean align);
+    public abstract void emitJump(LabelRef label, LIRDebugInfo info);
+    public abstract void emitBranch(CiValue left, CiValue right, Condition cond, boolean unorderedIsTrue, LabelRef label, LIRDebugInfo info);
+    public abstract Variable emitCMove(CiValue leftVal, CiValue right, Condition cond, boolean unorderedIsTrue, CiValue trueValue, CiValue falseValue);
+
+    protected FrameState stateBeforeCallWithArguments(FrameState stateAfter, MethodCallTargetNode call, int bci) {
+        return stateAfter.duplicateModified(bci, stateAfter.rethrowException(), call.returnKind(), toJVMArgumentStack(call.targetMethod().signature(), call.isStatic(), call.arguments()));
+    }
+
+    private static ValueNode[] toJVMArgumentStack(RiSignature signature, boolean isStatic, NodeInputList<ValueNode> arguments) {
+        int slotCount = signature.argumentSlots(!isStatic);
+        ValueNode[] stack = new ValueNode[slotCount];
+        int stackIndex = 0;
+        int argumentIndex = 0;
+        for (ValueNode arg : arguments) {
+            stack[stackIndex] = arg;
+
+            if (stackIndex == 0 && !isStatic) {
+                // Current argument is receiver.
+                stackIndex += stackSlots(CiKind.Object);
+            } else {
+                stackIndex += stackSlots(signature.argumentKindAt(argumentIndex, false));
+                argumentIndex++;
+            }
+        }
+        return stack;
+    }
+
+
+    public static int stackSlots(CiKind kind) {
+        return isTwoSlot(kind) ? 2 : 1;
+    }
+
+    public static boolean isTwoSlot(CiKind kind) {
+        assert kind != CiKind.Void && kind != CiKind.Illegal;
+        return kind == CiKind.Long || kind == CiKind.Double;
+    }
+
+    @Override
+    public void emitInvoke(Invoke x) {
+        MethodCallTargetNode callTarget = x.callTarget();
+        RiMethod targetMethod = callTarget.targetMethod();
+
+        XirSnippet snippet = null;
+        XirArgument receiver;
+        switch (callTarget.invokeKind()) {
+            case Static:
+                snippet = xir.genInvokeStatic(site(x.node()), targetMethod);
+                break;
+            case Special:
+                receiver = toXirArgument(callTarget.receiver());
+                snippet = xir.genInvokeSpecial(site(x.node(), callTarget.receiver()), receiver, targetMethod);
+                break;
+            case Virtual:
+                assert callTarget.receiver().kind() == CiKind.Object : callTarget + ": " + callTarget.targetMethod().toString();
+                receiver = toXirArgument(callTarget.receiver());
+                snippet = xir.genInvokeVirtual(site(x.node(), callTarget.receiver()), receiver, targetMethod, x.megamorph());
+                break;
+            case Interface:
+                assert callTarget.receiver().kind() == CiKind.Object : callTarget;
+                receiver = toXirArgument(callTarget.receiver());
+                snippet = xir.genInvokeInterface(site(x.node(), callTarget.receiver()), receiver, targetMethod);
+                break;
+        }
+
+        CiValue destinationAddress = null;
+        if (!target().invokeSnippetAfterArguments) {
+            // This is the version currently necessary for Maxine: since the invokeinterface-snippet uses a division, it
+            // destroys rdx, which is also used to pass a parameter.  Therefore, the snippet must be before the parameters are assigned to their locations.
+            LIRDebugInfo addrInfo = stateFor(stateBeforeCallWithArguments(x.stateAfter(), callTarget, x.bci()));
+            destinationAddress = emitXir(snippet, x.node(), addrInfo, false);
+        }
+
+        CiValue resultOperand = resultOperandFor(x.node().kind());
+
+        CiKind[] signature = CiUtil.signatureToKinds(callTarget.targetMethod().signature(), callTarget.isStatic() ? null : callTarget.targetMethod().holder().kind(true));
+        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(JavaCall, signature, target(), false);
+        frameMap.callsMethod(cc, JavaCall);
+        List<CiValue> argList = visitInvokeArguments(cc, callTarget.arguments());
+
+        if (target().invokeSnippetAfterArguments) {
+            // This is the version currently active for HotSpot.
+            LIRDebugInfo addrInfo = stateFor(stateBeforeCallWithArguments(x.stateAfter(), callTarget, x.bci()), null, null);
+            destinationAddress = emitXir(snippet, x.node(), addrInfo, false);
+        }
+
+        LIRDebugInfo callInfo = stateFor(x.stateDuring(), null, x instanceof InvokeWithExceptionNode ? getLIRBlock(((InvokeWithExceptionNode) x).exceptionEdge()) : null);
+        emitCall(targetMethod, resultOperand, argList, destinationAddress, callInfo, snippet.marks);
+
+        if (isLegal(resultOperand)) {
+            setResult(x.node(), emitMove(resultOperand));
+        }
+    }
+
+    protected abstract void emitCall(Object targetMethod, CiValue result, List<CiValue> arguments, CiValue targetAddress, LIRDebugInfo info, Map<XirMark, Mark> marks);
+
+
+    private static CiValue toStackKind(CiValue value) {
+        if (value.kind.stackKind() != value.kind) {
+            // We only have stack-kinds in the LIR, so convert the operand kind for values from the calling convention.
+            if (isRegister(value)) {
+                return asRegister(value).asValue(value.kind.stackKind());
+            } else if (isStackSlot(value)) {
+                return CiStackSlot.get(value.kind.stackKind(), asStackSlot(value).rawOffset(), asStackSlot(value).rawAddFrameSize());
+            } else {
+                throw GraalInternalError.shouldNotReachHere();
+            }
+        }
+        return value;
+    }
+
+    public List<CiValue> visitInvokeArguments(CiCallingConvention cc, Iterable<ValueNode> arguments) {
+        // for each argument, load it into the correct location
+        List<CiValue> argList = new ArrayList<>();
+        int j = 0;
+        for (ValueNode arg : arguments) {
+            if (arg != null) {
+                CiValue operand = toStackKind(cc.locations[j++]);
+                emitMove(operand(arg), operand);
+                argList.add(operand);
+
+            } else {
+                throw GraalInternalError.shouldNotReachHere("I thought we no longer have null entries for two-slot types...");
+            }
+        }
+        return argList;
+    }
+
+
+    protected abstract LabelRef createDeoptStub(DeoptAction action, LIRDebugInfo info, Object deoptInfo);
+
+    @Override
+    public Variable emitCallToRuntime(CiRuntimeCall runtimeCall, boolean canTrap, CiValue... args) {
+        LIRDebugInfo info = canTrap ? state() : null;
+
+        CiKind result = runtimeCall.resultKind;
+        CiKind[] arguments = runtimeCall.arguments;
+        CiValue physReg = resultOperandFor(result);
+
+        List<CiValue> argumentList;
+        if (arguments.length > 0) {
+            // move the arguments into the correct location
+            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
+            frameMap.callsMethod(cc, RuntimeCall);
+            assert cc.locations.length == args.length : "argument count mismatch";
+            for (int i = 0; i < args.length; i++) {
+                CiValue arg = args[i];
+                CiValue loc = cc.locations[i];
+                emitMove(arg, loc);
+            }
+            argumentList = Arrays.asList(cc.locations);
+        } else {
+            // no arguments
+            assert args == null || args.length == 0;
+            argumentList = Collections.emptyList();
+        }
+
+        emitCall(runtimeCall, physReg, argumentList, CiConstant.forLong(0), info, null);
+
+        if (isLegal(physReg)) {
+            return emitMove(physReg);
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public void emitRuntimeCall(RuntimeCallNode x) {
+        // TODO Merge with emitCallToRuntime() method above.
+
+        CiValue resultOperand = resultOperandFor(x.kind());
+        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, x.call().arguments, target(), false);
+        frameMap.callsMethod(cc, RuntimeCall);
+        List<CiValue> argList = visitInvokeArguments(cc, x.arguments());
+
+        LIRDebugInfo info = null;
+        FrameState stateAfter = x.stateAfter();
+        if (stateAfter != null) {
+            // (cwimmer) I made the code that modifies the operand stack conditional. My scenario: runtime calls to, e.g.,
+            // CreateNullPointerException have no equivalent in the bytecodes, so there is no invoke bytecode.
+            // Therefore, the result of the runtime call was never pushed to the stack, and we cannot pop it here.
+            FrameState stateBeforeReturn = stateAfter;
+            if ((stateAfter.stackSize() > 0 && stateAfter.stackAt(stateAfter.stackSize() - 1) == x) ||
+                (stateAfter.stackSize() > 1 && stateAfter.stackAt(stateAfter.stackSize() - 2) == x)) {
+
+                stateBeforeReturn = stateAfter.duplicateModified(stateAfter.bci, stateAfter.rethrowException(), x.kind());
+            }
+
+            // TODO is it correct here that the pointerSlots are not passed to the oop map generation?
+            info = stateFor(stateBeforeReturn);
+        }
+
+        emitCall(x.call(), resultOperand, argList, CiConstant.forLong(0), info, null);
+
+        if (isLegal(resultOperand)) {
+            setResult(x, emitMove(resultOperand));
+        }
+    }
+
+    @Override
+    public void emitLookupSwitch(LookupSwitchNode x) {
+        Variable tag = load(operand(x.value()));
+        if (x.numberOfCases() == 0 || x.numberOfCases() < GraalOptions.SequentialSwitchLimit) {
+            int len = x.numberOfCases();
+            for (int i = 0; i < len; i++) {
+                emitBranch(tag, CiConstant.forInt(x.keyAt(i)), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
+            }
+            emitJump(getLIRBlock(x.defaultSuccessor()), null);
+        } else {
+            visitSwitchRanges(createSwitchRanges(x, null), tag, getLIRBlock(x.defaultSuccessor()));
+        }
+    }
+
+    @Override
+    public void emitTableSwitch(TableSwitchNode x) {
+        Variable value = load(operand(x.value()));
+        // TODO: tune the defaults for the controls used to determine what kind of translation to use
+        if (x.numberOfCases() == 0 || x.numberOfCases() <= GraalOptions.SequentialSwitchLimit) {
+            int loKey = x.lowKey();
+            int len = x.numberOfCases();
+            for (int i = 0; i < len; i++) {
+                emitBranch(value, CiConstant.forInt(i + loKey), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
+            }
+            emitJump(getLIRBlock(x.defaultSuccessor()), null);
+        } else {
+            SwitchRange[] switchRanges = createSwitchRanges(null, x);
+            int rangeDensity = x.numberOfCases() / switchRanges.length;
+            if (rangeDensity >= GraalOptions.RangeTestsSwitchDensity) {
+                visitSwitchRanges(switchRanges, value, getLIRBlock(x.defaultSuccessor()));
+            } else {
+                LabelRef[] targets = new LabelRef[x.numberOfCases()];
+                for (int i = 0; i < x.numberOfCases(); ++i) {
+                    targets[i] = getLIRBlock(x.blockSuccessor(i));
+                }
+                emitTableSwitch(x.lowKey(), getLIRBlock(x.defaultSuccessor()), targets, value);
+            }
+        }
+    }
+
+    protected abstract void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiValue index);
+
+    // the range of values in a lookupswitch or tableswitch statement
+    private static final class SwitchRange {
+        protected final int lowKey;
+        protected int highKey;
+        protected final LabelRef sux;
+
+        SwitchRange(int lowKey, LabelRef sux) {
+            this.lowKey = lowKey;
+            this.highKey = lowKey;
+            this.sux = sux;
+        }
+    }
+
+    private SwitchRange[] createSwitchRanges(LookupSwitchNode ls, TableSwitchNode ts) {
+        // Only one of the parameters is used, but code is shared because it is mostly the same.
+        SwitchNode x = ls != null ? ls : ts;
+        // we expect the keys to be sorted by increasing value
+        List<SwitchRange> res = new ArrayList<>(x.numberOfCases());
+        int len = x.numberOfCases();
+        if (len > 0) {
+            LabelRef defaultSux = getLIRBlock(x.defaultSuccessor());
+            int key = ls != null ? ls.keyAt(0) : ts.lowKey();
+            LabelRef sux = getLIRBlock(x.blockSuccessor(0));
+            SwitchRange range = new SwitchRange(key, sux);
+            for (int i = 1; i < len; i++) {
+                int newKey = ls != null ? ls.keyAt(i) : key + 1;
+                LabelRef newSux = getLIRBlock(x.blockSuccessor(i));
+                if (key + 1 == newKey && sux == newSux) {
+                    // still in same range
+                    range.highKey = newKey;
+                } else {
+                    // skip tests which explicitly dispatch to the default
+                    if (range.sux != defaultSux) {
+                        res.add(range);
+                    }
+                    range = new SwitchRange(newKey, newSux);
+                }
+                key = newKey;
+                sux = newSux;
+            }
+            if (res.size() == 0 || res.get(res.size() - 1) != range) {
+                res.add(range);
+            }
+        }
+        return res.toArray(new SwitchRange[res.size()]);
+    }
+
+    private void visitSwitchRanges(SwitchRange[] x, Variable value, LabelRef defaultSux) {
+        for (int i = 0; i < x.length; i++) {
+            SwitchRange oneRange = x[i];
+            int lowKey = oneRange.lowKey;
+            int highKey = oneRange.highKey;
+            LabelRef dest = oneRange.sux;
+            if (lowKey == highKey) {
+                emitBranch(value, CiConstant.forInt(lowKey), Condition.EQ, false, dest, null);
+            } else if (highKey - lowKey == 1) {
+                emitBranch(value, CiConstant.forInt(lowKey), Condition.EQ, false, dest, null);
+                emitBranch(value, CiConstant.forInt(highKey), Condition.EQ, false, dest, null);
+            } else {
+                Label l = new Label();
+                emitBranch(value, CiConstant.forInt(lowKey), Condition.LT, false, LabelRef.forLabel(l), null);
+                emitBranch(value, CiConstant.forInt(highKey), Condition.LE, false, dest, null);
+                emitLabel(l, false);
+            }
+        }
+        emitJump(defaultSux, null);
+    }
+
+
+    protected XirArgument toXirArgument(CiValue v) {
+        if (v == null) {
+            return null;
+        }
+        return XirArgument.forInternalObject(v);
+    }
+
+    protected XirArgument toXirArgument(ValueNode i) {
+        if (i == null) {
+            return null;
+        }
+        return XirArgument.forInternalObject(loadNonConst(operand(i)));
+    }
+
+    private CiValue allocateOperand(XirSnippet snippet, XirOperand op) {
+        if (op instanceof XirParameter)  {
+            XirParameter param = (XirParameter) op;
+            return allocateOperand(snippet.arguments[param.parameterIndex], op, param.canBeConstant);
+        } else if (op instanceof XirRegister) {
+            XirRegister reg = (XirRegister) op;
+            return reg.register;
+        } else if (op instanceof XirTemp) {
+            return newVariable(op.kind);
+        } else {
+            GraalInternalError.shouldNotReachHere();
+            return null;
+        }
+    }
+
+    private CiValue allocateOperand(XirArgument arg, XirOperand var, boolean canBeConstant) {
+        if (arg.constant != null) {
+            return arg.constant;
+        }
+
+        CiValue value = (CiValue) arg.object;
+        if (canBeConstant) {
+            return value;
+        }
+        Variable variable = load(value);
+        if (var.kind == CiKind.Byte || var.kind == CiKind.Boolean) {
+            Variable tempVar = new Variable(value.kind, lir.nextVariable(), CiRegister.RegisterFlag.Byte);
+            emitMove(variable, tempVar);
+            variable = tempVar;
+        }
+        return variable;
+    }
+
+    protected CiValue emitXir(XirSnippet snippet, ValueNode x, LIRDebugInfo info, boolean setInstructionResult) {
+        return emitXir(snippet, x, info, null, setInstructionResult, null, null);
+    }
+
+    protected CiValue emitXir(XirSnippet snippet, ValueNode instruction, LIRDebugInfo info, LIRDebugInfo infoAfter, boolean setInstructionResult, LabelRef trueSuccessor, LabelRef falseSuccessor) {
+        if (GraalOptions.PrintXirTemplates) {
+            TTY.println("Emit XIR template " + snippet.template.name);
+        }
+
+        final CiValue[] operandsArray = new CiValue[snippet.template.variableCount];
+
+        frameMap.reserveOutgoing(snippet.template.outgoingStackSize);
+
+        XirOperand resultOperand = snippet.template.resultOperand;
+
+        if (snippet.template.allocateResultOperand) {
+            CiValue outputOperand = IllegalValue;
+            // This snippet has a result that must be separately allocated
+            // Otherwise it is assumed that the result is part of the inputs
+            if (resultOperand.kind != CiKind.Void && resultOperand.kind != CiKind.Illegal) {
+                if (setInstructionResult) {
+                    outputOperand = newVariable(instruction.kind());
+                } else {
+                    outputOperand = newVariable(resultOperand.kind);
+                }
+                assert operandsArray[resultOperand.index] == null;
+            }
+            operandsArray[resultOperand.index] = outputOperand;
+            if (GraalOptions.PrintXirTemplates) {
+                TTY.println("Output operand: " + outputOperand);
+            }
+        }
+
+        for (XirTemp t : snippet.template.temps) {
+            if (t instanceof XirRegister) {
+                XirRegister reg = (XirRegister) t;
+                if (!t.reserve) {
+                    operandsArray[t.index] = reg.register;
+                }
+            }
+        }
+
+        for (XirConstant c : snippet.template.constants) {
+            assert operandsArray[c.index] == null;
+            operandsArray[c.index] = c.value;
+        }
+
+        XirOperand[] inputOperands = snippet.template.inputOperands;
+        XirOperand[] inputTempOperands = snippet.template.inputTempOperands;
+        XirOperand[] tempOperands = snippet.template.tempOperands;
+
+        CiValue[] inputOperandArray = new CiValue[inputOperands.length + inputTempOperands.length];
+        CiValue[] tempOperandArray = new CiValue[tempOperands.length];
+        int[] inputOperandIndicesArray = new int[inputOperands.length + inputTempOperands.length];
+        int[] tempOperandIndicesArray = new int[tempOperands.length];
+        for (int i = 0; i < inputOperands.length; i++) {
+            XirOperand x = inputOperands[i];
+            CiValue op = allocateOperand(snippet, x);
+            operandsArray[x.index] = op;
+            inputOperandArray[i] = op;
+            inputOperandIndicesArray[i] = x.index;
+            if (GraalOptions.PrintXirTemplates) {
+                TTY.println("Input operand: " + x);
+            }
+        }
+
+        assert inputTempOperands.length == 0 : "cwi: I think this code is never used.  If you see this exception being thrown, please tell me...";
+
+        for (int i = 0; i < tempOperands.length; i++) {
+            XirOperand x = tempOperands[i];
+            CiValue op = allocateOperand(snippet, x);
+            operandsArray[x.index] = op;
+            tempOperandArray[i] = op;
+            tempOperandIndicesArray[i] = x.index;
+            if (GraalOptions.PrintXirTemplates) {
+                TTY.println("Temp operand: " + x);
+            }
+        }
+
+        for (CiValue operand : operandsArray) {
+            assert operand != null;
+        }
+
+        CiValue allocatedResultOperand = operandsArray[resultOperand.index];
+        if (!isVariable(allocatedResultOperand) && !isRegister(allocatedResultOperand)) {
+            allocatedResultOperand = IllegalValue;
+        }
+
+        if (setInstructionResult && isLegal(allocatedResultOperand)) {
+            CiValue operand = operand(instruction);
+            if (operand == null) {
+                setResult(instruction, allocatedResultOperand);
+            } else {
+                assert operand == allocatedResultOperand;
+            }
+        }
+
+
+        XirInstruction[] slowPath = snippet.template.slowPath;
+        if (!isConstant(operandsArray[resultOperand.index]) || snippet.template.fastPath.length != 0 || (slowPath != null && slowPath.length > 0)) {
+            // XIR instruction is only needed when the operand is not a constant!
+            emitXir(snippet, operandsArray, allocatedResultOperand,
+                    inputOperandArray, tempOperandArray, inputOperandIndicesArray, tempOperandIndicesArray,
+                    (allocatedResultOperand == IllegalValue) ? -1 : resultOperand.index,
+                    info, infoAfter, trueSuccessor, falseSuccessor);
+            Debug.metric("LIRXIRInstructions").increment();
+        }
+
+        return operandsArray[resultOperand.index];
+    }
+
+    protected abstract void emitXir(XirSnippet snippet, CiValue[] operands, CiValue outputOperand, CiValue[] inputs, CiValue[] temps, int[] inputOperandIndices, int[] tempOperandIndices, int outputOperandIndex,
+                    LIRDebugInfo info, LIRDebugInfo infoAfter, LabelRef trueSuccessor, LabelRef falseSuccessor);
+
+    protected final CiValue callRuntime(CiRuntimeCall runtimeCall, LIRDebugInfo info, CiValue... args) {
+        // get a result register
+        CiKind result = runtimeCall.resultKind;
+        CiKind[] arguments = runtimeCall.arguments;
+
+        CiValue physReg = result.isVoid() ? IllegalValue : resultOperandFor(result);
+
+        List<CiValue> argumentList;
+        if (arguments.length > 0) {
+            // move the arguments into the correct location
+            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
+            frameMap.callsMethod(cc, RuntimeCall);
+            assert cc.locations.length == args.length : "argument count mismatch";
+            for (int i = 0; i < args.length; i++) {
+                CiValue arg = args[i];
+                CiValue loc = cc.locations[i];
+                emitMove(arg, loc);
+            }
+            argumentList = Arrays.asList(cc.locations);
+        } else {
+            // no arguments
+            assert args == null || args.length == 0;
+            argumentList = Util.uncheckedCast(Collections.emptyList());
+        }
+
+        emitCall(runtimeCall, physReg, argumentList, CiConstant.forLong(0), info, null);
+
+        return physReg;
+    }
+
+    protected final Variable callRuntimeWithResult(CiRuntimeCall runtimeCall, LIRDebugInfo info, CiValue... args) {
+        CiValue location = callRuntime(runtimeCall, info, args);
+        return emitMove(location);
+    }
+
+    SwitchRange[] createLookupRanges(LookupSwitchNode x) {
+        // we expect the keys to be sorted by increasing value
+        List<SwitchRange> res = new ArrayList<>(x.numberOfCases());
+        int len = x.numberOfCases();
+        if (len > 0) {
+            LabelRef defaultSux = getLIRBlock(x.defaultSuccessor());
+            int key = x.keyAt(0);
+            LabelRef sux = getLIRBlock(x.blockSuccessor(0));
+            SwitchRange range = new SwitchRange(key, sux);
+            for (int i = 1; i < len; i++) {
+                int newKey = x.keyAt(i);
+                LabelRef newSux = getLIRBlock(x.blockSuccessor(i));
+                if (key + 1 == newKey && sux == newSux) {
+                    // still in same range
+                    range.highKey = newKey;
+                } else {
+                    // skip tests which explicitly dispatch to the default
+                    if (range.sux != defaultSux) {
+                        res.add(range);
+                    }
+                    range = new SwitchRange(newKey, newSux);
+                }
+                key = newKey;
+                sux = newSux;
+            }
+            if (res.size() == 0 || res.get(res.size() - 1) != range) {
+                res.add(range);
+            }
+        }
+        return res.toArray(new SwitchRange[res.size()]);
+    }
+
+    SwitchRange[] createLookupRanges(TableSwitchNode x) {
+        // TODO: try to merge this with the code for LookupSwitch
+        List<SwitchRange> res = new ArrayList<>(x.numberOfCases());
+        int len = x.numberOfCases();
+        if (len > 0) {
+            LabelRef sux = getLIRBlock(x.blockSuccessor(0));
+            int key = x.lowKey();
+            LabelRef defaultSux = getLIRBlock(x.defaultSuccessor());
+            SwitchRange range = new SwitchRange(key, sux);
+            for (int i = 0; i < len; i++, key++) {
+                LabelRef newSux = getLIRBlock(x.blockSuccessor(i));
+                if (sux == newSux) {
+                    // still in same range
+                    range.highKey = key;
+                } else {
+                    // skip tests which explicitly dispatch to the default
+                    if (sux != defaultSux) {
+                        res.add(range);
+                    }
+                    range = new SwitchRange(key, newSux);
+                }
+                sux = newSux;
+            }
+            if (res.size() == 0 || res.get(res.size() - 1) != range) {
+                res.add(range);
+            }
+        }
+        return res.toArray(new SwitchRange[res.size()]);
+    }
+
+    protected XirSupport site(ValueNode x) {
+        return xirSupport.site(x, null);
+    }
+
+    protected XirSupport site(ValueNode x, ValueNode receiver) {
+        return xirSupport.site(x, receiver);
+    }
+
+    /**
+     * Implements site-specific information for the XIR interface.
+     */
+    static class XirSupport implements XirSite {
+        ValueNode current;
+        ValueNode receiver;
+
+        public boolean isNonNull(XirArgument argument) {
+            return false;
+        }
+
+        public boolean requiresNullCheck() {
+            return receiver == null || !receiver.stamp().nonNull();
+        }
+
+        public boolean requiresBoundsCheck() {
+            return true;
+        }
+
+        public boolean requiresReadBarrier() {
+            return current == null || true;
+        }
+
+        public boolean requiresWriteBarrier() {
+            return current == null || true;
+        }
+
+        public boolean requiresArrayStoreCheck() {
+            return true;
+        }
+
+        XirSupport site(ValueNode v, ValueNode r) {
+            current = v;
+            receiver = r;
+            return this;
+        }
+
+        @Override
+        public String toString() {
+            return "XirSupport<" + current + ">";
+        }
+    }
+
+    public FrameMap frameMap() {
+        return frameMap;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.gen;
+
+import static com.oracle.max.cri.ci.CiValue.*;
+import static com.oracle.graal.lir.ValueUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * Converts {@link PhiNode} instructions into moves.
+ *
+ * Resolves cycles:
+ * <pre>
+ *
+ *  r1 := r2  becomes  temp := r1
+ *  r2 := r1           r1 := r2
+ *                     r2 := temp
+ * </pre>
+ *
+ * and orders moves:
+ *
+ * <pre>
+ *  r2 := r3  becomes  r1 := r2
+ *  r1 := r2           r2 := r3
+ * </pre>
+ */
+public class PhiResolver {
+
+    /**
+     * Tracks a data flow dependency between a source operand and any number of the destination operands.
+     */
+    static class PhiResolverNode {
+
+        /**
+         * A source operand whose value flows into the {@linkplain #destinations destination} operands.
+         */
+        final CiValue operand;
+
+        /**
+         * The operands whose values are defined by the {@linkplain #operand source} operand.
+         */
+        final ArrayList<PhiResolverNode> destinations;
+
+        /**
+         * Denotes if a move instruction has already been emitted to initialize the value of {@link #operand}.
+         */
+        boolean assigned;
+
+        /**
+         * Specifies if this operand been visited for the purpose of emitting a move instruction.
+         */
+        boolean visited;
+
+        /**
+         * Specifies if this is the initial definition in data flow path for a given value.
+         */
+        boolean startNode;
+
+        PhiResolverNode(CiValue operand) {
+            this.operand = operand;
+            destinations = new ArrayList<>(4);
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder buf = new StringBuilder(operand.toString());
+            if (!destinations.isEmpty()) {
+                buf.append(" ->");
+                for (PhiResolverNode node : destinations) {
+                    buf.append(' ').append(node.operand);
+                }
+            }
+            return buf.toString();
+        }
+    }
+
+    private final LIRGenerator gen;
+
+    /**
+     * The operand loop header phi for the operand currently being process in {@link #dispose()}.
+     */
+    private PhiResolverNode loop;
+
+    private CiValue temp;
+
+    private final ArrayList<PhiResolverNode> variableOperands = new ArrayList<>(3);
+    private final ArrayList<PhiResolverNode> otherOperands = new ArrayList<>(3);
+
+    /**
+     * Maps operands to nodes.
+     */
+    private final HashMap<CiValue, PhiResolverNode> operandToNodeMap = new HashMap<>();
+
+    public PhiResolver(LIRGenerator gen) {
+        this.gen = gen;
+        temp = IllegalValue;
+    }
+
+    public void dispose() {
+        // resolve any cycles in moves from and to variables
+        for (int i = variableOperands.size() - 1; i >= 0; i--) {
+            PhiResolverNode node = variableOperands.get(i);
+            if (!node.visited) {
+                loop = null;
+                move(null, node);
+                node.startNode = true;
+                assert isIllegal(temp) : "moveTempTo() call missing";
+            }
+        }
+
+        // generate move for move from non variable to arbitrary destination
+        for (int i = otherOperands.size() - 1; i >= 0; i--) {
+            PhiResolverNode node = otherOperands.get(i);
+            for (int j = node.destinations.size() - 1; j >= 0; j--) {
+                emitMove(node.operand, node.destinations.get(j).operand);
+            }
+        }
+    }
+
+    public void move(CiValue src, CiValue dest) {
+        assert isVariable(dest) : "destination must be virtual";
+        // tty.print("move "); src.print(); tty.print(" to "); dest.print(); tty.cr();
+        assert isLegal(src) : "source for phi move is illegal";
+        assert isLegal(dest) : "destination for phi move is illegal";
+        PhiResolverNode srcNode = sourceNode(src);
+        PhiResolverNode destNode = destinationNode(dest);
+        srcNode.destinations.add(destNode);
+      }
+
+    private PhiResolverNode createNode(CiValue operand, boolean source) {
+        PhiResolverNode node;
+        if (isVariable(operand)) {
+            node = operandToNodeMap.get(operand);
+            assert node == null || node.operand.equals(operand);
+            if (node == null) {
+                node = new PhiResolverNode(operand);
+                operandToNodeMap.put(operand, node);
+            }
+            // Make sure that all variables show up in the list when
+            // they are used as the source of a move.
+            if (source) {
+                if (!variableOperands.contains(node)) {
+                    variableOperands.add(node);
+                }
+            }
+        } else {
+            assert source;
+            node = new PhiResolverNode(operand);
+            otherOperands.add(node);
+        }
+        return node;
+    }
+
+    private PhiResolverNode destinationNode(CiValue opr) {
+        return createNode(opr, false);
+    }
+
+    private void emitMove(CiValue src, CiValue dest) {
+        assert isLegal(src);
+        assert isLegal(dest);
+        gen.emitMove(src, dest);
+    }
+
+    // Traverse assignment graph in depth first order and generate moves in post order
+    // ie. two assignments: b := c, a := b start with node c:
+    // Call graph: move(NULL, c) -> move(c, b) -> move(b, a)
+    // Generates moves in this order: move b to a and move c to b
+    // ie. cycle a := b, b := a start with node a
+    // Call graph: move(NULL, a) -> move(a, b) -> move(b, a)
+    // Generates moves in this order: move b to temp, move a to b, move temp to a
+    private void move(PhiResolverNode src, PhiResolverNode dest) {
+        if (!dest.visited) {
+            dest.visited = true;
+            for (int i = dest.destinations.size() - 1; i >= 0; i--) {
+                move(dest, dest.destinations.get(i));
+            }
+        } else if (!dest.startNode) {
+            // cycle in graph detected
+            assert loop == null : "only one loop valid!";
+            loop = dest;
+            moveToTemp(src.operand);
+            return;
+        } // else dest is a start node
+
+        if (!dest.assigned) {
+            if (loop == dest) {
+                moveTempTo(dest.operand);
+                dest.assigned = true;
+            } else if (src != null) {
+                emitMove(src.operand, dest.operand);
+                dest.assigned = true;
+            }
+        }
+    }
+
+    private void moveTempTo(CiValue dest) {
+        assert isLegal(temp);
+        emitMove(temp, dest);
+        temp = IllegalValue;
+    }
+
+    private void moveToTemp(CiValue src) {
+        assert isIllegal(temp);
+        temp = gen.newVariable(src.kind);
+        emitMove(src, temp);
+    }
+
+    private PhiResolverNode sourceNode(CiValue opr) {
+        return createNode(opr, true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+/**
+ * This package contains the port of the LIRGenerator which translates
+ * HIR instructions to LIR instructions for the backend.
+ */
+package com.oracle.graal.compiler.gen;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/graph/MergeableState.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.graph;
+
+import java.util.*;
+
+import com.oracle.graal.nodes.*;
+
+public interface MergeableState <T> {
+    T clone();
+    boolean merge(MergeNode merge, Collection<T> withStates);
+    void loopBegin(LoopBeginNode loopBegin);
+    void loopEnds(LoopBeginNode loopBegin, Collection<T> loopEndStates);
+    void afterSplit(FixedNode node);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/graph/PostOrderNodeIterator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.graph;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+public abstract class PostOrderNodeIterator<T extends MergeableState<T>> {
+
+    private final NodeBitMap visitedEnds;
+    private final Deque<FixedNode> nodeQueue;
+    private final IdentityHashMap<FixedNode, T> nodeStates;
+    private final FixedNode start;
+
+    protected T state;
+
+    public PostOrderNodeIterator(FixedNode start, T initialState) {
+        visitedEnds = start.graph().createNodeBitMap();
+        nodeQueue = new ArrayDeque<>();
+        nodeStates = new IdentityHashMap<>();
+        this.start = start;
+        this.state = initialState;
+    }
+
+    public void apply() {
+        FixedNode current = start;
+
+        do {
+            if (current instanceof InvokeWithExceptionNode) {
+                invoke((Invoke) current);
+                queueSuccessors(current, null);
+                current = nextQueuedNode();
+            } else if (current instanceof LoopBeginNode) {
+                state.loopBegin((LoopBeginNode) current);
+                nodeStates.put(current, state);
+                state = state.clone();
+                loopBegin((LoopBeginNode) current);
+                current = ((LoopBeginNode) current).next();
+                assert current != null;
+            } else if (current instanceof LoopEndNode) {
+                loopEnd((LoopEndNode) current);
+                finishLoopEnds((LoopEndNode) current);
+                current = nextQueuedNode();
+            } else if (current instanceof MergeNode) {
+                merge((MergeNode) current);
+                current = ((MergeNode) current).next();
+                assert current != null;
+            } else if (current instanceof FixedWithNextNode) {
+                FixedNode next = ((FixedWithNextNode) current).next();
+                assert next != null : current;
+                node(current);
+                current = next;
+            } else if (current instanceof EndNode) {
+                end((EndNode) current);
+                queueMerge((EndNode) current);
+                current = nextQueuedNode();
+            } else if (current instanceof DeoptimizeNode) {
+                deoptimize((DeoptimizeNode) current);
+                current = nextQueuedNode();
+            } else if (current instanceof ReturnNode) {
+                returnNode((ReturnNode) current);
+                current = nextQueuedNode();
+            } else if (current instanceof UnwindNode) {
+                unwind((UnwindNode) current);
+                current = nextQueuedNode();
+            } else if (current instanceof ControlSplitNode) {
+                Set<Node> successors = controlSplit((ControlSplitNode) current);
+                queueSuccessors(current, successors);
+                current = nextQueuedNode();
+            } else {
+                assert false : current;
+            }
+        } while(current != null);
+    }
+
+    private void queueSuccessors(FixedNode x, Set<Node> successors) {
+        nodeStates.put(x, state);
+        if (successors != null) {
+            for (Node node : successors) {
+                if (node != null) {
+                    nodeStates.put((FixedNode) node.predecessor(), state);
+                    nodeQueue.addFirst((FixedNode) node);
+                }
+            }
+        } else {
+            for (Node node : x.successors()) {
+                if (node != null) {
+                    nodeQueue.addFirst((FixedNode) node);
+                }
+            }
+        }
+    }
+
+    private FixedNode nextQueuedNode() {
+        int maxIterations = nodeQueue.size();
+        while (maxIterations-- > 0) {
+            FixedNode node = nodeQueue.removeFirst();
+            if (node instanceof MergeNode) {
+                MergeNode merge = (MergeNode) node;
+                state = nodeStates.get(merge.forwardEndAt(0)).clone();
+                ArrayList<T> states = new ArrayList<>(merge.forwardEndCount() - 1);
+                for (int i = 1; i < merge.forwardEndCount(); i++) {
+                    T other = nodeStates.get(merge.forwardEndAt(i));
+                    assert other != null;
+                    states.add(other);
+                }
+                boolean ready = state.merge(merge, states);
+                if (ready) {
+                    return merge;
+                } else {
+                    nodeQueue.addLast(merge);
+                }
+            } else {
+                assert node.predecessor() != null;
+                state = nodeStates.get(node.predecessor()).clone();
+                state.afterSplit(node);
+                return node;
+            }
+        }
+        return null;
+    }
+
+    private void finishLoopEnds(LoopEndNode end) {
+        assert !visitedEnds.isMarked(end);
+        assert !nodeStates.containsKey(end);
+        nodeStates.put(end, state);
+        visitedEnds.mark(end);
+        LoopBeginNode begin = end.loopBegin();
+        boolean endsVisited = true;
+        for (LoopEndNode le : begin.loopEnds()) {
+            if (!visitedEnds.isMarked(le)) {
+                endsVisited = false;
+                break;
+            }
+        }
+        if (endsVisited) {
+            ArrayList<T> states = new ArrayList<>(begin.loopEnds().count());
+            for (LoopEndNode le : begin.orderedLoopEnds()) {
+                states.add(nodeStates.get(le));
+            }
+            T loopBeginState = nodeStates.get(begin);
+            if (loopBeginState != null) {
+                loopBeginState.loopEnds(begin, states);
+            }
+        }
+    }
+
+    private void queueMerge(EndNode end) {
+        assert !visitedEnds.isMarked(end);
+        assert !nodeStates.containsKey(end);
+        nodeStates.put(end, state);
+        visitedEnds.mark(end);
+        MergeNode merge = end.merge();
+        boolean endsVisited = true;
+        for (int i = 0; i < merge.forwardEndCount(); i++) {
+            if (!visitedEnds.isMarked(merge.forwardEndAt(i))) {
+                endsVisited = false;
+                break;
+            }
+        }
+        if (endsVisited) {
+            nodeQueue.add(merge);
+        }
+    }
+
+    protected abstract void node(FixedNode node);
+
+    protected void end(EndNode endNode) {
+        node(endNode);
+    }
+
+    protected void merge(MergeNode merge) {
+        node(merge);
+    }
+
+    protected void loopBegin(LoopBeginNode loopBegin) {
+        node(loopBegin);
+    }
+
+    protected void loopEnd(LoopEndNode loopEnd) {
+        node(loopEnd);
+    }
+
+    protected void deoptimize(DeoptimizeNode deoptimize) {
+        node(deoptimize);
+    }
+
+    protected Set<Node> controlSplit(ControlSplitNode controlSplit) {
+        node(controlSplit);
+        return null;
+    }
+
+    protected void returnNode(ReturnNode returnNode) {
+        node(returnNode);
+    }
+
+    protected void invoke(Invoke invoke) {
+        node(invoke.node());
+    }
+
+    protected void unwind(UnwindNode unwind) {
+        node(unwind);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/graph/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ *
+ */
+package com.oracle.graal.compiler.graph;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * 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 top-level package in Graal containing options, metrics, timers and the main compiler class
+ * {@link com.oracle.graal.compiler.GraalCompiler}.
+ *
+ * <H2>{@code GraalCompiler} Overview</H2>
+ *
+ * Graal is intended to be used with multiple JVM's so makes no use of or reference to classes for a specific JVM, for
+ * example Maxine.
+ *
+ * The compiler is represented by the class {@code GraalCompiler}. {@code GraalCompiler} binds a specific target
+ * architecture and JVM interface to produce a usable compiler object.
+ * {@code RiMethod} is Graal's representation of a Java method and {@code RiXirGenerator} represents the interface through
+ * which the compiler requests the XIR for a given bytecode from the runtime system.
+ *
+ * <H3>The Graal Compilation Process</H3>
+ *
+ * {@link com.oracle.graal.compiler.GraalCompiler#compileMethod} creates a {@link GraalCompilation} instance and then returns the result of calling its
+ * {@link com.oracle.graal.compiler.GraalCompilation#compile} method.
+ * <p>
+ * 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.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.oracle.max.cri.ci.CiStatistics} object that accumulates information about the compilation process.
+ * </p>
+ * <H3>Supported backends</H3>
+ *
+ * <ul>
+ * <li>AMD64/x64 with SSE2</li>
+ * </ul>
+ */
+package com.oracle.graal.compiler;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BoxingEliminationPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.PhiNode.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.virtual.*;
+
+public class BoxingEliminationPhase extends Phase {
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        if (graph.getNodes(UnboxNode.class).isNotEmpty()) {
+
+            Map<PhiNode, PhiNode> phiReplacements = new HashMap<>();
+            for (UnboxNode unboxNode : graph.getNodes(UnboxNode.class)) {
+                tryEliminate(graph, unboxNode, phiReplacements);
+            }
+
+            new DeadCodeEliminationPhase().apply(graph);
+
+            for (BoxNode boxNode : graph.getNodes(BoxNode.class)) {
+                tryEliminate(boxNode);
+            }
+        }
+    }
+
+    private void tryEliminate(StructuredGraph graph, UnboxNode unboxNode, Map<PhiNode, PhiNode> phiReplacements) {
+        ValueNode unboxedValue = unboxedValue(unboxNode.source(), unboxNode.destinationKind(), phiReplacements);
+        if (unboxedValue != null) {
+            assert unboxedValue.kind() == unboxNode.kind();
+            unboxNode.replaceAtUsages(unboxedValue);
+            graph.removeFixed(unboxNode);
+        }
+    }
+
+    private PhiNode getReplacementPhi(PhiNode phiNode, CiKind kind, Map<PhiNode, PhiNode> phiReplacements) {
+        if (!phiReplacements.containsKey(phiNode)) {
+            PhiNode result = null;
+            if (phiNode.stamp().nonNull()) {
+                RiResolvedType exactType = phiNode.stamp().exactType();
+                if (exactType != null && exactType.toJava() == kind.toUnboxedJavaClass()) {
+                    StructuredGraph graph = (StructuredGraph) phiNode.graph();
+                    result = graph.add(new PhiNode(kind, phiNode.merge(), PhiType.Value));
+                    phiReplacements.put(phiNode, result);
+                    virtualizeUsages(phiNode, result, exactType);
+                    int i = 0;
+                    for (ValueNode n : phiNode.values()) {
+                        ValueNode unboxedValue = unboxedValue(n, kind, phiReplacements);
+                        if (unboxedValue != null) {
+                            assert unboxedValue.kind() == kind;
+                            result.addInput(unboxedValue);
+                        } else {
+                            UnboxNode unboxNode = graph.add(new UnboxNode(kind, n));
+                            FixedNode pred = phiNode.merge().phiPredecessorAt(i);
+                            graph.addBeforeFixed(pred, unboxNode);
+                            result.addInput(unboxNode);
+                        }
+                        ++i;
+                    }
+                }
+            }
+        }
+        return phiReplacements.get(phiNode);
+    }
+
+    private ValueNode unboxedValue(ValueNode n, CiKind kind, Map<PhiNode, PhiNode> phiReplacements) {
+        if (n instanceof BoxNode) {
+            BoxNode boxNode = (BoxNode) n;
+            return boxNode.source();
+        } else if (n instanceof PhiNode) {
+            PhiNode phiNode = (PhiNode) n;
+            return getReplacementPhi(phiNode, kind, phiReplacements);
+        } else {
+            return null;
+        }
+    }
+
+    private static void tryEliminate(BoxNode boxNode) {
+
+        virtualizeUsages(boxNode, boxNode.source(), boxNode.exactType());
+
+        if (boxNode.usages().filter(isNotA(FrameState.class).nor(VirtualObjectFieldNode.class)).isNotEmpty()) {
+            // Elimination failed, because boxing object escapes.
+            return;
+        }
+
+        FrameState stateAfter = boxNode.stateAfter();
+        boxNode.setStateAfter(null);
+        stateAfter.safeDelete();
+
+        ((StructuredGraph) boxNode.graph()).removeFixed(boxNode);
+    }
+
+    private static void virtualizeUsages(ValueNode boxNode, ValueNode replacement, RiResolvedType exactType) {
+        ValueNode virtualValueNode = null;
+        VirtualObjectNode virtualObjectNode = null;
+        for (Node n : boxNode.usages().filter(NodePredicates.isA(FrameState.class).or(VirtualObjectFieldNode.class)).snapshot()) {
+            if (virtualValueNode == null) {
+                virtualObjectNode = n.graph().unique(new BoxedVirtualObjectNode(exactType, replacement));
+            }
+            n.replaceFirstInput(boxNode, virtualObjectNode);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.util.*;
+
+public class CanonicalizerPhase extends Phase {
+    private static final int MAX_ITERATION_PER_NODE = 10;
+
+    private boolean newNodes;
+    private final CiTarget target;
+    private final CiAssumptions assumptions;
+    private final RiRuntime runtime;
+
+    public CanonicalizerPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions) {
+        this(target, runtime, false, assumptions);
+    }
+
+    public CanonicalizerPhase(CiTarget target, RiRuntime runtime, boolean newNodes, CiAssumptions assumptions) {
+        this.newNodes = newNodes;
+        this.target = target;
+        this.assumptions = assumptions;
+        this.runtime = runtime;
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        NodeWorkList nodeWorkList = graph.createNodeWorkList(!newNodes, MAX_ITERATION_PER_NODE);
+        if (newNodes) {
+            nodeWorkList.addAll(graph.getNewNodes());
+        }
+
+        canonicalize(graph, nodeWorkList, runtime, target, assumptions);
+    }
+
+    public static void canonicalize(StructuredGraph graph, NodeWorkList nodeWorkList, RiRuntime runtime, CiTarget target, CiAssumptions assumptions) {
+        graph.trackInputChange(nodeWorkList);
+        Tool tool = new Tool(nodeWorkList, runtime, target, assumptions);
+        for (Node node : nodeWorkList) {
+            if (node instanceof Canonicalizable) {
+                Debug.log("Canonicalizer: work on %s", node);
+                graph.mark();
+                ValueNode canonical = ((Canonicalizable) node).canonical(tool);
+//     cases:                                           original node:
+//                                         |Floating|Fixed-unconnected|Fixed-connected|
+//                                         --------------------------------------------
+//                                     null|   1    |        X        |       3       |
+//                                         --------------------------------------------
+//                                 Floating|   2    |        X        |       4       |
+//       canonical node:                   --------------------------------------------
+//                        Fixed-unconnected|   X    |        X        |       5       |
+//                                         --------------------------------------------
+//                          Fixed-connected|   2    |        X        |       6       |
+//                                         --------------------------------------------
+//       X: must not happen (checked with assertions)
+                if (canonical != node) {
+                    if (node instanceof FloatingNode) {
+                        if (canonical == null) {
+                            // case 1
+                            graph.removeFloating((FloatingNode) node);
+                        } else {
+                            // case 2
+                            assert !(canonical instanceof FixedNode) || canonical.predecessor() != null : node + " -> " + canonical +
+                                            " : replacement should be floating or fixed and connected";
+                            graph.replaceFloating((FloatingNode) node, canonical);
+                        }
+                    } else {
+                        assert node instanceof FixedWithNextNode && node.predecessor() != null : node + " -> " + canonical + " : node should be fixed & connected (" + node.predecessor() + ")";
+                        if (canonical == null) {
+                            // case 3
+                            graph.removeFixed((FixedWithNextNode) node);
+                        } else if (canonical instanceof FloatingNode) {
+                            // case 4
+                            graph.replaceFixedWithFloating((FixedWithNextNode) node, (FloatingNode) canonical);
+                        } else {
+                            assert canonical instanceof FixedNode;
+                            if (canonical.predecessor() == null) {
+                                assert !canonical.cfgSuccessors().iterator().hasNext() : "replacement " + canonical + " shouldn't have successors";
+                                // case 5
+                                graph.replaceFixedWithFixed((FixedWithNextNode) node, (FixedWithNextNode) canonical);
+                            } else {
+                                assert canonical.cfgSuccessors().iterator().hasNext() : "replacement " + canonical + " should have successors";
+                                // case 6
+                                node.replaceAtUsages(canonical);
+                                graph.removeFixed((FixedWithNextNode) node);
+                            }
+                        }
+                    }
+                    nodeWorkList.addAll(graph.getNewNodes());
+                }
+            } else if (node instanceof Simplifiable) {
+                ((Simplifiable) node).simplify(tool);
+            }
+        }
+        graph.stopTrackingInputChange();
+        while (graph.getUsagesDroppedNodesCount() > 0) {
+            for (Node n : graph.getAndCleanUsagesDroppedNodes()) {
+                if (!n.isDeleted() && n.usages().size() == 0 && n instanceof FloatingNode) {
+                    n.clearInputs();
+                    n.safeDelete();
+                }
+            }
+        }
+    }
+
+    private static final class Tool implements SimplifierTool {
+
+        private final NodeWorkList nodeWorkList;
+        private final RiRuntime runtime;
+        private final CiTarget target;
+        private final CiAssumptions assumptions;
+
+        public Tool(NodeWorkList nodeWorkList, RiRuntime runtime, CiTarget target, CiAssumptions assumptions) {
+            this.nodeWorkList = nodeWorkList;
+            this.runtime = runtime;
+            this.target = target;
+            this.assumptions = assumptions;
+        }
+
+        @Override
+        public void deleteBranch(FixedNode branch) {
+            branch.predecessor().replaceFirstSuccessor(branch, null);
+            GraphUtil.killCFG(branch);
+        }
+
+        /**
+         * @return the current target or {@code null} if no target is available in the current context.
+         */
+        @Override
+        public CiTarget target() {
+            return target;
+        }
+
+        /**
+         * @return an object that can be used for recording assumptions or {@code null} if assumptions are not allowed in the current context.
+         */
+        @Override
+        public CiAssumptions assumptions() {
+            return assumptions;
+        }
+
+        @Override
+        public RiRuntime runtime() {
+            return runtime;
+        }
+
+        @Override
+        public void addToWorkList(Node node) {
+            nodeWorkList.add(node);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,374 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.util.*;
+
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.graph.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+
+public class ComputeProbabilityPhase extends Phase {
+    private static final double EPSILON = 1d / Integer.MAX_VALUE;
+
+    /*
+     * The computation of absolute probabilities works in three steps:
+     *
+     * - The first step, "PropagateProbability", traverses the graph in post order (merges after their ends, ...) and keeps track of the "probability state".
+     *   Whenever it encounters a ControlSplit it uses the split's probability information to divide the probability upon the successors.
+     *   Whenever it encounters an Invoke it assumes that the exception edge is unlikely and propagates the whole probability to the normal successor.
+     *   Whenever it encounters a Merge it sums up the probability of all predecessors.
+     *   It also maintains a set of active loops (whose LoopBegin has been visited) and builds def/use information for the second step.
+     *
+     * - The third step propagates the loop frequencies and multiplies each FixedNode's probability with its loop frequency.
+     *
+     *   TODO: add exception probability information to Invokes
+     */
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        new PropagateProbability(graph.start()).apply();
+        Debug.dump(graph, "After PropagateProbability");
+        computeLoopFactors();
+        Debug.dump(graph, "After computeLoopFactors");
+        new PropagateLoopFrequency(graph.start()).apply();
+
+        if (GraalOptions.LoopFrequencyPropagationPolicy < 0) {
+            ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false);
+            BitMap visitedBlocks = new BitMap(cfg.getBlocks().length);
+            for (Loop loop : cfg.getLoops()) {
+                if (loop.parent == null) {
+                    correctLoopFrequencies(loop, 1, visitedBlocks);
+                }
+            }
+        }
+    }
+
+    private void correctLoopFrequencies(Loop loop, double parentFrequency, BitMap visitedBlocks) {
+        LoopBeginNode loopBegin = ((LoopBeginNode) loop.header.getBeginNode());
+        double frequency = parentFrequency * loopBegin.loopFrequency();
+        for (Loop child : loop.children) {
+            correctLoopFrequencies(child, frequency, visitedBlocks);
+        }
+
+        double factor = getCorrectionFactor(loopBegin.probability(), frequency);
+        for (Block block : loop.blocks) {
+            int blockId = block.getId();
+            if (!visitedBlocks.get(blockId)) {
+                visitedBlocks.set(blockId);
+
+                FixedNode node = block.getBeginNode();
+                while (node != block.getEndNode()) {
+                    node.setProbability(node.probability() * factor);
+                    node = ((FixedWithNextNode) node).next();
+                }
+                node.setProbability(node.probability() * factor);
+            }
+        }
+    }
+
+    private static double getCorrectionFactor(double probability, double frequency) {
+        switch (GraalOptions.LoopFrequencyPropagationPolicy) {
+            case -1:
+                return 1 / frequency;
+            case -2:
+                return (1 / frequency) * (Math.log(Math.E + frequency) - 1);
+            case -3:
+                double originalProbability = probability / frequency;
+                assert isRelativeProbability(originalProbability);
+                return (1 / frequency) * Math.max(1, Math.pow(originalProbability, 1.5) * Math.log10(frequency));
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private void computeLoopFactors() {
+        for (LoopInfo info : loopInfos) {
+            double frequency = info.loopFrequency();
+            assert frequency != -1;
+        }
+    }
+
+    private static boolean isRelativeProbability(double prob) {
+        // 1.01 to allow for some rounding errors
+        return prob >= 0 && prob <= 1.01;
+    }
+
+    public static class LoopInfo {
+        public final LoopBeginNode loopBegin;
+
+        public final NodeMap<Set<LoopInfo>> requires;
+
+        private double loopFrequency = -1;
+        public boolean ended = false;
+
+        public LoopInfo(LoopBeginNode loopBegin) {
+            this.loopBegin = loopBegin;
+            this.requires = loopBegin.graph().createNodeMap();
+        }
+
+        public double loopFrequency() {
+            if (loopFrequency == -1 && ended) {
+                double backEdgeProb = 0.0;
+                for (LoopEndNode le : loopBegin.loopEnds()) {
+                    double factor = 1;
+                    Set<LoopInfo> requireds = requires.get(le);
+                    for (LoopInfo required : requireds) {
+                        double t = required.loopFrequency();
+                        if (t == -1) {
+                            return -1;
+                        }
+                        factor *= t;
+                    }
+                    backEdgeProb += le.probability() * factor;
+                }
+                double d = backEdgeProb;
+                if (d < EPSILON) {
+                    d = EPSILON;
+                } else if (d > loopBegin.probability() - EPSILON) {
+                    d = loopBegin.probability() - EPSILON;
+                }
+                loopFrequency = loopBegin.probability() / (loopBegin.probability() - d);
+                loopBegin.setLoopFrequency(loopFrequency);
+            }
+            return loopFrequency;
+        }
+    }
+
+    public Set<LoopInfo> loopInfos = new HashSet<>();
+    public Map<MergeNode, Set<LoopInfo>> mergeLoops = new IdentityHashMap<>();
+
+    private class Probability implements MergeableState<Probability> {
+        public double probability;
+        public HashSet<LoopInfo> loops;
+        public LoopInfo loopInfo;
+
+        public Probability(double probability, HashSet<LoopInfo> loops) {
+            this.probability = probability;
+            this.loops = new HashSet<>(4);
+            if (loops != null) {
+                this.loops.addAll(loops);
+            }
+        }
+
+        @Override
+        public Probability clone() {
+            return new Probability(probability, loops);
+        }
+
+        @Override
+        public boolean merge(MergeNode merge, Collection<Probability> withStates) {
+            if (merge.forwardEndCount() > 1) {
+                HashSet<LoopInfo> intersection = new HashSet<>(loops);
+                for (Probability other : withStates) {
+                    intersection.retainAll(other.loops);
+                }
+                for (LoopInfo info : loops) {
+                    if (!intersection.contains(info)) {
+                        double loopFrequency = info.loopFrequency();
+                        if (loopFrequency == -1) {
+                            return false;
+                        }
+                        probability *= loopFrequency;
+                    }
+                }
+                for (Probability other : withStates) {
+                    double prob = other.probability;
+                    for (LoopInfo info : other.loops) {
+                        if (!intersection.contains(info)) {
+                            double loopFrequency = info.loopFrequency();
+                            if (loopFrequency == -1) {
+                                return false;
+                            }
+                            prob *= loopFrequency;
+                        }
+                    }
+                    probability += prob;
+                }
+                loops = intersection;
+                mergeLoops.put(merge, new HashSet<>(intersection));
+                assert isRelativeProbability(probability) : probability;
+            }
+            return true;
+        }
+
+        @Override
+        public void loopBegin(LoopBeginNode loopBegin) {
+            loopInfo = new LoopInfo(loopBegin);
+            loopInfos.add(loopInfo);
+            loops.add(loopInfo);
+        }
+
+        @Override
+        public void loopEnds(LoopBeginNode loopBegin, Collection<Probability> loopEndStates) {
+            assert loopInfo != null;
+            List<LoopEndNode> loopEnds = loopBegin.orderedLoopEnds();
+            int i = 0;
+            for (Probability proba : loopEndStates) {
+                LoopEndNode loopEnd = loopEnds.get(i++);
+                Set<LoopInfo> requires = loopInfo.requires.get(loopEnd);
+                if (requires == null) {
+                    requires = new HashSet<>();
+                    loopInfo.requires.set(loopEnd, requires);
+                }
+                for (LoopInfo innerLoop : proba.loops) {
+                    if (innerLoop != loopInfo && !this.loops.contains(innerLoop)) {
+                        requires.add(innerLoop);
+                    }
+                }
+            }
+            loopInfo.ended = true;
+        }
+
+        @Override
+        public void afterSplit(FixedNode node) {
+            assert node.predecessor() != null;
+            Node pred = node.predecessor();
+            if (pred instanceof Invoke) {
+                Invoke x = (Invoke) pred;
+                if (x.next() != node) {
+                    probability = 0;
+                }
+            } else {
+                assert pred instanceof ControlSplitNode;
+                ControlSplitNode x = (ControlSplitNode) pred;
+                double sum = 0;
+                for (int i = 0; i < x.blockSuccessorCount(); i++) {
+                    if (x.blockSuccessor(i) == node) {
+                        sum += x.probability(i);
+                    }
+                }
+                probability *= sum;
+            }
+        }
+    }
+
+    private class PropagateProbability extends PostOrderNodeIterator<Probability> {
+
+        public PropagateProbability(FixedNode start) {
+            super(start, new Probability(1d, null));
+        }
+
+        @Override
+        protected void node(FixedNode node) {
+            node.setProbability(state.probability);
+        }
+    }
+
+    private class LoopCount implements MergeableState<LoopCount> {
+        public double count;
+
+        public LoopCount(double count) {
+            this.count = count;
+        }
+
+        @Override
+        public LoopCount clone() {
+            return new LoopCount(count);
+        }
+
+        @Override
+        public boolean merge(MergeNode merge, Collection<LoopCount> withStates) {
+            assert merge.forwardEndCount() == withStates.size() + 1;
+            if (merge.forwardEndCount() > 1) {
+                Set<LoopInfo> loops = mergeLoops.get(merge);
+                assert loops != null;
+                double countProd = 1;
+                for (LoopInfo loop : loops) {
+                    countProd *= loop.loopFrequency();
+                }
+                count = countProd;
+            }
+            return true;
+        }
+
+        @Override
+        public void loopBegin(LoopBeginNode loopBegin) {
+            count *= loopBegin.loopFrequency();
+        }
+
+        @Override
+        public void loopEnds(LoopBeginNode loopBegin, Collection<LoopCount> loopEndStates) {
+            // nothing to do...
+        }
+
+        @Override
+        public void afterSplit(FixedNode node) {
+            // nothing to do...
+        }
+    }
+
+    private class PropagateLoopFrequency extends PostOrderNodeIterator<LoopCount> {
+
+        private final FrequencyPropagationPolicy policy;
+
+        public PropagateLoopFrequency(FixedNode start) {
+            super(start, new LoopCount(1d));
+            this.policy = createFrequencyPropagationPolicy();
+        }
+
+        @Override
+        protected void node(FixedNode node) {
+            node.setProbability(policy.compute(node.probability(), state.count));
+        }
+
+    }
+
+    private static FrequencyPropagationPolicy createFrequencyPropagationPolicy() {
+        switch (GraalOptions.LoopFrequencyPropagationPolicy) {
+            case -3:
+            case -2:
+            case -1:
+            case 0:
+                return new FullFrequencyPropagation();
+            case 1:
+                return new NoFrequencyPropagation();
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private interface FrequencyPropagationPolicy {
+
+        double compute(double probability, double frequency);
+    }
+
+    private static class FullFrequencyPropagation implements FrequencyPropagationPolicy {
+
+        @Override
+        public double compute(double probability, double frequency) {
+            return probability * frequency;
+        }
+    }
+
+    private static class NoFrequencyPropagation implements FrequencyPropagationPolicy {
+
+        @Override
+        public double compute(double probability, double frequency) {
+            return probability;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ConvertDeoptimizeToGuardPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.util.*;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.util.*;
+
+public class ConvertDeoptimizeToGuardPhase extends Phase {
+
+    private static BeginNode findBeginNode(Node startNode) {
+        Node n = startNode;
+        while (true) {
+            if (n instanceof BeginNode) {
+                return (BeginNode) n;
+            } else {
+                n = n.predecessor();
+            }
+        }
+    }
+
+    @Override
+    protected void run(final StructuredGraph graph) {
+        if (graph.getNodes(DeoptimizeNode.class).isEmpty()) {
+            return;
+        }
+
+        for (DeoptimizeNode d : graph.getNodes(DeoptimizeNode.class)) {
+            visitDeoptBranch(findBeginNode(d), d, graph);
+        }
+
+        new DeadCodeEliminationPhase().apply(graph);
+    }
+
+    private void visitDeoptBranch(BeginNode deoptBegin, DeoptimizeNode deopt, StructuredGraph graph) {
+        if (deoptBegin instanceof MergeNode) {
+            MergeNode mergeNode = (MergeNode) deoptBegin;
+            Debug.log("Eliminating %s followed by %s", mergeNode, deopt);
+            List<EndNode> ends = mergeNode.forwardEnds().snapshot();
+            for (EndNode end : ends) {
+                if (!end.isDeleted()) {
+                    BeginNode beginNode = findBeginNode(end);
+                    visitDeoptBranch(beginNode, deopt, graph);
+                }
+            }
+            if (!deopt.isDeleted()) {
+                visitDeoptBranch(findBeginNode(deopt), deopt, graph);
+            }
+        } else if (deoptBegin.predecessor() instanceof IfNode) {
+            IfNode ifNode = (IfNode) deoptBegin.predecessor();
+            BeginNode otherBegin = ifNode.trueSuccessor();
+            BooleanNode conditionNode = ifNode.compare();
+            if (deoptBegin == ifNode.trueSuccessor()) {
+                conditionNode = conditionNode.negate();
+                otherBegin = ifNode.falseSuccessor();
+            }
+            BeginNode ifBlockBegin = findBeginNode(ifNode);
+            Debug.log("Converting %s on %-5s branch of %s to guard for remaining branch %s. IfBegin=%s", deopt, deoptBegin == ifNode.trueSuccessor() ? "true" : "false", ifNode, otherBegin, ifBlockBegin);
+            FixedGuardNode guard = graph.add(new FixedGuardNode(conditionNode));
+            otherBegin.replaceAtUsages(ifBlockBegin);
+            FixedNode next = otherBegin.next();
+            otherBegin.setNext(null);
+            guard.setNext(next);
+            ifNode.replaceAtPredecessors(guard);
+            GraphUtil.killCFG(ifNode);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/DeadCodeEliminationPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+
+public class DeadCodeEliminationPhase extends Phase {
+
+    private NodeFlood flood;
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        this.flood = graph.createNodeFlood();
+
+        flood.add(graph.start());
+        iterateSuccessors();
+        disconnectCFGNodes(graph);
+        iterateInputs(graph);
+        deleteNodes(graph);
+
+        // remove chained Merges
+        for (MergeNode merge : graph.getNodes(MergeNode.class)) {
+            if (merge.forwardEndCount() == 1 && !(merge instanceof LoopBeginNode)) {
+                graph.reduceTrivialMerge(merge);
+            }
+        }
+    }
+
+    private void iterateSuccessors() {
+        for (Node current : flood) {
+            if (current instanceof EndNode) {
+                EndNode end = (EndNode) current;
+                flood.add(end.merge());
+            } else {
+                for (Node successor : current.successors()) {
+                    flood.add(successor);
+                }
+            }
+        }
+    }
+
+    private void disconnectCFGNodes(StructuredGraph graph) {
+        for (EndNode node : graph.getNodes(EndNode.class)) {
+            if (!flood.isMarked(node)) {
+                MergeNode merge = node.merge();
+                if (merge != null && flood.isMarked(merge)) {
+                    // We are a dead end node leading to a live merge.
+                    merge.removeEnd(node);
+                }
+            }
+        }
+        for (LoopBeginNode loop : graph.getNodes(LoopBeginNode.class)) {
+            if (flood.isMarked(loop)) {
+                boolean reachable = false;
+                for (LoopEndNode end : loop.loopEnds()) {
+                    if (flood.isMarked(end)) {
+                        reachable = true;
+                        break;
+                    }
+                }
+                if (!reachable) {
+                    Debug.log("Removing loop with unreachable end: %s", loop);
+                    for (LoopEndNode end : loop.loopEnds().snapshot()) {
+                        loop.removeEnd(end);
+                    }
+                    graph.reduceDegenerateLoopBegin(loop);
+                }
+            }
+        }
+    }
+
+    private void deleteNodes(StructuredGraph graph) {
+        for (Node node : graph.getNodes()) {
+            if (!flood.isMarked(node)) {
+                node.clearInputs();
+                node.clearSuccessors();
+            }
+        }
+        for (Node node : graph.getNodes()) {
+            if (!flood.isMarked(node)) {
+                node.safeDelete();
+            }
+        }
+    }
+
+    private void iterateInputs(StructuredGraph graph) {
+        for (Node node : graph.getNodes()) {
+            if (node instanceof LocalNode) {
+                flood.add(node);
+            }
+            if (flood.isMarked(node)) {
+                for (Node input : node.inputs()) {
+                    flood.add(input);
+                }
+            }
+        }
+        for (Node current : flood) {
+            for (Node input : current.inputs()) {
+                flood.add(input);
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,460 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.graph.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.PhiNode.PhiType;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.virtual.*;
+
+
+public class EscapeAnalysisPhase extends Phase {
+
+    public static class BlockExitState implements MergeableState<BlockExitState> {
+        public final ValueNode[] fieldState;
+        public final VirtualObjectNode virtualObject;
+        public ValueNode virtualObjectField;
+        public final Graph graph;
+
+        public BlockExitState(EscapeField[] fields, VirtualObjectNode virtualObject) {
+            this.fieldState = new ValueNode[fields.length];
+            this.virtualObject = virtualObject;
+            this.virtualObjectField = null;
+            this.graph = virtualObject.graph();
+            for (int i = 0; i < fields.length; i++) {
+                fieldState[i] = ConstantNode.defaultForKind(fields[i].type().kind(true), virtualObject.graph());
+                virtualObjectField = graph.add(new VirtualObjectFieldNode(virtualObject, virtualObjectField, fieldState[i], i));
+            }
+        }
+
+        public BlockExitState(BlockExitState state) {
+            this.fieldState = state.fieldState.clone();
+            this.virtualObject = state.virtualObject;
+            this.virtualObjectField = state.virtualObjectField;
+            this.graph = state.graph;
+        }
+
+        public void updateField(int fieldIndex) {
+            virtualObjectField = graph.add(new VirtualObjectFieldNode(virtualObject, virtualObjectField, fieldState[fieldIndex], fieldIndex));
+        }
+
+        @Override
+        public BlockExitState clone() {
+            return new BlockExitState(this);
+        }
+
+        @Override
+        public boolean merge(MergeNode merge, Collection<BlockExitState> withStates) {
+            PhiNode vobjPhi = null;
+            PhiNode[] valuePhis = new PhiNode[fieldState.length];
+            for (BlockExitState other : withStates) {
+                if (virtualObjectField != other.virtualObjectField && vobjPhi == null) {
+                    vobjPhi = graph.add(new PhiNode(CiKind.Illegal, merge, PhiType.Virtual));
+                    vobjPhi.addInput(virtualObjectField);
+                    virtualObjectField = vobjPhi;
+                }
+                for (int i2 = 0; i2 < fieldState.length; i2++) {
+                    if (fieldState[i2] != other.fieldState[i2] && valuePhis[i2] == null) {
+                        valuePhis[i2] = graph.add(new PhiNode(fieldState[i2].kind(), merge, PhiType.Value));
+                        valuePhis[i2].addInput(fieldState[i2]);
+                        fieldState[i2] = valuePhis[i2];
+                    }
+                }
+            }
+            for (BlockExitState other : withStates) {
+                if (vobjPhi != null) {
+                    vobjPhi.addInput(other.virtualObjectField);
+                }
+                for (int i2 = 0; i2 < fieldState.length; i2++) {
+                    if (valuePhis[i2] != null) {
+                        valuePhis[i2].addInput(other.fieldState[i2]);
+                    }
+                }
+            }
+            assert vobjPhi == null || vobjPhi.valueCount() == withStates.size() + 1;
+            for (int i2 = 0; i2 < fieldState.length; i2++) {
+                if (valuePhis[i2] != null) {
+                    virtualObjectField = graph.add(new VirtualObjectFieldNode(virtualObject, virtualObjectField, valuePhis[i2], i2));
+                    assert valuePhis[i2].valueCount() == withStates.size() + 1;
+                }
+            }
+            return true;
+        }
+
+        @Override
+        public void loopBegin(LoopBeginNode loopBegin) {
+            assert virtualObjectField != null : "unexpected null virtualObjectField";
+            PhiNode vobjPhi = null;
+            vobjPhi = graph.add(new PhiNode(CiKind.Illegal, loopBegin, PhiType.Virtual));
+            vobjPhi.addInput(virtualObjectField);
+            virtualObjectField = vobjPhi;
+            for (int i2 = 0; i2 < fieldState.length; i2++) {
+                PhiNode valuePhi = graph.add(new PhiNode(fieldState[i2].kind(), loopBegin, PhiType.Value));
+                valuePhi.addInput(fieldState[i2]);
+                fieldState[i2] = valuePhi;
+                updateField(i2);
+            }
+        }
+
+        @Override
+        public void loopEnds(LoopBeginNode loopBegin, Collection<BlockExitState> loopEndStates) {
+            while (!(virtualObjectField instanceof PhiNode)) {
+                virtualObjectField = ((VirtualObjectFieldNode) virtualObjectField).lastState();
+            }
+            for (BlockExitState loopEndState : loopEndStates) {
+                ((PhiNode) virtualObjectField).addInput(loopEndState.virtualObjectField);
+                for (int i2 = 0; i2 < fieldState.length; i2++) {
+                    ((PhiNode) fieldState[i2]).addInput(loopEndState.fieldState[i2]);
+                }
+            }
+        }
+
+        @Override
+        public void afterSplit(FixedNode node) {
+            // nothing to do...
+        }
+    }
+
+
+    public static class EscapementFixup {
+
+        private final Map<Object, Integer> fields = new HashMap<>();
+        private final EscapeOp op;
+        private final StructuredGraph graph;
+        private final FixedWithNextNode node;
+        private EscapeField[] escapeFields;
+
+        public EscapementFixup(EscapeOp op, StructuredGraph graph, FixedWithNextNode node) {
+            this.op = op;
+            this.graph = graph;
+            this.node = node;
+        }
+
+        public void apply() {
+            if (node.usages().isEmpty()) {
+                graph.removeFixed(node);
+            } else {
+                process();
+                removeAllocation();
+            }
+        }
+
+        public void removeAllocation() {
+            escapeFields = op.fields(node);
+            for (int i = 0; i < escapeFields.length; i++) {
+                fields.put(escapeFields[i].representation(), i);
+            }
+            final VirtualObjectNode virtual = graph.add(new VirtualObjectNode(((ValueNode) node).exactType(), escapeFields));
+            if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
+                TTY.println("new virtual object: " + virtual);
+            }
+            node.replaceAtUsages(virtual);
+            FixedNode next = node.next();
+            graph.removeFixed(node);
+
+            if (virtual.fieldsCount() > 0) {
+                final BlockExitState startState = new BlockExitState(escapeFields, virtual);
+                final PostOrderNodeIterator<?> iterator = new PostOrderNodeIterator<BlockExitState>(next, startState) {
+                    @Override
+                    protected void node(FixedNode curNode) {
+                        int changedField = op.updateState(virtual, curNode, fields, state.fieldState);
+                        if (changedField != -1) {
+                            state.updateField(changedField);
+                        }
+                        if (!curNode.isDeleted() && curNode instanceof StateSplit && ((StateSplit) curNode).stateAfter() != null) {
+                            if (state.virtualObjectField != null) {
+                                ((StateSplit) curNode).stateAfter().addVirtualObjectMapping(state.virtualObjectField);
+                            }
+                        }
+                    }
+                };
+                iterator.apply();
+            }
+        }
+
+        private void process() {
+            for (Node usage : node.usages().snapshot()) {
+                op.beforeUpdate(node, usage);
+            }
+        }
+    }
+
+    private final CiTarget target;
+    private final GraalRuntime runtime;
+    private final CiAssumptions assumptions;
+    private final PhasePlan plan;
+
+    public EscapeAnalysisPhase(CiTarget target, GraalRuntime runtime, CiAssumptions assumptions, PhasePlan plan) {
+        this.runtime = runtime;
+        this.target = target;
+        this.assumptions = assumptions;
+        this.plan = plan;
+    }
+
+    public static class EscapeRecord {
+
+        public final Node node;
+        public final ArrayList<Node> escapesThrough = new ArrayList<>();
+        public final ArrayList<Invoke> invokes = new ArrayList<>();
+        public double localWeight;
+
+        public EscapeRecord(Node node) {
+            this.node = node;
+        }
+
+        public void dump() {
+            TTY.print("node %s (%f) escapes through ", node, localWeight);
+            for (Node escape : escapesThrough) {
+                TTY.print("%s ", escape);
+            }
+            TTY.println();
+        }
+    }
+
+    private static Node escape(EscapeRecord record, Node usage) {
+        final Node node = record.node;
+        if (usage instanceof FrameState) {
+            assert usage.inputs().contains(node);
+            return null;
+        } else {
+            if (usage instanceof FixedNode) {
+                record.localWeight += ((FixedNode) usage).probability();
+            }
+            if (usage instanceof NullCheckNode) {
+                assert ((NullCheckNode) usage).object() == node;
+                return null;
+            } else if (usage instanceof IsTypeNode) {
+                assert ((IsTypeNode) usage).objectClass() == node;
+                return null;
+            } else if (usage instanceof AccessMonitorNode) {
+                assert ((AccessMonitorNode) usage).object() == node;
+                return null;
+            } else if (usage instanceof LoadFieldNode) {
+                assert ((LoadFieldNode) usage).object() == node;
+                return null;
+            } else if (usage instanceof StoreFieldNode) {
+                StoreFieldNode x = (StoreFieldNode) usage;
+                // self-references do not escape
+                return x.value() == node ? x.object() : null;
+            } else if (usage instanceof LoadIndexedNode) {
+                LoadIndexedNode x = (LoadIndexedNode) usage;
+                if (x.index() == node) {
+                    return x.array();
+                } else {
+                    assert x.array() == node;
+                    return EscapeOp.isValidConstantIndex(x) ? null : x.array();
+                }
+            } else if (usage instanceof StoreIndexedNode) {
+                StoreIndexedNode x = (StoreIndexedNode) usage;
+                if (x.index() == node) {
+                    return x.array();
+                } else {
+                    assert x.array() == node || x.value() == node;
+                    // in order to not escape, the access needs to have a valid constant index and either a store into node or be self-referencing
+                    return EscapeOp.isValidConstantIndex(x) && x.value() != node ? null : x.array();
+                }
+            } else if (usage instanceof VirtualObjectFieldNode) {
+                return null;
+            } else if (usage instanceof RegisterFinalizerNode) {
+                assert ((RegisterFinalizerNode) usage).object() == node;
+                return null;
+            } else if (usage instanceof ArrayLengthNode) {
+                assert ((ArrayLengthNode) usage).array() == node;
+                return null;
+            } else {
+                return usage;
+            }
+        }
+    }
+
+    @SuppressWarnings("unused")
+    private static void completeAnalysis(StructuredGraph graph) {
+        // TODO (lstadler): debugging code
+
+        TTY.println("================================================================");
+        for (Node node : graph.getNodes()) {
+            if (node != null && node instanceof FixedWithNextNode && node instanceof EscapeAnalyzable) {
+                EscapeOp op = ((EscapeAnalyzable) node).getEscapeOp();
+                if (op != null && op.canAnalyze(node)) {
+                    EscapeRecord record = new EscapeRecord(node);
+
+                    for (Node usage : node.usages()) {
+                        Node escapesThrough = escape(record, usage);
+                        if (escapesThrough != null && escapesThrough != node) {
+                            record.escapesThrough.add(escapesThrough);
+                        }
+                    }
+                    record.dump();
+                }
+            }
+        }
+    }
+
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (Node node : new GraphOrder(graph)) {
+            if (node != null && node instanceof FixedWithNextNode && node instanceof EscapeAnalyzable) {
+                FixedWithNextNode fixedNode = (FixedWithNextNode) node;
+                EscapeOp op = ((EscapeAnalyzable) node).getEscapeOp();
+                if (op != null && op.canAnalyze(fixedNode)) {
+                    try {
+                        performAnalysis(graph, fixedNode, op);
+                    } catch (GraalInternalError e) {
+                        throw e.addContext("escape analysis of node", node);
+                    }
+                }
+            }
+        }
+    }
+
+    private void performAnalysis(StructuredGraph graph, FixedWithNextNode node, EscapeOp op) {
+        if (!shouldAnalyze(node)) {
+            return;
+        }
+        Set<Node> exits = new HashSet<>();
+        Set<Invoke> invokes = new HashSet<>();
+        int iterations = 0;
+
+        int minimumWeight = getMinimumWeight(node);
+        do {
+            double weight = analyze(op, node, exits, invokes);
+            if (exits.size() != 0) {
+                if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
+                    TTY.println("%n####### escaping object: %s (%s)", node, node.exactType());
+                    if (GraalOptions.TraceEscapeAnalysis) {
+                        TTY.print("%d: new value: %s, weight %f, escapes at ", iterations, node, weight);
+                        for (Node n : exits) {
+                            TTY.print("%s, ", n);
+                        }
+                        for (Invoke n : invokes) {
+                            TTY.print("%s, ", n);
+                        }
+                        TTY.println();
+                    }
+                }
+                break;
+            }
+            if (invokes.size() == 0) {
+
+                Debug.dump(graph, "Before escape %s", node);
+                Debug.log("!!!!!!!! non-escaping object: %s (%s)", node, node.exactType());
+                removeAllocation(node, op);
+                Debug.dump(graph, "After escape", graph);
+                break;
+            }
+            if (weight < minimumWeight) {
+                if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
+                    TTY.println("####### possibly escaping object: %s (insufficient weight for inlining: %f)", node, weight);
+                }
+                break;
+            }
+            if (!GraalOptions.Inline) {
+                break;
+            }
+            if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
+                TTY.println("Trying inlining to get a non-escaping object for %s", node);
+            }
+            new InliningPhase(target, runtime, invokes, assumptions, plan).apply(graph);
+            new DeadCodeEliminationPhase().apply(graph);
+            if (node.isDeleted()) {
+                if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
+                    TTY.println("!!!!!!!! object died while performing escape analysis: %s (%s)", node, node.exactType());
+                }
+                break;
+            }
+            exits.clear();
+            invokes.clear();
+        } while (iterations++ < 3);
+    }
+
+    protected void removeAllocation(FixedWithNextNode node, EscapeOp op) {
+        new EscapementFixup(op, (StructuredGraph) node.graph(), node).apply();
+
+        for (PhiNode phi : node.graph().getNodes(PhiNode.class)) {
+            ValueNode simpleValue = phi;
+            boolean required = false;
+            for (ValueNode value : phi.values()) {
+                if (value != phi && value != simpleValue) {
+                    if (simpleValue != phi) {
+                        required = true;
+                        break;
+                    }
+                    simpleValue = value;
+                }
+            }
+            if (!required) {
+                ((StructuredGraph) node.graph()).replaceFloating(phi, simpleValue);
+            }
+        }
+    }
+
+    protected boolean shouldAnalyze(@SuppressWarnings("unused") FixedWithNextNode node) {
+        return true;
+    }
+
+    protected int getMinimumWeight(@SuppressWarnings("unused") FixedWithNextNode node) {
+        return GraalOptions.ForcedInlineEscapeWeight;
+    }
+
+    private static double analyze(EscapeOp op, Node node, Collection<Node> exits, Collection<Invoke> invokes) {
+        double weight = 0;
+        for (Node usage : node.usages().snapshot()) {
+            boolean escapes = op.escape(node, usage);
+            if (escapes) {
+                if (usage instanceof FrameState) {
+                    // nothing to do...
+                } else if (usage instanceof MethodCallTargetNode) {
+                    if (usage.usages().size() == 0) {
+                        usage.safeDelete();
+                    } else {
+                        invokes.add(((MethodCallTargetNode) usage).invoke());
+                    }
+                } else {
+                    exits.add(usage);
+                    break;
+                }
+            } else {
+                if (GraalOptions.ProbabilityAnalysis && usage instanceof FixedNode) {
+                    weight += ((FixedNode) usage).probability();
+                } else {
+                    weight++;
+                }
+            }
+        }
+        return weight;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ExpandBoxingNodesPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+
+public class ExpandBoxingNodesPhase extends Phase {
+
+    private final BoxingMethodPool pool;
+
+    public ExpandBoxingNodesPhase(BoxingMethodPool pool) {
+        this.pool = pool;
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (BoxNode boxNode : graph.getNodes(BoxNode.class)) {
+            boxNode.expand(pool);
+        }
+
+        for (UnboxNode unboxNode : graph.getNodes(UnboxNode.class)) {
+            unboxNode.expand(pool);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/FloatingReadPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,314 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.PhiNode.PhiType;
+import com.oracle.graal.nodes.extended.*;
+
+public class FloatingReadPhase extends Phase {
+
+    private static class MemoryMap {
+        private Block block;
+        private IdentityHashMap<Object, Node> map;
+        private IdentityHashMap<Object, Node> loopEntryMap;
+        private int mergeOperationCount;
+
+        public MemoryMap(Block block) {
+            this.block = block;
+            map = new IdentityHashMap<>();
+        }
+
+        public MemoryMap(Block block, MemoryMap other) {
+            this(block);
+            map.putAll(other.map);
+        }
+
+        public void mergeLoopEntryWith(MemoryMap otherMemoryMap, LoopBeginNode begin) {
+            for (Object keyInOther : otherMemoryMap.map.keySet()) {
+                assert loopEntryMap.containsKey(keyInOther) || map.get(keyInOther) == otherMemoryMap.map.get(keyInOther) : keyInOther + ", " + map.get(keyInOther) + " vs " + otherMemoryMap.map.get(keyInOther) + " " + begin;
+            }
+
+            for (Map.Entry<Object, Node> entry : loopEntryMap.entrySet()) {
+                PhiNode phiNode = (PhiNode) entry.getValue();
+                Object key = entry.getKey();
+                Node other;
+                if (otherMemoryMap.map.containsKey(key)) {
+                    other = otherMemoryMap.map.get(key);
+                } else {
+                    other = otherMemoryMap.map.get(LocationNode.ANY_LOCATION);
+                }
+
+                phiNode.addInput((ValueNode) other);
+            }
+        }
+
+        public void mergeWith(MemoryMap otherMemoryMap, Block b) {
+            Debug.log("Merging block %s into block %s.", otherMemoryMap.block, block);
+            IdentityHashMap<Object, Node> otherMap = otherMemoryMap.map;
+
+            for (Map.Entry<Object, Node> entry : map.entrySet()) {
+                if (otherMap.containsKey(entry.getKey())) {
+                    mergeNodes(entry.getKey(), entry.getValue(), otherMap.get(entry.getKey()), b);
+                } else {
+                    mergeNodes(entry.getKey(), entry.getValue(), otherMap.get(LocationNode.ANY_LOCATION), b);
+                }
+            }
+
+            Node anyLocationNode = map.get(LocationNode.ANY_LOCATION);
+            for (Map.Entry<Object, Node> entry : otherMap.entrySet()) {
+                if (!map.containsKey(entry.getKey())) {
+                    Node current = anyLocationNode;
+                    if (anyLocationNode instanceof PhiNode) {
+                        PhiNode phiNode = (PhiNode) anyLocationNode;
+                        if (phiNode.merge() == block.getBeginNode()) {
+                            PhiNode phiCopy = (PhiNode) phiNode.copyWithInputs();
+                            phiCopy.removeInput(phiCopy.valueCount() - 1);
+                            current = phiCopy;
+                            map.put(entry.getKey(), current);
+                        }
+                    }
+                    mergeNodes(entry.getKey(), current, entry.getValue(), b);
+                }
+            }
+
+            mergeOperationCount++;
+        }
+
+        private void mergeNodes(Object location, Node original, Node newValue, Block mergeBlock) {
+            if (original == newValue) {
+                Debug.log("Nothing to merge both nodes are %s.", original);
+                return;
+            }
+            MergeNode m = (MergeNode) mergeBlock.getBeginNode();
+            if (m.isPhiAtMerge(original)) {
+                PhiNode phi = (PhiNode) original;
+                phi.addInput((ValueNode) newValue);
+                Debug.log("Add new input to %s: %s.", original, newValue);
+                assert phi.valueCount() <= phi.merge().forwardEndCount() : phi.merge();
+            } else {
+                PhiNode phi = m.graph().unique(new PhiNode(CiKind.Illegal, m, PhiType.Memory));
+                for (int i = 0; i < mergeOperationCount + 1; ++i) {
+                    phi.addInput((ValueNode) original);
+                }
+                phi.addInput((ValueNode) newValue);
+                Debug.log("Creating new %s merge=%s newValue=%s location=%s.", phi, phi.merge(), newValue, location);
+                assert phi.valueCount() <= phi.merge().forwardEndCount() + ((phi.merge() instanceof LoopBeginNode) ? 1 : 0) : phi.merge() + "/" + phi.valueCount() + "/" + phi.merge().forwardEndCount() + "/" + mergeOperationCount;
+                assert m.usages().contains(phi);
+                assert phi.merge().usages().contains(phi);
+                for (Node input : phi.inputs()) {
+                    assert input.usages().contains(phi);
+                }
+                map.put(location, phi);
+            }
+        }
+
+        public void processCheckpoint(MemoryCheckpoint checkpoint) {
+            map.clear();
+            map.put(LocationNode.ANY_LOCATION, (Node) checkpoint);
+        }
+
+        public void processWrite(WriteNode writeNode) {
+            map.put(writeNode.location().locationIdentity(), writeNode);
+        }
+
+        public void processRead(ReadNode readNode) {
+            StructuredGraph graph = (StructuredGraph) readNode.graph();
+            assert readNode.getNullCheck() == false;
+
+            Debug.log("Register read to node %s.", readNode);
+            FloatingReadNode floatingRead;
+            if (readNode.location().locationIdentity() == LocationNode.FINAL_LOCATION) {
+                floatingRead = graph.unique(new FloatingReadNode(readNode.kind(), readNode.object(), readNode.guard(), readNode.location()));
+            } else {
+                floatingRead = graph.unique(new FloatingReadNode(readNode.kind(), readNode.object(), readNode.guard(), readNode.location(), getLocationForRead(readNode)));
+            }
+            graph.replaceFixedWithFloating(readNode, floatingRead);
+        }
+
+        private Node getLocationForRead(ReadNode readNode) {
+            Object locationIdentity = readNode.location().locationIdentity();
+            Node result = map.get(locationIdentity);
+            if (result == null) {
+                result = map.get(LocationNode.ANY_LOCATION);
+            }
+            return result;
+        }
+
+        public void createLoopEntryMemoryMap(Set<Object> modifiedLocations, Loop loop) {
+
+            loopEntryMap = new IdentityHashMap<>();
+
+            for (Object modifiedLocation : modifiedLocations) {
+                Node other;
+                if (map.containsKey(modifiedLocation)) {
+                    other = map.get(modifiedLocation);
+                } else {
+                    other = map.get(LocationNode.ANY_LOCATION);
+                }
+                createLoopEntryPhi(modifiedLocation, other, loop);
+            }
+
+            if (modifiedLocations.contains(LocationNode.ANY_LOCATION)) {
+                for (Map.Entry<Object, Node> entry : map.entrySet()) {
+                    if (!modifiedLocations.contains(entry.getKey())) {
+                        createLoopEntryPhi(entry.getKey(), entry.getValue(), loop);
+                    }
+                }
+            }
+        }
+
+        private void createLoopEntryPhi(Object modifiedLocation, Node other, Loop loop) {
+            PhiNode phi = other.graph().unique(new PhiNode(CiKind.Illegal, (MergeNode) loop.header.getBeginNode(), PhiType.Memory));
+            phi.addInput((ValueNode) other);
+            map.put(modifiedLocation, phi);
+            loopEntryMap.put(modifiedLocation, phi);
+        }
+
+
+        public IdentityHashMap<Object, Node> getLoopEntryMap() {
+            return loopEntryMap;
+        }
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+
+        // Add start node write checkpoint.
+        addStartCheckpoint(graph);
+
+        // Identify blocks.
+        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false);
+        Block[] blocks = cfg.getBlocks();
+
+        HashMap<Loop, Set<Object>> modifiedValues = new HashMap<>();
+        // Initialize modified values to empty hash set.
+        for (Loop loop : cfg.getLoops()) {
+            modifiedValues.put(loop, new HashSet<>());
+        }
+
+        // Get modified values in loops.
+        for (Node n : graph.getNodes()) {
+            Block block = cfg.blockFor(n);
+            if (block != null && block.getLoop() != null) {
+                if (n instanceof WriteNode) {
+                    WriteNode writeNode = (WriteNode) n;
+                    traceWrite(block.getLoop(), writeNode.location().locationIdentity(), modifiedValues);
+                } else if (n instanceof MemoryCheckpoint) {
+                    traceMemoryCheckpoint(block.getLoop(), modifiedValues);
+                }
+            }
+        }
+
+        // Propagate values to parent loops.
+        for (Loop loop : cfg.getLoops()) {
+            if (loop.depth == 1) {
+                propagateFromChildren(loop, modifiedValues);
+            }
+        }
+
+        Debug.log("Modified values: %s.", modifiedValues);
+
+
+        // Process blocks (predecessors first).
+        MemoryMap[] memoryMaps = new MemoryMap[blocks.length];
+        for (final Block b : blocks) {
+            processBlock(b, memoryMaps, cfg.getNodeToBlock(), modifiedValues);
+        }
+    }
+
+    private static void addStartCheckpoint(StructuredGraph graph) {
+        BeginNode entryPoint = graph.start();
+        FixedNode next = entryPoint.next();
+        if (!(next instanceof MemoryCheckpoint)) {
+            graph.addAfterFixed(entryPoint, graph.add(new WriteMemoryCheckpointNode()));
+        }
+    }
+
+    private static void processBlock(Block b, MemoryMap[] memoryMaps, NodeMap<Block> nodeToBlock, HashMap<Loop, Set<Object>> modifiedValues) {
+        // Create initial memory map for the block.
+        MemoryMap map = null;
+        if (b.getPredecessors().size() == 0) {
+            map = new MemoryMap(b);
+        } else {
+            map = new MemoryMap(b, memoryMaps[b.getPredecessors().get(0).getId()]);
+            if (b.isLoopHeader()) {
+                Loop loop = b.getLoop();
+                map.createLoopEntryMemoryMap(modifiedValues.get(loop), loop);
+            }
+            for (int i = 1; i < b.getPredecessors().size(); ++i) {
+                Block block = b.getPredecessors().get(i);
+                if (!block.isLoopEnd()) {
+                    map.mergeWith(memoryMaps[block.getId()], b);
+                }
+            }
+        }
+        memoryMaps[b.getId()] = map;
+
+        // Process instructions of this block.
+        for (Node n : b.getNodes()) {
+            if (n instanceof ReadNode) {
+                ReadNode readNode = (ReadNode) n;
+                map.processRead(readNode);
+            } else if (n instanceof WriteNode) {
+                WriteNode writeNode = (WriteNode) n;
+                map.processWrite(writeNode);
+            } else if (n instanceof MemoryCheckpoint) {
+                MemoryCheckpoint checkpoint = (MemoryCheckpoint) n;
+                map.processCheckpoint(checkpoint);
+            }
+        }
+
+
+        if (b.getEndNode() instanceof LoopEndNode) {
+            LoopEndNode end = (LoopEndNode) b.getEndNode();
+            LoopBeginNode begin = end.loopBegin();
+            Block beginBlock = nodeToBlock.get(begin);
+            MemoryMap memoryMap = memoryMaps[beginBlock.getId()];
+            assert memoryMap != null;
+            assert memoryMap.getLoopEntryMap() != null;
+            memoryMap.mergeLoopEntryWith(map, begin);
+        }
+    }
+
+    private static void traceMemoryCheckpoint(Loop loop, HashMap<Loop, Set<Object>> modifiedValues) {
+        modifiedValues.get(loop).add(LocationNode.ANY_LOCATION);
+    }
+
+    private void propagateFromChildren(Loop loop, HashMap<Loop, Set<Object>> modifiedValues) {
+        for (Loop child : loop.children) {
+            propagateFromChildren(child, modifiedValues);
+            modifiedValues.get(loop).addAll(modifiedValues.get(child));
+        }
+    }
+
+    private static void traceWrite(Loop loop, Object locationIdentity, HashMap<Loop, Set<Object>> modifiedValues) {
+        modifiedValues.get(loop).add(locationIdentity);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/GlobalValueNumberingPhase.java	Thu Mar 08 19:24:17 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.graal.compiler.phases;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+public class GlobalValueNumberingPhase extends Phase {
+
+    public static final DebugMetric metricGlobalValueNumberingHits = Debug.metric("GlobalValueNumberingHits");
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        NodeBitMap visited = graph.createNodeBitMap();
+        for (Node n : graph.getNodes()) {
+            apply(n, visited, graph);
+        }
+    }
+
+    private void apply(Node n, NodeBitMap visited, StructuredGraph compilerGraph) {
+        if (!visited.isMarked(n)) {
+            visited.mark(n);
+            for (Node input : n.inputs()) {
+                apply(input, visited, compilerGraph);
+            }
+            if (n.getNodeClass().valueNumberable()) {
+                Node newNode = compilerGraph.findDuplicate(n);
+                if (newNode != null) {
+                    assert !(n instanceof FixedNode || newNode instanceof FixedNode);
+                    n.replaceAtUsages(newNode);
+                    n.safeDelete();
+                    metricGlobalValueNumberingHits.increment();
+                    Debug.log("GVN applied and new node is %1s", newNode);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IdentifyBoxingPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+
+public class IdentifyBoxingPhase extends Phase {
+
+    private final BoxingMethodPool pool;
+
+    public IdentifyBoxingPhase(BoxingMethodPool pool) {
+        this.pool = pool;
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (Invoke invoke : graph.getInvokes()) {
+            tryIntrinsify(invoke);
+        }
+    }
+
+    public void tryIntrinsify(Invoke invoke) {
+        MethodCallTargetNode callTarget = invoke.callTarget();
+        RiResolvedMethod targetMethod = callTarget.targetMethod();
+        if (pool.isSpecialMethod(targetMethod)) {
+            assert callTarget.arguments().size() == 1 : "boxing/unboxing method must have exactly one argument";
+            CiKind returnKind = callTarget.returnKind();
+            ValueNode sourceValue = callTarget.arguments().get(0);
+
+            // Check whether this is a boxing or an unboxing.
+            Node newNode = null;
+            if (returnKind == CiKind.Object) {
+                // We have a boxing method here.
+                assert Modifier.isStatic(targetMethod.accessFlags()) : "boxing method must be static";
+                CiKind sourceKind = targetMethod.signature().argumentKindAt(0, false);
+                newNode = invoke.graph().add(new BoxNode(sourceValue, targetMethod.holder(), sourceKind, invoke.bci()));
+            } else {
+                // We have an unboxing method here.
+                assert !Modifier.isStatic(targetMethod.accessFlags()) : "unboxing method must be an instance method";
+                newNode = invoke.graph().add(new UnboxNode(returnKind, sourceValue));
+            }
+
+            // Intrinsify the invoke to the special node.
+            invoke.intrinsify(newNode);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,435 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.compiler.util.InliningUtil.InlineInfo;
+import com.oracle.graal.compiler.util.InliningUtil.InliningCallback;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.debug.internal.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+
+public class InliningPhase extends Phase implements InliningCallback {
+    /*
+     * - Detect method which only call another method with some parameters set to constants: void foo(a) -> void foo(a, b) -> void foo(a, b, c) ...
+     *   These should not be taken into account when determining inlining depth.
+     * - honor the result of overrideInliningDecision(0, caller, invoke.bci, method, true);
+     */
+
+    private final CiTarget target;
+    private final GraalRuntime runtime;
+
+    private final Collection<? extends Invoke> hints;
+
+    private final PriorityQueue<InlineInfo> inlineCandidates = new PriorityQueue<>();
+    private CiAssumptions assumptions;
+
+    private final PhasePlan plan;
+    private final WeightComputationPolicy weightComputationPolicy;
+    private final InliningPolicy inliningPolicy;
+
+    // Metrics
+    private static final DebugMetric metricInliningPerformed = Debug.metric("InliningPerformed");
+    private static final DebugMetric metricInliningConsidered = Debug.metric("InliningConsidered");
+    private static final DebugMetric metricInliningStoppedByMaxDesiredSize = Debug.metric("InliningStoppedByMaxDesiredSize");
+
+    public InliningPhase(CiTarget target, GraalRuntime runtime, Collection<? extends Invoke> hints, CiAssumptions assumptions, PhasePlan plan) {
+        this.target = target;
+        this.runtime = runtime;
+        this.hints = hints;
+        this.assumptions = assumptions;
+        this.plan = plan;
+        this.weightComputationPolicy = createWeightComputationPolicy();
+        this.inliningPolicy = createInliningPolicy();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    protected void run(StructuredGraph graph) {
+        graph.createNodeMap();
+
+        if (hints != null) {
+            scanInvokes((Iterable<? extends Node>) Util.uncheckedCast(this.hints), -1, graph);
+        } else {
+            scanInvokes(graph.getNodes(InvokeNode.class), 0, graph);
+            scanInvokes(graph.getNodes(InvokeWithExceptionNode.class), 0, graph);
+        }
+
+        while (!inlineCandidates.isEmpty() && graph.getNodeCount() < GraalOptions.MaximumDesiredSize) {
+            InlineInfo info = inlineCandidates.remove();
+            if (info.invoke.node().isAlive() && inliningPolicy.isWorthInlining(graph, info)) {
+                Iterable<Node> newNodes = null;
+                try {
+                    info.inline(graph, runtime, this);
+                    Debug.dump(graph, "after %s", info);
+                    // get the new nodes here, the canonicalizer phase will reset the mark
+                    newNodes = graph.getNewNodes();
+                    if (GraalOptions.OptCanonicalizer) {
+                        new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph);
+                    }
+                    if (GraalOptions.Intrinsify) {
+                        new IntrinsificationPhase(runtime).apply(graph);
+                    }
+                    metricInliningPerformed.increment();
+                } catch (CiBailout bailout) {
+                    // TODO determine if we should really bail out of the whole compilation.
+                    throw bailout;
+                } catch (AssertionError e) {
+                    throw new GraalInternalError(e).addContext(info.toString());
+                } catch (RuntimeException e) {
+                    throw new GraalInternalError(e).addContext(info.toString());
+                } catch (GraalInternalError e) {
+                    throw e.addContext(info.toString());
+                }
+
+                if (newNodes != null && info.level < GraalOptions.MaximumInlineLevel) {
+                    scanInvokes(newNodes, info.level + 1, graph);
+                }
+            }
+        }
+
+        if (GraalOptions.Debug && graph.getNodeCount() >= GraalOptions.MaximumDesiredSize) {
+            Debug.log("inlining cut off by MaximumDesiredSize");
+            metricInliningStoppedByMaxDesiredSize.increment();
+        }
+    }
+
+    private void scanInvokes(Iterable<? extends Node> newNodes, int level, StructuredGraph graph) {
+        graph.mark();
+        for (Node node : newNodes) {
+            if (node != null) {
+                if (node instanceof Invoke) {
+                    Invoke invoke = (Invoke) node;
+                    scanInvoke(invoke, level);
+                }
+                for (Node usage : node.usages().filterInterface(Invoke.class).snapshot()) {
+                    scanInvoke((Invoke) usage, level);
+                }
+            }
+        }
+    }
+
+    private void scanInvoke(Invoke invoke, int level) {
+        InlineInfo info = InliningUtil.getInlineInfo(invoke, level >= 0 ? level : computeInliningLevel(invoke), runtime, assumptions, this);
+        if (info != null) {
+            assert level == -1 || computeInliningLevel(invoke) == level : "outer FramesStates must match inlining level";
+            metricInliningConsidered.increment();
+            inlineCandidates.add(info);
+        }
+    }
+
+    public static final Map<RiMethod, Integer> parsedMethods = new HashMap<>();
+
+    @Override
+    public StructuredGraph buildGraph(RiResolvedMethod method) {
+        StructuredGraph newGraph = new StructuredGraph(method);
+
+        if (plan != null) {
+            plan.runPhases(PhasePosition.AFTER_PARSING, newGraph);
+        }
+        assert newGraph.start().next() != null : "graph needs to be populated during PhasePosition.AFTER_PARSING";
+
+        if (GraalOptions.ProbabilityAnalysis) {
+            new DeadCodeEliminationPhase().apply(newGraph);
+            new ComputeProbabilityPhase().apply(newGraph);
+        }
+        if (GraalOptions.OptCanonicalizer) {
+            new CanonicalizerPhase(target, runtime, assumptions).apply(newGraph);
+        }
+        return newGraph;
+    }
+
+    @Override
+    public double inliningWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke) {
+        boolean preferred = hints != null && hints.contains(invoke);
+        return weightComputationPolicy.computeWeight(caller, method, invoke, preferred);
+    }
+
+    public static int graphComplexity(StructuredGraph graph) {
+        int result = 0;
+        for (Node node : graph.getNodes()) {
+            if (node instanceof ConstantNode || node instanceof LocalNode || node instanceof BeginNode || node instanceof ReturnNode || node instanceof UnwindNode) {
+                result += 0;
+            } else if (node instanceof PhiNode) {
+                result += 5;
+            } else if (node instanceof MergeNode || node instanceof Invoke || node instanceof LoopEndNode || node instanceof EndNode) {
+                result += 0;
+            } else if (node instanceof ControlSplitNode) {
+                result += ((ControlSplitNode) node).blockSuccessorCount();
+            } else {
+                result += 1;
+            }
+        }
+        return Math.max(1, result);
+    }
+
+
+    @Override
+    public void recordConcreteMethodAssumption(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl) {
+        assumptions.recordConcreteMethod(method, context, impl);
+    }
+
+    @Override
+    public void recordMethodContentsAssumption(RiResolvedMethod method) {
+        if (assumptions != null) {
+            assumptions.recordMethodContents(method);
+        }
+    }
+
+    private static int computeInliningLevel(Invoke invoke) {
+        int count = 0;
+        FrameState curState = invoke.stateAfter();
+        while (curState != null) {
+            count++;
+            curState = curState.outerFrameState();
+        }
+        return count - 1;
+    }
+
+    private static InliningPolicy createInliningPolicy() {
+        switch(GraalOptions.InliningPolicy) {
+            case 0: return new WeightBasedInliningPolicy();
+            case 1: return new C1StaticSizeBasedInliningPolicy();
+            case 2: return new MinimumCodeSizeBasedInliningPolicy();
+            case 3: return new DynamicSizeBasedInliningPolicy();
+            case 4: return new GreedySizeBasedInliningPolicy();
+            default:
+                GraalInternalError.shouldNotReachHere();
+                return null;
+        }
+    }
+
+    private WeightComputationPolicy createWeightComputationPolicy() {
+        switch(GraalOptions.WeightComputationPolicy) {
+            case 0: return new ExecutionCountBasedWeightComputationPolicy();
+            case 1: return new BytecodeSizeBasedWeightComputationPolicy();
+            case 2: return new ComplexityBasedWeightComputationPolicy();
+            default:
+                GraalInternalError.shouldNotReachHere();
+                return null;
+        }
+    }
+
+    private interface InliningPolicy {
+        boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info);
+    }
+
+    private static class WeightBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            if (!checkCompiledCodeSize(info)) {
+                return false;
+            }
+
+            double penalty = Math.pow(GraalOptions.InliningSizePenaltyExp, callerGraph.getNodeCount() / (double) GraalOptions.MaximumDesiredSize) / GraalOptions.InliningSizePenaltyExp;
+            if (info.weight > GraalOptions.MaximumInlineWeight / (1 + penalty * GraalOptions.InliningSizePenalty)) {
+                Debug.log("not inlining (cut off by weight %e): %s", info.weight, info);
+                return false;
+            }
+
+            Debug.log("inlining (weight %f): %s", info.weight, info);
+            return true;
+        }
+    }
+
+    private static class C1StaticSizeBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            double maxSize = Math.max(GraalOptions.MaximumTrivialSize, Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize);
+            return decideSizeBasedInlining(info, maxSize);
+        }
+    }
+
+    private static class MinimumCodeSizeBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            assert GraalOptions.ProbabilityAnalysis;
+            if (!checkCompiledCodeSize(info)) {
+                return false;
+            }
+
+            double inlineWeight = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability());
+            double maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize * inlineWeight;
+            maxSize = Math.max(GraalOptions.MaximumTrivialSize, maxSize);
+
+            return decideSizeBasedInlining(info, maxSize);
+        }
+    }
+
+    private static class DynamicSizeBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            assert GraalOptions.ProbabilityAnalysis;
+            if (!checkCompiledCodeSize(info)) {
+                return false;
+            }
+
+            double inlineBoost = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability()) + Math.log10(Math.max(1, info.invoke.probability() - GraalOptions.ProbabilityCapForInlining + 1));
+            double maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize;
+            maxSize = maxSize + maxSize * inlineBoost;
+            maxSize = Math.min(GraalOptions.MaximumGreedyInlineSize, Math.max(GraalOptions.MaximumTrivialSize, maxSize));
+
+            return decideSizeBasedInlining(info, maxSize);
+        }
+    }
+
+    private static class GreedySizeBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            assert GraalOptions.ProbabilityAnalysis;
+            if (!checkCompiledCodeSize(info)) {
+                return false;
+            }
+
+            double maxSize = GraalOptions.MaximumGreedyInlineSize;
+            if (GraalOptions.InliningBonusPerTransferredValue != 0) {
+                RiSignature signature = info.invoke.callTarget().targetMethod().signature();
+                int transferredValues = signature.argumentCount(true);
+                if (signature.returnKind(false) != CiKind.Void) {
+                    transferredValues++;
+                }
+                maxSize += transferredValues * GraalOptions.InliningBonusPerTransferredValue;
+            }
+
+            double inlineRatio = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability());
+            maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * maxSize * inlineRatio;
+            maxSize = Math.max(maxSize, GraalOptions.MaximumTrivialSize);
+
+            return decideSizeBasedInlining(info, maxSize);
+        }
+    }
+
+    private static boolean decideSizeBasedInlining(InlineInfo info, double maxSize) {
+        boolean success = info.weight <= maxSize;
+        if (DebugScope.getInstance().isLogEnabled()) {
+            String formatterString = success ? "inlining invoke at %s@%d (size %f <= %f): %s" : "not inlining invoke at %s@%d (too large %f > %f): %s";
+            Debug.log(formatterString, CiUtil.format("%H.%n(%p):%r", info.invoke.stateAfter().method()), info.invoke.bci(), info.weight, maxSize, info);
+        }
+        return success;
+    }
+
+    private static boolean checkCompiledCodeSize(InlineInfo info) {
+        if (GraalOptions.SmallCompiledCodeSize >= 0 && info.compiledCodeSize() > GraalOptions.SmallCompiledCodeSize) {
+            Debug.log("not inlining invoke at %s@%d (CompiledCodeSize %d > %d): %s", CiUtil.format("%H.%n(%p):%r", info.invoke.stateAfter().method()), info.invoke.bci(), info.compiledCodeSize(), GraalOptions.SmallCompiledCodeSize, info);
+            return false;
+        }
+        return true;
+    }
+
+
+    private interface WeightComputationPolicy {
+        double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke);
+    }
+
+    private class ExecutionCountBasedWeightComputationPolicy implements WeightComputationPolicy {
+        @Override
+        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
+            double ratio;
+            if (preferredInvoke) {
+                ratio = 1000000;
+            } else {
+                if (GraalOptions.ProbabilityAnalysis) {
+                    ratio = invoke.node().probability();
+                } else {
+                    RiProfilingInfo profilingInfo = method.profilingInfo();
+                    int executionCount = profilingInfo.getExecutionCount(invoke.bci());
+                    if (executionCount > 0) {
+                        RiResolvedMethod parent = invoke.stateAfter().method();
+                        ratio = executionCount / (float) parent.invocationCount();
+                    } else {
+                        ratio = 1;
+                    }
+                }
+            }
+
+            final double normalSize;
+            // TODO (lstadler) get rid of this magic, it's here to emulate the old behavior for the time being
+            if (ratio < 0.01) {
+                ratio = 0.01;
+            }
+            if (ratio < 0.5) {
+                normalSize = 10 * ratio / 0.5;
+            } else if (ratio < 2) {
+                normalSize = 10 + (35 - 10) * (ratio - 0.5) / 1.5;
+            } else if (ratio < 20) {
+                normalSize = 35;
+            } else if (ratio < 40) {
+                normalSize = 35 + (350 - 35) * (ratio - 20) / 20;
+            } else {
+                normalSize = 350;
+            }
+
+            int count;
+            if (GraalOptions.ParseBeforeInlining) {
+                if (!parsedMethods.containsKey(method)) {
+                    StructuredGraph newGraph = new StructuredGraph(method);
+                    if (plan != null) {
+                        plan.runPhases(PhasePosition.AFTER_PARSING, newGraph);
+                    }
+                    if (GraalOptions.OptCanonicalizer) {
+                        new CanonicalizerPhase(target, runtime, assumptions).apply(newGraph);
+                    }
+                    count = graphComplexity(newGraph);
+                    parsedMethods.put(method, count);
+                } else {
+                    count = parsedMethods.get(method);
+                }
+            } else {
+                count = method.codeSize();
+            }
+
+            return count / normalSize;
+        }
+    }
+
+    private static class BytecodeSizeBasedWeightComputationPolicy implements WeightComputationPolicy {
+        @Override
+        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
+            double codeSize = method.codeSize();
+            if (preferredInvoke) {
+                codeSize = codeSize / GraalOptions.BoostInliningForEscapeAnalysis;
+            }
+            return codeSize;
+        }
+    }
+
+    private static class ComplexityBasedWeightComputationPolicy implements WeightComputationPolicy {
+        @Override
+        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
+            double complexity = method.compilationComplexity();
+            if (preferredInvoke) {
+                complexity = complexity / GraalOptions.BoostInliningForEscapeAnalysis;
+            }
+            return complexity;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InsertStateAfterPlaceholderPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class InsertStateAfterPlaceholderPhase extends Phase {
+
+    private static class PlaceholderNode extends AbstractStateSplit implements Node.IterableNodeType, LIRLowerable {
+        public PlaceholderNode() {
+            super(StampFactory.illegal());
+        }
+
+        @Override
+        public void generate(LIRGeneratorTool gen) {
+            // nothing to do
+        }
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (ReturnNode ret : graph.getNodes(ReturnNode.class)) {
+            PlaceholderNode p = graph.add(new PlaceholderNode());
+            p.setStateAfter(graph.add(new FrameState(null, FrameState.AFTER_BCI, 0, 0, false, false)));
+            graph.addBeforeFixed(ret, p);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+public class IntrinsificationPhase extends Phase {
+
+    private final GraalRuntime runtime;
+
+    public IntrinsificationPhase(GraalRuntime runtime) {
+        this.runtime = runtime;
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (InvokeNode invoke : graph.getNodes(InvokeNode.class)) {
+            tryIntrinsify(invoke, runtime);
+        }
+        for (InvokeWithExceptionNode invoke : graph.getNodes(InvokeWithExceptionNode.class)) {
+            tryIntrinsify(invoke, runtime);
+        }
+    }
+
+    public static boolean canIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
+        return getIntrinsicGraph(invoke, target, runtime) != null;
+    }
+
+    private static void tryIntrinsify(Invoke invoke, GraalRuntime runtime) {
+        RiResolvedMethod target = invoke.callTarget().targetMethod();
+        if (target != null) {
+            tryIntrinsify(invoke, target, runtime);
+        }
+    }
+
+    private static void tryIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
+        StructuredGraph intrinsicGraph = getIntrinsicGraph(invoke, target, runtime);
+        if (intrinsicGraph != null) {
+            Debug.log(" > Intrinsify %s", target);
+            InliningUtil.inline(invoke, intrinsicGraph, true);
+        }
+    }
+
+    private static StructuredGraph getIntrinsicGraph(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
+        StructuredGraph intrinsicGraph = (StructuredGraph) target.compilerStorage().get(Graph.class);
+        if (intrinsicGraph == null) {
+            // TODO remove once all intrinsics are available via compilerStorage
+            intrinsicGraph = runtime.intrinsicGraph(invoke.stateAfter().method(), invoke.bci(), target, invoke.callTarget().arguments());
+        }
+        return intrinsicGraph;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+public class LoweringPhase extends Phase {
+
+    private final GraalRuntime runtime;
+
+    public LoweringPhase(GraalRuntime runtime) {
+        this.runtime = runtime;
+    }
+
+    @Override
+    protected void run(final StructuredGraph graph) {
+        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, false, true, true);
+
+        NodeBitMap processed = graph.createNodeBitMap();
+        NodeBitMap activeGuards = graph.createNodeBitMap();
+        processBlock(cfg.getStartBlock(), activeGuards, processed, null);
+
+        processed.negate();
+        final CiLoweringTool loweringTool = new CiLoweringTool() {
+
+            @Override
+            public Node getGuardAnchor() {
+                throw new UnsupportedOperationException();
+            }
+
+            @Override
+            public GraalRuntime getRuntime() {
+                return runtime;
+            }
+
+            @Override
+            public Node createGuard(Node condition) {
+                // TODO (thomaswue): Docuemnt why this must not be called on floating nodes.
+                throw new UnsupportedOperationException();
+            }
+        };
+        for (Node node : processed) {
+            if (node instanceof Lowerable) {
+                assert !(node instanceof FixedNode) || node.predecessor() == null;
+                ((Lowerable) node).lower(loweringTool);
+            }
+        }
+    }
+
+    private void processBlock(Block block, NodeBitMap activeGuards, NodeBitMap processed, FixedNode parentAnchor) {
+
+        FixedNode anchor = parentAnchor;
+        if (anchor == null) {
+            anchor = block.getBeginNode();
+        }
+        process(block, activeGuards, processed, anchor);
+
+        // Process always reached block first.
+        Block alwaysReachedBlock = block.getPostdominator();
+        if (alwaysReachedBlock != null && alwaysReachedBlock.getDominator() == block) {
+            assert alwaysReachedBlock.getDominator() == block;
+            processBlock(alwaysReachedBlock, activeGuards, processed, anchor);
+        }
+
+        // Now go for the other dominators.
+        for (Block dominated : block.getDominated()) {
+            if (dominated != alwaysReachedBlock) {
+                assert dominated.getDominator() == block;
+                processBlock(dominated, activeGuards, processed, null);
+            }
+        }
+
+        if (parentAnchor == null) {
+            for (GuardNode guard : anchor.usages().filter(GuardNode.class)) {
+                activeGuards.clear(guard);
+            }
+        }
+    }
+
+    private void process(final Block b, final NodeBitMap activeGuards, NodeBitMap processed, final Node anchor) {
+
+        final CiLoweringTool loweringTool = new CiLoweringTool() {
+
+            @Override
+            public Node getGuardAnchor() {
+                return anchor;
+            }
+
+            @Override
+            public GraalRuntime getRuntime() {
+                return runtime;
+            }
+
+            @Override
+            public Node createGuard(Node condition) {
+                FixedNode guardAnchor = (FixedNode) getGuardAnchor();
+                if (GraalOptions.OptEliminateGuards) {
+                    for (Node usage : condition.usages()) {
+                        if (activeGuards.isMarked(usage)) {
+                            return usage;
+                        }
+                    }
+                }
+                GuardNode newGuard = guardAnchor.graph().unique(new GuardNode((BooleanNode) condition, guardAnchor));
+                activeGuards.grow();
+                activeGuards.mark(newGuard);
+                return newGuard;
+            }
+        };
+
+        // Lower the instructions of this block.
+        for (Node node : b.getNodes()) {
+            processed.mark(node);
+            if (node instanceof Lowerable) {
+                ((Lowerable) node).lower(loweringTool);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/Phase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.nodes.*;
+
+public abstract class Phase {
+
+    private String name;
+
+    protected Phase() {
+        this.name = this.getClass().getSimpleName();
+        if (name.endsWith("Phase")) {
+            name = name.substring(0, name.length() - "Phase".length());
+        }
+    }
+
+    protected Phase(String name) {
+        this.name = name;
+    }
+
+    protected String getDetailedName() {
+        return getName();
+    }
+
+    public final void apply(final StructuredGraph graph) {
+        apply(graph, true);
+    }
+
+    public final void apply(final StructuredGraph graph, final boolean dumpGraph) {
+        Debug.scope(name, this, new Runnable() {
+            public void run() {
+                Phase.this.run(graph);
+                if (dumpGraph) {
+                    Debug.dump(graph, "After phase %s", name);
+                }
+                assert graph.verify();
+            }
+        });
+    }
+
+    public final String getName() {
+        return name;
+    }
+
+    protected abstract void run(StructuredGraph graph);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/PhasePlan.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.util.*;
+
+import com.oracle.graal.nodes.*;
+
+/**
+ * Tells the compiler about additional phases that need to be executed during compilation.
+ */
+public class PhasePlan {
+    /**
+     * The compilation is split into the following sections:
+     * ========================================================================
+     * Period 1: High-level nodes. (Graph building)
+     * ========================================================================
+     * Runtime-specific lowering.
+     * ========================================================================
+     * Period 2: Mid-level nodes. (Memory dependence graph)
+     * ========================================================================
+     * Target-specific lowering, de-SSA.
+     * ========================================================================
+     * Period 3: Low-level nodes. (Register allocation, code generation)
+     * ========================================================================
+     *
+     * A compiler extension phase can chose to run at the end of periods 1-3.
+     */
+    public static enum PhasePosition {
+        AFTER_PARSING,
+        HIGH_LEVEL,
+        MID_LEVEL,
+        LOW_LEVEL
+    }
+
+    public static final PhasePlan DEFAULT = new PhasePlan();
+
+    @SuppressWarnings("unchecked")
+    private final ArrayList<Phase>[] phases = new ArrayList[PhasePosition.values().length];
+
+    private final Set<Class<? extends Phase>> disabledPhases = new HashSet<>();
+
+    public void addPhase(PhasePosition pos, Phase phase) {
+        if (phases[pos.ordinal()] == null) {
+            phases[pos.ordinal()] = new ArrayList<>();
+        }
+        phases[pos.ordinal()].add(phase);
+    }
+
+    public void runPhases(PhasePosition pos, StructuredGraph graph) {
+        if (phases[pos.ordinal()] != null) {
+            for (Phase p : phases[pos.ordinal()]) {
+                p.apply(graph);
+            }
+        }
+    }
+
+    public void disablePhase(Class<? extends Phase> clazz) {
+        disabledPhases.add(clazz);
+    }
+
+    public boolean isPhaseDisabled(Class<? extends Phase> clazz) {
+        return disabledPhases.contains(clazz);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/PhiStampPhase.java	Thu Mar 08 19:24:17 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.graal.compiler.phases;
+
+import com.oracle.graal.nodes.*;
+
+public class PhiStampPhase extends Phase {
+    @Override
+    protected void run(StructuredGraph graph) {
+        // Infer phis stopping at loop phis.
+        for (PhiNode phi : graph.getNodes(PhiNode.class)) {
+            inferPhi(phi);
+        }
+
+        // Start iterative inference for loop phis.
+        if (graph.hasLoops()) {
+            for (PhiNode phi : graph.getNodes(PhiNode.class)) {
+                if (phi.isLoopPhi()) {
+                    iterativeInferPhi(phi);
+                }
+            }
+        }
+    }
+
+    private void iterativeInferPhi(PhiNode phi) {
+        if (phi.inferStamp()) {
+            for (PhiNode phiUsage : phi.usages().filter(PhiNode.class)) {
+                iterativeInferPhi(phiUsage);
+            }
+        }
+    }
+
+    private void inferPhi(PhiNode phi) {
+        for (PhiNode phiInput : phi.values().filter(PhiNode.class)) {
+            if (!phiInput.isLoopPhi()) {
+                inferPhi(phiInput);
+            }
+        }
+        phi.inferStamp();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ReadEliminationPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+
+public class ReadEliminationPhase extends Phase {
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (FloatingReadNode n : graph.getNodes(FloatingReadNode.class)) {
+            if (n.dependencies().size() > 0) {
+                assert n.dependencies().size() == 1;
+                Node memoryInput = n.dependencies().get(0);
+                if (memoryInput instanceof WriteNode) {
+                    WriteNode other = (WriteNode) memoryInput;
+                    if (other.object() == n.object() && other.location() == n.location()) {
+                        Debug.log("Eliminated memory read %1.1s and replaced with node %s", n, other.value());
+                        graph.replaceFloating(n, other.value());
+                    }
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SafepointPollingEliminationPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.util.*;
+
+public class SafepointPollingEliminationPhase extends Phase {
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (LoopEndNode loopEnd : graph.getNodes(LoopEndNode.class)) {
+            NodeIterable<FixedNode> it = NodeIterators.dominators(loopEnd).until(loopEnd.loopBegin());
+            for (FixedNode n : it) {
+                if (n instanceof Invoke) {
+                    loopEnd.setSafepointPolling(false);
+                    break;
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.phases;
+
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.ConstantNodeParameter;
+import com.oracle.graal.graph.Node.NodeIntrinsic;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.util.*;
+
+public class SnippetIntrinsificationPhase extends Phase {
+
+    private final RiRuntime runtime;
+    private final BoxingMethodPool pool;
+
+    public SnippetIntrinsificationPhase(RiRuntime runtime, BoxingMethodPool pool) {
+        this.runtime = runtime;
+        this.pool = pool;
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        for (Invoke i : graph.getInvokes()) {
+            tryIntrinsify(i);
+        }
+    }
+
+    private void tryIntrinsify(Invoke invoke) {
+        RiResolvedMethod target = invoke.callTarget().targetMethod();
+        NodeIntrinsic intrinsic = target.getAnnotation(Node.NodeIntrinsic.class);
+        if (intrinsic != null) {
+            Class< ? >[] parameterTypes = CiUtil.signatureToTypes(target.signature(), target.holder());
+
+            // Prepare the arguments for the reflective constructor call on the node class.
+            Object[] nodeConstructorArguments = prepareArguments(invoke, parameterTypes, target);
+
+            // Create the new node instance.
+            Class< ? > c = getNodeClass(target, intrinsic);
+            Node newInstance = createNodeInstance(c, parameterTypes, nodeConstructorArguments);
+
+            // Replace the invoke with the new node.
+            invoke.node().graph().add(newInstance);
+            invoke.intrinsify(newInstance);
+
+            // Clean up checkcast instructions inserted by javac if the return type is generic.
+            cleanUpReturnCheckCast(newInstance);
+        }
+    }
+
+    private Object[] prepareArguments(Invoke invoke, Class< ? >[] parameterTypes, RiResolvedMethod target) {
+        NodeInputList<ValueNode> arguments = invoke.callTarget().arguments();
+        Object[] nodeConstructorArguments = new Object[arguments.size()];
+        for (int i = 0; i < nodeConstructorArguments.length; ++i) {
+            int parameterIndex = i;
+            if (!invoke.callTarget().isStatic()) {
+                parameterIndex--;
+            }
+            ValueNode argument = tryBoxingElimination(parameterIndex, target, arguments.get(i));
+            ConstantNodeParameter param = CiUtil.getParameterAnnotation(ConstantNodeParameter.class, parameterIndex, target);
+            if (param != null) {
+                assert argument instanceof ConstantNode : "parameter " + parameterIndex + " must be compile time constant for " + invoke.callTarget().targetMethod();
+                ConstantNode constantNode = (ConstantNode) argument;
+                Object o = constantNode.asConstant().boxedValue();
+                if (o instanceof Class< ? >) {
+                    nodeConstructorArguments[i] = runtime.getType((Class< ? >) o);
+                    parameterTypes[i] = RiResolvedType.class;
+                } else {
+                    nodeConstructorArguments[i] = o;
+                }
+            } else {
+                nodeConstructorArguments[i] = argument;
+                parameterTypes[i] = ValueNode.class;
+            }
+        }
+        return nodeConstructorArguments;
+    }
+
+    private static Class< ? > getNodeClass(RiResolvedMethod target, NodeIntrinsic intrinsic) {
+        Class< ? > result = intrinsic.value();
+        if (result == NodeIntrinsic.class) {
+            result = target.holder().toJava();
+        }
+        assert Node.class.isAssignableFrom(result);
+        return result;
+    }
+
+    private ValueNode tryBoxingElimination(int parameterIndex, RiResolvedMethod target, ValueNode node) {
+        if (parameterIndex >= 0) {
+            Type type = target.getGenericParameterTypes()[parameterIndex];
+            if (type instanceof TypeVariable) {
+                TypeVariable typeVariable = (TypeVariable) type;
+                if (typeVariable.getBounds().length == 1) {
+                    Type boundType = typeVariable.getBounds()[0];
+                    if (boundType instanceof Class && ((Class) boundType).getSuperclass() == null) {
+                        // Unbound generic => try boxing elimination
+                        if (node.usages().size() == 2) {
+                            if (node instanceof Invoke) {
+                                Invoke invokeNode = (Invoke) node;
+                                MethodCallTargetNode callTarget = invokeNode.callTarget();
+                                if (pool.isBoxingMethod(callTarget.targetMethod())) {
+                                    FrameState stateAfter = invokeNode.stateAfter();
+                                    assert stateAfter.usages().size() == 1;
+                                    invokeNode.node().replaceAtUsages(null);
+                                    ValueNode result = callTarget.arguments().get(0);
+                                    StructuredGraph graph = (StructuredGraph) node.graph();
+                                    if (invokeNode instanceof InvokeWithExceptionNode) {
+                                        // Destroy exception edge & clear stateAfter.
+                                        InvokeWithExceptionNode invokeWithExceptionNode = (InvokeWithExceptionNode) invokeNode;
+
+                                        invokeWithExceptionNode.killExceptionEdge();
+                                        graph.removeSplit(invokeWithExceptionNode, InvokeWithExceptionNode.NORMAL_EDGE);
+                                    } else {
+                                        graph.removeFixed((InvokeNode) invokeNode);
+                                    }
+                                    stateAfter.safeDelete();
+                                    GraphUtil.propagateKill(callTarget);
+                                    return result;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return node;
+    }
+
+    private static Node createNodeInstance(Class< ? > nodeClass, Class< ? >[] parameterTypes, Object[] nodeConstructorArguments) {
+
+        Constructor< ? > constructor;
+        try {
+            constructor = nodeClass.getDeclaredConstructor(parameterTypes);
+            constructor.setAccessible(true);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        try {
+            return (ValueNode) constructor.newInstance(nodeConstructorArguments);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public void cleanUpReturnCheckCast(Node newInstance) {
+        if (newInstance instanceof ValueNode && ((ValueNode) newInstance).kind() != CiKind.Object) {
+            StructuredGraph graph = (StructuredGraph) newInstance.graph();
+            for (CheckCastNode checkCastNode : newInstance.usages().filter(CheckCastNode.class).snapshot()) {
+                for (Node checkCastUsage : checkCastNode.usages().snapshot()) {
+                    if (checkCastUsage instanceof ValueAnchorNode) {
+                        ValueAnchorNode valueAnchorNode = (ValueAnchorNode) checkCastUsage;
+                        graph.removeFixed(valueAnchorNode);
+                    } else if (checkCastUsage instanceof MethodCallTargetNode) {
+                        MethodCallTargetNode checkCastCallTarget = (MethodCallTargetNode) checkCastUsage;
+                        assert pool.isUnboxingMethod(checkCastCallTarget.targetMethod());
+                        Invoke invokeNode = checkCastCallTarget.invoke();
+                        invokeNode.node().replaceAtUsages(newInstance);
+                        if (invokeNode instanceof InvokeWithExceptionNode) {
+                            // Destroy exception edge & clear stateAfter.
+                            InvokeWithExceptionNode invokeWithExceptionNode = (InvokeWithExceptionNode) invokeNode;
+
+                            invokeWithExceptionNode.killExceptionEdge();
+                            graph.removeSplit(invokeWithExceptionNode, InvokeWithExceptionNode.NORMAL_EDGE);
+                        } else {
+                            graph.removeFixed((InvokeNode) invokeNode);
+                        }
+                        checkCastCallTarget.safeDelete();
+                    } else if (checkCastUsage instanceof FrameState) {
+                        checkCastUsage.replaceFirstInput(checkCastNode, null);
+                    } else {
+                        assert false : "unexpected checkcast usage: " + checkCastUsage;
+                    }
+                }
+                checkCastNode.safeDelete();
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/BlockClosure.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.schedule;
+
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ * The {@code BlockClosure} interface represents a closure for iterating over blocks.
+ */
+public interface BlockClosure {
+    void apply(Block block);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/SchedulePhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,334 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.schedule;
+
+import java.util.*;
+
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.Verbosity;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.virtual.*;
+
+public class SchedulePhase extends Phase {
+    private ControlFlowGraph cfg;
+    private NodeMap<Block> earliestCache;
+
+    private BlockMap<List<Node>> nodesFor;
+
+    public SchedulePhase() {
+        super("Schedule");
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        cfg = ControlFlowGraph.compute(graph, true, true, true, false);
+        earliestCache = graph.createNodeMap();
+        nodesFor = new BlockMap<>(cfg);
+
+        assignBlockToNodes(graph);
+        sortNodesWithinBlocks(graph);
+    }
+
+    public void scheduleGraph() {
+        for (Block block : cfg.getBlocks()) {
+            List<Node> nodeList = nodesFor.get(block);
+            ScheduledNode last = null;
+            for (Node node : nodeList) {
+                if (!(node instanceof FrameState)) {
+                    if (last != null) {
+                        last.setScheduledNext((ScheduledNode) node);
+                    }
+                    last = (ScheduledNode) node;
+                }
+            }
+        }
+    }
+
+    public ControlFlowGraph getCFG() {
+        return cfg;
+    }
+
+    public BlockMap<List<Node>> getNodesFor() {
+        return nodesFor;
+    }
+
+    public List<Node> nodesFor(Block block) {
+        return nodesFor.get(block);
+    }
+
+    private void assignBlockToNodes(StructuredGraph graph) {
+        for (Block block : cfg.getBlocks()) {
+            List<Node> nodes = new ArrayList<>();
+            assert nodesFor.get(block) == null;
+            nodesFor.put(block, nodes);
+            for (Node node : block.getNodes()) {
+                nodes.add(node);
+            }
+        }
+
+        for (Node n : graph.getNodes()) {
+            assignBlockToNode(n);
+        }
+    }
+
+    private void assignBlockToNode(Node n) {
+        if (n == null) {
+            return;
+        }
+
+        assert !n.isDeleted();
+
+        Block prevBlock = cfg.getNodeToBlock().get(n);
+        if (prevBlock != null) {
+            return;
+        }
+        assert !(n instanceof PhiNode) : n;
+        // if in CFG, schedule at the latest position possible in the outermost loop possible
+        Block latestBlock = latestBlock(n);
+        Block block;
+        if (latestBlock == null) {
+            block = earliestBlock(n);
+        } else if (GraalOptions.ScheduleOutOfLoops && !(n instanceof VirtualObjectFieldNode) && !(n instanceof VirtualObjectNode)) {
+            Block earliestBlock = earliestBlock(n);
+            block = scheduleOutOfLoops(n, latestBlock, earliestBlock);
+            assert earliestBlock.dominates(block) : "Graph can not be scheduled : inconsistent for " + n;
+        } else {
+            block = latestBlock;
+        }
+        assert !(n instanceof MergeNode);
+        cfg.getNodeToBlock().set(n, block);
+        nodesFor.get(block).add(n);
+    }
+
+    private Block latestBlock(Node n) {
+        Block block = null;
+        for (Node succ : n.successors()) {
+            if (succ == null) {
+                continue;
+            }
+            assignBlockToNode(succ);
+            block = getCommonDominator(block, cfg.getNodeToBlock().get(succ));
+        }
+        ensureScheduledUsages(n);
+        CommonDominatorBlockClosure cdbc = new CommonDominatorBlockClosure(block);
+        for (Node usage : n.usages()) {
+            blocksForUsage(n, usage, cdbc);
+        }
+        return cdbc.block;
+    }
+
+    private class CommonDominatorBlockClosure implements BlockClosure {
+        public Block block;
+        public CommonDominatorBlockClosure(Block block) {
+            this.block = block;
+        }
+        @Override
+        public void apply(Block newBlock) {
+            this.block = getCommonDominator(this.block, newBlock);
+        }
+    }
+
+    private Block earliestBlock(Node n) {
+        Block earliest = cfg.getNodeToBlock().get(n);
+        if (earliest != null) {
+            return earliest;
+        }
+        earliest = earliestCache.get(n);
+        if (earliest != null) {
+            return earliest;
+        }
+        BitMap bits = new BitMap(cfg.getBlocks().length);
+        ArrayList<Node> before = new ArrayList<>();
+        if (n.predecessor() != null) {
+            before.add(n.predecessor());
+        }
+        for (Node input : n.inputs()) {
+            before.add(input);
+        }
+        for (Node pred : before) {
+            if (pred == null) {
+                continue;
+            }
+            Block b = earliestBlock(pred);
+            if (!bits.get(b.getId())) {
+                earliest = b;
+                do {
+                    bits.set(b.getId());
+                    b = b.getDominator();
+                } while(b != null && !bits.get(b.getId()));
+            }
+        }
+        if (earliest == null) {
+            Block start = cfg.getNodeToBlock().get(((StructuredGraph) n.graph()).start());
+            assert start != null;
+            return start;
+        }
+        earliestCache.set(n, earliest);
+        return earliest;
+    }
+
+
+    private static Block scheduleOutOfLoops(Node n, Block latestBlock, Block earliest) {
+        assert latestBlock != null : "no latest : " + n;
+        Block cur = latestBlock;
+        Block result = latestBlock;
+        while (cur.getLoop() != null && cur != earliest && cur.getDominator() != null) {
+            Block dom = cur.getDominator();
+            if (dom.getLoopDepth() < result.getLoopDepth()) {
+                result = dom;
+            }
+            cur = dom;
+        }
+        return result;
+    }
+
+    private void blocksForUsage(Node node, Node usage, BlockClosure closure) {
+        if (usage instanceof PhiNode) {
+            PhiNode phi = (PhiNode) usage;
+            MergeNode merge = phi.merge();
+            Block mergeBlock = cfg.getNodeToBlock().get(merge);
+            assert mergeBlock != null : "no block for merge " + merge.toString(Verbosity.Id);
+            for (int i = 0; i < phi.valueCount(); ++i) {
+                if (phi.valueAt(i) == node) {
+                    if (mergeBlock.getPredecessors().size() <= i) {
+                        TTY.println(merge.toString());
+                        TTY.println(phi.toString());
+                        TTY.println(merge.cfgPredecessors().toString());
+                        TTY.println(mergeBlock.getPredecessors().toString());
+                        TTY.println(phi.inputs().toString());
+                        TTY.println("value count: " + phi.valueCount());
+                    }
+                    closure.apply(mergeBlock.getPredecessors().get(i));
+                }
+            }
+        } else if (usage instanceof FrameState && ((FrameState) usage).block() != null) {
+            MergeNode merge = ((FrameState) usage).block();
+            Block block = null;
+            for (Node pred : merge.cfgPredecessors()) {
+                block = getCommonDominator(block, cfg.getNodeToBlock().get(pred));
+            }
+            closure.apply(block);
+        } else {
+            assignBlockToNode(usage);
+            closure.apply(cfg.getNodeToBlock().get(usage));
+        }
+    }
+
+    private void ensureScheduledUsages(Node node) {
+        for (Node usage : node.usages().snapshot()) {
+            assignBlockToNode(usage);
+        }
+        // now true usages are ready
+    }
+
+    private static Block getCommonDominator(Block a, Block b) {
+        if (a == null) {
+            return b;
+        }
+        if (b == null) {
+            return a;
+        }
+        return ControlFlowGraph.commonDominator(a, b);
+    }
+
+    private void sortNodesWithinBlocks(StructuredGraph graph) {
+        NodeBitMap map = graph.createNodeBitMap();
+        for (Block b : cfg.getBlocks()) {
+            sortNodesWithinBlocks(b, map);
+        }
+    }
+
+    private void sortNodesWithinBlocks(Block b, NodeBitMap map) {
+        List<Node> instructions = nodesFor.get(b);
+        List<Node> sortedInstructions = new ArrayList<>(instructions.size() + 2);
+
+        assert !map.isMarked(b.getBeginNode()) && cfg.blockFor(b.getBeginNode()) == b;
+        assert !map.isMarked(b.getEndNode()) && cfg.blockFor(b.getEndNode()) == b;
+
+        for (Node i : instructions) {
+            addToSorting(b, i, sortedInstructions, map);
+        }
+
+        // Make sure that last node gets really last (i.e. when a frame state successor hangs off it).
+        Node lastSorted = sortedInstructions.get(sortedInstructions.size() - 1);
+        if (lastSorted != b.getEndNode()) {
+            int idx = sortedInstructions.indexOf(b.getEndNode());
+            boolean canNotMove = false;
+            for (int i = idx + 1; i < sortedInstructions.size(); i++) {
+                if (sortedInstructions.get(i).inputs().contains(b.getEndNode())) {
+                    canNotMove = true;
+                    break;
+                }
+            }
+            if (canNotMove) {
+                if (b.getEndNode() instanceof ControlSplitNode) {
+                    throw new GraalInternalError("Schedule is not possible : needs to move a node after the last node of the block which can not be move").
+                    addContext(lastSorted).
+                    addContext(b.getEndNode());
+                }
+
+                //b.setLastNode(lastSorted);
+            } else {
+                sortedInstructions.remove(b.getEndNode());
+                sortedInstructions.add(b.getEndNode());
+            }
+        }
+        nodesFor.put(b, sortedInstructions);
+    }
+
+    private void addToSorting(Block b, Node i, List<Node> sortedInstructions, NodeBitMap map) {
+        if (i == null || map.isMarked(i) || cfg.getNodeToBlock().get(i) != b || i instanceof PhiNode || i instanceof LocalNode) {
+            return;
+        }
+
+        FrameState state = null;
+        WriteNode writeNode = null;
+        for (Node input : i.inputs()) {
+            if (input instanceof WriteNode && !map.isMarked(input) && cfg.getNodeToBlock().get(input) == b) {
+                writeNode = (WriteNode) input;
+            } else if (input instanceof FrameState) {
+                state = (FrameState) input;
+            } else {
+                addToSorting(b, input, sortedInstructions, map);
+            }
+        }
+
+        if (i.predecessor() != null) {
+            addToSorting(b, i.predecessor(), sortedInstructions, map);
+        }
+
+        map.mark(i);
+
+        addToSorting(b, state, sortedInstructions, map);
+        assert writeNode == null || !map.isMarked(writeNode);
+        addToSorting(b, writeNode, sortedInstructions, map);
+
+        // Now predecessors and inputs are scheduled => we can add this node.
+        sortedInstructions.add(i);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/UnscheduleNodes.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.schedule;
+
+import java.util.*;
+
+import com.oracle.graal.compiler.graph.*;
+import com.oracle.graal.compiler.types.*;
+import com.oracle.graal.nodes.*;
+
+class UnscheduleState implements MergeableState<UnscheduleState> {
+
+    public FixedWithNextNode last;
+
+    @Override
+    public boolean merge(MergeNode merge, Collection<UnscheduleState> withStates) {
+        last = null;
+        return true;
+    }
+
+    @Override
+    public void loopBegin(LoopBeginNode loop) {
+        last = null;
+    }
+
+    @Override
+    public void loopEnds(LoopBeginNode loop, Collection<UnscheduleState> loopEndStates) {
+        last = null;
+    }
+
+    @Override
+    public void afterSplit(FixedNode node) {
+        last = null;
+    }
+
+    @Override
+    public UnscheduleState clone() {
+        return new UnscheduleState();
+    }
+}
+
+public class UnscheduleNodes extends ScheduledNodeIterator<UnscheduleState> {
+
+    public UnscheduleNodes(FixedNode start) {
+        super(start, new UnscheduleState());
+    }
+
+    @Override
+    protected void node(ScheduledNode node) {
+        if (node instanceof FixedNode) {
+            if (state.last != null) {
+                state.last.setNext((FixedNode) node);
+            }
+            if (node instanceof FixedWithNextNode) {
+                state.last = (FixedWithNextNode) node;
+            }
+        } else {
+            node.setScheduledNext(null);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.target;
+
+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.graal.compiler.gen.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+
+/**
+ * The {@code Backend} class represents a compiler backend for Graal.
+ */
+public abstract class Backend {
+    public final RiRuntime runtime;
+    public final CiTarget target;
+
+    protected Backend(RiRuntime runtime, CiTarget target) {
+        this.runtime = runtime;
+        this.target = target;
+    }
+
+    public static Backend create(CiArchitecture arch, RiRuntime runtime, CiTarget target) {
+        String className = arch.getClass().getName().replace("com.oracle.max.asm", "com.oracle.graal.compiler") + "Backend";
+        try {
+            Class<?> c = Class.forName(className);
+            Constructor<?> cons = c.getDeclaredConstructor(RiRuntime.class, CiTarget.class);
+            return (Backend) cons.newInstance(runtime, target);
+        } catch (Exception e) {
+            throw new Error("Could not instantiate " + className, e);
+        }
+    }
+
+    public abstract FrameMap newFrameMap(RiRegisterConfig registerConfig);
+    public abstract LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir);
+    public abstract AbstractAssembler newAssembler(RiRegisterConfig registerConfig);
+    public abstract CiXirAssembler newXirAssembler();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64Backend.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.target.amd64;
+
+import com.oracle.max.asm.*;
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
+import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.compiler.target.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+
+/**
+ * The {@code X86Backend} class represents the backend for the AMD64 architecture.
+ */
+public class AMD64Backend extends Backend {
+
+    public AMD64Backend(RiRuntime runtime, CiTarget target) {
+        super(runtime, target);
+    }
+    /**
+     * Creates a new LIRGenerator for x86.
+     * @param compilation the compilation for which to create the LIR generator
+     * @return an appropriate LIR generator instance
+     */
+    @Override
+    public LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
+        return new AMD64LIRGenerator(graph, runtime, target, frameMap, method, lir, xir);
+    }
+
+    @Override
+    public FrameMap newFrameMap(RiRegisterConfig registerConfig) {
+        return new FrameMap(runtime, target, registerConfig);
+    }
+
+    @Override
+    public AbstractAssembler newAssembler(RiRegisterConfig registerConfig) {
+        return new AMD64MacroAssembler(target, registerConfig);
+    }
+
+    @Override
+    public CiXirAssembler newXirAssembler() {
+        return new AMD64XirAssembler(target);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.target.amd64;
+
+import java.util.*;
+
+import com.oracle.max.asm.*;
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.amd64.*;
+import com.oracle.graal.lir.asm.*;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+
+public class AMD64DeoptimizationStub extends AMD64SlowPath {
+    public final Label label = new Label();
+    public final LIRDebugInfo info;
+    public final DeoptAction action;
+    public final Object deoptInfo;
+
+    public AMD64DeoptimizationStub(DeoptAction action, LIRDebugInfo info, Object deoptInfo) {
+        this.action = action;
+        this.info = info;
+        this.deoptInfo = deoptInfo;
+    }
+
+
+    private static ArrayList<Object> keepAlive = new ArrayList<>();
+
+    @Override
+    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+        // TODO (cwimmer): we want to get rid of a generally reserved scratch register.
+        CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
+
+        masm.bind(label);
+        if (GraalOptions.CreateDeoptInfo && deoptInfo != null) {
+            masm.nop();
+            keepAlive.add(deoptInfo.toString());
+            AMD64Move.move(tasm, masm, scratch.asValue(), CiConstant.forObject(deoptInfo));
+            // TODO Make this an explicit calling convention instead of using a scratch register
+            AMD64Call.directCall(tasm, masm, CiRuntimeCall.SetDeoptInfo, info);
+        }
+        int code;
+        switch(action) {
+            case None:
+                code = 0;
+                break;
+            case Recompile:
+                code = 1;
+                break;
+            case InvalidateReprofile:
+                code = 2;
+                break;
+            case InvalidateRecompile:
+                code = 3;
+                break;
+            case InvalidateStopCompiling:
+                code = 4;
+                break;
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+        masm.movq(scratch, code);
+     // TODO Make this an explicit calling convention instead of using a scratch register
+        AMD64Call.directCall(tasm, masm, CiRuntimeCall.Deoptimize, info);
+        AMD64Call.shouldNotReachHere(tasm, masm);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,606 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.compiler.target.amd64;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.lir.amd64.AMD64Arithmetic.*;
+import static com.oracle.graal.lir.amd64.AMD64Compare.*;
+
+import java.util.*;
+
+import com.oracle.max.asm.*;
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.Mark;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
+import com.oracle.max.cri.xir.*;
+import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.StandardOp.JumpOp;
+import com.oracle.graal.lir.StandardOp.LabelOp;
+import com.oracle.graal.lir.amd64.AMD64Arithmetic.DivOp;
+import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op1Reg;
+import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op1Stack;
+import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op2Reg;
+import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op2Stack;
+import com.oracle.graal.lir.amd64.AMD64Arithmetic.ShiftOp;
+import com.oracle.graal.lir.amd64.AMD64Call.DirectCallOp;
+import com.oracle.graal.lir.amd64.AMD64Call.IndirectCallOp;
+import com.oracle.graal.lir.amd64.AMD64Compare.CompareOp;
+import com.oracle.graal.lir.amd64.AMD64ControlFlow.BranchOp;
+import com.oracle.graal.lir.amd64.AMD64ControlFlow.CondMoveOp;
+import com.oracle.graal.lir.amd64.AMD64ControlFlow.FloatBranchOp;
+import com.oracle.graal.lir.amd64.AMD64ControlFlow.FloatCondMoveOp;
+import com.oracle.graal.lir.amd64.AMD64ControlFlow.ReturnOp;
+import com.oracle.graal.lir.amd64.AMD64ControlFlow.TableSwitchOp;
+import com.oracle.graal.lir.amd64.AMD64Move.CompareAndSwapOp;
+import com.oracle.graal.lir.amd64.AMD64Move.LeaOp;
+import com.oracle.graal.lir.amd64.AMD64Move.LoadOp;
+import com.oracle.graal.lir.amd64.AMD64Move.MembarOp;
+import com.oracle.graal.lir.amd64.AMD64Move.MoveFromRegOp;
+import com.oracle.graal.lir.amd64.AMD64Move.MoveToRegOp;
+import com.oracle.graal.lir.amd64.AMD64Move.NullCheckOp;
+import com.oracle.graal.lir.amd64.AMD64Move.SpillMoveOp;
+import com.oracle.graal.lir.amd64.AMD64Move.StoreOp;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+
+/**
+ * This class implements the X86-specific portion of the LIR generator.
+ */
+public class AMD64LIRGenerator extends LIRGenerator {
+
+    private static final CiRegisterValue RAX_I = AMD64.rax.asValue(CiKind.Int);
+    private static final CiRegisterValue RAX_L = AMD64.rax.asValue(CiKind.Long);
+    private static final CiRegisterValue RDX_I = AMD64.rdx.asValue(CiKind.Int);
+    private static final CiRegisterValue RDX_L = AMD64.rdx.asValue(CiKind.Long);
+    private static final CiRegisterValue RCX_I = AMD64.rcx.asValue(CiKind.Int);
+
+    public static class AMD64SpillMoveFactory implements LIR.SpillMoveFactory {
+        @Override
+        public LIRInstruction createMove(CiValue result, CiValue input) {
+            return new SpillMoveOp(result, input);
+        }
+
+        @Override
+        public LIRInstruction createExchange(CiValue input1, CiValue input2) {
+            // TODO (cwimmer) implement XCHG operation for LIR
+            return null;
+        }
+    }
+
+    public AMD64LIRGenerator(Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
+        super(graph, runtime, target, frameMap, method, lir, xir);
+        lir.methodEndMarker = new AMD64MethodEndStub();
+        lir.spillMoveFactory = new AMD64SpillMoveFactory();
+    }
+
+    @Override
+    protected void emitNode(ValueNode node) {
+        if (node instanceof AMD64LIRLowerable) {
+            ((AMD64LIRLowerable) node).generateAmd64(this);
+        } else {
+            super.emitNode(node);
+        }
+    }
+
+    @Override
+    public boolean canStoreConstant(CiConstant c) {
+        // there is no immediate move of 64-bit constants on Intel
+        switch (c.kind) {
+            case Long:   return Util.isInt(c.asLong());
+            case Double: return false;
+            case Object: return c.isNull();
+            default:     return true;
+        }
+    }
+
+    @Override
+    public boolean canInlineConstant(CiConstant c) {
+        switch (c.kind) {
+            case Long:   return NumUtil.isInt(c.asLong());
+            case Object: return c.isNull();
+            default:     return true;
+        }
+    }
+
+    @Override
+    public CiAddress makeAddress(LocationNode location, ValueNode object) {
+        CiValue base = operand(object);
+        CiValue index = CiValue.IllegalValue;
+        int scale = 1;
+        long displacement = location.displacement();
+
+        if (isConstant(base)) {
+            if (!asConstant(base).isNull()) {
+                displacement += asConstant(base).asLong();
+            }
+            base = CiValue.IllegalValue;
+        }
+
+        if (location instanceof IndexedLocationNode) {
+            IndexedLocationNode indexedLoc = (IndexedLocationNode) location;
+
+            index = operand(indexedLoc.index());
+            if (indexedLoc.indexScalingEnabled()) {
+                scale = target().sizeInBytes(location.getValueKind());
+            }
+            if (isConstant(index)) {
+                long newDisplacement = displacement + asConstant(index).asLong() * scale;
+                // only use the constant index if the resulting displacement fits into a 32 bit offset
+                if (NumUtil.isInt(newDisplacement)) {
+                    displacement = newDisplacement;
+                    index = CiValue.IllegalValue;
+                } else {
+                    // create a temporary variable for the index, the pointer load cannot handle a constant index
+                    CiValue newIndex = newVariable(CiKind.Long);
+                    emitMove(index, newIndex);
+                    index = newIndex;
+                }
+            }
+        }
+
+        return new CiAddress(location.getValueKind(), base, index, CiAddress.Scale.fromInt(scale), (int) displacement);
+    }
+
+    @Override
+    public Variable emitMove(CiValue input) {
+        Variable result = newVariable(input.kind);
+        emitMove(input, result);
+        return result;
+    }
+
+    @Override
+    public void emitMove(CiValue src, CiValue dst) {
+        if (isRegister(src) || isStackSlot(dst)) {
+            append(new MoveFromRegOp(dst, src));
+        } else {
+            append(new MoveToRegOp(dst, src));
+        }
+    }
+
+    @Override
+    public Variable emitLoad(CiValue loadAddress, boolean canTrap) {
+        Variable result = newVariable(loadAddress.kind);
+        append(new LoadOp(result, loadAddress, canTrap ? state() : null));
+        return result;
+    }
+
+    @Override
+    public void emitStore(CiValue storeAddress, CiValue inputVal, boolean canTrap) {
+        CiValue input = loadForStore(inputVal, storeAddress.kind);
+        append(new StoreOp(storeAddress, input, canTrap ? state() : null));
+    }
+
+    @Override
+    public Variable emitLea(CiValue address) {
+        Variable result = newVariable(target().wordKind);
+        append(new LeaOp(result, address));
+        return result;
+    }
+
+    @Override
+    public void emitLabel(Label label, boolean align) {
+        append(new LabelOp(label, align));
+    }
+
+    @Override
+    public void emitJump(LabelRef label, LIRDebugInfo info) {
+        append(new JumpOp(label, info));
+    }
+
+    @Override
+    public void emitBranch(CiValue left, CiValue right, Condition cond, boolean unorderedIsTrue, LabelRef label, LIRDebugInfo info) {
+        emitCompare(left, right);
+        switch (left.kind) {
+            case Boolean:
+            case Int:
+            case Long:
+            case Object: append(new BranchOp(cond, label, info)); break;
+            case Float:
+            case Double: append(new FloatBranchOp(cond, unorderedIsTrue, label, info)); break;
+            default: throw GraalInternalError.shouldNotReachHere("" + left.kind);
+        }
+    }
+
+    @Override
+    public Variable emitCMove(CiValue left, CiValue right, Condition cond, boolean unorderedIsTrue, CiValue trueValue, CiValue falseValue) {
+        emitCompare(left, right);
+
+        Variable result = newVariable(trueValue.kind);
+        switch (left.kind) {
+            case Boolean:
+            case Int:
+            case Long:
+            case Object: append(new CondMoveOp(result, cond, load(trueValue), loadNonConst(falseValue))); break;
+            case Float:
+            case Double: append(new FloatCondMoveOp(result, cond, unorderedIsTrue, load(trueValue), load(falseValue))); break;
+
+        }
+        return result;
+    }
+
+    private void emitCompare(CiValue a, CiValue b) {
+        Variable left = load(a);
+        CiValue right = loadNonConst(b);
+        switch (left.kind) {
+            case Jsr:
+            case Int: append(new CompareOp(ICMP, left, right)); break;
+            case Long: append(new CompareOp(LCMP, left, right)); break;
+            case Object: append(new CompareOp(ACMP, left, right)); break;
+            case Float: append(new CompareOp(FCMP, left, right)); break;
+            case Double: append(new CompareOp(DCMP, left, right)); break;
+            default: throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    @Override
+    public Variable emitNegate(CiValue input) {
+        Variable result = newVariable(input.kind);
+        switch (input.kind) {
+            case Int:    append(new Op1Stack(INEG, result, input)); break;
+            case Long:   append(new Op1Stack(LNEG, result, input)); break;
+            case Float:  append(new Op2Reg(FXOR, result, input, CiConstant.forFloat(Float.intBitsToFloat(0x80000000)))); break;
+            case Double: append(new Op2Reg(DXOR, result, input, CiConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L)))); break;
+            default: throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitAdd(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch(a.kind) {
+            case Int:    append(new Op2Stack(IADD, result, a, loadNonConst(b))); break;
+            case Long:   append(new Op2Stack(LADD, result, a, loadNonConst(b))); break;
+            case Float:  append(new Op2Stack(FADD, result, a, loadNonConst(b))); break;
+            case Double: append(new Op2Stack(DADD, result, a, loadNonConst(b))); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitSub(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch(a.kind) {
+            case Int:    append(new Op2Stack(ISUB, result, a, loadNonConst(b))); break;
+            case Long:   append(new Op2Stack(LSUB, result, a, loadNonConst(b))); break;
+            case Float:  append(new Op2Stack(FSUB, result, a, loadNonConst(b))); break;
+            case Double: append(new Op2Stack(DSUB, result, a, loadNonConst(b))); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitMul(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch(a.kind) {
+            case Int:    append(new Op2Reg(IMUL, result, a, loadNonConst(b))); break;
+            case Long:   append(new Op2Reg(LMUL, result, a, loadNonConst(b))); break;
+            case Float:  append(new Op2Stack(FMUL, result, a, loadNonConst(b))); break;
+            case Double: append(new Op2Stack(DMUL, result, a, loadNonConst(b))); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitDiv(CiValue a, CiValue b) {
+        switch(a.kind) {
+            case Int:
+                emitMove(a, RAX_I);
+                append(new DivOp(IDIV, RAX_I, RAX_I, load(b), state()));
+                return emitMove(RAX_I);
+            case Long:
+                emitMove(a, RAX_L);
+                append(new DivOp(LDIV, RAX_L, RAX_L, load(b), state()));
+                return emitMove(RAX_L);
+            case Float: {
+                Variable result = newVariable(a.kind);
+                append(new Op2Stack(FDIV, result, a, loadNonConst(b)));
+                return result;
+            }
+            case Double: {
+                Variable result = newVariable(a.kind);
+                append(new Op2Stack(DDIV, result, a, loadNonConst(b)));
+                return result;
+            }
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    @Override
+    public Variable emitRem(CiValue a, CiValue b) {
+        switch(a.kind) {
+            case Int:
+                emitMove(a, RAX_I);
+                append(new DivOp(IREM, RDX_I, RAX_I, load(b), state()));
+                return emitMove(RDX_I);
+            case Long:
+                emitMove(a, RAX_L);
+                append(new DivOp(LREM, RDX_L, RAX_L, load(b), state()));
+                return emitMove(RDX_L);
+            case Float:
+                return emitCallToRuntime(CiRuntimeCall.ArithmeticFrem, false, a, b);
+            case Double:
+                return emitCallToRuntime(CiRuntimeCall.ArithmeticDrem, false, a, b);
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    @Override
+    public Variable emitUDiv(CiValue a, CiValue b) {
+        switch(a.kind) {
+            case Int:
+                emitMove(a, RAX_I);
+                append(new DivOp(IUDIV, RAX_I, RAX_I, load(b), state()));
+                return emitMove(RAX_I);
+            case Long:
+                emitMove(a, RAX_L);
+                append(new DivOp(LUDIV, RAX_L, RAX_L, load(b), state()));
+                return emitMove(RAX_L);
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    @Override
+    public Variable emitURem(CiValue a, CiValue b) {
+        switch(a.kind) {
+            case Int:
+                emitMove(a, RAX_I);
+                append(new DivOp(IUREM, RDX_I, RAX_I, load(b), state()));
+                return emitMove(RDX_I);
+            case Long:
+                emitMove(a, RAX_L);
+                append(new DivOp(LUREM, RDX_L, RAX_L, load(b), state()));
+                return emitMove(RDX_L);
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    @Override
+    public Variable emitAnd(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch(a.kind) {
+            case Int:    append(new Op2Stack(IAND, result, a, loadNonConst(b))); break;
+            case Long:   append(new Op2Stack(LAND, result, a, loadNonConst(b))); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitOr(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch(a.kind) {
+            case Int:    append(new Op2Stack(IOR, result, a, loadNonConst(b))); break;
+            case Long:   append(new Op2Stack(LOR, result, a, loadNonConst(b))); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitXor(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch(a.kind) {
+            case Int:    append(new Op2Stack(IXOR, result, a, loadNonConst(b))); break;
+            case Long:   append(new Op2Stack(LXOR, result, a, loadNonConst(b))); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+
+    @Override
+    public Variable emitShl(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch (a.kind) {
+            case Int:    append(new ShiftOp(ISHL, result, a, loadShiftCount(b))); break;
+            case Long:   append(new ShiftOp(LSHL, result, a, loadShiftCount(b))); break;
+            default: GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitShr(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch (a.kind) {
+            case Int:    append(new ShiftOp(ISHR, result, a, loadShiftCount(b))); break;
+            case Long:   append(new ShiftOp(LSHR, result, a, loadShiftCount(b))); break;
+            default: GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    @Override
+    public Variable emitUShr(CiValue a, CiValue b) {
+        Variable result = newVariable(a.kind);
+        switch (a.kind) {
+            case Int:    append(new ShiftOp(IUSHR, result, a, loadShiftCount(b))); break;
+            case Long:   append(new ShiftOp(LUSHR, result, a, loadShiftCount(b))); break;
+            default: GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+    private CiValue loadShiftCount(CiValue value) {
+        if (isConstant(value)) {
+            return value;
+        }
+        // Non-constant shift count must be in RCX
+        emitMove(value, RCX_I);
+        return RCX_I;
+    }
+
+
+    @Override
+    public Variable emitConvert(ConvertNode.Op opcode, CiValue inputVal) {
+        Variable input = load(inputVal);
+        Variable result = newVariable(opcode.to);
+        switch (opcode) {
+            case I2L: append(new Op1Reg(I2L, result, input)); break;
+            case L2I: append(new Op1Stack(L2I, result, input)); break;
+            case I2B: append(new Op1Stack(I2B, result, input)); break;
+            case I2C: append(new Op1Stack(I2C, result, input)); break;
+            case I2S: append(new Op1Stack(I2S, result, input)); break;
+            case F2D: append(new Op1Reg(F2D, result, input)); break;
+            case D2F: append(new Op1Reg(D2F, result, input)); break;
+            case I2F: append(new Op1Reg(I2F, result, input)); break;
+            case I2D: append(new Op1Reg(I2D, result, input)); break;
+            case F2I: append(new Op1Reg(F2I, result, input)); break;
+            case D2I: append(new Op1Reg(D2I, result, input)); break;
+            case L2F: append(new Op1Reg(L2F, result, input)); break;
+            case L2D: append(new Op1Reg(L2D, result, input)); break;
+            case F2L: append(new Op1Reg(F2L, result, input)); break;
+            case D2L: append(new Op1Reg(D2L, result, input)); break;
+            case MOV_I2F: append(new Op1Reg(MOV_I2F, result, input)); break;
+            case MOV_L2D: append(new Op1Reg(MOV_L2D, result, input)); break;
+            case MOV_F2I: append(new Op1Reg(MOV_F2I, result, input)); break;
+            case MOV_D2L: append(new Op1Reg(MOV_D2L, result, input)); break;
+            default: throw GraalInternalError.shouldNotReachHere();
+        }
+        return result;
+    }
+
+
+    @Override
+    public void emitDeoptimizeOn(Condition cond, DeoptAction action, Object deoptInfo) {
+        LIRDebugInfo info = state();
+        LabelRef stubEntry = createDeoptStub(action, info, deoptInfo);
+        if (cond != null) {
+            append(new BranchOp(cond, stubEntry, info));
+        } else {
+            append(new JumpOp(stubEntry, info));
+        }
+    }
+
+    @Override
+    public void emitMembar(int barriers) {
+        int necessaryBarriers = target.arch.requiredBarriers(barriers);
+        if (target.isMP && necessaryBarriers != 0) {
+            append(new MembarOp(necessaryBarriers));
+        }
+    }
+
+    @Override
+    protected void emitCall(Object targetMethod, CiValue result, List<CiValue> arguments, CiValue targetAddress, LIRDebugInfo info, Map<XirMark, Mark> marks) {
+        if (isConstant(targetAddress)) {
+            assert asConstant(targetAddress).isDefaultValue() : "destination address should be zero";
+            append(new DirectCallOp(targetMethod, result, arguments.toArray(new CiValue[arguments.size()]), info, marks));
+        } else {
+            append(new IndirectCallOp(targetMethod, result, arguments.toArray(new CiValue[arguments.size()]), targetAddress, info, marks));
+        }
+    }
+
+    @Override
+    protected void emitReturn(CiValue input) {
+        append(new ReturnOp(input));
+    }
+
+    @Override
+    protected void emitXir(XirSnippet snippet, CiValue[] operands, CiValue outputOperand, CiValue[] inputs, CiValue[] temps, int[] inputOperandIndices, int[] tempOperandIndices, int outputOperandIndex,
+                    LIRDebugInfo info, LIRDebugInfo infoAfter, LabelRef trueSuccessor, LabelRef falseSuccessor) {
+        append(new AMD64XirOp(snippet, operands, outputOperand, inputs, temps, inputOperandIndices, tempOperandIndices, outputOperandIndex, info, infoAfter, trueSuccessor, falseSuccessor));
+    }
+
+    @Override
+    protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiValue index) {
+        // Making a copy of the switch value is necessary because jump table destroys the input value
+        Variable tmp = emitMove(index);
+        append(new TableSwitchOp(lowKey, defaultTarget, targets, tmp, newVariable(target.wordKind)));
+    }
+
+    @Override
+    protected LabelRef createDeoptStub(DeoptAction action, LIRDebugInfo info, Object deoptInfo) {
+        assert info.topFrame.bci >= 0 : "invalid bci for deopt framestate";
+        AMD64DeoptimizationStub stub = new AMD64DeoptimizationStub(action, info, deoptInfo);
+        lir.deoptimizationStubs.add(stub);
+        return LabelRef.forLabel(stub.label);
+    }
+
+    @Override
+    protected void emitNullCheckGuard(NullCheckNode node) {
+        assert !node.expectedNull;
+        Variable value = load(operand(node.object()));
+        LIRDebugInfo info = state();
+        append(new NullCheckOp(value, info));
+    }
+
+    // TODO (cwimmer) The CompareAndSwapNode in its current form needs to be lowered to several Nodes before code generation to separate three parts:
+    // * The write barriers (and possibly read barriers) when accessing an object field
+    // * The distinction of returning a boolean value (semantic similar to a BooleanNode to be used as a condition?) or the old value being read
+    // * The actual compare-and-swap
+    @Override
+    public void visitCompareAndSwap(CompareAndSwapNode node) {
+        CiKind kind = node.newValue().kind();
+        assert kind == node.expected().kind();
+
+        CiValue expected = loadNonConst(operand(node.expected()));
+        Variable newValue = load(operand(node.newValue()));
+
+        CiAddress address;
+        CiValue index = operand(node.offset());
+        if (isConstant(index) && NumUtil.isInt(asConstant(index).asLong())) {
+            address = new CiAddress(kind, load(operand(node.object())), (int) asConstant(index).asLong());
+        } else {
+            address = new CiAddress(kind, load(operand(node.object())), load(index), CiAddress.Scale.Times1, 0);
+        }
+
+        if (kind == CiKind.Object) {
+            address = new CiAddress(kind, emitLea(address));
+            preGCWriteBarrier(address.base, false, null);
+        }
+
+        CiRegisterValue rax = AMD64.rax.asValue(kind);
+        emitMove(expected, rax);
+        append(new CompareAndSwapOp(rax, address, rax, newValue));
+
+        Variable result = newVariable(node.kind());
+        if (node.directResult()) {
+            emitMove(rax, result);
+        } else {
+            append(new CondMoveOp(result, Condition.EQ, load(CiConstant.TRUE), CiConstant.FALSE));
+        }
+        setResult(node, result);
+
+        if (kind == CiKind.Object) {
+            postGCWriteBarrier(address.base, newValue);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRLowerable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.target.amd64;
+
+public interface AMD64LIRLowerable {
+
+    void generateAmd64(AMD64LIRGenerator generator);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64MethodEndStub.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.target.amd64;
+
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.lir.amd64.*;
+import com.oracle.graal.lir.asm.*;
+
+public class AMD64MethodEndStub extends AMD64SlowPath {
+    @Override
+    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+        for (int i = 0; i < GraalOptions.MethodEndBreakpointGuards; ++i) {
+            masm.int3();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirAssembler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.target.amd64;
+
+import static com.oracle.max.cri.xir.XirTemplate.GlobalFlags.*;
+
+import java.util.*;
+
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.xir.*;
+
+/**
+ * AMD64 version of {@link CiXirAssembler}.
+ *
+ */
+public class AMD64XirAssembler extends CiXirAssembler {
+    public AMD64XirAssembler(CiTarget target) {
+        super(target);
+    }
+
+    @Override
+    protected XirTemplate buildTemplate(String name, boolean isStub) {
+        List<XirInstruction> fastPath = new ArrayList<>(instructions.size());
+        List<XirInstruction> slowPath = new ArrayList<>();
+
+        int flags = 0;
+
+        if (isStub) {
+            flags |= GLOBAL_STUB.mask;
+        }
+
+        List<XirInstruction> currentList = fastPath;
+
+        XirOperand fixedRDX = null;
+        XirOperand fixedRAX = null;
+        XirOperand fixedRCX = null;
+        XirOperand fixedRSI = null;
+        XirOperand fixedRDI = null;
+        HashSet<XirLabel> boundLabels = new HashSet<>();
+
+        for (XirInstruction i : instructions) {
+            boolean appended = false;
+            switch (i.op) {
+                case Mov:
+                    break;
+
+                case Add:
+                case Sub:
+                case Div:
+                case Mul:
+                case Mod:
+                case Shl:
+                case Shr:
+                case And:
+                case Or:
+                case Xor:
+                    // Convert to two operand form
+                    XirOperand xOp = i.x();
+                    if (i.op == XirOp.Div || i.op == XirOp.Mod) {
+                        if (fixedRDX == null) {
+                            fixedRDX = createRegisterTemp("divModTemp", CiKind.Int, AMD64.rdx);
+                        }
+                        // Special treatment to make sure that the left input of % and / is in RAX
+                        if (fixedRAX == null) {
+                            fixedRAX = createRegisterTemp("divModLeftInput", CiKind.Int, AMD64.rax);
+                        }
+                        currentList.add(new XirInstruction(i.x().kind, XirOp.Mov, fixedRAX, i.x()));
+                        xOp = fixedRAX;
+                    } else {
+                        if (i.result != i.x()) {
+                            currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, i.result, i.x()));
+                            xOp = i.result;
+                        }
+                    }
+
+                    XirOperand yOp = i.y();
+                    if ((i.op == XirOp.Shl || i.op == XirOp.Shr) && (!(i.y() instanceof XirConstantOperand))) {
+                        // Special treatment to make sure that the shift count is always in RCX
+                        if (fixedRCX == null) {
+                            fixedRCX = createRegisterTemp("fixedShiftCount", i.y().kind, AMD64.rcx);
+                        }
+                        currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, fixedRCX, i.y()));
+                        yOp = fixedRCX;
+                    } else if (i.op == XirOp.Mul && (i.y() instanceof XirConstantOperand)) {
+                        // Cannot multiply directly with a constant, so introduce a new temporary variable
+                        XirOperand tempLocation = createTemp("mulTempLocation", i.y().kind);
+                        currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, tempLocation, i.y()));
+                        yOp = tempLocation;
+
+                    }
+
+                    XirOperand resultOp = i.result;
+                    if (i.op == XirOp.Div) {
+                        resultOp = fixedRAX;
+                    } else if (i.op == XirOp.Mod) {
+                        resultOp = fixedRDX;
+                    }
+
+                    if (xOp != i.x() || yOp != i.y() || resultOp != i.result) {
+                        currentList.add(new XirInstruction(i.result.kind, i.op, resultOp, xOp, yOp));
+                        appended = true;
+                    }
+
+                    if (resultOp != i.result) {
+                        currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, i.result, resultOp));
+                    }
+                    break;
+
+                case RepeatMoveWords:
+                case RepeatMoveBytes:
+                    if (fixedRSI == null) {
+                        fixedRSI = createRegisterTemp("fixedRSI", target.wordKind, AMD64.rsi);
+                    }
+                    if (fixedRDI == null) {
+                        fixedRDI = createRegisterTemp("fixedRDI", target.wordKind, AMD64.rdi);
+                    }
+                    if (fixedRCX == null) {
+                        fixedRCX = createRegisterTemp("fixedRCX", target.wordKind, AMD64.rcx);
+                    }
+                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRSI, i.x()));
+                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRDI, i.y()));
+                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRCX, i.z()));
+                    currentList.add(new XirInstruction(CiKind.Illegal, i.op, i.result, fixedRSI, fixedRDI, fixedRCX));
+                    appended = true;
+                    break;
+
+                case NullCheck:
+                case PointerLoad:
+                case LoadEffectiveAddress:
+                case PointerStore:
+                case PointerLoadDisp:
+                case PointerStoreDisp:
+                    break;
+                case PointerCAS:
+                    if (fixedRAX == null) {
+                        fixedRAX = createRegisterTemp("fixedRAX", target.wordKind, AMD64.rax);
+                    }
+                    // x = source of cmpxch
+                    // y = new value
+                    // z = old value (i.e., the one compared to). Must be in RAX (and so must the result).
+                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRAX, i.z()));
+                    currentList.add(new XirInstruction(i.kind, i.op, i.result, i.x(), i.y(), fixedRAX));
+                    appended = true;
+                    break;
+                case CallRuntime:
+                    flags |= HAS_RUNTIME_CALL.mask;
+                    break;
+                case Jmp:
+                    // jmp can be either into the snippet or to a runtime target
+                    flags |= i.extra instanceof XirLabel ? HAS_CONTROL_FLOW.mask : HAS_RUNTIME_CALL.mask;
+                    break;
+                case Jeq:
+                case Jneq:
+                case Jgt:
+                case Jgteq:
+                case Jugteq:
+                case Jlt:
+                case Jlteq:
+                case DecAndJumpNotZero:
+                case Jbset:
+                    flags |= HAS_CONTROL_FLOW.mask;
+                    break;
+                case Bind:
+                    XirLabel label = (XirLabel) i.extra;
+                    currentList = label.inline ? fastPath : slowPath;
+                    assert !boundLabels.contains(label) : "label may be bound only once";
+                    boundLabels.add(label);
+                    break;
+                case Safepoint:
+                case Align:
+                case StackOverflowCheck:
+                case PushFrame:
+                case PopFrame:
+                case Push:
+                case Pop:
+                case Mark:
+                case Nop:
+                case RawBytes:
+                case ShouldNotReachHere:
+                    break;
+                default:
+                    assert false : "Unknown XIR operation " + i.op;
+            }
+            if (!appended) {
+                currentList.add(i);
+            }
+        }
+        for (XirLabel label : labels) {
+            assert label.name == XirLabel.TrueSuccessor || label.name == XirLabel.FalseSuccessor || boundLabels.contains(label) : "label " + label.name + " is not bound!";
+        }
+        XirInstruction[] fp = fastPath.toArray(new XirInstruction[fastPath.size()]);
+        XirInstruction[] sp = slowPath.size() > 0 ? slowPath.toArray(new XirInstruction[slowPath.size()]) : null;
+        XirLabel[] xirLabels = labels.toArray(new XirLabel[labels.size()]);
+        XirParameter[] xirParameters = parameters.toArray(new XirParameter[parameters.size()]);
+        XirTemp[] temporaryOperands = temps.toArray(new XirTemp[temps.size()]);
+        XirConstant[] constantOperands = constants.toArray(new XirConstant[constants.size()]);
+        XirMark[] marksArray = marks.toArray(new XirMark[marks.size()]);
+        return new XirTemplate(name, this.variableCount, this.allocateResultOperand, resultOperand, fp, sp, xirLabels, xirParameters, temporaryOperands, constantOperands, flags, marksArray, outgoingStackSize);
+    }
+
+    @Override
+    public CiXirAssembler copy() {
+        return new AMD64XirAssembler(target);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,553 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.target.amd64;
+
+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.Mark;
+import com.oracle.max.cri.xir.*;
+import com.oracle.max.cri.xir.CiXirAssembler.RuntimeCallInformation;
+import com.oracle.max.cri.xir.CiXirAssembler.XirInstruction;
+import com.oracle.max.cri.xir.CiXirAssembler.XirLabel;
+import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.amd64.*;
+import com.oracle.graal.lir.asm.*;
+
+public class AMD64XirOp extends LIRXirInstruction {
+    public AMD64XirOp(XirSnippet snippet, CiValue[] operands, CiValue outputOperand, CiValue[] inputs, CiValue[] temps, int[] inputOperandIndices, int[] tempOperandIndices, int outputOperandIndex,
+                        LIRDebugInfo info, LIRDebugInfo infoAfter, LabelRef trueSuccessor, LabelRef falseSuccessor) {
+        super("XIR", snippet, operands, outputOperand, inputs, temps, inputOperandIndices, tempOperandIndices, outputOperandIndex, info, infoAfter, trueSuccessor, falseSuccessor);
+    }
+
+    @Override
+    public void emitCode(TargetMethodAssembler tasm) {
+        AMD64MacroAssembler masm = (AMD64MacroAssembler) tasm.asm;
+
+        Label endLabel = null;
+        Label[] labels = new Label[snippet.template.labels.length];
+        for (int i = 0; i < labels.length; i++) {
+            labels[i] = new Label();
+            if (snippet.template.labels[i].name == XirLabel.TrueSuccessor) {
+                if (trueSuccessor == null) {
+                    assert endLabel == null;
+                    endLabel = new Label();
+                    labels[i] = endLabel;
+                } else {
+                    labels[i] = trueSuccessor.label();
+                }
+            } else if (snippet.template.labels[i].name == XirLabel.FalseSuccessor) {
+                if (falseSuccessor == null) {
+                    assert endLabel == null;
+                    endLabel = new Label();
+                    labels[i] = endLabel;
+                } else {
+                    labels[i] = falseSuccessor.label();
+                }
+            }
+        }
+        emitXirInstructions(tasm, masm, snippet.template.fastPath, labels, getOperands(), snippet.marks);
+        if (endLabel != null) {
+            masm.bind(endLabel);
+        }
+
+        if (snippet.template.slowPath != null) {
+            tasm.slowPaths.add(new SlowPath(labels));
+        }
+    }
+
+    private class SlowPath extends AMD64SlowPath {
+        public final Label[] labels;
+
+        public SlowPath(Label[] labels) {
+            this.labels = labels;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            emitXirInstructions(tasm, masm, snippet.template.slowPath, labels, getOperands(), snippet.marks);
+            masm.nop();
+        }
+    }
+
+
+    protected void emitXirInstructions(TargetMethodAssembler tasm, AMD64MacroAssembler masm, XirInstruction[] instructions, Label[] labels, CiValue[] operands, Map<XirMark, Mark> marks) {
+        for (XirInstruction inst : instructions) {
+            switch (inst.op) {
+                case Add:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IADD, AMD64Arithmetic.LADD, AMD64Arithmetic.FADD, AMD64Arithmetic.DADD, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Sub:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.ISUB, AMD64Arithmetic.LSUB, AMD64Arithmetic.FSUB, AMD64Arithmetic.DSUB, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Div:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IDIV, AMD64Arithmetic.LDIV, AMD64Arithmetic.FDIV, AMD64Arithmetic.DDIV, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Mul:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IMUL, AMD64Arithmetic.LMUL, AMD64Arithmetic.FMUL, AMD64Arithmetic.DMUL, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Mod:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IREM, AMD64Arithmetic.LREM, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Shl:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.ISHL, AMD64Arithmetic.LSHL, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Sar:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.ISHR, AMD64Arithmetic.LSHR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Shr:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IUSHR, AMD64Arithmetic.LUSHR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case And:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IAND, AMD64Arithmetic.LAND, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Or:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IOR, AMD64Arithmetic.LOR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Xor:
+                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IXOR, AMD64Arithmetic.LXOR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
+                    break;
+
+                case Mov: {
+                    CiValue result = operands[inst.result.index];
+                    CiValue source = operands[inst.x().index];
+                    AMD64Move.move(tasm, masm, result, source);
+                    break;
+                }
+
+                case PointerLoad: {
+                    CiValue result = operands[inst.result.index];
+                    CiValue pointer = operands[inst.x().index];
+                    CiRegisterValue register = assureInRegister(tasm, masm, pointer);
+
+                    AMD64Move.load(tasm, masm, result, new CiAddress(inst.kind, register), (Boolean) inst.extra ? info : null);
+                    break;
+                }
+
+                case PointerStore: {
+                    CiValue value = assureNot64BitConstant(tasm, masm, operands[inst.y().index]);
+                    CiValue pointer = operands[inst.x().index];
+                    assert isRegister(pointer);
+
+                    AMD64Move.store(tasm, masm, new CiAddress(inst.kind, pointer), value, (Boolean) inst.extra ? info : null);
+                    break;
+                }
+
+                case PointerLoadDisp: {
+                    CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
+                    boolean canTrap = addressInformation.canTrap;
+
+                    CiAddress.Scale scale = addressInformation.scale;
+                    int displacement = addressInformation.disp;
+
+                    CiValue result = operands[inst.result.index];
+                    CiValue pointer = operands[inst.x().index];
+                    CiValue index = operands[inst.y().index];
+
+                    pointer = assureInRegister(tasm, masm, pointer);
+                    assert isRegister(pointer);
+
+                    CiAddress src;
+                    if (isConstant(index)) {
+                        assert index.kind == CiKind.Int;
+                        CiConstant constantIndex = (CiConstant) index;
+                        src = new CiAddress(inst.kind, pointer, constantIndex.asInt() * scale.value + displacement);
+                    } else {
+                        src = new CiAddress(inst.kind, pointer, index, scale, displacement);
+                    }
+
+                    AMD64Move.load(tasm, masm, result, src, canTrap ? info : null);
+                    break;
+                }
+
+                case LoadEffectiveAddress: {
+                    CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
+
+                    CiAddress.Scale scale = addressInformation.scale;
+                    int displacement = addressInformation.disp;
+
+                    CiValue result = operands[inst.result.index];
+                    CiValue pointer = operands[inst.x().index];
+                    CiValue index = operands[inst.y().index];
+
+                    pointer = assureInRegister(tasm, masm, pointer);
+                    assert isRegister(pointer);
+                    CiAddress src = new CiAddress(CiKind.Illegal, pointer, index, scale, displacement);
+                    masm.leaq(asRegister(result), src);
+                    break;
+                }
+
+                case PointerStoreDisp: {
+                    CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
+                    boolean canTrap = addressInformation.canTrap;
+
+                    CiAddress.Scale scale = addressInformation.scale;
+                    int displacement = addressInformation.disp;
+
+                    CiValue value = assureNot64BitConstant(tasm, masm, operands[inst.z().index]);
+                    CiValue pointer = operands[inst.x().index];
+                    CiValue index = operands[inst.y().index];
+
+                    pointer = assureInRegister(tasm, masm, pointer);
+                    assert isRegister(pointer);
+
+                    CiAddress dst;
+                    if (isConstant(index)) {
+                        assert index.kind == CiKind.Int;
+                        CiConstant constantIndex = (CiConstant) index;
+                        dst = new CiAddress(inst.kind, pointer, IllegalValue, scale, constantIndex.asInt() * scale.value + displacement);
+                    } else {
+                        dst = new CiAddress(inst.kind, pointer, index, scale, displacement);
+                    }
+
+                    AMD64Move.store(tasm, masm, dst, value, canTrap ? info : null);
+                    break;
+                }
+
+                case RepeatMoveBytes:
+                    assert asRegister(operands[inst.x().index]).equals(AMD64.rsi) : "wrong input x: " + operands[inst.x().index];
+                    assert asRegister(operands[inst.y().index]).equals(AMD64.rdi) : "wrong input y: " + operands[inst.y().index];
+                    assert asRegister(operands[inst.z().index]).equals(AMD64.rcx) : "wrong input z: " + operands[inst.z().index];
+                    masm.repeatMoveBytes();
+                    break;
+
+                case RepeatMoveWords:
+                    assert asRegister(operands[inst.x().index]).equals(AMD64.rsi) : "wrong input x: " + operands[inst.x().index];
+                    assert asRegister(operands[inst.y().index]).equals(AMD64.rdi) : "wrong input y: " + operands[inst.y().index];
+                    assert asRegister(operands[inst.z().index]).equals(AMD64.rcx) : "wrong input z: " + operands[inst.z().index];
+                    masm.repeatMoveWords();
+                    break;
+
+                case PointerCAS:
+                    assert asRegister(operands[inst.x().index]).equals(AMD64.rax) : "wrong input x: " + operands[inst.x().index];
+
+                    CiValue exchangedVal = operands[inst.y().index];
+                    CiValue exchangedAddress = operands[inst.x().index];
+                    CiRegisterValue pointerRegister = assureInRegister(tasm, masm, exchangedAddress);
+                    CiAddress addr = new CiAddress(tasm.target.wordKind, pointerRegister);
+
+                    if ((Boolean) inst.extra && info != null) {
+                        tasm.recordImplicitException(masm.codeBuffer.position(), info);
+                    }
+                    masm.cmpxchgq(asRegister(exchangedVal), addr);
+
+                    break;
+
+                case CallRuntime: {
+                    CiKind[] signature = new CiKind[inst.arguments.length];
+                    for (int i = 0; i < signature.length; i++) {
+                        signature[i] = inst.arguments[i].kind;
+                    }
+
+                    CiCallingConvention cc = tasm.frameMap.registerConfig.getCallingConvention(RuntimeCall, signature, tasm.target, false);
+                    for (int i = 0; i < inst.arguments.length; i++) {
+                        CiValue argumentLocation = cc.locations[i];
+                        CiValue argumentSourceLocation = operands[inst.arguments[i].index];
+                        if (argumentLocation != argumentSourceLocation) {
+                            AMD64Move.move(tasm, masm, argumentLocation, argumentSourceLocation);
+                        }
+                    }
+
+                    RuntimeCallInformation runtimeCallInformation = (RuntimeCallInformation) inst.extra;
+                    AMD64Call.directCall(tasm, masm, runtimeCallInformation.target, (runtimeCallInformation.useInfoAfter) ? infoAfter : info);
+
+                    if (inst.result != null && inst.result.kind != CiKind.Illegal && inst.result.kind != CiKind.Void) {
+                        CiRegister returnRegister = tasm.frameMap.registerConfig.getReturnRegister(inst.result.kind);
+                        CiValue resultLocation = returnRegister.asValue(inst.result.kind.stackKind());
+                        AMD64Move.move(tasm, masm, operands[inst.result.index], resultLocation);
+                    }
+                    break;
+                }
+                case Jmp: {
+                    if (inst.extra instanceof XirLabel) {
+                        Label label = labels[((XirLabel) inst.extra).index];
+                        masm.jmp(label);
+                    } else {
+                        AMD64Call.directJmp(tasm, masm, inst.extra);
+                    }
+                    break;
+                }
+                case DecAndJumpNotZero: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    CiValue value = operands[inst.x().index];
+                    if (value.kind == CiKind.Long) {
+                        masm.decq(asRegister(value));
+                    } else {
+                        assert value.kind == CiKind.Int;
+                        masm.decl(asRegister(value));
+                    }
+                    masm.jcc(ConditionFlag.notZero, label);
+                    break;
+                }
+                case Jeq: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    emitXirCompare(tasm, masm, inst, ConditionFlag.equal, operands, label);
+                    break;
+                }
+                case Jneq: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    emitXirCompare(tasm, masm, inst, ConditionFlag.notEqual, operands, label);
+                    break;
+                }
+
+                case Jgt: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    emitXirCompare(tasm, masm, inst, ConditionFlag.greater, operands, label);
+                    break;
+                }
+
+                case Jgteq: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    emitXirCompare(tasm, masm, inst, ConditionFlag.greaterEqual, operands, label);
+                    break;
+                }
+
+                case Jugteq: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    emitXirCompare(tasm, masm, inst, ConditionFlag.aboveEqual, operands, label);
+                    break;
+                }
+
+                case Jlt: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    emitXirCompare(tasm, masm, inst, ConditionFlag.less, operands, label);
+                    break;
+                }
+
+                case Jlteq: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    emitXirCompare(tasm, masm, inst, ConditionFlag.lessEqual, operands, label);
+                    break;
+                }
+
+                case Jbset: {
+                    Label label = labels[((XirLabel) inst.extra).index];
+                    CiValue pointer = operands[inst.x().index];
+                    CiValue offset = operands[inst.y().index];
+                    CiValue bit = operands[inst.z().index];
+                    assert isConstant(offset) && isConstant(bit);
+                    CiConstant constantOffset = (CiConstant) offset;
+                    CiConstant constantBit = (CiConstant) bit;
+                    CiAddress src = new CiAddress(inst.kind, pointer, constantOffset.asInt());
+                    masm.btli(src, constantBit.asInt());
+                    masm.jcc(ConditionFlag.aboveEqual, label);
+                    break;
+                }
+
+                case Bind: {
+                    XirLabel l = (XirLabel) inst.extra;
+                    Label label = labels[l.index];
+                    masm.bind(label);
+                    break;
+                }
+                case Safepoint: {
+                    assert info != null : "Must have debug info in order to create a safepoint.";
+                    tasm.recordSafepoint(masm.codeBuffer.position(), info);
+                    break;
+                }
+                case NullCheck: {
+                    tasm.recordImplicitException(masm.codeBuffer.position(), info);
+                    CiValue pointer = operands[inst.x().index];
+                    masm.nullCheck(asRegister(pointer));
+                    break;
+                }
+                case Align: {
+                    masm.align((Integer) inst.extra);
+                    break;
+                }
+                case StackOverflowCheck: {
+                    int frameSize = tasm.frameMap.frameSize();
+                    int lastFramePage = frameSize / tasm.target.pageSize;
+                    // emit multiple stack bangs for methods with frames larger than a page
+                    for (int i = 0; i <= lastFramePage; i++) {
+                        int offset = (i + GraalOptions.StackShadowPages) * tasm.target.pageSize;
+                        // Deduct 'frameSize' to handle frames larger than the shadow
+                        bangStackWithOffset(tasm, masm, offset - frameSize);
+                    }
+                    break;
+                }
+                case PushFrame: {
+                    int frameSize = tasm.frameMap.frameSize();
+                    masm.decrementq(AMD64.rsp, frameSize); // does not emit code for frameSize == 0
+                    if (GraalOptions.ZapStackOnMethodEntry) {
+                        final int intSize = 4;
+                        for (int i = 0; i < frameSize / intSize; ++i) {
+                            masm.movl(new CiAddress(CiKind.Int, AMD64.rsp.asValue(), i * intSize), 0xC1C1C1C1);
+                        }
+                    }
+                    CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
+                    if (csl != null && csl.size != 0) {
+                        int frameToCSA = tasm.frameMap.offsetToCalleeSaveArea();
+                        assert frameToCSA >= 0;
+                        masm.save(csl, frameToCSA);
+                    }
+                    break;
+                }
+                case PopFrame: {
+                    int frameSize = tasm.frameMap.frameSize();
+
+                    CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
+                    if (csl != null && csl.size != 0) {
+                        tasm.targetMethod.setRegisterRestoreEpilogueOffset(masm.codeBuffer.position());
+                        // saved all registers, restore all registers
+                        int frameToCSA = tasm.frameMap.offsetToCalleeSaveArea();
+                        masm.restore(csl, frameToCSA);
+                    }
+
+                    masm.incrementq(AMD64.rsp, frameSize);
+                    break;
+                }
+                case Push: {
+                    CiRegisterValue value = assureInRegister(tasm, masm, operands[inst.x().index]);
+                    masm.push(asRegister(value));
+                    break;
+                }
+                case Pop: {
+                    CiValue result = operands[inst.result.index];
+                    if (isRegister(result)) {
+                        masm.pop(asRegister(result));
+                    } else {
+                        CiRegister rscratch = tasm.frameMap.registerConfig.getScratchRegister();
+                        masm.pop(rscratch);
+                        AMD64Move.move(tasm, masm, result, rscratch.asValue());
+                    }
+                    break;
+                }
+                case Mark: {
+                    XirMark xmark = (XirMark) inst.extra;
+                    Mark[] references = new Mark[xmark.references.length];
+                    for (int i = 0; i < references.length; i++) {
+                        references[i] = marks.get(xmark.references[i]);
+                        assert references[i] != null;
+                    }
+                    Mark mark = tasm.recordMark(xmark.id, references);
+                    marks.put(xmark, mark);
+                    break;
+                }
+                case Nop: {
+                    for (int i = 0; i < (Integer) inst.extra; i++) {
+                        masm.nop();
+                    }
+                    break;
+                }
+                case RawBytes: {
+                    for (byte b : (byte[]) inst.extra) {
+                        masm.codeBuffer.emitByte(b & 0xff);
+                    }
+                    break;
+                }
+                case ShouldNotReachHere: {
+                    AMD64Call.shouldNotReachHere(tasm, masm);
+                    break;
+                }
+                default:
+                    throw GraalInternalError.shouldNotReachHere("Unknown XIR operation " + inst.op);
+            }
+        }
+    }
+
+    private static void emitXirViaLir(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Arithmetic intOp, AMD64Arithmetic longOp, AMD64Arithmetic floatOp,
+                    AMD64Arithmetic doubleOp, CiValue left, CiValue right, CiValue result) {
+        AMD64Arithmetic code;
+        switch (result.kind) {
+            case Int: code = intOp; break;
+            case Long: code = longOp; break;
+            case Float: code = floatOp; break;
+            case Double: code = doubleOp; break;
+            default: throw GraalInternalError.shouldNotReachHere();
+        }
+        assert left == result;
+        if (isRegister(right) && right.kind != result.kind) {
+            // XIR is not strongly typed, so we can have a type mismatch that we have to fix here.
+            AMD64Arithmetic.emit(tasm, masm, code, result, asRegister(right).asValue(result.kind), null);
+        } else {
+            AMD64Arithmetic.emit(tasm, masm, code, result, right, null);
+        }
+    }
+
+    private static void emitXirCompare(TargetMethodAssembler tasm, AMD64MacroAssembler masm, XirInstruction inst, ConditionFlag cflag, CiValue[] ops, Label label) {
+        CiValue x = ops[inst.x().index];
+        CiValue y = ops[inst.y().index];
+        AMD64Compare code;
+        switch (x.kind) {
+            case Int: code = AMD64Compare.ICMP; break;
+            case Long: code = AMD64Compare.LCMP; break;
+            case Object: code = AMD64Compare.ACMP; break;
+            case Float: code = AMD64Compare.FCMP; break;
+            case Double: code = AMD64Compare.DCMP; break;
+            default: throw GraalInternalError.shouldNotReachHere();
+        }
+        AMD64Compare.emit(tasm, masm, code, x, y);
+        masm.jcc(cflag, label);
+    }
+
+    /**
+     * @param offset the offset RSP at which to bang. Note that this offset is relative to RSP after RSP has been
+     *            adjusted to allocated the frame for the method. It denotes an offset "down" the stack.
+     *            For very large frames, this means that the offset may actually be negative (i.e. denoting
+     *            a slot "up" the stack above RSP).
+     */
+    private static void bangStackWithOffset(TargetMethodAssembler tasm, AMD64MacroAssembler masm, int offset) {
+        masm.movq(new CiAddress(tasm.target.wordKind, AMD64.RSP, -offset), AMD64.rax);
+    }
+
+    private static CiValue assureNot64BitConstant(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue value) {
+        if (isConstant(value) && (value.kind == CiKind.Long || value.kind == CiKind.Object)) {
+            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(value.kind);
+            AMD64Move.move(tasm, masm, register, value);
+            return register;
+        }
+        return value;
+    }
+
+    private static CiRegisterValue assureInRegister(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue pointer) {
+        if (isConstant(pointer)) {
+            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(pointer.kind);
+            AMD64Move.move(tasm, masm, register, pointer);
+            return register;
+        }
+
+        assert isRegister(pointer) : "should be register, but is: " + pointer;
+        return (CiRegisterValue) pointer;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PostOrderBlockIterator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.types;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.cfg.*;
+
+public abstract class PostOrderBlockIterator {
+
+    private final BitMap visitedEndBlocks;
+    private final Deque<Block> blockQueue;
+
+    public PostOrderBlockIterator(Block start, int blockCount) {
+        visitedEndBlocks = new BitMap(blockCount);
+        blockQueue = new ArrayDeque<>();
+        blockQueue.add(start);
+    }
+
+    public void apply() {
+        while (!blockQueue.isEmpty()) {
+            Block current = blockQueue.removeLast();
+            block(current);
+
+            for (int i = 0; i < current.getSuccessors().size(); i++) {
+                Block successor = current.getSuccessors().get(i);
+                if (successor.getPredecessors().size() > 1) {
+                    queueMerge(current, successor);
+                } else {
+                    blockQueue.addLast(successor);
+                }
+            }
+        }
+    }
+
+    protected abstract void block(Block block);
+
+    private void queueMerge(Block end, Block merge) {
+        visitedEndBlocks.set(end.getId());
+        for (Block pred : merge.getPredecessors()) {
+            if (!visitedEndBlocks.get(pred.getId())) {
+                return;
+            }
+        }
+        blockQueue.addFirst(merge);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypesPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.types;
+
+import java.util.*;
+import java.util.Map.Entry;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.graph.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.schedule.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.NodeClass.NodeClassIterator;
+import com.oracle.graal.graph.NodeClass.Position;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class PropagateTypesPhase extends Phase {
+
+    private final CiTarget target;
+    private final RiRuntime runtime;
+    private final CiAssumptions assumptions;
+
+    private NodeWorkList changedNodes;
+
+    public PropagateTypesPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions) {
+        this.target = target;
+        this.runtime = runtime;
+        this.assumptions = assumptions;
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+
+        new DeadCodeEliminationPhase().apply(graph);
+
+        changedNodes = graph.createNodeWorkList(false, 10);
+
+        SchedulePhase schedule = new SchedulePhase();
+        schedule.apply(graph);
+
+        schedule.scheduleGraph();
+        Debug.dump(graph, "scheduled");
+
+        new PropagateTypes(graph.start()).apply();
+        Debug.dump(graph, "after propagation");
+
+        new UnscheduleNodes(graph.start()).apply();
+
+        CanonicalizerPhase.canonicalize(graph, changedNodes, runtime, target, assumptions);
+    }
+
+    private class PiNodeList {
+
+        public final PiNodeList last;
+        public final ValueNode replacement;
+        public final int depth;
+
+        public PiNodeList(ValueNode replacement, PiNodeList last) {
+            this.last = last;
+            this.replacement = replacement;
+            this.depth = last != null ? last.depth + 1 : 1;
+        }
+
+        public PiNodeList merge(PiNodeList other) {
+            PiNodeList thisList = this;
+            PiNodeList otherList = other;
+            while (thisList.depth > otherList.depth) {
+                thisList = thisList.last;
+            }
+            while (otherList.depth > thisList.depth) {
+                otherList = otherList.last;
+            }
+            while (thisList != otherList) {
+                thisList = thisList.last;
+                otherList = otherList.last;
+            }
+            return thisList;
+        }
+    }
+
+    private class TypeInfo implements MergeableState<TypeInfo> {
+
+        private HashMap<ValueNode, PiNodeList> piNodes = new HashMap<>();
+
+        public TypeInfo(HashMap<ValueNode, PiNodeList> piNodes) {
+            this.piNodes.putAll(piNodes);
+        }
+
+        @Override
+        public TypeInfo clone() {
+            return new TypeInfo(piNodes);
+        }
+
+        @Override
+        public boolean merge(MergeNode merge, Collection<TypeInfo> withStates) {
+            if (merge.forwardEndCount() > 1) {
+                HashMap<ValueNode, PiNodeList> newPiNodes = new HashMap<>();
+                for (Entry<ValueNode, PiNodeList> entry : piNodes.entrySet()) {
+                    PiNodeList list = entry.getValue();
+                    for (TypeInfo info : withStates) {
+                        PiNodeList other = info.piNodes.get(entry.getKey());
+                        if (other == null) {
+                            list = null;
+                        } else {
+                            list = list.merge(other);
+                        }
+                        if (list == null) {
+                            break;
+                        }
+                    }
+                    if (list != null) {
+                        newPiNodes.put(entry.getKey(), list);
+                    }
+                }
+                piNodes = newPiNodes;
+            }
+            return true;
+        }
+
+        @Override
+        public void loopBegin(LoopBeginNode loop) {
+        }
+
+        @Override
+        public void loopEnds(LoopBeginNode loop, Collection<TypeInfo> loopEndStates) {
+        }
+
+        @Override
+        public void afterSplit(FixedNode node) {
+            assert node.predecessor() != null;
+            assert node.predecessor() instanceof ControlSplitNode;
+//            TTY.println("after split: %s", node);
+            if (node.predecessor() instanceof IfNode) {
+                IfNode ifNode = (IfNode) node.predecessor();
+                if (ifNode.compare() instanceof InstanceOfNode) {
+                    InstanceOfNode instanceOf = (InstanceOfNode) ifNode.compare();
+                    assert node == ifNode.trueSuccessor() || node == ifNode.falseSuccessor();
+                    if ((node == ifNode.trueSuccessor() && !instanceOf.negated()) || (node == ifNode.falseSuccessor() && instanceOf.negated())) {
+                        ValueNode value = instanceOf.object();
+                        if (value.declaredType() != instanceOf.targetClass() || !value.stamp().nonNull()) {
+                            PiNode piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.declaredNonNull(instanceOf.targetClass())));
+                            PiNodeList list = piNodes.get(value);
+                            piNodes.put(value, new PiNodeList(piNode, list));
+                        }
+                    }
+                } else if (ifNode.compare() instanceof CompareNode) {
+                    CompareNode compare = (CompareNode) ifNode.compare();
+                    assert node == ifNode.trueSuccessor() || node == ifNode.falseSuccessor();
+                    if ((node == ifNode.trueSuccessor() && compare.condition() == Condition.EQ) || (node == ifNode.falseSuccessor() && compare.condition() == Condition.NE)) {
+                        if (compare.y().isConstant()) {
+                            ValueNode value = compare.x();
+                            PiNodeList list = piNodes.get(value);
+                            piNodes.put(value, new PiNodeList(compare.y(), list));
+                        }
+                    } else if ((node == ifNode.trueSuccessor() && compare.condition() == Condition.NE) || (node == ifNode.falseSuccessor() && compare.condition() == Condition.EQ)) {
+                        if (!compare.x().isConstant() && compare.y().isNullConstant() && !compare.x().stamp().nonNull()) {
+                            ValueNode value = compare.x();
+                            PiNode piNode;
+                            if (value.exactType() != null) {
+                                piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.declaredNonNull(value.exactType())));
+                            } else if (value.declaredType() != null) {
+                                piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.declaredNonNull(value.declaredType())));
+                            } else {
+                                piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.objectNonNull()));
+                            }
+                            PiNodeList list = piNodes.get(value);
+                            piNodes.put(value, new PiNodeList(piNode, list));
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private class Tool implements CanonicalizerTool {
+        @Override
+        public CiTarget target() {
+            return target;
+        }
+
+        @Override
+        public CiAssumptions assumptions() {
+            return assumptions;
+        }
+
+        @Override
+        public RiRuntime runtime() {
+            return runtime;
+        }
+    }
+
+    private final Tool tool = new Tool();
+
+    private class PropagateTypes extends ScheduledNodeIterator<TypeInfo> {
+
+        public PropagateTypes(FixedNode start) {
+            super(start, new TypeInfo(new HashMap<ValueNode, PiNodeList>()));
+        }
+
+        @Override
+        protected void node(ScheduledNode node) {
+            if (node instanceof Canonicalizable || node instanceof Invoke) {
+                NodeClassIterator iter = node.inputs().iterator();
+                ArrayList<Node> changedInputs = new ArrayList<>();
+                while (iter.hasNext()) {
+                    Position pos = iter.nextPosition();
+                    Node value = pos.get(node);
+                    PiNodeList list = state.piNodes.get(value);
+                    if (list != null) {
+                        changedInputs.add(list.replacement instanceof PiNode ? value : null);
+                        pos.set(node, list.replacement);
+                    } else {
+                        changedInputs.add(null);
+                    }
+                }
+
+                ValueNode canonical = null;
+                if (node instanceof Canonicalizable) {
+                    canonical = ((Canonicalizable) node).canonical(tool);
+                }
+
+                if (canonical == node) {
+                    iter = node.inputs().iterator();
+                    int i = 0;
+                    while (iter.hasNext()) {
+                        Position pos = iter.nextPosition();
+                        if (changedInputs.get(i) != null) {
+                            pos.set(node, changedInputs.get(i));
+                        }
+                        i++;
+                    }
+                } else {
+                    changedNodes.add(node);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/ScheduledNodeIterator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.types;
+
+import java.util.*;
+
+import com.oracle.graal.compiler.graph.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+public abstract class ScheduledNodeIterator<T extends MergeableState<T>> {
+
+    private final NodeBitMap visitedEnds;
+    private final Deque<ScheduledNode> nodeQueue;
+    private final IdentityHashMap<ScheduledNode, T> nodeStates;
+    private final FixedNode start;
+
+    protected T state;
+
+    public ScheduledNodeIterator(FixedNode start, T initialState) {
+        visitedEnds = start.graph().createNodeBitMap();
+        nodeQueue = new ArrayDeque<>();
+        nodeStates = new IdentityHashMap<>();
+        this.start = start;
+        this.state = initialState;
+    }
+
+    public void apply() {
+        ScheduledNode current = start;
+
+        do {
+            if (current instanceof LoopBeginNode) {
+                state.loopBegin((LoopBeginNode) current);
+                nodeStates.put(current, state);
+                state = state.clone();
+                loopBegin((LoopBeginNode) current);
+                current = current.scheduledNext();
+                assert current != null;
+            } else if (current instanceof LoopEndNode) {
+                loopEnd((LoopEndNode) current);
+                finishLoopEnds((LoopEndNode) current);
+                current = nextQueuedNode();
+            } else if (current instanceof MergeNode) {
+                merge((MergeNode) current);
+                current = current.scheduledNext();
+                assert current != null;
+            } else if (current instanceof EndNode) {
+                end((EndNode) current);
+                queueMerge((EndNode) current);
+                current = nextQueuedNode();
+            } else if (current instanceof ControlSplitNode) {
+                controlSplit((ControlSplitNode) current);
+                queueSuccessors(current);
+                current = nextQueuedNode();
+            } else {
+                ScheduledNode next = current.scheduledNext();
+                node(current);
+                if (next == null) {
+                    current = nextQueuedNode();
+                } else {
+                    current = next;
+                }
+            }
+        } while(current != null);
+    }
+
+    private void queueSuccessors(ScheduledNode x) {
+        nodeStates.put(x, state);
+        for (Node node : x.successors()) {
+            if (node != null) {
+                nodeQueue.addFirst((FixedNode) node);
+            }
+        }
+    }
+
+    private ScheduledNode nextQueuedNode() {
+        int maxIterations = nodeQueue.size();
+        while (maxIterations-- > 0) {
+            ScheduledNode node = nodeQueue.removeFirst();
+            if (node instanceof MergeNode) {
+                MergeNode merge = (MergeNode) node;
+                state = nodeStates.get(merge.forwardEndAt(0)).clone();
+                ArrayList<T> states = new ArrayList<>(merge.forwardEndCount() - 1);
+                for (int i = 1; i < merge.forwardEndCount(); i++) {
+                    T other = nodeStates.get(merge.forwardEndAt(i));
+                    assert other != null;
+                    states.add(other);
+                }
+                boolean ready = state.merge(merge, states);
+                if (ready) {
+                    return merge;
+                } else {
+                    nodeQueue.addLast(merge);
+                }
+            } else {
+                assert node.predecessor() != null;
+                state = nodeStates.get(node.predecessor()).clone();
+                state.afterSplit((FixedNode) node);
+                return node;
+            }
+        }
+        return null;
+    }
+
+    private void queueMerge(EndNode end) {
+        assert !visitedEnds.isMarked(end);
+        assert !nodeStates.containsKey(end);
+        nodeStates.put(end, state);
+        visitedEnds.mark(end);
+        MergeNode merge = end.merge();
+        boolean endsVisited = true;
+        for (int i = 0; i < merge.forwardEndCount(); i++) {
+            if (!visitedEnds.isMarked(merge.forwardEndAt(i))) {
+                endsVisited = false;
+                break;
+            }
+        }
+        if (endsVisited) {
+            nodeQueue.add(merge);
+        }
+    }
+
+    private void finishLoopEnds(LoopEndNode end) {
+        assert !visitedEnds.isMarked(end);
+        assert !nodeStates.containsKey(end);
+        nodeStates.put(end, state);
+        visitedEnds.mark(end);
+        LoopBeginNode begin = end.loopBegin();
+        boolean endsVisited = true;
+        for (LoopEndNode le : begin.loopEnds()) {
+            if (!visitedEnds.isMarked(le)) {
+                endsVisited = false;
+                break;
+            }
+        }
+        if (endsVisited) {
+            ArrayList<T> states = new ArrayList<>(begin.loopEnds().count());
+            for (LoopEndNode le : begin.orderedLoopEnds()) {
+                states.add(nodeStates.get(le));
+            }
+            T loopBeginState = nodeStates.get(begin);
+            if (loopBeginState != null) {
+                loopBeginState.loopEnds(begin, states);
+            }
+        }
+    }
+
+    protected abstract void node(ScheduledNode node);
+
+    protected void end(EndNode endNode) {
+        node(endNode);
+    }
+
+    protected void merge(MergeNode merge) {
+        node(merge);
+    }
+
+    protected void loopBegin(LoopBeginNode loopBegin) {
+        node(loopBegin);
+    }
+
+    protected void loopEnd(LoopEndNode loopEnd) {
+        node(loopEnd);
+    }
+
+    protected void controlSplit(ControlSplitNode controlSplit) {
+        node(controlSplit);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/ArrayMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.util;
+
+/**
+ * The {@code ArrayMap} class implements an efficient one-level map which is implemented
+ * as an array. Note that because of the one-level array inside, this data structure performs best
+ * when the range of integer keys is small and densely used. Note that the implementation can
+ * handle arbitrary intervals, including negative numbers, up to intervals of size 2^31 - 1.
+ */
+public class ArrayMap<T> {
+
+    private static final int INITIAL_SIZE = 5; // how big the initial array should be
+    private static final int EXTRA = 2; // how far on the left or right of a new element to grow
+
+    Object[] map;
+    int low;
+
+    /**
+     * Constructs a new {@code ArrayMap} with no initial assumptions.
+     */
+    public ArrayMap() {
+    }
+
+    /**
+     * Constructs a new {@code ArrayMap} that initially covers the specified interval.
+     * Note that this map will automatically expand if necessary later.
+     * @param low the low index, inclusive
+     * @param high the high index, exclusive
+     */
+    public ArrayMap(int low, int high) {
+        this.low = low;
+        this.map = new Object[high - low + 1];
+    }
+
+    /**
+     * Puts a new value in the map at the specified index.
+     * @param i the index at which to store the value
+     * @param value the value to store at the specified index
+     */
+    public void put(int i, T value) {
+        int index = i - low;
+        if (map == null) {
+            // no map yet
+            map = new Object[INITIAL_SIZE];
+            low = index - 2;
+            map[INITIAL_SIZE / 2] = value;
+        } else if (index < 0) {
+            // grow backwards
+            growBackward(i, value);
+        } else if (index >= map.length) {
+            // grow forwards
+            growForward(i, value);
+        } else {
+            // no growth necessary
+            map[index] = value;
+        }
+    }
+
+    /**
+     * Gets the value at the specified index in the map.
+     * @param i the index
+     * @return the value at the specified index; {@code null} if there is no value at the specified index,
+     * or if the index is out of the currently stored range
+     */
+    public T get(int i) {
+        int index = i - low;
+        if (map == null || index < 0 || index >= map.length) {
+            return null;
+        }
+        Class<T> type = null;
+        return Util.uncheckedCast(type, map[index]);
+    }
+
+    public int length() {
+        return map.length;
+    }
+
+    private void growBackward(int i, T value) {
+        int nlow = i - EXTRA;
+        Object[] nmap = new Object[low - nlow + map.length];
+        System.arraycopy(map, 0, nmap, low - nlow, map.length);
+        map = nmap;
+        low = nlow;
+        map[i - low] = value;
+    }
+
+    private void growForward(int i, T value) {
+        int nlen = i - low + 1 + EXTRA;
+        Object[] nmap = new Object[nlen];
+        System.arraycopy(map, 0, nmap, 0, map.length);
+        map = nmap;
+        map[i - low] = value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/BitMap2D.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.util;
+
+import com.oracle.graal.graph.*;
+
+/**
+ * This class implements a two-dimensional bitmap.
+ */
+public final class BitMap2D {
+
+    private BitMap map;
+    private final int bitsPerSlot;
+
+    private int bitIndex(int slotIndex, int bitWithinSlotIndex)  {
+      return slotIndex * bitsPerSlot + bitWithinSlotIndex;
+    }
+
+    private boolean verifyBitWithinSlotIndex(int index)  {
+      assert index < bitsPerSlot : "index " + index + " is out of bounds " + bitsPerSlot;
+      return true;
+    }
+
+    public BitMap2D(int sizeInSlots, int bitsPerSlot) {
+        map = new BitMap(sizeInSlots * bitsPerSlot);
+        this.bitsPerSlot = bitsPerSlot;
+    }
+
+    public int sizeInBits() {
+      return map.size();
+    }
+
+    // Returns number of full slots that have been allocated
+    public int sizeInSlots() {
+      return map.size() / bitsPerSlot;
+    }
+
+    public boolean isValidIndex(int slotIndex, int bitWithinSlotIndex) {
+      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
+      return (bitIndex(slotIndex, bitWithinSlotIndex) < sizeInBits());
+    }
+
+    public boolean at(int slotIndex, int bitWithinSlotIndex)  {
+      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
+      return map.get(bitIndex(slotIndex, bitWithinSlotIndex));
+    }
+
+    public void setBit(int slotIndex, int bitWithinSlotIndex) {
+      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
+      map.set(bitIndex(slotIndex, bitWithinSlotIndex));
+    }
+
+    public void clearBit(int slotIndex, int bitWithinSlotIndex) {
+      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
+      map.clear(bitIndex(slotIndex, bitWithinSlotIndex));
+    }
+
+    public void atPutGrow(int slotIndex, int bitWithinSlotIndex, boolean value) {
+       int size = sizeInSlots();
+       if (size <= slotIndex) {
+           while (size <= slotIndex) {
+               size *= 2;
+           }
+           BitMap newBitMap = new BitMap(size * bitsPerSlot);
+           newBitMap.setUnion(map);
+           map = newBitMap;
+       }
+
+       if (value) {
+           setBit(slotIndex, bitWithinSlotIndex);
+       } else {
+           clearBit(slotIndex, bitWithinSlotIndex);
+       }
+    }
+
+    public void clear() {
+        map.clearAll();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/BlockWorkList.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.util;
+
+import com.oracle.graal.nodes.*;
+
+/**
+ * This class implements a worklist for dealing with blocks. The worklist can
+ * operate either as a stack (i.e. first-in / last-out), or as a sorted list,
+ * where blocks can be sorted by a supplied number. The latter usage lends itself
+ * naturally to iterative dataflow analysis problems.
+ *
+ * This implementation is not able to tell if a block is in the worklist already.
+ * Note that this implementation is slightly less efficient than the dedicated
+ * work list in {@link com.oracle.graal.compiler.graph.ScopeData}, because this worklist uses
+ * an externally supplied number.
+ */
+public class BlockWorkList {
+    MergeNode[] workList;
+    int[] workListNumbers;
+    int workListIndex;
+
+    /**
+     * Adds a block to this list in an unsorted fashion, like a stack.
+     * @param block the block to add
+     */
+    public void add(MergeNode block) {
+        if (workList == null) {
+            // worklist not allocated yet
+            allocate();
+        } else if (workListIndex == workList.length) {
+            // need to grow the worklist
+            grow();
+        }
+        // put the block at the end of the array
+        workList[workListIndex++] = block;
+    }
+
+    /**
+     * Adds a block to this list, sorted by the supplied number. The block
+     * with the lowest number is returned upon subsequent removes.
+     * @param block the block to add
+     * @param number the number used to sort the block
+     */
+    public void addSorted(MergeNode block, int number) {
+        if (workList == null) {
+            // worklist not allocated yet
+            allocate();
+        } else if (workListIndex == workList.length) {
+            // need to grow the worklist
+            grow();
+        }
+        // put the block at the end of the array
+        workList[workListIndex] = block;
+        workListNumbers[workListIndex] = number;
+        workListIndex++;
+        int i = workListIndex - 2;
+        // push block towards the beginning of the array
+        for (; i >= 0; i--) {
+            int n = workListNumbers[i];
+            if (n >= number) {
+                break; // already in the right position
+            }
+            workList[i + 1] = workList[i]; // bubble b down by one
+            workList[i] = block;           // and overwrite its place with block
+            workListNumbers[i + 1] = n;    // bubble n down by one
+            workListNumbers[i] = number;   // and overwrite its place with number
+        }
+    }
+
+    /**
+     * Removes the next block from this work list. If the blocks have been added
+     * in a sorted order, then the block with the lowest number is returned. Otherwise,
+     * the last block added is returned.
+     * @return the next block in the list
+     */
+    public MergeNode removeFromWorkList() {
+        if (workListIndex != 0) {
+            return workList[--workListIndex];
+        }
+        return null;
+    }
+
+    /**
+     * Checks whether the list is empty.
+     * @return {@code true} if this list is empty
+     */
+    public boolean isEmpty() {
+        return workListIndex == 0;
+    }
+
+    private void allocate() {
+        workList = new MergeNode[5];
+        workListNumbers = new int[5];
+    }
+
+    private void grow() {
+        int prevLength = workList.length;
+        MergeNode[] nworkList = new MergeNode[prevLength * 3];
+        System.arraycopy(workList, 0, nworkList, 0, prevLength);
+        workList = nworkList;
+
+        int[] nworkListNumbers = new int[prevLength * 3];
+        System.arraycopy(workListNumbers, 0, nworkListNumbers, 0, prevLength);
+        workListNumbers = nworkListNumbers;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/GraphOrder.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.util;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+public class GraphOrder implements Iterable<Node> {
+
+    private final ArrayList<Node> nodes = new ArrayList<>();
+
+    private GraphOrder() {
+    }
+
+    public GraphOrder(Graph graph) {
+        NodeBitMap visited = graph.createNodeBitMap();
+
+        for (ReturnNode node : graph.getNodes(ReturnNode.class)) {
+            visitForward(visited, node);
+        }
+        for (UnwindNode node : graph.getNodes(UnwindNode.class)) {
+            visitForward(visited, node);
+        }
+        for (DeoptimizeNode node : graph.getNodes(DeoptimizeNode.class)) {
+            visitForward(visited, node);
+        }
+    }
+
+    public static GraphOrder forwardGraph(Graph graph) {
+        GraphOrder result = new GraphOrder();
+
+        NodeBitMap visited = graph.createNodeBitMap();
+
+        for (ReturnNode node : graph.getNodes(ReturnNode.class)) {
+            result.visitForward(visited, node);
+        }
+        for (UnwindNode node : graph.getNodes(UnwindNode.class)) {
+            result.visitForward(visited, node);
+        }
+        for (DeoptimizeNode node : graph.getNodes(DeoptimizeNode.class)) {
+            result.visitForward(visited, node);
+        }
+        return result;
+    }
+
+    public static GraphOrder backwardGraph(Graph graph) {
+        GraphOrder result = new GraphOrder();
+
+        NodeBitMap visited = graph.createNodeBitMap();
+
+        for (Node node : forwardGraph(graph)) {
+            result.visitBackward(visited, node);
+        }
+        return result;
+    }
+
+    private void visitForward(NodeBitMap visited, Node node) {
+        if (node != null && !visited.isMarked(node)) {
+            visited.mark(node);
+            if (node.predecessor() != null) {
+                visitForward(visited, node.predecessor());
+            }
+            if (node instanceof MergeNode) {
+                // make sure that the cfg predecessors of a MergeNode are processed first
+                MergeNode merge = (MergeNode) node;
+                for (int i = 0; i < merge.forwardEndCount(); i++) {
+                    visitForward(visited, merge.forwardEndAt(i));
+                }
+            }
+            for (Node input : node.inputs()) {
+                visitForward(visited, input);
+            }
+            nodes.add(node);
+        }
+    }
+
+    private void visitBackward(NodeBitMap visited, Node node) {
+        if (node != null && !visited.isMarked(node)) {
+            visited.mark(node);
+            for (Node successor : node.successors()) {
+                visitBackward(visited, successor);
+            }
+            for (Node usage : node.usages()) {
+                visitBackward(visited, usage);
+            }
+            nodes.add(node);
+        }
+    }
+
+    @Override
+    public Iterator<Node> iterator() {
+        return new Iterator<Node>() {
+
+            private int pos = 0;
+
+            private void removeDeleted() {
+                while (pos < nodes.size() && nodes.get(pos).isDeleted()) {
+                    pos++;
+                }
+            }
+
+            @Override
+            public boolean hasNext() {
+                removeDeleted();
+                return pos < nodes.size();
+            }
+
+            @Override
+            public Node next() {
+                return nodes.get(pos++);
+            }
+
+            @Override
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,906 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.util;
+
+import java.lang.reflect.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.Representation;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+import com.oracle.graal.nodes.PhiNode.PhiType;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind;
+import com.oracle.graal.nodes.util.*;
+
+public class InliningUtil {
+
+    public interface InliningCallback {
+        StructuredGraph buildGraph(RiResolvedMethod method);
+        double inliningWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke);
+        void recordMethodContentsAssumption(RiResolvedMethod method);
+        void recordConcreteMethodAssumption(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl);
+    }
+
+    public static String methodName(RiResolvedMethod method) {
+        return CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
+    }
+
+    private static String methodName(RiResolvedMethod method, Invoke invoke) {
+        if (Debug.isLogEnabled()) {
+            if (invoke != null && invoke.stateAfter() != null) {
+                RiMethod parent = invoke.stateAfter().method();
+                return parent.name() + "@" + invoke.bci() + ": " + CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
+            } else {
+                return CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
+            }
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Represents an opportunity for inlining at the given invoke, with the given weight and level.
+     * The weight is the amortized weight of the additional code - so smaller is better.
+     * The level is the number of nested inlinings that lead to this invoke.
+     */
+    public abstract static class InlineInfo implements Comparable<InlineInfo> {
+        public final Invoke invoke;
+        public final double weight;
+        public final int level;
+
+        public InlineInfo(Invoke invoke, double weight, int level) {
+            this.invoke = invoke;
+            this.weight = weight;
+            this.level = level;
+        }
+
+        public abstract int compiledCodeSize();
+
+        @Override
+        public int compareTo(InlineInfo o) {
+            return (weight < o.weight) ? -1 : (weight > o.weight) ? 1 : 0;
+        }
+
+        protected static StructuredGraph getGraph(final RiResolvedMethod concrete, final InliningCallback callback) {
+            return Debug.scope("Inlining", concrete, new Callable<StructuredGraph>() {
+                @Override
+                public StructuredGraph call() throws Exception {
+                    return callback.buildGraph(concrete);
+                }
+            });
+        }
+
+        public abstract boolean canDeopt();
+
+        /**
+         * Performs the inlining described by this object and returns the node that represents the return value of the
+         * inlined method (or null for void methods and methods that have no non-exceptional exit).
+         *
+         * @param graph
+         * @param runtime
+         * @param callback
+         */
+        public abstract void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback);
+    }
+
+    /**
+     * Represents an inlining opportunity where the compiler can statically determine a monomorphic target method and
+     * therefore is able to determine the called method exactly.
+     */
+    private static class ExactInlineInfo extends InlineInfo {
+        public final RiResolvedMethod concrete;
+
+        public ExactInlineInfo(Invoke invoke, double weight, int level, RiResolvedMethod concrete) {
+            super(invoke, weight, level);
+            this.concrete = concrete;
+        }
+
+        @Override
+        public void inline(StructuredGraph compilerGraph, GraalRuntime runtime, final InliningCallback callback) {
+            StructuredGraph graph = getGraph(concrete, callback);
+            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
+            callback.recordMethodContentsAssumption(concrete);
+            InliningUtil.inline(invoke, graph, true);
+        }
+
+        @Override
+        public int compiledCodeSize() {
+            return concrete.compiledCodeSize();
+        }
+
+        @Override
+        public String toString() {
+            return "exact " + CiUtil.format("%H.%n(%p):%r", concrete);
+        }
+
+        @Override
+        public boolean canDeopt() {
+            return false;
+        }
+    }
+
+    /**
+     * Represents an inlining opportunity for which profiling information suggests a monomorphic receiver, but for which
+     * the receiver type cannot be proven. A type check guard will be generated if this inlining is performed.
+     */
+    private static class TypeGuardInlineInfo extends InlineInfo {
+        public final RiResolvedMethod concrete;
+        public final RiResolvedType type;
+
+        public TypeGuardInlineInfo(Invoke invoke, double weight, int level, RiResolvedMethod concrete, RiResolvedType type) {
+            super(invoke, weight, level);
+            this.concrete = concrete;
+            this.type = type;
+        }
+
+        @Override
+        public int compiledCodeSize() {
+            return concrete.compiledCodeSize();
+        }
+
+        @Override
+        public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
+            // receiver null check must be before the type check
+            InliningUtil.receiverNullCheck(invoke);
+            ValueNode receiver = invoke.callTarget().receiver();
+            ReadHubNode objectClass = graph.add(new ReadHubNode(receiver));
+            IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClass, type));
+            FixedGuardNode guard = graph.add(new FixedGuardNode(isTypeNode));
+            AnchorNode anchor = graph.add(new AnchorNode());
+            assert invoke.predecessor() != null;
+
+            CheckCastNode checkCast = createAnchoredReceiver(graph, runtime, anchor, type, receiver);
+            invoke.callTarget().replaceFirstInput(receiver, checkCast);
+
+            graph.addBeforeFixed(invoke.node(), objectClass);
+            graph.addBeforeFixed(invoke.node(), guard);
+            graph.addBeforeFixed(invoke.node(), anchor);
+
+            StructuredGraph calleeGraph = getGraph(concrete, callback);
+            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
+            callback.recordMethodContentsAssumption(concrete);
+            InliningUtil.inline(invoke, calleeGraph, false);
+        }
+
+        @Override
+        public String toString() {
+            return "type-checked " + CiUtil.format("%H.%n(%p):%r", concrete);
+        }
+
+        @Override
+        public boolean canDeopt() {
+            return true;
+        }
+    }
+
+    /**
+     * Polymorphic inlining of m methods with n type checks (n >= m) in case that the profiling information suggests a reasonable
+     * amounts of different receiver types and different methods. If an unknown type is encountered a deoptimization is triggered.
+     */
+    private static class MultiTypeGuardInlineInfo extends InlineInfo {
+        public final List<RiResolvedMethod> concretes;
+        public final RiResolvedType[] types;
+        public final int[] typesToConcretes;
+        public final double[] typeProbabilities;
+        public final double notRecordedTypeProbability;
+
+        public MultiTypeGuardInlineInfo(Invoke invoke, double weight, int level, List<RiResolvedMethod> concretes, RiResolvedType[] types,
+                        int[] typesToConcretes, double[] typeProbabilities, double notRecordedTypeProbability) {
+            super(invoke, weight, level);
+            assert concretes.size() > 0 && concretes.size() <= types.length : "must have at least one method but no more than types methods";
+            assert types.length == typesToConcretes.length && types.length == typeProbabilities.length : "array length must match";
+
+            this.concretes = concretes;
+            this.types = types;
+            this.typesToConcretes = typesToConcretes;
+            this.typeProbabilities = typeProbabilities;
+            this.notRecordedTypeProbability = notRecordedTypeProbability;
+        }
+
+        @Override
+        public int compiledCodeSize() {
+            int result = 0;
+            for (RiResolvedMethod m: concretes) {
+                result += m.compiledCodeSize();
+            }
+            return result;
+        }
+
+        @Override
+        public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
+            int numberOfMethods = concretes.size();
+            boolean hasReturnValue = invoke.node().kind() != CiKind.Void;
+
+            // receiver null check must be the first node
+            InliningUtil.receiverNullCheck(invoke);
+            if (numberOfMethods > 1 || shouldFallbackToInvoke()) {
+                inlineMultipleMethods(graph, runtime, callback, numberOfMethods, hasReturnValue);
+            } else {
+                inlineSingleMethod(graph, runtime, callback);
+            }
+        }
+
+        private boolean shouldFallbackToInvoke() {
+            return notRecordedTypeProbability > 0;
+        }
+
+        private void inlineMultipleMethods(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback, int numberOfMethods, boolean hasReturnValue) {
+            FixedNode continuation = invoke.next();
+
+            // setup merge and phi nodes for results and exceptions
+            MergeNode returnMerge = graph.add(new MergeNode());
+            returnMerge.setProbability(invoke.probability());
+            returnMerge.setStateAfter(invoke.stateAfter().duplicate(invoke.stateAfter().bci));
+
+            PhiNode returnValuePhi = null;
+            if (hasReturnValue) {
+                returnValuePhi = graph.unique(new PhiNode(invoke.node().kind(), returnMerge, PhiType.Value));
+            }
+
+            MergeNode exceptionMerge = null;
+            PhiNode exceptionObjectPhi = null;
+            if (invoke instanceof InvokeWithExceptionNode) {
+                InvokeWithExceptionNode invokeWithException = (InvokeWithExceptionNode) invoke;
+                BeginNode exceptionEdge = invokeWithException.exceptionEdge();
+                ExceptionObjectNode exceptionObject = (ExceptionObjectNode) exceptionEdge.next();
+
+                exceptionMerge = graph.add(new MergeNode());
+                exceptionMerge.setProbability(exceptionEdge.probability());
+
+                FixedNode exceptionSux = exceptionObject.next();
+                graph.addBeforeFixed(exceptionSux, exceptionMerge);
+                exceptionObjectPhi = graph.unique(new PhiNode(CiKind.Object, exceptionMerge, PhiType.Value));
+                exceptionMerge.setStateAfter(exceptionEdge.stateAfter().duplicateModified(invoke.stateAfter().bci, true, CiKind.Void, exceptionObjectPhi));
+            }
+
+            // create one separate block for each invoked method
+            BeginNode[] calleeEntryNodes = new BeginNode[numberOfMethods];
+            for (int i = 0; i < numberOfMethods; i++) {
+                int predecessors = 0;
+                double probability = 0;
+                for (int j = 0; j < typesToConcretes.length; j++) {
+                    if (typesToConcretes[j] == i) {
+                        predecessors++;
+                        probability += typeProbabilities[j];
+                    }
+                }
+
+                calleeEntryNodes[i] = createInvocationBlock(graph, invoke, returnMerge, returnValuePhi, exceptionMerge, exceptionObjectPhi, predecessors, invoke.probability() * probability, true);
+            }
+
+            // create the successor for an unknown type
+            FixedNode unknownTypeNode;
+            if (shouldFallbackToInvoke()) {
+                unknownTypeNode = createInvocationBlock(graph, invoke, returnMerge, returnValuePhi, exceptionMerge, exceptionObjectPhi, 1, notRecordedTypeProbability, false);
+            } else {
+                unknownTypeNode = graph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile));
+            }
+
+            // replace the invoke exception edge
+            if (invoke instanceof InvokeWithExceptionNode) {
+                InvokeWithExceptionNode invokeWithExceptionNode = (InvokeWithExceptionNode) invoke;
+                BeginNode exceptionEdge = invokeWithExceptionNode.exceptionEdge();
+                ExceptionObjectNode exceptionObject = (ExceptionObjectNode) exceptionEdge.next();
+                exceptionObject.replaceAtUsages(exceptionObjectPhi);
+                exceptionObject.setNext(null);
+                GraphUtil.killCFG(invokeWithExceptionNode.exceptionEdge());
+            }
+
+            // replace the invoke with a cascade of if nodes
+            ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver()));
+            graph.addBeforeFixed(invoke.node(), objectClassNode);
+            FixedNode dispatchOnType = createDispatchOnType(graph, objectClassNode, calleeEntryNodes, unknownTypeNode);
+
+            assert invoke.next() == continuation;
+            invoke.setNext(null);
+            returnMerge.setNext(continuation);
+            invoke.node().replaceAtUsages(returnValuePhi);
+            invoke.node().replaceAndDelete(dispatchOnType);
+
+            // do the actual inlining for every invoke
+            for (int i = 0; i < calleeEntryNodes.length; i++) {
+                BeginNode node = calleeEntryNodes[i];
+                Invoke invokeForInlining = (Invoke) node.next();
+
+                RiResolvedType commonType = getLeastCommonType(i);
+                ValueNode receiver = invokeForInlining.callTarget().receiver();
+                CheckCastNode checkCast = createAnchoredReceiver(graph, runtime, node, commonType, receiver);
+                invokeForInlining.callTarget().replaceFirstInput(receiver, checkCast);
+
+                RiResolvedMethod concrete = concretes.get(i);
+                StructuredGraph calleeGraph = getGraph(concrete, callback);
+                callback.recordMethodContentsAssumption(concrete);
+                assert !IntrinsificationPhase.canIntrinsify(invokeForInlining, concrete, runtime);
+                InliningUtil.inline(invokeForInlining, calleeGraph, false);
+            }
+        }
+
+        private RiResolvedType getLeastCommonType(int concreteMethodIndex) {
+            RiResolvedType commonType = null;
+            for (int i = 0; i < typesToConcretes.length; i++) {
+                if (typesToConcretes[i] == concreteMethodIndex) {
+                    if (commonType == null) {
+                        commonType = types[i];
+                    } else {
+                        commonType = commonType.leastCommonAncestor(types[i]);
+                    }
+                }
+            }
+            assert commonType != null;
+            return commonType;
+        }
+
+        private void inlineSingleMethod(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
+            assert concretes.size() == 1 && types.length > 1 && !shouldFallbackToInvoke() && notRecordedTypeProbability == 0;
+
+            MergeNode calleeEntryNode = graph.add(new MergeNode());
+            calleeEntryNode.setProbability(invoke.probability());
+            ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver()));
+            graph.addBeforeFixed(invoke.node(), objectClassNode);
+
+            FixedNode unknownTypeNode = graph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile));
+            FixedNode dispatchOnType = createDispatchOnType(graph, objectClassNode, new BeginNode[] {calleeEntryNode}, unknownTypeNode);
+
+            FixedWithNextNode pred = (FixedWithNextNode) invoke.node().predecessor();
+            pred.setNext(dispatchOnType);
+            calleeEntryNode.setNext(invoke.node());
+
+            RiResolvedMethod concrete = concretes.get(0);
+            StructuredGraph calleeGraph = getGraph(concrete, callback);
+            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
+            callback.recordMethodContentsAssumption(concrete);
+            InliningUtil.inline(invoke, calleeGraph, false);
+        }
+
+        private FixedNode createDispatchOnType(StructuredGraph graph, ReadHubNode objectClassNode, BeginNode[] calleeEntryNodes, FixedNode unknownTypeSux) {
+            assert types.length > 1;
+
+            int lastIndex = types.length - 1;
+            double[] branchProbabilities = convertTypeToBranchProbabilities(typeProbabilities, notRecordedTypeProbability);
+            double nodeProbability = typeProbabilities[lastIndex];
+            IfNode nextNode = createTypeCheck(graph, objectClassNode, types[lastIndex], calleeEntryNodes[typesToConcretes[lastIndex]], unknownTypeSux, branchProbabilities[lastIndex], invoke.probability() * nodeProbability);
+            for (int i = lastIndex - 1; i >= 0; i--) {
+                nodeProbability += typeProbabilities[i];
+                nextNode = createTypeCheck(graph, objectClassNode, types[i], calleeEntryNodes[typesToConcretes[i]], nextNode, branchProbabilities[i], invoke.probability() * nodeProbability);
+            }
+
+            return nextNode;
+        }
+
+        private static IfNode createTypeCheck(StructuredGraph graph, ReadHubNode objectClassNode, RiResolvedType type, BeginNode tsux, FixedNode nextNode, double tsuxProbability, double probability) {
+            IfNode result;
+            IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClassNode, type));
+            if (tsux instanceof MergeNode) {
+                EndNode endNode = graph.add(new EndNode());
+                result = graph.add(new IfNode(isTypeNode, endNode, nextNode, tsuxProbability));
+                ((MergeNode) tsux).addForwardEnd(endNode);
+            } else {
+                result = graph.add(new IfNode(isTypeNode, tsux, nextNode, tsuxProbability));
+            }
+            result.setProbability(probability);
+            return result;
+        }
+
+        private static double[] convertTypeToBranchProbabilities(double[] typeProbabilities, double notRecordedTypeProbability) {
+            double[] result = new double[typeProbabilities.length];
+            double total = notRecordedTypeProbability;
+            for (int i = typeProbabilities.length - 1; i >= 0; i--) {
+                total += typeProbabilities[i];
+                result[i] = typeProbabilities[i] / total;
+            }
+            assert total > 0.99 && total < 1.01;
+            return result;
+        }
+
+        private static BeginNode createInvocationBlock(StructuredGraph graph, Invoke invoke, MergeNode returnMerge, PhiNode returnValuePhi,
+                        MergeNode exceptionMerge, PhiNode exceptionObjectPhi, int predecessors, double probability, boolean useForInlining) {
+            Invoke duplicatedInvoke = duplicateInvokeForInlining(graph, invoke, exceptionMerge, exceptionObjectPhi, useForInlining, probability);
+            BeginNode calleeEntryNode = graph.add(predecessors > 1 ? new MergeNode() : new BeginNode());
+            calleeEntryNode.setNext(duplicatedInvoke.node());
+            calleeEntryNode.setProbability(probability);
+
+            EndNode endNode = graph.add(new EndNode());
+            endNode.setProbability(probability);
+
+            duplicatedInvoke.setNext(endNode);
+            returnMerge.addForwardEnd(endNode);
+
+            if (returnValuePhi != null) {
+                returnValuePhi.addInput(duplicatedInvoke.node());
+            }
+            return calleeEntryNode;
+        }
+
+        private static Invoke duplicateInvokeForInlining(StructuredGraph graph, Invoke invoke, MergeNode exceptionMerge, PhiNode exceptionObjectPhi, boolean useForInlining, double probability) {
+            Invoke result = (Invoke) invoke.node().copyWithInputs();
+            Node callTarget = result.callTarget().copyWithInputs();
+            result.node().replaceFirstInput(result.callTarget(), callTarget);
+            result.setUseForInlining(useForInlining);
+            result.setProbability(probability);
+
+            CiKind kind = invoke.node().kind();
+            if (!kind.isVoid()) {
+                FrameState stateAfter = invoke.stateAfter();
+                stateAfter = stateAfter.duplicate(stateAfter.bci);
+                stateAfter.replaceFirstInput(invoke.node(), result.node());
+                result.setStateAfter(stateAfter);
+            }
+
+            if (invoke instanceof InvokeWithExceptionNode) {
+                assert exceptionMerge != null && exceptionObjectPhi != null;
+
+                InvokeWithExceptionNode invokeWithException = (InvokeWithExceptionNode) invoke;
+                BeginNode exceptionEdge = invokeWithException.exceptionEdge();
+                ExceptionObjectNode exceptionObject = (ExceptionObjectNode) exceptionEdge.next();
+                FrameState stateAfterException = exceptionObject.stateAfter();
+
+                BeginNode newExceptionEdge = (BeginNode) exceptionEdge.copyWithInputs();
+                ExceptionObjectNode newExceptionObject = (ExceptionObjectNode) exceptionObject.copyWithInputs();
+                // set new state (pop old exception object, push new one)
+                newExceptionObject.setStateAfter(stateAfterException.duplicateModified(stateAfterException.bci, stateAfterException.rethrowException(), CiKind.Object, newExceptionObject));
+                newExceptionEdge.setNext(newExceptionObject);
+
+                EndNode endNode = graph.add(new EndNode());
+                newExceptionObject.setNext(endNode);
+                exceptionMerge.addForwardEnd(endNode);
+                exceptionObjectPhi.addInput(newExceptionObject);
+
+                ((InvokeWithExceptionNode) result).setExceptionEdge(newExceptionEdge);
+            }
+            return result;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder builder = new StringBuilder(shouldFallbackToInvoke() ? "megamorphic" : "polymorphic");
+            builder.append(String.format(", %d methods with %d type checks:", concretes.size(), types.length));
+            for (int i = 0; i < concretes.size(); i++) {
+                builder.append(CiUtil.format("  %H.%n(%p):%r", concretes.get(i)));
+            }
+            return builder.toString();
+        }
+
+        @Override
+        public boolean canDeopt() {
+            return true;
+        }
+    }
+
+
+    /**
+     * Represents an inlining opportunity where the current class hierarchy leads to a monomorphic target method,
+     * but for which an assumption has to be registered because of non-final classes.
+     */
+    private static class AssumptionInlineInfo extends ExactInlineInfo {
+        public final RiResolvedType context;
+
+        public AssumptionInlineInfo(Invoke invoke, double weight, int level, RiResolvedType context, RiResolvedMethod concrete) {
+            super(invoke, weight, level, concrete);
+            this.context = context;
+        }
+
+        @Override
+        public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
+            if (Debug.isLogEnabled()) {
+                String targetName = CiUtil.format("%H.%n(%p):%r", invoke.callTarget().targetMethod());
+                String concreteName = CiUtil.format("%H.%n(%p):%r", concrete);
+                Debug.log("recording concrete method assumption: %s on receiver type %s -> %s", targetName, context, concreteName);
+            }
+            callback.recordConcreteMethodAssumption(invoke.callTarget().targetMethod(), context, concrete);
+
+            super.inline(graph, runtime, callback);
+        }
+
+        @Override
+        public String toString() {
+            return "assumption " + CiUtil.format("%H.%n(%p):%r", concrete);
+        }
+
+        @Override
+        public boolean canDeopt() {
+            return true;
+        }
+    }
+
+    /**
+     * Determines if inlining is possible at the given invoke node.
+     * @param invoke the invoke that should be inlined
+     * @param level the number of nested inlinings that lead to this invoke, or 0 if the invoke was part of the initial graph
+     * @param runtime a GraalRuntime instance used to determine of the invoke can be inlined and/or should be intrinsified
+     * @param callback a callback that is used to determine the weight of a specific inlining
+     * @return an instance of InlineInfo, or null if no inlining is possible at the given invoke
+     */
+    public static InlineInfo getInlineInfo(Invoke invoke, int level, GraalRuntime runtime, CiAssumptions assumptions, InliningCallback callback) {
+        if (!checkInvokeConditions(invoke)) {
+            return null;
+        }
+        RiResolvedMethod parent = invoke.stateAfter().method();
+        MethodCallTargetNode callTarget = invoke.callTarget();
+        RiResolvedMethod targetMethod = callTarget.targetMethod();
+
+        if (targetMethod == null) {
+            return null;
+        }
+        if (callTarget.invokeKind() == InvokeKind.Special || targetMethod.canBeStaticallyBound()) {
+            if (checkTargetConditions(invoke, targetMethod)) {
+                double weight = callback == null ? 0 : callback.inliningWeight(parent, targetMethod, invoke);
+                return new ExactInlineInfo(invoke, weight, level, targetMethod);
+            }
+            return null;
+        }
+        if (callTarget.receiver().exactType() != null) {
+            RiResolvedType exact = callTarget.receiver().exactType();
+            assert exact.isSubtypeOf(targetMethod.holder()) : exact + " subtype of " + targetMethod.holder() + " for " + targetMethod;
+            RiResolvedMethod resolved = exact.resolveMethodImpl(targetMethod);
+            if (checkTargetConditions(invoke, resolved)) {
+                double weight = callback == null ? 0 : callback.inliningWeight(parent, resolved, invoke);
+                return new ExactInlineInfo(invoke, weight, level, resolved);
+            }
+            return null;
+        }
+        RiResolvedType holder = targetMethod.holder();
+
+        if (callTarget.receiver().declaredType() != null) {
+            RiResolvedType declared = callTarget.receiver().declaredType();
+            // the invoke target might be more specific than the holder (happens after inlining: locals lose their declared type...)
+            // TODO (lstadler) fix this
+            if (declared != null && declared.isSubtypeOf(holder)) {
+                holder = declared;
+            }
+        }
+        // TODO (thomaswue) fix this
+        if (assumptions != null) {
+            RiResolvedMethod concrete = holder.uniqueConcreteMethod(targetMethod);
+            if (concrete != null) {
+                if (checkTargetConditions(invoke, concrete)) {
+                    double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
+                    return new AssumptionInlineInfo(invoke, weight, level, holder, concrete);
+                }
+                return null;
+            }
+        }
+
+        // type check based inlining
+        RiProfilingInfo profilingInfo = parent.profilingInfo();
+        RiTypeProfile typeProfile = profilingInfo.getTypeProfile(invoke.bci());
+        if (typeProfile != null) {
+            RiResolvedType[] types = typeProfile.getTypes();
+            double[] probabilities = typeProfile.getProbabilities();
+
+            if (types != null && probabilities != null && types.length > 0) {
+                assert types.length == probabilities.length : "length must match";
+                double notRecordedTypeProbability = typeProfile.getNotRecordedProbability();
+                if (types.length == 1 && notRecordedTypeProbability == 0) {
+                    if (GraalOptions.InlineMonomorphicCalls) {
+                        RiResolvedType type = types[0];
+                        RiResolvedMethod concrete = type.resolveMethodImpl(targetMethod);
+                        if (checkTargetConditions(invoke, concrete)) {
+                            double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
+                            return new TypeGuardInlineInfo(invoke, weight, level, concrete, type);
+                        }
+
+                        Debug.log("not inlining %s because method can't be inlined", methodName(targetMethod, invoke));
+                        return null;
+                    } else {
+                        Debug.log("not inlining %s because GraalOptions.InlineMonomorphicCalls == false", methodName(targetMethod, invoke));
+                        return null;
+                    }
+                } else {
+                    invoke.setMegamorph(true);
+                    if (GraalOptions.InlinePolymorphicCalls && notRecordedTypeProbability == 0 || GraalOptions.InlineMegamorphicCalls && notRecordedTypeProbability > 0) {
+                        // TODO (chaeubl) inlining of multiple methods should work differently
+                        // 1. check which methods can be inlined
+                        // 2. for those methods, use weight and probability to compute which of them should be inlined
+                        // 3. do the inlining
+                        //    a) all seen methods can be inlined -> do so and guard with deopt
+                        //    b) some methods can be inlined -> inline them and fall back to invocation if violated
+                        // TODO (chaeubl) sort types by probability
+
+                        // determine concrete methods and map type to specific method
+                        ArrayList<RiResolvedMethod> concreteMethods = new ArrayList<>();
+                        int[] typesToConcretes = new int[types.length];
+                        for (int i = 0; i < types.length; i++) {
+                            RiResolvedMethod concrete = types[i].resolveMethodImpl(targetMethod);
+
+                            int index = concreteMethods.indexOf(concrete);
+                            if (index < 0) {
+                                index = concreteMethods.size();
+                                concreteMethods.add(concrete);
+                            }
+                            typesToConcretes[i] = index;
+                        }
+
+                        double totalWeight = 0;
+                        boolean canInline = true;
+                        for (RiResolvedMethod concrete: concreteMethods) {
+                            if (!checkTargetConditions(invoke, concrete)) {
+                                canInline = false;
+                                break;
+                            }
+                            totalWeight += callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
+                        }
+
+                        if (canInline) {
+                            return new MultiTypeGuardInlineInfo(invoke, totalWeight, level, concreteMethods, types, typesToConcretes, probabilities, notRecordedTypeProbability);
+                        } else {
+                            Debug.log("not inlining %s because it is a polymorphic method call and at least one invoked method cannot be inlined", methodName(targetMethod, invoke));
+                            return null;
+                        }
+                    } else {
+                        if (!GraalOptions.InlinePolymorphicCalls && notRecordedTypeProbability == 0) {
+                            Debug.log("not inlining %s because GraalOptions.InlinePolymorphicCalls == false", methodName(targetMethod, invoke));
+                        } else {
+                            Debug.log("not inlining %s because GraalOptions.InlineMegamorphicCalls == false", methodName(targetMethod, invoke));
+                        }
+                        return null;
+                    }
+                }
+            }
+
+            Debug.log("not inlining %s because no types/probabilities were recorded", methodName(targetMethod, invoke));
+            return null;
+        } else {
+            Debug.log("not inlining %s because no type profile exists", methodName(targetMethod, invoke));
+            return null;
+        }
+    }
+
+    private static CheckCastNode createAnchoredReceiver(StructuredGraph graph, GraalRuntime runtime, FixedNode anchor, RiResolvedType commonType, ValueNode receiver) {
+        // to avoid that floating reads on receiver fields float above the type check
+        ConstantNode typeConst = graph.unique(ConstantNode.forCiConstant(commonType.getEncoding(Representation.ObjectHub), runtime, graph));
+        CheckCastNode checkCast = graph.unique(new CheckCastNode(anchor, typeConst, commonType, receiver, false));
+        return checkCast;
+    }
+
+    private static boolean checkInvokeConditions(Invoke invoke) {
+        if (invoke.stateAfter() == null) {
+            Debug.log("not inlining %s because the invoke has no after state", methodName(invoke.callTarget().targetMethod(), invoke));
+            return false;
+        }
+        if (invoke.predecessor() == null) {
+            Debug.log("not inlining %s because the invoke is dead code", methodName(invoke.callTarget().targetMethod(), invoke));
+            return false;
+        }
+        if (!invoke.useForInlining()) {
+            Debug.log("not inlining %s because invoke is marked to be not used for inlining", methodName(invoke.callTarget().targetMethod(), invoke));
+            return false;
+        }
+        return true;
+    }
+
+    private static boolean checkTargetConditions(Invoke invoke, RiMethod method) {
+        if (method == null) {
+            Debug.log("not inlining because method is not resolved");
+            return false;
+        }
+        if (!(method instanceof RiResolvedMethod)) {
+            Debug.log("not inlining %s because it is unresolved", method.toString());
+            return false;
+        }
+        RiResolvedMethod resolvedMethod = (RiResolvedMethod) method;
+        if (Modifier.isNative(resolvedMethod.accessFlags())) {
+            Debug.log("not inlining %s because it is a native method", methodName(resolvedMethod));
+            return false;
+        }
+        if (Modifier.isAbstract(resolvedMethod.accessFlags())) {
+            Debug.log("not inlining %s because it is an abstract method", methodName(resolvedMethod));
+            return false;
+        }
+        if (!resolvedMethod.holder().isInitialized()) {
+            Debug.log("not inlining %s because of non-initialized class", methodName(resolvedMethod));
+            return false;
+        }
+        if (!resolvedMethod.canBeInlined()) {
+            Debug.log("not inlining %s because it is marked non-inlinable", methodName(resolvedMethod));
+            return false;
+        }
+        if (computeRecursiveInliningLevel(invoke.stateAfter(), (RiResolvedMethod) method) > GraalOptions.MaximumRecursiveInlining) {
+            Debug.log("not inlining %s because it exceeds the maximum recursive inlining depth", methodName(resolvedMethod));
+            return false;
+        }
+
+        return true;
+    }
+
+    private static int computeRecursiveInliningLevel(FrameState state, RiResolvedMethod method) {
+        assert state != null;
+
+        int count = 0;
+        FrameState curState = state;
+        while (curState != null) {
+            if (curState.method() == method) {
+                count++;
+            }
+            curState = curState.outerFrameState();
+        }
+        return count;
+    }
+
+    /**
+     * Performs an actual inlining, thereby replacing the given invoke with the given inlineGraph.
+     * @param invoke the invoke that will be replaced
+     * @param inlineGraph the graph that the invoke will be replaced with
+     * @param receiverNullCheck true if a null check needs to be generated for non-static inlinings, false if no such check is required
+     * @return The node that represents the return value, or null for void methods and methods that have no non-exceptional exit.
+     */
+    public static void inline(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck) {
+        NodeInputList<ValueNode> parameters = invoke.callTarget().arguments();
+        StructuredGraph graph = (StructuredGraph) invoke.node().graph();
+
+        FrameState stateAfter = invoke.stateAfter();
+        assert stateAfter.isAlive();
+
+        IdentityHashMap<Node, Node> replacements = new IdentityHashMap<>();
+        ArrayList<Node> nodes = new ArrayList<>();
+        ReturnNode returnNode = null;
+        UnwindNode unwindNode = null;
+        BeginNode entryPointNode = inlineGraph.start();
+        FixedNode firstCFGNode = entryPointNode.next();
+        for (Node node : inlineGraph.getNodes()) {
+            if (node == entryPointNode || node == entryPointNode.stateAfter()) {
+                // Do nothing.
+            } else if (node instanceof LocalNode) {
+                replacements.put(node, parameters.get(((LocalNode) node).index()));
+            } else {
+                nodes.add(node);
+                if (node instanceof ReturnNode) {
+                    returnNode = (ReturnNode) node;
+                } else if (node instanceof UnwindNode) {
+                    unwindNode = (UnwindNode) node;
+                }
+            }
+        }
+
+        assert invoke.node().successors().first() != null : invoke;
+        assert invoke.node().predecessor() != null;
+
+        Map<Node, Node> duplicates = graph.addDuplicates(nodes, replacements);
+        FixedNode firstCFGNodeDuplicate = (FixedNode) duplicates.get(firstCFGNode);
+        if (receiverNullCheck) {
+            receiverNullCheck(invoke);
+        }
+        invoke.node().replaceAtPredecessors(firstCFGNodeDuplicate);
+
+        FrameState stateAtExceptionEdge = null;
+        if (invoke instanceof InvokeWithExceptionNode) {
+            InvokeWithExceptionNode invokeWithException = ((InvokeWithExceptionNode) invoke);
+            if (unwindNode != null) {
+                assert unwindNode.predecessor() != null;
+                assert invokeWithException.exceptionEdge().successors().count() == 1;
+                ExceptionObjectNode obj = (ExceptionObjectNode) invokeWithException.exceptionEdge().next();
+                stateAtExceptionEdge = obj.stateAfter();
+                UnwindNode unwindDuplicate = (UnwindNode) duplicates.get(unwindNode);
+                obj.replaceAtUsages(unwindDuplicate.exception());
+                unwindDuplicate.clearInputs();
+                Node n = obj.next();
+                obj.setNext(null);
+                unwindDuplicate.replaceAndDelete(n);
+            } else {
+                invokeWithException.killExceptionEdge();
+            }
+        } else {
+            if (unwindNode != null) {
+                UnwindNode unwindDuplicate = (UnwindNode) duplicates.get(unwindNode);
+                DeoptimizeNode deoptimizeNode = new DeoptimizeNode(DeoptAction.InvalidateRecompile);
+                unwindDuplicate.replaceAndDelete(graph.add(deoptimizeNode));
+                // move the deopt upwards if there is a monitor exit that tries to use the "after exception" frame state
+                // (because there is no "after exception" frame state!)
+                if (deoptimizeNode.predecessor() instanceof MonitorExitNode) {
+                    MonitorExitNode monitorExit = (MonitorExitNode) deoptimizeNode.predecessor();
+                    if (monitorExit.stateAfter() != null && monitorExit.stateAfter().bci == FrameState.AFTER_EXCEPTION_BCI) {
+                        FrameState monitorFrameState = monitorExit.stateAfter();
+                        graph.removeFixed(monitorExit);
+                        monitorFrameState.safeDelete();
+                    }
+                }
+            }
+        }
+
+        FrameState outerFrameState = null;
+        double invokeProbability = invoke.node().probability();
+        for (Node node : duplicates.values()) {
+            if (GraalOptions.ProbabilityAnalysis) {
+                if (node instanceof FixedNode) {
+                    FixedNode fixed = (FixedNode) node;
+                    double newProbability = fixed.probability() * invokeProbability;
+                    if (GraalOptions.LimitInlinedProbability) {
+                        newProbability = Math.min(newProbability, invokeProbability);
+                    }
+                    fixed.setProbability(newProbability);
+                }
+            }
+            if (node instanceof FrameState) {
+                FrameState frameState = (FrameState) node;
+                assert frameState.bci != FrameState.BEFORE_BCI;
+                if (frameState.bci == FrameState.AFTER_BCI) {
+                    frameState.replaceAndDelete(stateAfter);
+                } else if (frameState.bci == FrameState.AFTER_EXCEPTION_BCI) {
+                    if (frameState.isAlive()) {
+                        assert stateAtExceptionEdge != null;
+                        frameState.replaceAndDelete(stateAtExceptionEdge);
+                    } else {
+                        assert stateAtExceptionEdge == null;
+                    }
+                } else {
+                    if (outerFrameState == null) {
+                        outerFrameState = stateAfter.duplicateModified(invoke.bci(), stateAfter.rethrowException(), invoke.node().kind());
+                        outerFrameState.setDuringCall(true);
+                    }
+                    frameState.setOuterFrameState(outerFrameState);
+                }
+            }
+        }
+
+        Node returnValue = null;
+        if (returnNode != null) {
+            if (returnNode.result() instanceof LocalNode) {
+                returnValue = replacements.get(returnNode.result());
+            } else {
+                returnValue = duplicates.get(returnNode.result());
+            }
+            invoke.node().replaceAtUsages(returnValue);
+            Node returnDuplicate = duplicates.get(returnNode);
+            returnDuplicate.clearInputs();
+            Node n = invoke.next();
+            invoke.setNext(null);
+            if (n instanceof BeginNode) {
+                BeginNode begin = (BeginNode) n;
+                FixedNode next = begin.next();
+                begin.setNext(null);
+                returnDuplicate.replaceAndDelete(next);
+                begin.safeDelete();
+            } else {
+                returnDuplicate.replaceAndDelete(n);
+            }
+        }
+
+        invoke.node().clearInputs();
+        invoke.node().replaceAtUsages(null);
+        GraphUtil.killCFG(invoke.node());
+
+        if (stateAfter.usages().isEmpty()) {
+            stateAfter.safeDelete();
+        }
+    }
+
+    public static void receiverNullCheck(Invoke invoke) {
+        MethodCallTargetNode callTarget = invoke.callTarget();
+        StructuredGraph graph = (StructuredGraph) invoke.graph();
+        NodeInputList<ValueNode> parameters = callTarget.arguments();
+        ValueNode firstParam = parameters.size() <= 0 ? null : parameters.get(0);
+        if (!callTarget.isStatic() && firstParam.kind() == CiKind.Object && !firstParam.stamp().nonNull()) {
+            graph.addBeforeFixed(invoke.node(), graph.add(new FixedGuardNode(graph.unique(new NullCheckNode(firstParam, false)))));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/IntList.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.util;
+
+import java.util.*;
+
+/**
+ * An expandable and indexable list of {@code int}s.
+ *
+ * This class avoids the boxing/unboxing incurred by {@code ArrayList<Integer>}.
+ */
+public final class IntList {
+
+    private int[] array;
+    private int size;
+
+    /**
+     * Creates an int list with a specified initial capacity.
+     *
+     * @param initialCapacity
+     */
+    public IntList(int initialCapacity) {
+        array = new int[initialCapacity];
+    }
+
+    /**
+     * Creates an int list with a specified initial array.
+     *
+     * @param array the initial array used for the list (no copy is made)
+     * @param initialSize the initial {@linkplain #size() size} of the list (must be less than or equal to {@code array.length}
+     */
+    public IntList(int[] array, int initialSize) {
+        assert initialSize <= array.length;
+        this.array = array;
+        this.size = initialSize;
+    }
+
+    /**
+     * Makes a new int list by copying a range from a given int list.
+     *
+     * @param other the list from which a range of values is to be copied into the new list
+     * @param startIndex the index in {@code other} at which to start copying
+     * @param length the number of values to copy from {@code other}
+     * @return a new int list whose {@linkplain #size() size} and capacity is {@code length}
+     */
+    public static IntList copy(IntList other, int startIndex, int length) {
+        return copy(other, startIndex, length, length);
+    }
+
+    /**
+     * Makes a new int list by copying a range from a given int list.
+     *
+     * @param other the list from which a range of values is to be copied into the new list
+     * @param startIndex the index in {@code other} at which to start copying
+     * @param length the number of values to copy from {@code other}
+     * @param initialCapacity the initial capacity of the new int list (must be greater or equal to {@code length})
+     * @return a new int list whose {@linkplain #size() size} is {@code length}
+     */
+    public static IntList copy(IntList other, int startIndex, int length, int initialCapacity) {
+        assert initialCapacity >= length : "initialCapacity < length";
+        int[] array = new int[initialCapacity];
+        System.arraycopy(other.array, startIndex, array, 0, length);
+        return new IntList(array, length);
+    }
+
+    public int size() {
+        return size;
+    }
+
+    /**
+     * Appends a value to the end of this list, increasing its {@linkplain #size() size} by 1.
+     *
+     * @param value the value to append
+     */
+    public void add(int value) {
+        if (size == array.length) {
+            int newSize = (size * 3) / 2 + 1;
+            array = Arrays.copyOf(array, newSize);
+        }
+        array[size++] = value;
+    }
+
+    /**
+     * Gets the value in this list at a given index.
+     *
+     * @param index the index of the element to return
+     * @throws IndexOutOfBoundsException if {@code index < 0 || index >= size()}
+     */
+    public int get(int index) {
+        if (index >= size) {
+            throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
+        }
+        return array[index];
+    }
+
+    /**
+     * Sets the size of this list to 0.
+     */
+    public void clear() {
+        size = 0;
+    }
+
+    /**
+     * Sets a value at a given index in this list.
+     *
+     * @param index the index of the element to update
+     * @param value the new value of the element
+     * @throws IndexOutOfBoundsException if {@code index < 0 || index >= size()}
+     */
+    public void set(int index, int value) {
+        if (index >= size) {
+            throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
+        }
+        array[index] = value;
+    }
+
+    /**
+     * Adjusts the {@linkplain #size() size} of this int list.
+     *
+     * If {@code newSize < size()}, the size is changed to {@code newSize}.
+     * If {@code newSize > size()}, sufficient 0 elements are {@linkplain #add(int) added}
+     * until {@code size() == newSize}.
+     *
+     * @param newSize the new size of this int list
+     */
+    public void setSize(int newSize) {
+        if (newSize < size) {
+            size = newSize;
+        } else if (newSize > size) {
+            array = Arrays.copyOf(array, newSize);
+        }
+    }
+
+    @Override
+    public String toString() {
+        if (array.length == size) {
+            return Arrays.toString(array);
+        }
+        return Arrays.toString(Arrays.copyOf(array, size));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/Util.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.util;
+
+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.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+
+/**
+ * The {@code Util} class contains a motley collection of utility methods used throughout the compiler.
+ */
+public class Util {
+
+    public static final int PRINTING_LINE_WIDTH = 40;
+    public static final char SECTION_CHARACTER = '*';
+    public static final char SUB_SECTION_CHARACTER = '=';
+    public static final char SEPERATOR_CHARACTER = '-';
+
+    public static <T> boolean replaceInList(T a, T b, List<T> list) {
+        final int max = list.size();
+        for (int i = 0; i < max; i++) {
+            if (list.get(i) == a) {
+                list.set(i, b);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static <T> boolean replaceAllInList(T a, T b, List<T> list) {
+        final int max = list.size();
+        for (int i = 0; i < max; i++) {
+            if (list.get(i) == a) {
+                list.set(i, b);
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Statically cast an object to an arbitrary Object type. Dynamically checked.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T uncheckedCast(@SuppressWarnings("unused") Class<T> type, Object object) {
+        return (T) object;
+    }
+
+    /**
+     * Statically cast an object to an arbitrary Object type. Dynamically checked.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T uncheckedCast(Object object) {
+        return (T) object;
+    }
+
+    /**
+     * Utility method to combine a base hash with the identity hash of one or more objects.
+     *
+     * @param hash the base hash
+     * @param x the object to add to the hash
+     * @return the combined hash
+     */
+    public static int hash1(int hash, Object x) {
+        // always set at least one bit in case the hash wraps to zero
+        return 0x10000000 | (hash + 7 * System.identityHashCode(x));
+    }
+
+    /**
+     * Utility method to combine a base hash with the identity hash of one or more objects.
+     *
+     * @param hash the base hash
+     * @param x the first object to add to the hash
+     * @param y the second object to add to the hash
+     * @return the combined hash
+     */
+    public static int hash2(int hash, Object x, Object y) {
+        // always set at least one bit in case the hash wraps to zero
+        return 0x20000000 | (hash + 7 * System.identityHashCode(x) + 11 * System.identityHashCode(y));
+    }
+
+    /**
+     * Utility method to combine a base hash with the identity hash of one or more objects.
+     *
+     * @param hash the base hash
+     * @param x the first object to add to the hash
+     * @param y the second object to add to the hash
+     * @param z the third object to add to the hash
+     * @return the combined hash
+     */
+    public static int hash3(int hash, Object x, Object y, Object z) {
+        // always set at least one bit in case the hash wraps to zero
+        return 0x30000000 | (hash + 7 * System.identityHashCode(x) + 11 * System.identityHashCode(y) + 13 * System.identityHashCode(z));
+    }
+
+    /**
+     * Utility method to combine a base hash with the identity hash of one or more objects.
+     *
+     * @param hash the base hash
+     * @param x the first object to add to the hash
+     * @param y the second object to add to the hash
+     * @param z the third object to add to the hash
+     * @param w the fourth object to add to the hash
+     * @return the combined hash
+     */
+    public static int hash4(int hash, Object x, Object y, Object z, Object w) {
+        // always set at least one bit in case the hash wraps to zero
+        return 0x40000000 | (hash + 7 * System.identityHashCode(x) + 11 * System.identityHashCode(y) + 13 * System.identityHashCode(z) + 17 * System.identityHashCode(w));
+    }
+
+    static {
+        assert CiUtil.log2(2) == 1;
+        assert CiUtil.log2(4) == 2;
+        assert CiUtil.log2(8) == 3;
+        assert CiUtil.log2(16) == 4;
+        assert CiUtil.log2(32) == 5;
+        assert CiUtil.log2(0x40000000) == 30;
+
+        assert CiUtil.log2(2L) == 1;
+        assert CiUtil.log2(4L) == 2;
+        assert CiUtil.log2(8L) == 3;
+        assert CiUtil.log2(16L) == 4;
+        assert CiUtil.log2(32L) == 5;
+        assert CiUtil.log2(0x4000000000000000L) == 62;
+
+        assert !CiUtil.isPowerOf2(3);
+        assert !CiUtil.isPowerOf2(5);
+        assert !CiUtil.isPowerOf2(7);
+        assert !CiUtil.isPowerOf2(-1);
+
+        assert CiUtil.isPowerOf2(2);
+        assert CiUtil.isPowerOf2(4);
+        assert CiUtil.isPowerOf2(8);
+        assert CiUtil.isPowerOf2(16);
+        assert CiUtil.isPowerOf2(32);
+        assert CiUtil.isPowerOf2(64);
+    }
+
+    /**
+     * Sets the element at a given position of a list and ensures that this position exists. If the list is current
+     * shorter than the position, intermediate positions are filled with a given value.
+     *
+     * @param list the list to put the element into
+     * @param pos the position at which to insert the element
+     * @param x the element that should be inserted
+     * @param filler the filler element that is used for the intermediate positions in case the list is shorter than pos
+     */
+    public static <T> void atPutGrow(List<T> list, int pos, T x, T filler) {
+        if (list.size() < pos + 1) {
+            while (list.size() < pos + 1) {
+                list.add(filler);
+            }
+            assert list.size() == pos + 1;
+        }
+
+        assert list.size() >= pos + 1;
+        list.set(pos, x);
+    }
+
+    public static void breakpoint() {
+        // do nothing.
+    }
+
+    public static void guarantee(boolean b, String string) {
+        if (!b) {
+            throw new CiBailout(string);
+        }
+    }
+
+    public static void warning(String string) {
+        TTY.println("WARNING: " + string);
+    }
+
+    public static int safeToInt(long l) {
+        assert (int) l == l;
+        return (int) l;
+    }
+
+    public static int roundUp(int number, int mod) {
+        return ((number + mod - 1) / mod) * mod;
+    }
+
+    public static void truncate(List<?> list, int length) {
+        while (list.size() > length) {
+            list.remove(list.size() - 1);
+        }
+    }
+
+    public static void printSection(String name, char sectionCharacter) {
+
+        String header = " " + name + " ";
+        int remainingCharacters = PRINTING_LINE_WIDTH - header.length();
+        int leftPart = remainingCharacters / 2;
+        int rightPart = remainingCharacters - leftPart;
+        for (int i = 0; i < leftPart; i++) {
+            TTY.print(sectionCharacter);
+        }
+
+        TTY.print(header);
+
+        for (int i = 0; i < rightPart; i++) {
+            TTY.print(sectionCharacter);
+        }
+
+        TTY.println();
+    }
+
+    /**
+     * Prints entries in a byte array as space separated hex values to {@link TTY}.
+     *
+     * @param address an address at which the bytes are located. This is used to print an address prefix per line of output.
+     * @param array the array containing all the bytes to print
+     * @param bytesPerLine the number of values to print per line of output
+     */
+    public static void printBytes(long address, byte[] array, int bytesPerLine) {
+        printBytes(address, array, 0, array.length, bytesPerLine);
+    }
+
+    /**
+     * Prints entries in a byte array as space separated hex values to {@link TTY}.
+     *
+     * @param address an address at which the bytes are located. This is used to print an address prefix per line of output.
+     * @param array the array containing the bytes to print
+     * @param offset the offset in {@code array} of the values to print
+     * @param length the number of values from {@code array} print
+     * @param bytesPerLine the number of values to print per line of output
+     */
+    public static void printBytes(long address, byte[] array, int offset, int length, int bytesPerLine) {
+        assert bytesPerLine > 0;
+        boolean newLine = true;
+        for (int i = 0; i < length; i++) {
+            if (newLine) {
+                TTY.print("%08x: ", address + i);
+                newLine = false;
+            }
+            TTY.print("%02x ", array[i]);
+            if (i % bytesPerLine == bytesPerLine - 1) {
+                TTY.println();
+                newLine = true;
+            }
+        }
+
+        if (length % bytesPerLine != bytesPerLine) {
+            TTY.println();
+        }
+    }
+
+    public static boolean isShiftCount(int x) {
+        return 0 <= x && x < 32;
+    }
+
+    /**
+     * Determines if a given {@code int} value is the range of unsigned byte values.
+     */
+    public static boolean isUByte(int x) {
+        return (x & 0xff) == x;
+    }
+
+    /**
+     * Determines if a given {@code int} value is the range of signed byte values.
+     */
+    public static boolean isByte(int x) {
+        return (byte) x == x;
+    }
+
+    /**
+     * Determines if a given {@code long} value is the range of unsigned byte values.
+     */
+    public static boolean isUByte(long x) {
+        return (x & 0xffL) == x;
+    }
+
+    /**
+     * Determines if a given {@code long} value is the range of signed byte values.
+     */
+    public static boolean isByte(long l) {
+        return (byte) l == l;
+    }
+
+    /**
+     * Determines if a given {@code long} value is the range of unsigned int values.
+     */
+    public static boolean isUInt(long x) {
+        return (x & 0xffffffffL) == x;
+    }
+
+    /**
+     * Determines if a given {@code long} value is the range of signed int values.
+     */
+    public static boolean isInt(long l) {
+        return (int) l == l;
+    }
+    /**
+     * Determines if a given {@code int} value is the range of signed short values.
+     */
+    public static boolean isShort(int x) {
+        return (short) x == x;
+    }
+
+    public static boolean is32bit(long x) {
+        return -0x80000000L <= x && x < 0x80000000L;
+    }
+
+    public static short safeToShort(int v) {
+        assert isShort(v);
+        return (short) v;
+    }
+
+    /**
+     * Checks that two instructions are equivalent, optionally comparing constants.
+     * @param x the first instruction
+     * @param y the second instruction
+     * @param compareConstants {@code true} if equivalent constants should be considered equivalent
+     * @return {@code true} if the instructions are equivalent; {@code false} otherwise
+     */
+    public static boolean equivalent(FixedWithNextNode x, FixedWithNextNode y, boolean compareConstants) {
+        if (x == y) {
+            return true;
+        }
+        if (compareConstants && x != null && y != null) {
+            if (x.isConstant() && x.asConstant().equivalent(y.asConstant())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static boolean isFixed(Node n) {
+        return n instanceof FixedNode;
+    }
+
+    public static boolean isFloating(Node n) {
+        return n instanceof FloatingNode;
+    }
+
+    public static boolean isFinalClass(RiResolvedType type) {
+        return Modifier.isFinal(type.accessFlags()) || (type.isArrayClass() && Modifier.isFinal(type.componentType().accessFlags()));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug;
+
+import com.oracle.graal.debug.internal.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+public class Debug {
+
+    private static boolean ENABLED = false;
+
+    public static void enable() {
+        ENABLED = true;
+        DebugScope.initialize();
+    }
+
+    public static boolean isEnabled() {
+        return ENABLED;
+    }
+
+    public static boolean isDumpEnabled() {
+        return ENABLED && DebugScope.getInstance().isDumpEnabled();
+    }
+
+    public static boolean isMeterEnabled() {
+        return ENABLED && DebugScope.getInstance().isMeterEnabled();
+    }
+
+    public static boolean isTimeEnabled() {
+        return ENABLED && DebugScope.getInstance().isTimeEnabled();
+    }
+
+    public static boolean isLogEnabled() {
+        return ENABLED && DebugScope.getInstance().isLogEnabled();
+    }
+
+    public static void sandbox(String name, Runnable runnable) {
+        if (ENABLED) {
+            DebugScope.getInstance().scope(name, runnable, null, true, new Object[0]);
+        } else {
+            runnable.run();
+        }
+    }
+
+    public static void scope(String name, Runnable runnable) {
+        scope(name, new Object[0], runnable);
+    }
+
+    public static <T> T scope(String name, Callable<T> callable) {
+        return scope(name, new Object[0], callable);
+    }
+
+    public static void scope(String name, Object context, Runnable runnable) {
+        scope(name, new Object[] {context}, runnable);
+    }
+
+    public static void scope(String name, Object[] context, Runnable runnable) {
+        if (ENABLED) {
+            DebugScope.getInstance().scope(name, runnable, null, false, context);
+        } else {
+            runnable.run();
+        }
+    }
+
+    public static String currentScope() {
+        if (ENABLED) {
+            return DebugScope.getInstance().getQualifiedName();
+        } else {
+            return "";
+        }
+    }
+
+    public static <T> T scope(String name, Object context, Callable<T> callable) {
+        return scope(name, new Object[] {context}, callable);
+    }
+
+    public static <T> T scope(String name, Object[] context, Callable<T> callable) {
+        if (ENABLED) {
+            return DebugScope.getInstance().scope(name, null, callable, false, context);
+        } else {
+            return DebugScope.call(callable);
+        }
+    }
+
+    public static void log(String msg, Object... args) {
+        if (ENABLED && DebugScope.getInstance().isLogEnabled()) {
+            DebugScope.getInstance().log(msg, args);
+        }
+    }
+
+    public static void dump(Object object, String msg, Object... args) {
+        if (ENABLED && DebugScope.getInstance().isDumpEnabled()) {
+            DebugScope.getInstance().dump(object, msg, args);
+        }
+    }
+
+    public static Iterable<Object> context() {
+        if (ENABLED) {
+            return DebugScope.getInstance().getCurrentContext();
+        } else {
+            return Collections.emptyList();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public static <T> List<T> contextSnapshot(Class<T> clazz) {
+        if (ENABLED) {
+            List<T> result = new ArrayList<>();
+            for (Object o : context()) {
+                if (clazz.isInstance(o)) {
+                    result.add((T) o);
+                }
+            }
+            return result;
+        } else {
+            return Collections.emptyList();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public static <T> T contextLookup(Class<T> clazz) {
+        if (ENABLED) {
+            for (Object o : context()) {
+                if (clazz.isInstance(o)) {
+                    return ((T) o);
+                }
+            }
+        }
+        return null;
+    }
+
+    public static DebugMetric metric(String name) {
+        if (ENABLED) {
+            return new MetricImpl(name);
+        } else {
+            return VOID_METRIC;
+        }
+    }
+
+    public static void setConfig(DebugConfig config) {
+        if (ENABLED) {
+            DebugScope.getInstance().setConfig(config);
+        }
+    }
+
+    public static DebugConfig fixedConfig(final boolean isLogEnabled, final boolean isDumpEnabled, final boolean isMeterEnabled, final boolean isTimerEnabled, final Collection<? extends DebugDumpHandler> dumpHandlers) {
+        return new DebugConfig() {
+
+            @Override
+            public boolean isLogEnabled() {
+                return isLogEnabled;
+            }
+
+            @Override
+            public boolean isMeterEnabled() {
+                return isMeterEnabled;
+            }
+
+            @Override
+            public boolean isDumpEnabled() {
+                return isDumpEnabled;
+            }
+
+            @Override
+            public boolean isTimeEnabled() {
+                return isTimerEnabled;
+            }
+
+            @Override
+            public RuntimeException interceptException(Throwable e) {
+                return null;
+            }
+
+            @Override
+            public Collection< ? extends DebugDumpHandler> dumpHandlers() {
+                return dumpHandlers;
+            }
+        };
+    }
+
+    private static final DebugMetric VOID_METRIC = new DebugMetric() {
+
+        public void increment() {
+        }
+
+        public void add(int value) {
+        }
+    };
+
+    public static DebugTimer timer(String name) {
+        if (ENABLED) {
+            return new TimerImpl(name);
+        } else {
+            return VOID_TIMER;
+        }
+    }
+
+    private static final DebugTimer VOID_TIMER = new DebugTimer() {
+
+        public TimerCloseable start() {
+            return TimerImpl.VOID_CLOSEABLE;
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugConfig.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug;
+
+import java.util.*;
+
+
+public interface DebugConfig {
+    boolean isLogEnabled();
+    boolean isMeterEnabled();
+    boolean isDumpEnabled();
+    boolean isTimeEnabled();
+    RuntimeException interceptException(Throwable e);
+    Collection<? extends DebugDumpHandler> dumpHandlers();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug;
+
+public interface DebugDumpHandler {
+    void dump(Object object, String message);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpScope.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug;
+
+public final class DebugDumpScope {
+
+    private final String name;
+
+    public DebugDumpScope(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String toString() {
+        return "DebugDumpScope[" + name + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugMetric.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug;
+
+public interface DebugMetric {
+    void increment();
+    void add(int value);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugTimer.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug;
+
+import com.oracle.graal.debug.internal.*;
+
+public interface DebugTimer {
+    TimerCloseable start();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug.internal;
+
+import java.io.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import com.oracle.graal.debug.*;
+
+public final class DebugScope {
+
+    private static ThreadLocal<DebugScope> instanceTL = new ThreadLocal<>();
+    private static ThreadLocal<DebugConfig> configTL = new ThreadLocal<>();
+    private static ThreadLocal<Throwable> lastExceptionThrownTL = new ThreadLocal<>();
+    private static DebugTimer scopeTime = Debug.timer("ScopeTime");
+
+    private final DebugScope parent;
+
+    private Object[] context;
+
+    private DebugValueMap valueMap;
+    private String qualifiedName;
+    private String name;
+
+    private static final char SCOPE_SEP = '.';
+
+    private boolean logEnabled;
+    private boolean meterEnabled;
+    private boolean timeEnabled;
+    private boolean dumpEnabled;
+
+    public static DebugScope getInstance() {
+        DebugScope result = instanceTL.get();
+        if (result == null) {
+            DebugScope topLevelDebugScope = new DebugScope(Thread.currentThread().getName(), "", null);
+            instanceTL.set(topLevelDebugScope);
+            DebugValueMap.registerTopLevel(topLevelDebugScope.getValueMap());
+            return topLevelDebugScope;
+        } else {
+            return result;
+        }
+    }
+
+    public static DebugConfig getConfig() {
+        return configTL.get();
+    }
+
+    private DebugScope(String name, String qualifiedName, DebugScope parent, Object... context) {
+        this.name = name;
+        this.parent = parent;
+        this.context = context;
+        this.qualifiedName = qualifiedName;
+        assert context != null;
+    }
+
+    public boolean isDumpEnabled() {
+        return dumpEnabled;
+    }
+
+    public boolean isLogEnabled() {
+        return logEnabled;
+    }
+
+    public boolean isMeterEnabled() {
+        return meterEnabled;
+    }
+
+    public boolean isTimeEnabled() {
+        return timeEnabled;
+    }
+
+    public void log(String msg, Object... args) {
+        if (isLogEnabled()) {
+            cachedOut.println(String.format(msg, args));
+        }
+    }
+
+    public void dump(Object object, String formatString, Object[] args) {
+        if (isDumpEnabled()) {
+            DebugConfig config = getConfig();
+            if (config != null) {
+                String message = String.format(formatString, args);
+                for (DebugDumpHandler dumpHandler : config.dumpHandlers()) {
+                    dumpHandler.dump(object, message);
+                }
+            }
+        }
+    }
+
+    public <T> T scope(String newName, Runnable runnable, Callable<T> callable, boolean sandbox, Object[] newContext) {
+        DebugScope oldContext = getInstance();
+        DebugConfig oldConfig = getConfig();
+        DebugScope newChild = null;
+        if (sandbox) {
+            newChild = new DebugScope(newName, newName, null, newContext);
+            setConfig(null);
+        } else {
+            newChild = oldContext.createChild(newName, newContext);
+        }
+        instanceTL.set(newChild);
+        newChild.updateFlags();
+        try (TimerCloseable a = scopeTime.start()) {
+            return executeScope(runnable, callable);
+        } finally {
+            if (!sandbox && newChild.hasValueMap()) {
+                getValueMap().addChild(newChild.getValueMap());
+            }
+            newChild.context = null;
+            instanceTL.set(oldContext);
+            setConfig(oldConfig);
+        }
+    }
+
+    private <T> T executeScope(Runnable runnable, Callable<T> callable) {
+        try {
+            if (runnable != null) {
+                runnable.run();
+            }
+            if (callable != null) {
+                return call(callable);
+            }
+        } catch (Throwable e) {
+            if (e == lastExceptionThrownTL.get()) {
+                throw e;
+            } else {
+                RuntimeException newException = interceptException(e);
+                if (newException == null) {
+                    lastExceptionThrownTL.set(e);
+                    throw e;
+                } else {
+                    lastExceptionThrownTL.set(newException);
+                    throw newException;
+                }
+            }
+        }
+        return null;
+    }
+
+    private void updateFlags() {
+        DebugConfig config = getConfig();
+        if (config == null) {
+            logEnabled = false;
+            meterEnabled = false;
+            timeEnabled = false;
+            dumpEnabled = false;
+        } else {
+            logEnabled = config.isLogEnabled();
+            meterEnabled = config.isMeterEnabled();
+            timeEnabled = config.isTimeEnabled();
+            dumpEnabled = config.isDumpEnabled();
+        }
+    }
+
+    private RuntimeException interceptException(final Throwable e) {
+        final DebugConfig config = getConfig();
+        if (config != null) {
+            return scope("InterceptException", null, new Callable<RuntimeException>() {
+
+                @Override
+                public RuntimeException call() throws Exception {
+                    try {
+                        return config.interceptException(e);
+                    } catch (Throwable t) {
+                        return new RuntimeException("Exception while intercepting exception", t);
+                    }
+                }
+            }, false, new Object[] {e});
+        }
+        return null;
+    }
+
+    private DebugValueMap getValueMap() {
+        if (valueMap == null) {
+            valueMap = new DebugValueMap(name);
+        }
+        return valueMap;
+    }
+
+    private boolean hasValueMap() {
+        return valueMap != null;
+    }
+
+    long getCurrentValue(int index) {
+        return getValueMap().getCurrentValue(index);
+    }
+
+    void setCurrentValue(int index, long l) {
+        getValueMap().setCurrentValue(index, l);
+    }
+
+    private DebugScope createChild(String newName, Object[] newContext) {
+        String newQualifiedName = newName;
+        if (this.qualifiedName.length() > 0) {
+            newQualifiedName = this.qualifiedName + SCOPE_SEP + newName;
+        }
+        DebugScope result = new DebugScope(newName, newQualifiedName, this, newContext);
+        return result;
+    }
+
+    public Iterable<Object> getCurrentContext() {
+        return new Iterable<Object>() {
+
+            @Override
+            public Iterator<Object> iterator() {
+                return new Iterator<Object>() {
+
+                    DebugScope currentScope = DebugScope.this;
+                    int objectIndex;
+
+                    @Override
+                    public boolean hasNext() {
+                        selectScope();
+                        return currentScope != null;
+                    }
+
+                    private void selectScope() {
+                        while (currentScope != null && currentScope.context.length <= objectIndex) {
+                            currentScope = currentScope.parent;
+                            objectIndex = 0;
+                        }
+                    }
+
+                    @Override
+                    public Object next() {
+                        selectScope();
+                        if (currentScope != null) {
+                            return currentScope.context[objectIndex++];
+                        }
+                        throw new IllegalStateException("May only be called if there is a next element.");
+                    }
+
+                    @Override
+                    public void remove() {
+                        throw new UnsupportedOperationException("This iterator is read only.");
+                    }
+                };
+            }
+        };
+    }
+
+    public static <T> T call(Callable<T> callable) {
+        try {
+            return callable.call();
+        } catch (Exception e) {
+            if (e instanceof RuntimeException) {
+                throw (RuntimeException) e;
+            } else {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    public void setConfig(DebugConfig newConfig) {
+        configTL.set(newConfig);
+        updateFlags();
+    }
+
+    public String getQualifiedName() {
+        return qualifiedName;
+    }
+
+    public static PrintStream cachedOut;
+
+    public static void initialize() {
+        cachedOut = System.out;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValue.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug.internal;
+
+public class DebugValue {
+
+    private String name;
+    private int index;
+
+    protected DebugValue(String name) {
+        this.name = name;
+        this.index = -1;
+    }
+
+    protected long getCurrentValue() {
+        ensureInitialized();
+        return DebugScope.getInstance().getCurrentValue(index);
+    }
+
+    protected void setCurrentValue(long l) {
+        ensureInitialized();
+        DebugScope.getInstance().setCurrentValue(index, l);
+    }
+
+    private void ensureInitialized() {
+        if (index == -1) {
+            index = KeyRegistry.register(name, this);
+        }
+    }
+
+    protected void addToCurrentValue(long timeSpan) {
+        setCurrentValue(getCurrentValue() + timeSpan);
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public String getName() {
+        return name;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug.internal;
+
+import java.util.*;
+
+public class DebugValueMap {
+
+    private static List<DebugValueMap> topLevelMaps = new ArrayList<>();
+
+    private long[] values;
+    private List<DebugValueMap> children;
+    private String name;
+
+    public DebugValueMap(String name) {
+        this.name = name;
+    }
+
+    public void setCurrentValue(int index, long l) {
+        ensureSize(index);
+        values[index] = l;
+    }
+
+    public long getCurrentValue(int index) {
+        ensureSize(index);
+        return values[index];
+    }
+
+    private void ensureSize(int index) {
+        if (values == null) {
+            values = new long[index + 1];
+        }
+        if (values.length <= index) {
+            values = Arrays.copyOf(values, index + 1);
+        }
+    }
+
+    private int capacity() {
+        return (values == null) ? 0 : values.length;
+    }
+
+    public void addChild(DebugValueMap map) {
+        if (children == null) {
+            children = new ArrayList<>(4);
+        }
+        children.add(map);
+    }
+
+    public List<DebugValueMap> getChildren() {
+        if (children == null) {
+            return Collections.emptyList();
+        } else {
+            return Collections.unmodifiableList(children);
+        }
+    }
+
+    public boolean hasChildren() {
+        return children != null && !children.isEmpty();
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    @Override
+    public String toString() {
+        return "DebugValueMap<" + getName() + ">";
+    }
+
+    public static synchronized void registerTopLevel(DebugValueMap map) {
+        topLevelMaps.add(map);
+    }
+
+    public static synchronized List<DebugValueMap> getTopLevelMaps() {
+        return topLevelMaps;
+    }
+
+    public void normalize() {
+        if (this.hasChildren()) {
+            Map<String, DebugValueMap> occurred = new HashMap<>();
+            for (DebugValueMap map : this.children) {
+                String mapName = map.getName();
+                if (!occurred.containsKey(mapName)) {
+                    occurred.put(mapName, map);
+                    map.normalize();
+                } else {
+                    occurred.get(mapName).mergeWith(map);
+                    occurred.get(mapName).normalize();
+                }
+            }
+
+            if (occurred.values().size() < children.size()) {
+                // At least one duplicate was found.
+                children.clear();
+                for (DebugValueMap map : occurred.values()) {
+                    children.add(map);
+                    map.normalize();
+                }
+            }
+        }
+    }
+
+    private void mergeWith(DebugValueMap map) {
+        if (map.hasChildren()) {
+            if (hasChildren()) {
+                children.addAll(map.children);
+            } else {
+                children = map.children;
+            }
+            map.children = null;
+        }
+
+        int size = Math.max(this.capacity(), map.capacity());
+        ensureSize(size);
+        for (int i = 0; i < size; ++i) {
+            long curValue = getCurrentValue(i);
+            long otherValue = map.getCurrentValue(i);
+            setCurrentValue(i, curValue + otherValue);
+        }
+    }
+
+    public void group() {
+        if (this.hasChildren()) {
+            List<DebugValueMap> oldChildren = new ArrayList<>(this.children);
+            this.children.clear();
+            for (DebugValueMap map : oldChildren) {
+                mergeWith(map);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug.internal;
+
+import java.util.*;
+
+public class KeyRegistry {
+    private static int keyCount;
+    private static Map<String, Integer> keyMap = new HashMap<>();
+    private static List<DebugValue> debugValues = new ArrayList<>();
+
+    public static synchronized int register(String name, DebugValue value) {
+        if (!keyMap.containsKey(name)) {
+            keyMap.put(name, keyCount++);
+            debugValues.add(value);
+        }
+        return keyMap.get(name);
+    }
+
+    public static synchronized List<DebugValue> getDebugValues() {
+        return Collections.unmodifiableList(debugValues);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/MetricImpl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug.internal;
+
+import com.oracle.graal.debug.*;
+
+public final class MetricImpl extends DebugValue implements DebugMetric {
+
+    public MetricImpl(String name) {
+        super(name);
+    }
+
+    public void increment() {
+        add(1);
+    }
+
+    public void add(int value) {
+        if (Debug.isMeterEnabled()) {
+            super.addToCurrentValue(value);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/TimerCloseable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug.internal;
+
+public interface TimerCloseable extends AutoCloseable {
+    void close();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/TimerImpl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.debug.internal;
+
+import com.oracle.graal.debug.*;
+
+public final class TimerImpl extends DebugValue implements DebugTimer {
+
+    public static final TimerCloseable VOID_CLOSEABLE = new TimerCloseable() {
+        @Override
+        public void close() {
+        }
+    };
+
+    public TimerImpl(String name) {
+        super(name);
+    }
+
+    @Override
+    public TimerCloseable start() {
+        if (Debug.isTimeEnabled()) {
+            final long startTime = System.currentTimeMillis();
+            return new TimerCloseable() {
+                @Override
+                public void close() {
+                    long timeSpan = System.currentTimeMillis() - startTime;
+                    TimerImpl.this.addToCurrentValue(timeSpan);
+                }
+            };
+        } else {
+            return VOID_CLOSEABLE;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.examples/src/examples/HelloWorld.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package examples;
+
+
+public class HelloWorld {
+    public static void main(String[] args) {
+        System.out.println("hello world!");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/BitMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,723 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.BitSet;
+
+/**
+ * Implements a bitmap that stores a single bit for a range of integers (0-n).
+ */
+public final class BitMap implements Serializable {
+
+    public static final long serialVersionUID = 0L;
+
+    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 BitMap() {
+        this(DEFAULT_LENGTH);
+    }
+
+    /**
+     * Constructs a new bit map from a byte array encoded bit map.
+     *
+     * @param bitmap the bit map to convert
+     */
+    public BitMap(byte[] bitmap) {
+        this(bitmap, 0, bitmap.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 BitMap(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 BitMap}.
+     */
+    public static BitMap fromLong(long bitmap) {
+        BitMap bm = new BitMap(64);
+        bm.low = bitmap;
+        return bm;
+    }
+
+    /**
+     * Constructs a new bit map with the specified length.
+     *
+     * @param length the length of the bitmap
+     */
+    public BitMap(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(BitMap 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, all bits set in either of the two
+     * bitmaps will be set in this bitmap following this operation. It returns whether this bitmap was changed by the operation.
+     *
+     * @param other the other bitmap for the union operation
+     */
+    public boolean setUnionWithResult(BitMap other) {
+        long temp = low | other.low;
+        boolean changed = temp != low;
+        low = temp;
+
+        if (extra != null && other.extra != null) {
+            for (int i = 0; i < extra.length && i < other.extra.length; i++) {
+                temp = extra[i] | other.extra[i];
+                changed = changed || temp != extra[i];
+                extra[i] |= temp;
+            }
+        }
+        return changed;
+    }
+
+    /**
+     * 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(BitMap 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("Index " + i + " is out of bounds (size=" + size + ")");
+        }
+        return i;
+    }
+
+    public void setFrom(BitMap 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(BitMap 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 negate() {
+        low = ~low;
+        if (extra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                extra[i] = ~extra[i];
+            }
+        }
+    }
+
+    public boolean isSame(BitMap 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 BitMap) {
+            BitMap bm = (BitMap) 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;
+    }
+
+    /**
+     * 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();
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + Arrays.hashCode(extra);
+        result = prime * result + (int) (low ^ (low >>> 32));
+        result = prime * result + size;
+        return result;
+    }
+
+    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 = 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();
+    }
+
+    private static int align(int size, int align) {
+        return (size + align - 1) & ~(align - 1);
+    }
+
+    public BitMap copy() {
+        BitMap n = new BitMap(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.
+     * @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;
+    }
+
+    public boolean containsAll(BitMap other) {
+        assert this.size == other.size : "must have same size";
+        if ((low & other.low) != other.low) {
+            return false;
+        }
+        if (extra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                if ((extra[i] & other.extra[i]) != other.extra[i]) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraalInternalError.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.*;
+
+/**
+ * This error represents a conditions that should never occur during normal operation.
+ */
+public class GraalInternalError extends Error {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 8776065085829593278L;
+    private Node node;
+    private Graph graph;
+    private final ArrayList<String> context = new ArrayList<>();
+
+    public static RuntimeException unimplemented() {
+        throw new GraalInternalError("unimplemented");
+    }
+
+    public static RuntimeException unimplemented(String msg) {
+        throw new GraalInternalError("unimplemented: %s", msg);
+    }
+
+    public static RuntimeException shouldNotReachHere() {
+        throw new GraalInternalError("should not reach here");
+    }
+
+    public static RuntimeException shouldNotReachHere(String msg) {
+        throw new GraalInternalError("should not reach here: %s", msg);
+    }
+
+
+    /**
+     * This constructor creates a {@link GraalInternalError} with a message assembled via {@link String#format(String, Object...)}.
+     * It always uses the ENGLISH locale in order to always generate the same output.
+     * @param msg the message that will be associated with the error, in String.format syntax
+     * @param args parameters to String.format - parameters that implement {@link Iterable} will be expanded into a [x, x, ...] representation.
+     */
+    public GraalInternalError(String msg, Object... args) {
+        super(format(msg, args));
+    }
+
+    /**
+     * This constructor creates a {@link GraalInternalError} for a given causing Throwable instance.
+     * @param cause the original exception that contains additional information on this error
+     */
+    public GraalInternalError(Throwable cause) {
+        super(cause);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder str = new StringBuilder();
+        str.append(super.toString());
+        for (String s : context) {
+            str.append("\n\tat ").append(s);
+        }
+        return str.toString();
+    }
+
+    private static String format(String msg, Object... args) {
+        if (args != null) {
+            // expand Iterable parameters into a list representation
+            for (int i = 0; i < args.length; i++) {
+                if (args[i] instanceof Iterable<?>) {
+                    ArrayList<Object> list = new ArrayList<>();
+                    for (Object o : (Iterable<?>) args[i]) {
+                        list.add(o);
+                    }
+                    args[i] = list.toString();
+                }
+            }
+        }
+        return String.format(Locale.ENGLISH, msg, args);
+    }
+
+    public GraalInternalError addContext(String newContext) {
+        this.context.add(newContext);
+        return this;
+    }
+
+    public GraalInternalError addContext(String name, Object obj) {
+        return addContext(format("%s: %s", name, obj));
+    }
+
+    /**
+     * Adds a graph to the context of this VerificationError. The first graph added via this method will be returned by {@link #graph()}.
+     * @param newGraph the graph which is in a incorrect state, if the verification error was not caused by a specific node
+     */
+    public GraalInternalError addContext(Graph newGraph) {
+        if (newGraph != this.graph) {
+            addContext("graph", newGraph);
+            if (this.graph == null) {
+                this.graph = newGraph;
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Adds a node to the context of this VerificationError. The first node added via this method will be returned by {@link #node()}.
+     * @param newNode the node which is in a incorrect state, if the verification error was caused by a node
+     */
+    public GraalInternalError addContext(Node newNode) {
+        if (newNode != this.node) {
+            addContext("node", newNode);
+            if (this.node == null) {
+                this.node = newNode;
+            }
+        }
+        return this;
+    }
+
+    public Node node() {
+        return node;
+    }
+
+    public Graph graph() {
+        return graph;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,506 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.*;
+
+import com.oracle.graal.graph.GraphEvent.NodeEvent;
+import com.oracle.graal.graph.Node.IterableNodeType;
+import com.oracle.graal.graph.Node.ValueNumberable;
+import com.oracle.graal.graph.iterators.*;
+
+/**
+ * This class is a graph container, it contains the set of nodes that belong to this graph.
+ */
+public class Graph {
+
+    protected final String name;
+
+    private static final boolean TIME_TRAVEL = false;
+
+    private final ArrayList<Node> nodes;
+
+    // these two arrays contain one entry for each NodeClass, indexed by NodeClass.iterableId.
+    // they contain the first and last pointer to a linked list of all nodes with this type.
+    private final ArrayList<Node> nodeCacheFirst;
+    private final ArrayList<Node> nodeCacheLast;
+    private int deletedNodeCount;
+    private int mark;
+    private GraphEventLog eventLog;
+
+    ArrayList<Node> usagesDropped = new ArrayList<>();
+    NodeWorkList inputChanged;
+    private final HashMap<CacheEntry, Node> cachedNodes = new HashMap<>();
+
+    private static final class CacheEntry {
+
+        private final Node node;
+
+        public CacheEntry(Node node) {
+            this.node = node;
+        }
+
+        @Override
+        public int hashCode() {
+            return node.getNodeClass().valueNumber(node);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == this) {
+                return true;
+            }
+            if (obj instanceof CacheEntry) {
+                CacheEntry other = (CacheEntry) obj;
+                NodeClass nodeClass = node.getNodeClass();
+                if (other.node.getNodeClass() == nodeClass) {
+                    return nodeClass.valueNumberable() && nodeClass.valueEqual(node, other.node) && nodeClass.edgesEqual(node, other.node);
+                }
+            }
+            return false;
+        }
+    }
+
+    /**
+     * Creates an empty Graph with no name.
+     */
+    public Graph() {
+        this(null);
+    }
+
+    /**
+     * Creates an empty Graph with a given name.
+     *
+     * @param name the name of the graph, used for debugging purposes
+     */
+    public Graph(String name) {
+        nodes = new ArrayList<>(32);
+        nodeCacheFirst = new ArrayList<>(NodeClass.cacheSize());
+        nodeCacheLast = new ArrayList<>(NodeClass.cacheSize());
+        this.name = name;
+    }
+
+    /**
+     * Creates a copy of this graph.
+     */
+    public Graph copy() {
+        return copy(name);
+    }
+
+    /**
+     * Creates a copy of this graph.
+     *
+     * @param name the name of the copy, used for debugging purposes (can be null)
+     */
+    public Graph copy(String newName) {
+        Graph copy = new Graph(newName);
+        Map<Node, Node> emptyMap = Collections.emptyMap();
+        copy.addDuplicates(getNodes(), emptyMap);
+        return copy;
+    }
+
+    @Override
+    public String toString() {
+        return name == null ? super.toString() : "Graph " + name;
+    }
+
+    /**
+     * Gets the number of live nodes in this graph. That is the number of nodes which have been added to the graph minus the number of deleted nodes.
+     * @return the number of live nodes in this graph
+     */
+    public int getNodeCount() {
+        return nodes.size() - getDeletedNodeCount();
+    }
+
+    /**
+     * Gets the number of node which have been deleted from this graph.
+     * @return the number of node which have been deleted from this graph
+     */
+    public int getDeletedNodeCount() {
+        return deletedNodeCount;
+    }
+
+    /**
+     * Adds a new node to the graph.
+     * @param node the node to be added
+     * @return the node which was added to the graph
+     */
+    public <T extends Node> T add(T node) {
+        node.initialize(this);
+        return node;
+    }
+
+    public int getUsagesDroppedNodesCount() {
+        return usagesDropped.size();
+    }
+
+    public List<Node> getAndCleanUsagesDroppedNodes() {
+        ArrayList<Node> result = usagesDropped;
+        usagesDropped = new ArrayList<>();
+        return result;
+    }
+
+    public void trackInputChange(NodeWorkList worklist) {
+        this.inputChanged = worklist;
+    }
+
+    public void stopTrackingInputChange() {
+        inputChanged = null;
+    }
+
+    /**
+     * Adds a new node to the graph, if a <i>similar</i> node already exists in the graph, the provided node will not be added to the graph but the <i>similar</i> node will be returned instead.
+     * @param node
+     * @return the node which was added to the graph or a <i>similar</i> which was already in the graph.
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends Node & ValueNumberable> T unique(T node) {
+        assert checkValueNumberable(node);
+
+        for (Node input : node.inputs()) {
+            if (input != null) {
+                for (Node usage : input.usages()) {
+                    if (usage != node && node.getNodeClass().valueEqual(node, usage) && node.getNodeClass().edgesEqual(node, usage)) {
+                        return (T) usage;
+                    }
+                }
+                return add(node);
+            }
+        }
+        Node cachedNode = cachedNodes.get(new CacheEntry(node));
+        if (cachedNode != null && cachedNode.isAlive()) {
+            return (T) cachedNode;
+        } else {
+            Node result = add(node);
+            cachedNodes.put(new CacheEntry(node), result);
+            return (T) result;
+        }
+    }
+
+    public Node findDuplicate(Node node) {
+        if (node.getNodeClass().valueNumberable()) {
+            for (Node input : node.inputs()) {
+                if (input != null) {
+                    for (Node usage : input.usages()) {
+                        if (usage != node && node.getNodeClass().valueEqual(node, usage) && node.getNodeClass().edgesEqual(node, usage)) {
+                            return usage;
+                        }
+                    }
+                    break;
+                }
+            }
+        }
+        return null;
+    }
+
+    private static boolean checkValueNumberable(Node node) {
+        if (!node.getNodeClass().valueNumberable()) {
+            throw new VerificationError("node is not valueNumberable").addContext(node);
+        }
+        return true;
+    }
+
+    public void mark() {
+        this.mark = nodeIdCount();
+    }
+
+    private class NodeIterator implements Iterator<Node> {
+        private int index;
+
+        public NodeIterator() {
+            this(0);
+        }
+
+        public NodeIterator(int index) {
+            this.index = index - 1;
+            forward();
+        }
+
+        private void forward() {
+            if (index < nodes.size()) {
+                do {
+                    index++;
+                } while (index < nodes.size() && nodes.get(index) == null);
+            }
+        }
+
+        @Override
+        public boolean hasNext() {
+            checkForDeletedNode();
+            return index < nodes.size();
+        }
+
+        private void checkForDeletedNode() {
+            if (index < nodes.size()) {
+                while (index < nodes.size() && nodes.get(index) == null) {
+                    index++;
+                }
+            }
+        }
+
+        @Override
+        public Node next() {
+            try {
+                return nodes.get(index);
+            } finally {
+                forward();
+            }
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     * Returns an {@link Iterable} providing all nodes added since the last {@link Graph#mark() mark}.
+     * @return an {@link Iterable} providing the new nodes
+     */
+    public NodeIterable<Node> getNewNodes() {
+        final int index = this.mark;
+        return new NodeIterable<Node>() {
+            @Override
+            public Iterator<Node> iterator() {
+                return new NodeIterator(index);
+            }
+        };
+    }
+
+    /**
+     * Returns an {@link Iterable} providing all the live nodes.
+     * @return an {@link Iterable} providing all the live nodes.
+     */
+    public NodeIterable<Node> getNodes() {
+        return new NodeIterable<Node>() {
+            @Override
+            public Iterator<Node> iterator() {
+                return new NodeIterator();
+            }
+        };
+    }
+
+    private static class TypedNodeIterator<T extends IterableNodeType> implements Iterator<T> {
+        private Node current;
+        private final Node start;
+
+        public TypedNodeIterator(Node start) {
+            if (start != null && start.isDeleted()) {
+                this.current = start;
+            } else {
+                this.current = null;
+            }
+            this.start = start;
+        }
+
+        @Override
+        public boolean hasNext() {
+            if (current != null) {
+                Node next = current.typeCacheNext;
+                if (next != null) {
+                    while (next.isDeleted()) {
+                        next = next.typeCacheNext;
+                        if (next == null) {
+                            return false;
+                        }
+                        current.typeCacheNext = next;
+                    }
+                    return true;
+                }
+                return false;
+            } else {
+                return start != null;
+            }
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public T next() {
+            if (current == null) {
+                Node result = start;
+                current = result;
+                return (T) result;
+            } else {
+                Node result = current.typeCacheNext;
+                current = result;
+                return (T) result;
+            }
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     * Returns an {@link Iterable} providing all the live nodes whose type is compatible with {@code type}.
+     * @param type the type of node to return
+     * @return an {@link Iterable} providing all the matching nodes.
+     */
+    public <T extends Node & IterableNodeType> NodeIterable<T> getNodes(final Class<T> type) {
+        final Node start = getStartNode(type);
+        return new NodeIterable<T>() {
+            @Override
+            public Iterator<T> iterator() {
+                return new TypedNodeIterator<>(start);
+            }
+        };
+    }
+
+    /**
+     * Returns whether the graph contains at least one node of the given type.
+     * @param type the type of node that is checked for occurrence
+     * @return whether there is at least one such node
+     */
+    public <T extends Node & IterableNodeType> boolean hasNode(final Class<T> type) {
+        return getNodes(type).iterator().hasNext();
+    }
+
+    private <T> Node getStartNode(final Class<T> type) {
+        int nodeClassId = NodeClass.get(type).iterableId();
+        assert nodeClassId != -1 : type + " is not iterable within graphs (missing \"implements IterableNodeType\"?)";
+        Node start = nodeCacheFirst.size() <= nodeClassId ? null : nodeCacheFirst.get(nodeClassId);
+        return start;
+    }
+
+    public NodeBitMap createNodeBitMap() {
+        return new NodeBitMap(this);
+    }
+
+    public <T> NodeMap<T> createNodeMap() {
+        return new NodeMap<>(this);
+    }
+
+    public NodeFlood createNodeFlood() {
+        return new NodeFlood(this);
+    }
+
+    public NodeWorkList createNodeWorkList() {
+        return new NodeWorkList(this);
+    }
+
+    public NodeWorkList createNodeWorkList(boolean fill, int iterationLimitPerNode) {
+        return new NodeWorkList(this, fill, iterationLimitPerNode);
+    }
+
+    void register(Node node) {
+        assert node.id() == Node.INITIAL_ID;
+        int id = nodes.size();
+        nodes.add(id, node);
+
+        int nodeClassId = node.getNodeClass().iterableId();
+        if (nodeClassId != NodeClass.NOT_ITERABLE) {
+            while (nodeCacheFirst.size() <= nodeClassId) {
+                nodeCacheFirst.add(null);
+                nodeCacheLast.add(null);
+            }
+            Node prev = nodeCacheLast.get(nodeClassId);
+            if (prev != null) {
+                prev.typeCacheNext = node;
+            } else {
+                nodeCacheFirst.set(nodeClassId, node);
+            }
+            nodeCacheLast.set(nodeClassId, node);
+        }
+
+        node.id = id;
+        logNodeAdded(node);
+    }
+
+    void logNodeAdded(Node node) {
+        if (TIME_TRAVEL) {
+            log(new GraphEvent.NodeEvent(node, GraphEvent.NodeEvent.Type.ADDED));
+        }
+    }
+
+    void logNodeDeleted(Node node) {
+        if (TIME_TRAVEL) {
+            log(new GraphEvent.NodeEvent(node, GraphEvent.NodeEvent.Type.DELETED));
+        }
+    }
+
+    private void log(NodeEvent nodeEvent) {
+        if (eventLog == null) {
+            eventLog = new GraphEventLog();
+        }
+        eventLog.add(nodeEvent);
+    }
+
+    public GraphEventLog getEventLog() {
+        return eventLog;
+    }
+
+    void unregister(Node node) {
+        assert !node.isDeleted() : "cannot delete a node twice! node=" + node;
+        logNodeDeleted(node);
+        nodes.set(node.id(), null);
+        deletedNodeCount++;
+
+        // nodes aren't removed from the type cache here - they will be removed during iteration
+    }
+
+    public boolean verify() {
+        for (Node node : getNodes()) {
+            try {
+                try {
+                    assert node.verify();
+                } catch (AssertionError t) {
+                    throw new GraalInternalError(t);
+                } catch (RuntimeException t) {
+                    throw new GraalInternalError(t);
+                }
+            } catch (GraalInternalError e) {
+                throw e.addContext(node).addContext(this);
+            }
+        }
+        return true;
+    }
+
+    Node getNode(int i) {
+        return nodes.get(i);
+    }
+
+    /**
+     * Returns the number of node ids generated so far.
+     * @return the number of node ids generated so far
+     */
+    int nodeIdCount() {
+        return nodes.size();
+    }
+
+    /**
+     * Adds duplicates of the nodes in {@code nodes} to this graph.
+     * This will recreate any edges between the duplicate nodes. The {@code replacement} map can be used to
+     * replace a node from the source graph by a given node (which must already be in this graph).
+     * Edges between duplicate and replacement nodes will also be recreated so care should be taken
+     * regarding the matching of node types in the replacement map.
+     *
+     * @param newNodes the nodes to be duplicated
+     * @param replacements the replacement map (can be null if no replacement is to be performed)
+     * @return a map which associates the original nodes from {@code nodes} to their duplicates
+     */
+    public Map<Node, Node> addDuplicates(Iterable<Node> newNodes, Map<Node, Node> replacements) {
+        return NodeClass.addGraphDuplicate(this, newNodes, replacements);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraphEvent.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+
+public abstract class GraphEvent {
+
+    private Exception exceptionContext;
+
+    public static class NodeEvent extends GraphEvent {
+
+        public static enum Type {
+            ADDED,
+            DELETED,
+            CHANGED
+        }
+
+        public final Node node;
+        public final Type type;
+        private final String nodeString;
+
+        public NodeEvent(Node n, Type type) {
+            this.node = n;
+            this.type = type;
+            nodeString = n.toString();
+        }
+
+        @Override
+        public StackTraceElement[] print(StackTraceElement[] last) {
+            System.out.println(type.toString() + ", " + nodeString);
+            return super.print(last);
+        }
+    }
+
+    public static class EdgeEvent extends GraphEvent {
+
+        public static enum Type {
+            INPUT,
+            SUCC
+        }
+
+        public final Node node;
+        public final int index;
+        public final Node newValue;
+        public final Type type;
+
+        public EdgeEvent(Node node, int index, Node newValue, Type type) {
+            this.node = node;
+            this.index = index;
+            this.newValue = newValue;
+            this.type = type;
+        }
+    }
+
+    public GraphEvent() {
+        exceptionContext = new Exception();
+    }
+
+    public StackTraceElement[] print(StackTraceElement[] last) {
+        StackTraceElement[] stackTrace = exceptionContext.getStackTrace();
+
+        boolean atTop = true;
+        for (int i = 0; i < stackTrace.length; ++i) {
+            StackTraceElement elem = stackTrace[i];
+            int toBottom = stackTrace.length - i;
+            if (atTop) {
+                if (!elem.getClassName().startsWith("com.oracle.graal.graph.Graph") && !elem.getClassName().startsWith("com.oracle.graal.graph.Node")) {
+                    atTop = false;
+                } else {
+                    continue;
+                }
+            } else {
+                if (last.length >= toBottom && last[last.length - toBottom].equals(elem)) {
+                    continue;
+                }
+            }
+            System.out.println(String.format("%s.%s(%s:%d)", elem.getClassName(), elem.getMethodName(), elem.getFileName(), elem.getLineNumber()));
+        }
+        return stackTrace;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/GraphEventLog.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.*;
+
+
+public class GraphEventLog {
+
+    private List<GraphEvent> events = new ArrayList<>();
+
+    public void add(GraphEvent e) {
+        this.events.add(e);
+    }
+
+    public void printEvents() {
+        StackTraceElement[] last = new StackTraceElement[0];
+        for (GraphEvent e : events) {
+            last = e.print(last);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,561 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.lang.annotation.*;
+import java.util.*;
+
+import com.oracle.graal.graph.NodeClass.*;
+
+
+/**
+ * This class is the base class for all nodes, it represent a node which can be inserted in a {@link Graph}.<br>
+ * Once a node has been added to a graph, it has a graph-unique {@link #id()}. Edges in the subclasses are represented
+ * with annotated fields. There are two kind of edges : {@link Input} and {@link Successor}. If a field, of a type
+ * compatible with {@link Node}, annotated with either {@link Input} and {@link Successor} is not null, then there is an
+ * edge from this node to the node this field points to.<br>
+ * Fields in a node subclass can also be annotated with {@link Data} : such fields will be used when comparing 2 nodes
+ * with {@link #equals(Object)}, for value numbering and for debugging purposes.<br>
+ * Nodes which are be value numberable should implement the {@link ValueNumberable} interface.
+ *
+ * <h1>Assertions and Verification</h1>
+ *
+ * The Node class supplies the {@link #assertTrue(boolean, String, Object...)} and
+ * {@link #assertFalse(boolean, String, Object...)} methods, which will check the supplied boolean and throw a
+ * VerificationError if it has the wrong value. Both methods will always either throw an exception or return true.
+ * They can thus be used within an assert statement, so that the check is only performed if assertions are enabled.
+ *
+ *
+ */
+public abstract class Node implements Cloneable, Formattable {
+
+    static final int DELETED_ID_START = -1000000000;
+    static final int INITIAL_ID = -1;
+    static final int ALIVE_ID_START = 0;
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.FIELD)
+    public static @interface Input {
+        boolean notDataflow() default false;
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.FIELD)
+    public static @interface Successor {}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.FIELD)
+    public static @interface Data {}
+
+    /**
+     * Denotes that a parameter of an {@linkplain NodeIntrinsic intrinsic} method
+     * must be a compile time constant at all call sites to the intrinic method.
+     */
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.PARAMETER)
+    public static @interface ConstantNodeParameter {}
+
+    /**
+     * Annotates a method that can be replaced by a compiler intrinsic.
+     * That is, a (resolved) call to the annotated method can be replaced
+     * with an instance of the node class denoted by {@link #value()}.
+     * For this reason, the signature of the annotated method must match
+     * the signature of a constructor in the node class.
+     */
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.METHOD)
+    public static @interface NodeIntrinsic {
+        /**
+         * Gets the {@link Node} subclass instantiated when intrinsifying a call to the annotated method.
+         * If not specified, then the class in which the annotated method is declared is used
+         * (and is assumed to be a {@link Node} subclass).
+         */
+        Class value() default NodeIntrinsic.class;
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.METHOD)
+    public static @interface NodePhase {
+        Class value() default NodePhase.class;
+    }
+
+    public interface ValueNumberable {}
+
+    public interface IterableNodeType {}
+
+    private Graph graph;
+    int id;
+
+    // this next pointer is used in Graph to implement fast iteration over NodeClass types, it therefore points to the next Node of the same type.
+    Node typeCacheNext;
+
+    private NodeUsagesList usages;
+    private Node predecessor;
+    private int modCount;
+    private NodeClass nodeClass;
+
+    public Node() {
+        this.graph = null;
+        this.id = INITIAL_ID;
+        nodeClass = NodeClass.get(getClass());
+    }
+
+    protected int id() {
+        return id;
+    }
+
+    public Graph graph() {
+        return graph;
+    }
+
+    /**
+     * Returns an {@link NodeInputsIterable iterable} which can be used to traverse all non-null input edges of this node.
+     * @return an {@link NodeInputsIterable iterable} for all non-null input edges.
+     */
+    public NodeInputsIterable inputs() {
+        return getNodeClass().getInputIterable(this);
+    }
+
+    /**
+     * Returns an {@link NodeSuccessorsIterable iterable} which can be used to traverse all non-null successor edges of this node.
+     * @return an {@link NodeSuccessorsIterable iterable} for all non-null successor edges.
+     */
+    public NodeSuccessorsIterable successors() {
+        return getNodeClass().getSuccessorIterable(this);
+    }
+
+    public final NodeUsagesList usages() {
+        return usages;
+    }
+
+    public final Node predecessor() {
+        return predecessor;
+    }
+
+    final int modCount() {
+        return modCount;
+    }
+
+    final void incModCount() {
+        modCount++;
+    }
+
+    public boolean isDeleted() {
+        return id <= DELETED_ID_START;
+    }
+
+    public boolean isAlive() {
+        return id >= ALIVE_ID_START;
+    }
+
+    /**
+     * Updates the usages sets of the given nodes after an input slot is changed from oldInput to newInput:
+     * removes this node from oldInput's usages and adds this node to newInput's usages.
+     */
+    protected void updateUsages(Node oldInput, Node newInput) {
+        assert assertTrue(usages != null, "usages == null while adding %s to %s", newInput, this);
+        if (oldInput != newInput) {
+            if (oldInput != null) {
+                boolean result = removeThisFromUsages(oldInput);
+                assert assertTrue(result, "not found in usages, old input: %s", oldInput);
+            }
+            if (newInput != null) {
+                NodeWorkList inputChanged = graph.inputChanged;
+                if (inputChanged != null) {
+                    inputChanged.addAgain(this);
+                }
+                newInput.usages.add(this);
+            }
+        }
+    }
+
+    /**
+     * Updates the predecessor sets of the given nodes after a successor slot is changed from oldSuccessor to newSuccessor:
+     * removes this node from oldSuccessor's predecessors and adds this node to newSuccessor's predecessors.
+     */
+    protected void updatePredecessors(Node oldSuccessor, Node newSuccessor) {
+        assert assertTrue(usages != null, "usages == null while adding %s to %s", newSuccessor, this);
+        if (oldSuccessor != newSuccessor) {
+            if (oldSuccessor != null) {
+                assert assertTrue(oldSuccessor.predecessor == this, "wrong predecessor in old successor (%s): %s", oldSuccessor, oldSuccessor.predecessor);
+                oldSuccessor.predecessor = null;
+            }
+            if (newSuccessor != null) {
+                assert assertTrue(newSuccessor.predecessor == null, "unexpected non-null predecessor in new successor (%s): %s", newSuccessor, newSuccessor.predecessor);
+                newSuccessor.predecessor = this;
+            }
+        }
+    }
+
+    void initialize(Graph newGraph) {
+        assert assertTrue(id == INITIAL_ID, "unexpected id: %d", id);
+        this.graph = newGraph;
+        newGraph.register(this);
+        usages = new NodeUsagesList();
+        for (Node input : inputs()) {
+            updateUsages(null, input);
+        }
+        for (Node successor : successors()) {
+            updatePredecessors(null, successor);
+        }
+    }
+
+    public final NodeClass getNodeClass() {
+        return nodeClass;
+    }
+
+    // TODO (thomaswue): Do not allow to replace with null.
+    private boolean checkReplaceWith(Node other) {
+        assert assertFalse(other == this, "cannot replace a node with itself");
+        assert assertFalse(isDeleted(), "cannot replace deleted node");
+//        assert assertTrue(other != null, "cannot replace with null node");
+        assert assertTrue(other == null || !other.isDeleted(), "cannot replace with deleted node %s", other);
+        assert assertTrue(other == null || other.graph() == graph, "cannot replace with node in different graph: %s", other == null ? null : other.graph());
+        return true;
+    }
+
+    public void replaceAtUsages(Node other) {
+        assert checkReplaceWith(other);
+        for (Node usage : usages) {
+            boolean result = usage.getNodeClass().replaceFirstInput(usage, this, other);
+            assert assertTrue(result, "not found in inputs, usage: %s", usage);
+            if (other != null) {
+                other.usages.add(usage);
+            }
+        }
+        usages.clear();
+    }
+
+    public void replaceAtPredecessors(Node other) {
+        assert checkReplaceWith(other);
+        if (predecessor != null) {
+            boolean result = predecessor.getNodeClass().replaceFirstSuccessor(predecessor, this, other);
+            assert assertTrue(result, "not found in successors, predecessor: %s", predecessor);
+            predecessor.updatePredecessors(this, other);
+        }
+    }
+
+    public void replaceAndDelete(Node other) {
+        assert checkReplaceWith(other);
+        if (other != null) {
+            clearSuccessors();
+            replaceAtUsages(other);
+            replaceAtPredecessors(other);
+        }
+        safeDelete();
+    }
+
+    public void replaceFirstSuccessor(Node oldSuccessor, Node newSuccessor) {
+        if (getNodeClass().replaceFirstSuccessor(this, oldSuccessor, newSuccessor)) {
+            updatePredecessors(oldSuccessor, newSuccessor);
+        }
+    }
+
+    public void replaceFirstInput(Node oldInput, Node newInput) {
+        if (getNodeClass().replaceFirstInput(this, oldInput, newInput)) {
+            updateUsages(oldInput, newInput);
+        }
+    }
+
+    public void clearInputs() {
+        assert assertFalse(isDeleted(), "cannot clear inputs of deleted node");
+
+        for (Node input : inputs()) {
+            removeThisFromUsages(input);
+        }
+        getNodeClass().clearInputs(this);
+    }
+
+    private boolean removeThisFromUsages(Node n) {
+        if (n.usages.remove(this)) {
+            if (n.usages.size() == 0) {
+                graph.usagesDropped.add(n);
+            }
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public void clearSuccessors() {
+        assert assertFalse(isDeleted(), "cannot clear successors of deleted node");
+
+        for (Node successor : successors()) {
+            assert assertTrue(successor.predecessor == this, "wrong predecessor in old successor (%s): %s", successor, successor.predecessor);
+            successor.predecessor = null;
+        }
+        getNodeClass().clearSuccessors(this);
+    }
+
+    private boolean checkDeletion() {
+        assertTrue(usages.isEmpty(), "cannot delete node %s because of usages: %s", this, usages);
+        assertTrue(predecessor == null, "cannot delete node %s because of predecessor: %s", this, predecessor);
+        return true;
+    }
+
+    public void safeDelete() {
+        assert checkDeletion();
+        clearInputs();
+        clearSuccessors();
+        graph.unregister(this);
+        id = DELETED_ID_START - id;
+        assert isDeleted();
+    }
+
+    public final Node copyWithInputs() {
+        Node newNode = clone(graph);
+        NodeClass clazz = getNodeClass();
+        clazz.copyInputs(this, newNode);
+        for (Node input : inputs()) {
+            input.usages.add(newNode);
+        }
+        return newNode;
+    }
+
+    public Node clone(Graph into) {
+        Node newNode = null;
+        try {
+            newNode = (Node) this.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new GraalInternalError(e).addContext(this);
+        }
+        getNodeClass().clearInputs(newNode);
+        getNodeClass().clearSuccessors(newNode);
+        newNode.graph = into;
+        newNode.typeCacheNext = null;
+        newNode.id = INITIAL_ID;
+        into.register(newNode);
+        newNode.usages = new NodeUsagesList();
+        newNode.predecessor = null;
+        newNode.modCount = 0;
+        return newNode;
+    }
+
+    public boolean verify() {
+        assertTrue(isAlive(), "cannot verify inactive nodes (id=%d)", id);
+        assertTrue(graph() != null, "null graph");
+        for (Node input : inputs()) {
+            assertTrue(input.usages().contains(this), "missing usage in input %s", input);
+            assertTrue(input.graph() == graph(), "mismatching graph in input %s", input);
+        }
+        for (Node successor : successors()) {
+            assertTrue(successor.predecessor() == this, "missing predecessor in %s (actual: %s)", successor, successor.predecessor());
+            assertTrue(successor.graph() == graph(), "mismatching graph in successor %s", successor);
+        }
+        for (Node usage : usages()) {
+            assertFalse(usage.isDeleted(), "usage must never be deleted");
+            assertTrue(usage.inputs().contains(this), "missing input in usage %s", usage);
+        }
+        if (predecessor != null) {
+            assertFalse(predecessor.isDeleted(), "predecessor must never be deleted");
+            assertTrue(predecessor.successors().contains(this), "missing successor in predecessor %s", predecessor);
+        }
+        return true;
+    }
+
+    public boolean assertTrue(boolean condition, String message, Object... args) {
+        if (condition) {
+            return true;
+        } else {
+            throw new VerificationError(message, args).addContext(this);
+        }
+    }
+
+    public boolean assertFalse(boolean condition, String message, Object... args) {
+        if (condition) {
+            throw new VerificationError(message, args).addContext(this);
+        } else {
+            return true;
+        }
+    }
+
+    public Iterable<? extends Node> cfgPredecessors() {
+        if (predecessor == null) {
+            return Collections.emptySet();
+        } else {
+            return Collections.singleton(predecessor);
+        }
+    }
+
+    /**
+     * Returns an iterator that will provide all control-flow successors of this node. Normally this will be the contents of all fields marked as NodeSuccessor,
+     * but some node classes (like EndNode) may return different nodes.
+     * Note that the iterator may generate null values if the fields contain them.
+     */
+    public Iterable<? extends Node> cfgSuccessors() {
+        return successors();
+    }
+
+    /**
+     * hashCode and equals should always rely on object identity alone, thus hashCode and equals are final.
+     */
+    @Override
+    public final int hashCode() {
+        return super.hashCode();
+    }
+
+    /**
+     * hashCode and equals should always rely on object identity alone, thus hashCode and equals are final.
+     */
+    @Override
+    public final boolean equals(Object obj) {
+        return super.equals(obj);
+    }
+
+    /**
+     * Provides a {@link Map} of properties of this node for use in debugging (e.g., to view in the ideal graph
+     * visualizer). Subclasses overriding this method should add to the map returned by their superclass.
+     */
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> map = new HashMap<>();
+        map.put("usageCount", usages.size());
+        map.put("predecessorCount", predecessor == null ? 0 : 1);
+        getNodeClass().getDebugProperties(this, map);
+        return map;
+    }
+
+    /**
+     * This method is a shortcut for {@link #toString(Verbosity)} with {@link Verbosity#Short}.
+     */
+    @Override
+    public final String toString() {
+        return toString(Verbosity.Short);
+    }
+
+    public enum Verbosity {
+        /**
+         * Only the id of the node.
+         */
+        Id,
+        /**
+         * Only the name of the node, which may contain some more information for certain node types (constants, ...).
+         */
+        Name,
+        /**
+         * {@link #Id} + {@link #Name}.
+         */
+        Short,
+        /**
+         * Defaults to {@link #Short} and may be enhanced by subclasses.
+         */
+        Long,
+        /**
+         * For use by a custom formatting facility in an IDE.
+         */
+        Debugger,
+        /**
+         * All the other information plus all debug properties of the node.
+         */
+        All
+    }
+
+    /**
+     * Creates a String representation for this node with a given {@link Verbosity}.
+     */
+    public String toString(Verbosity verbosity) {
+        switch (verbosity) {
+            case Id:
+                return Integer.toString(id);
+            case Name:
+                return getNodeClass().shortName();
+            case Short:
+                return toString(Verbosity.Id) + "|" + toString(Verbosity.Name);
+            case Long:
+                return toString(Verbosity.Short);
+            case Debugger:
+            case All: {
+                StringBuilder str = new StringBuilder();
+                str.append(toString(Verbosity.Short)).append(" { ");
+                for (Map.Entry<Object, Object> entry : getDebugProperties().entrySet()) {
+                    str.append(entry.getKey()).append("=").append(entry.getValue()).append(", ");
+                }
+                str.append(" }");
+                return str.toString();
+            }
+            default:
+                throw new RuntimeException("unknown verbosity: " + verbosity);
+        }
+    }
+
+    @Override
+    public void formatTo(Formatter formatter, int flags, int width, int precision) {
+        if ((flags & FormattableFlags.ALTERNATE) == FormattableFlags.ALTERNATE) {
+            formatter.format("%s", toString(Verbosity.Id));
+        } else if ((flags & FormattableFlags.UPPERCASE) == FormattableFlags.UPPERCASE) {
+            formatter.format("%s", toString(Verbosity.Long));
+        } else {
+            formatter.format("%s", toString(Verbosity.Short));
+        }
+
+        boolean neighborsAlternate = ((flags & FormattableFlags.LEFT_JUSTIFY) == FormattableFlags.LEFT_JUSTIFY);
+        int neighborsFlags = (neighborsAlternate ? FormattableFlags.ALTERNATE | FormattableFlags.LEFT_JUSTIFY : 0);
+        if (width > 0) {
+            if (this.predecessor != null) {
+                formatter.format(" pred={");
+                this.predecessor.formatTo(formatter, neighborsFlags, width - 1, 0);
+                formatter.format("}");
+            }
+
+            NodeClassIterator inputIter = inputs().iterator();
+            while (inputIter.hasNext()) {
+                Position position = inputIter.nextPosition();
+                Node input = getNodeClass().get(this, position);
+                if (input != null) {
+                    formatter.format(" ");
+                    formatter.format(getNodeClass().getName(position));
+                    formatter.format("={");
+                    input.formatTo(formatter, neighborsFlags, width - 1, 0);
+                    formatter.format("}");
+                }
+            }
+        }
+
+        if (precision > 0) {
+            if (this.usages.size() > 0) {
+                formatter.format(" usages={");
+                int z = 0;
+                for (Node usage : this.usages) {
+                    if (z != 0) {
+                        formatter.format(", ");
+                    }
+                    usage.formatTo(formatter, neighborsFlags, 0, precision - 1);
+                    ++z;
+                }
+                formatter.format("}");
+            }
+
+            NodeClassIterator succIter = successors().iterator();
+            while (succIter.hasNext()) {
+                Position position = succIter.nextPosition();
+                Node successor = getNodeClass().get(this, position);
+                if (successor != null) {
+                    formatter.format(" ");
+                    formatter.format(getNodeClass().getName(position));
+                    formatter.format("={");
+                    successor.formatTo(formatter, neighborsFlags, 0, precision - 1);
+                    formatter.format("}");
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeBitMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+
+
+public final class NodeBitMap implements Iterable<Node>{
+
+    private final BitMap bitMap;
+    private final Graph graph;
+
+    public NodeBitMap(Graph graph) {
+        this.graph = graph;
+        bitMap = new BitMap(graph.nodeIdCount());
+    }
+
+    public Graph graph() {
+        return graph;
+    }
+
+    public boolean setIntersect(NodeBitMap other) {
+        return bitMap.setIntersect(other.bitMap);
+    }
+
+    public void setUnion(NodeBitMap other) {
+        bitMap.setUnion(other.bitMap);
+    }
+
+    public void negate() {
+        grow();
+        bitMap.negate();
+    }
+
+    public boolean isNotNewMarked(Node node) {
+        return !isNew(node) && isMarked(node);
+    }
+
+    public boolean isNotNewNotMarked(Node node) {
+        return !isNew(node) && !isMarked(node);
+    }
+
+    public boolean isMarked(Node node) {
+        check(node);
+        return bitMap.get(node.id());
+    }
+
+    public boolean isNew(Node node) {
+        return node.id() >= bitMap.size();
+    }
+
+    public void mark(Node node) {
+        check(node);
+        bitMap.set(node.id());
+    }
+
+    public void clear(Node node) {
+        check(node);
+        bitMap.clear(node.id());
+    }
+
+    public void clearAll() {
+        bitMap.clearAll();
+    }
+
+    public void grow(Node node) {
+        bitMap.grow(node.id() + 1);
+    }
+
+    public void grow() {
+        bitMap.grow(graph.nodeIdCount());
+    }
+
+    private void check(Node node) {
+        assert node.graph() == graph : "this node is not part of the graph";
+        assert !isNew(node) : "this node (" + node.id() + ") was added to the graph after creating the node bitmap (" + bitMap.length() + ")";
+        assert node.isAlive() : "node " + node + " is deleted!";
+    }
+
+    @Override
+    public String toString() {
+        return bitMap.toBinaryString();
+    }
+
+    public <T extends Node> void markAll(Collection<T> nodes) {
+        for (Node node : nodes) {
+            mark(node);
+        }
+    }
+
+    private static class MarkedNodeIterator implements Iterator<Node> {
+        private final NodeBitMap visited;
+        private Iterator<Node> nodes;
+        private Node nextNode;
+
+        public MarkedNodeIterator(NodeBitMap visited, Iterator<Node> nodes) {
+            this.visited = visited;
+            this.nodes = nodes;
+            forward();
+        }
+
+        private void forward() {
+            do {
+                if (!nodes.hasNext()) {
+                    nextNode = null;
+                    return;
+                }
+                nextNode = nodes.next();
+                if (visited.isNew(nextNode)) {
+                    nextNode = null;
+                    return;
+                }
+            } while (!visited.isMarked(nextNode));
+        }
+
+        @Override
+        public boolean hasNext() {
+            return nextNode != null;
+        }
+
+        @Override
+        public Node next() {
+            try {
+                return nextNode;
+            } finally {
+                forward();
+            }
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+
+    }
+
+    @Override
+    public Iterator<Node> iterator() {
+        return new MarkedNodeIterator(NodeBitMap.this, graph().getNodes().iterator());
+    }
+
+    public int cardinality() {
+        return bitMap.cardinality();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,949 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.*;
+import java.util.Map.*;
+import java.util.concurrent.ConcurrentHashMap;
+
+import com.oracle.graal.graph.Node.Data;
+
+import sun.misc.Unsafe;
+
+public class NodeClass {
+
+    public static final int NOT_ITERABLE = -1;
+
+    /**
+     * Interface used by {@link NodeClass#rescanAllFieldOffsets(CalcOffset)} to determine the offset (in bytes) of a field.
+     */
+    public interface CalcOffset {
+        long getOffset(Field field);
+    }
+
+    private static final Class< ? > NODE_CLASS = Node.class;
+    private static final Class< ? > INPUT_LIST_CLASS = NodeInputList.class;
+    private static final Class< ? > SUCCESSOR_LIST_CLASS = NodeSuccessorList.class;
+
+    private static final Unsafe unsafe = getUnsafe();
+
+    private static Unsafe getUnsafe() {
+        try {
+            // this will only fail if graal is not part of the boot class path
+            return Unsafe.getUnsafe();
+        } catch (SecurityException e) {
+            // nothing to do
+        }
+        try {
+            Field theUnsafeInstance = Unsafe.class.getDeclaredField("theUnsafe");
+            theUnsafeInstance.setAccessible(true);
+            return (Unsafe) theUnsafeInstance.get(Unsafe.class);
+        } catch (Exception e) {
+            // currently we rely on being able to use Unsafe...
+            throw new RuntimeException("exception while trying to get Unsafe.theUnsafe via reflection:", e);
+        }
+    }
+
+    private static final Map<Class< ? >, NodeClass> nodeClasses = new ConcurrentHashMap<>();
+    private static int nextIterableId = 0;
+
+    private final Class< ? > clazz;
+    private final int directInputCount;
+    private final long[] inputOffsets;
+    private final Class<?>[] inputTypes;
+    private final String[] inputNames;
+    private final int directSuccessorCount;
+    private final long[] successorOffsets;
+    private final Class<?>[] successorTypes;
+    private final String[] successorNames;
+    private final long[] dataOffsets;
+    private final Class<?>[] dataTypes;
+    private final String[] dataNames;
+    private final boolean canGVN;
+    private final int startGVNNumber;
+    private final String shortName;
+    private final int iterableId;
+    private final boolean hasOutgoingEdges;
+
+    static class DefaultCalcOffset implements CalcOffset {
+        @Override
+        public long getOffset(Field field) {
+            return unsafe.objectFieldOffset(field);
+        }
+    }
+
+    public NodeClass(Class< ? > clazz) {
+        assert NODE_CLASS.isAssignableFrom(clazz);
+        this.clazz = clazz;
+
+        FieldScanner scanner = new FieldScanner(new DefaultCalcOffset());
+        scanner.scan(clazz);
+
+        directInputCount = scanner.inputOffsets.size();
+        inputOffsets = sortedLongCopy(scanner.inputOffsets, scanner.inputListOffsets);
+        directSuccessorCount = scanner.successorOffsets.size();
+        successorOffsets = sortedLongCopy(scanner.successorOffsets, scanner.successorListOffsets);
+        dataOffsets = new long[scanner.dataOffsets.size()];
+        for (int i = 0; i < scanner.dataOffsets.size(); ++i) {
+            dataOffsets[i] = scanner.dataOffsets.get(i);
+        }
+        dataTypes = scanner.dataTypes.toArray(new Class[0]);
+        dataNames = scanner.dataNames.toArray(new String[0]);
+        inputTypes = arrayUsingSortedOffsets(scanner.inputTypesMap, inputOffsets, new Class<?>[inputOffsets.length]);
+        inputNames = arrayUsingSortedOffsets(scanner.inputNamesMap, inputOffsets, new String[inputOffsets.length]);
+        successorTypes = arrayUsingSortedOffsets(scanner.successorTypesMap, successorOffsets, new Class<?>[successorOffsets.length]);
+        successorNames = arrayUsingSortedOffsets(scanner.successorNamesMap, successorOffsets, new String[successorOffsets.length]);
+
+        canGVN = Node.ValueNumberable.class.isAssignableFrom(clazz);
+        startGVNNumber = clazz.hashCode();
+
+        String newShortName = clazz.getSimpleName();
+        if (newShortName.endsWith("Node") && !newShortName.equals("StartNode") && !newShortName.equals("EndNode")) {
+            newShortName = newShortName.substring(0, newShortName.length() - 4);
+        }
+        NodeInfo info = clazz.getAnnotation(NodeInfo.class);
+        if (info != null) {
+            if (!info.shortName().isEmpty()) {
+                newShortName = info.shortName();
+            }
+        }
+        this.shortName = newShortName;
+        if (Node.IterableNodeType.class.isAssignableFrom(clazz)) {
+            this.iterableId = nextIterableId++;
+            // TODO (lstadler) add type hierarchy - based node iteration
+//            for (NodeClass nodeClass : nodeClasses.values()) {
+//                if (clazz.isAssignableFrom(nodeClass.clazz)) {
+//                    throw new UnsupportedOperationException("iterable non-final Node classes not supported: " + clazz);
+//                }
+//            }
+        } else {
+            this.iterableId = NOT_ITERABLE;
+        }
+        this.hasOutgoingEdges = this.inputOffsets.length > 0 || this.successorOffsets.length > 0;
+    }
+
+    public static void rescanAllFieldOffsets(CalcOffset calc) {
+        for (NodeClass nodeClass : nodeClasses.values()) {
+            nodeClass.rescanFieldOffsets(calc);
+        }
+    }
+
+    private void rescanFieldOffsets(CalcOffset calc) {
+        FieldScanner scanner = new FieldScanner(calc);
+        scanner.scan(clazz);
+        assert directInputCount == scanner.inputOffsets.size();
+        copyInto(inputOffsets, sortedLongCopy(scanner.inputOffsets, scanner.inputListOffsets));
+        assert directSuccessorCount == scanner.successorOffsets.size();
+        copyInto(successorOffsets, sortedLongCopy(scanner.successorOffsets, scanner.successorListOffsets));
+        assert dataOffsets.length == scanner.dataOffsets.size();
+        for (int i = 0; i < scanner.dataOffsets.size(); ++i) {
+            dataOffsets[i] = scanner.dataOffsets.get(i);
+        }
+        copyInto(dataTypes, scanner.dataTypes);
+        copyInto(dataNames, scanner.dataNames);
+
+        copyInto(inputTypes, arrayUsingSortedOffsets(scanner.inputTypesMap, this.inputOffsets, new Class<?>[this.inputOffsets.length]));
+        copyInto(inputNames, arrayUsingSortedOffsets(scanner.inputNamesMap, this.inputOffsets, new String[this.inputOffsets.length]));
+        copyInto(successorTypes, arrayUsingSortedOffsets(scanner.successorTypesMap, this.successorOffsets, new Class<?>[this.successorOffsets.length]));
+        copyInto(successorNames, arrayUsingSortedOffsets(scanner.successorNamesMap, this.successorOffsets, new String[this.successorNames.length]));
+    }
+
+    private static void copyInto(long[] dest, long[] src) {
+        assert dest.length == src.length;
+        for (int i = 0; i < dest.length; i++) {
+            dest[i] = src[i];
+        }
+    }
+
+    private static <T> void copyInto(T[] dest, T[] src) {
+        assert dest.length == src.length;
+        for (int i = 0; i < dest.length; i++) {
+            dest[i] = src[i];
+        }
+    }
+
+    private static <T> void copyInto(T[] dest, List<T> src) {
+        assert dest.length == src.size();
+        for (int i = 0; i < dest.length; i++) {
+            dest[i] = src.get(i);
+        }
+    }
+
+    public boolean hasOutgoingEdges() {
+        return hasOutgoingEdges;
+    }
+
+    public String shortName() {
+        return shortName;
+    }
+
+    public int iterableId() {
+        return iterableId;
+    }
+
+    public boolean valueNumberable() {
+        return canGVN;
+    }
+
+    private static synchronized NodeClass getSynchronized(Class< ? > c) {
+        NodeClass clazz = nodeClasses.get(c);
+        if (clazz == null) {
+            clazz = new NodeClass(c);
+            nodeClasses.put(c, clazz);
+        }
+        return clazz;
+    }
+
+    public static final NodeClass get(Class< ? > c) {
+        NodeClass clazz = nodeClasses.get(c);
+        return clazz == null ? getSynchronized(c) : clazz;
+    }
+
+    public static int cacheSize() {
+        return nextIterableId;
+    }
+
+    private static class FieldScanner {
+        public final ArrayList<Long> inputOffsets = new ArrayList<>();
+        public final ArrayList<Long> inputListOffsets = new ArrayList<>();
+        public final Map<Long, Class< ? >> inputTypesMap = new HashMap<>();
+        public final Map<Long, String> inputNamesMap = new HashMap<>();
+        public final ArrayList<Long> successorOffsets = new ArrayList<>();
+        public final ArrayList<Long> successorListOffsets = new ArrayList<>();
+        public final Map<Long, Class< ? >> successorTypesMap = new HashMap<>();
+        public final Map<Long, String> successorNamesMap = new HashMap<>();
+        public final ArrayList<Long> dataOffsets = new ArrayList<>();
+        public final ArrayList<Class< ? >> dataTypes = new ArrayList<>();
+        public final ArrayList<String> dataNames = new ArrayList<>();
+        public final CalcOffset calc;
+
+        public FieldScanner(CalcOffset calc) {
+            this.calc = calc;
+        }
+
+        public void scan(Class< ? > clazz) {
+            Class< ? > currentClazz = clazz;
+            do {
+                for (Field field : currentClazz.getDeclaredFields()) {
+                    if (!Modifier.isStatic(field.getModifiers())) {
+                        Class< ? > type = field.getType();
+                        long offset = calc.getOffset(field);
+                        String name = field.getName();
+                        if (field.isAnnotationPresent(Node.Input.class)) {
+                            assert !field.isAnnotationPresent(Node.Successor.class) : "field cannot be both input and successor";
+                            if (INPUT_LIST_CLASS.isAssignableFrom(type)) {
+                                inputListOffsets.add(offset);
+                            } else {
+                                assert NODE_CLASS.isAssignableFrom(type) : "invalid input type: " + type;
+                                inputOffsets.add(offset);
+                                inputTypesMap.put(offset, type);
+                            }
+                            if (field.getAnnotation(Node.Input.class).notDataflow()) {
+                                inputNamesMap.put(offset, name + "#NDF");
+                            } else {
+                                inputNamesMap.put(offset, name);
+                            }
+                        } else if (field.isAnnotationPresent(Node.Successor.class)) {
+                            if (SUCCESSOR_LIST_CLASS.isAssignableFrom(type)) {
+                                successorListOffsets.add(offset);
+                            } else {
+                                assert NODE_CLASS.isAssignableFrom(type) : "invalid successor type: " + type;
+                                successorOffsets.add(offset);
+                                successorTypesMap.put(offset, type);
+                            }
+                            successorNamesMap.put(offset, name);
+                        } else if (field.isAnnotationPresent(Node.Data.class)) {
+                            dataOffsets.add(offset);
+                            dataTypes.add(type);
+                            dataNames.add(name);
+                        } else {
+                            assert !NODE_CLASS.isAssignableFrom(type) || name.equals("Null") : "suspicious node field: " + field;
+                            assert !INPUT_LIST_CLASS.isAssignableFrom(type) : "suspicious node input list field: " + field;
+                            assert !SUCCESSOR_LIST_CLASS.isAssignableFrom(type) : "suspicious node successor list field: " + field;
+                        }
+                    }
+                }
+                currentClazz = currentClazz.getSuperclass();
+            } while (currentClazz != Node.class);
+        }
+    }
+
+    private static <T> T[] arrayUsingSortedOffsets(Map<Long, T> map, long[] sortedOffsets, T[] result) {
+        for (int i = 0; i < sortedOffsets.length; i++) {
+            result[i] = map.get(sortedOffsets[i]);
+        }
+        return result;
+    }
+
+    private static long[] sortedLongCopy(ArrayList<Long> list1, ArrayList<Long> list2) {
+        Collections.sort(list1);
+        Collections.sort(list2);
+        long[] result = new long[list1.size() + list2.size()];
+        for (int i = 0; i < list1.size(); i++) {
+            result[i] = list1.get(i);
+        }
+        for (int i = 0; i < list2.size(); i++) {
+            result[list1.size() + i] = list2.get(i);
+        }
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder str = new StringBuilder();
+        str.append("NodeClass ").append(clazz.getSimpleName()).append(" [");
+        for (int i = 0; i < inputOffsets.length; i++) {
+            str.append(i == 0 ? "" : ", ").append(inputOffsets[i]);
+        }
+        str.append("] [");
+        for (int i = 0; i < successorOffsets.length; i++) {
+            str.append(i == 0 ? "" : ", ").append(successorOffsets[i]);
+        }
+        str.append("] [");
+        for (int i = 0; i < dataOffsets.length; i++) {
+            str.append(i == 0 ? "" : ", ").append(dataOffsets[i]);
+        }
+        str.append("]");
+        return str.toString();
+    }
+
+    public static final class Position {
+        public final boolean input;
+        public final int index;
+        public final int subIndex;
+
+        public Position(boolean input, int index, int subIndex) {
+            this.input = input;
+            this.index = index;
+            this.subIndex = subIndex;
+        }
+
+        @Override
+        public String toString() {
+            return (input ? "input " : "successor ") + index + "/" + subIndex;
+        }
+
+        public Node get(Node node) {
+            return node.getNodeClass().get(node, this);
+        }
+
+        public void set(Node node, Node value) {
+            node.getNodeClass().set(node, this, value);
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + index;
+            result = prime * result + (input ? 1231 : 1237);
+            result = prime * result + subIndex;
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            Position other = (Position) obj;
+            if (index != other.index) {
+                return false;
+            }
+            if (input != other.input) {
+                return false;
+            }
+            if (subIndex != other.subIndex) {
+                return false;
+            }
+            return true;
+        }
+    }
+
+    private static Node getNode(Node node, long offset) {
+        return (Node) unsafe.getObject(node, offset);
+    }
+
+    @SuppressWarnings("unchecked")
+    private static NodeList<Node> getNodeList(Node node, long offset) {
+        return (NodeList<Node>) unsafe.getObject(node, offset);
+    }
+
+    private static void putNode(Node node, long offset, Node value) {
+        unsafe.putObject(node, offset, value);
+    }
+
+    private static void putNodeList(Node node, long offset, NodeList value) {
+        unsafe.putObject(node, offset, value);
+    }
+
+    /**
+     * An iterator that will iterate over the fields given in {@link offsets}.
+     * The first {@ directCount} offsets are treated as fields of type {@link Node}, while the rest of the fields are treated as {@link NodeList}s.
+     * All elements of these NodeLists will be visited by the iterator as well.
+     * This iterator can be used to iterate over the inputs or successors of a node.
+     *
+     * An iterator of this type will not return null values, unless the field values are modified concurrently.
+     * Concurrent modifications are detected by an assertion on a best-effort basis.
+     */
+    public static final class NodeClassIterator implements Iterator<Node> {
+
+        private final Node node;
+        private final int modCount;
+        private final int directCount;
+        private final long[] offsets;
+        private int index;
+        private int subIndex;
+
+        /**
+         * Creates an iterator that will iterate over fields in the given node.
+         * @param node the node which contains the fields.
+         * @param offsets the offsets of the fields.
+         * @param directCount the number of fields that should be treated as fields of type {@link Node}, the rest are treated as {@link NodeList}s.
+         */
+        private NodeClassIterator(Node node, long[] offsets, int directCount) {
+            this.node = node;
+            this.modCount = node.modCount();
+            this.offsets = offsets;
+            this.directCount = directCount;
+            index = NOT_ITERABLE;
+            subIndex = 0;
+            forward();
+        }
+
+        private void forward() {
+            if (index < directCount) {
+                index++;
+                while (index < directCount) {
+                    Node element = getNode(node, offsets[index]);
+                    if (element != null) {
+                        return;
+                    }
+                    index++;
+                }
+            } else {
+                subIndex++;
+            }
+            while (index < offsets.length) {
+                NodeList<Node> list = getNodeList(node, offsets[index]);
+                while (subIndex < list.size()) {
+                    if (list.get(subIndex) != null) {
+                        return;
+                    }
+                    subIndex++;
+                }
+                subIndex = 0;
+                index++;
+            }
+        }
+
+        private Node nextElement() {
+            if (index < directCount) {
+                return getNode(node, offsets[index]);
+            } else  if (index < offsets.length) {
+                NodeList<Node> list = getNodeList(node, offsets[index]);
+                return list.get(subIndex);
+            }
+            return null;
+        }
+
+        @Override
+        public boolean hasNext() {
+            try {
+                return index < offsets.length;
+            } finally {
+                assert modCount == node.modCount() : "must not be modified";
+            }
+        }
+
+        @Override
+        public Node next() {
+            try {
+                return nextElement();
+            } finally {
+                forward();
+                assert modCount == node.modCount();
+            }
+        }
+
+        public Position nextPosition() {
+            try {
+                if (index < directCount) {
+                    return new Position(offsets == node.getNodeClass().inputOffsets, index, NOT_ITERABLE);
+                } else {
+                    return new Position(offsets == node.getNodeClass().inputOffsets, index, subIndex);
+                }
+            } finally {
+                forward();
+                assert modCount == node.modCount();
+            }
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    public int valueNumber(Node n) {
+        int number = 0;
+        if (canGVN) {
+            number = startGVNNumber;
+            for (int i = 0; i < dataOffsets.length; ++i) {
+                Class<?> type = dataTypes[i];
+                if (type.isPrimitive()) {
+                    if (type == Integer.TYPE) {
+                        int intValue = unsafe.getInt(n, dataOffsets[i]);
+                        number += intValue;
+                    } else if (type == Boolean.TYPE) {
+                        boolean booleanValue = unsafe.getBoolean(n, dataOffsets[i]);
+                        if (booleanValue) {
+                            number += 7;
+                        }
+                    } else {
+                        assert false;
+                    }
+                } else {
+                    Object o = unsafe.getObject(n, dataOffsets[i]);
+                    if (o != null) {
+                        number += o.hashCode();
+                    }
+                }
+                number *= 13;
+            }
+        }
+        return number;
+    }
+
+    /**
+     * Populates a given map with the names and values of all fields marked with @{@link Data}.
+     * @param node the node from which to take the values.
+     * @param properties a map that will be populated.
+     */
+    public void getDebugProperties(Node node, Map<Object, Object> properties) {
+        for (int i = 0; i < dataOffsets.length; ++i) {
+            Class<?> type = dataTypes[i];
+            Object value = null;
+            if (type.isPrimitive()) {
+                if (type == Integer.TYPE) {
+                    value = unsafe.getInt(node, dataOffsets[i]);
+                } else if (type == Boolean.TYPE) {
+                    value = unsafe.getBoolean(node, dataOffsets[i]);
+                } else {
+                    assert false;
+                }
+            } else {
+                value = unsafe.getObject(node, dataOffsets[i]);
+            }
+            properties.put("data." + dataNames[i], value);
+        }
+    }
+
+    public boolean valueEqual(Node a, Node b) {
+        if (!canGVN || a.getNodeClass() != b.getNodeClass()) {
+            return a == b;
+        }
+        for (int i = 0; i < dataOffsets.length; ++i) {
+            Class<?> type = dataTypes[i];
+            if (type.isPrimitive()) {
+                if (type == Integer.TYPE) {
+                    int aInt = unsafe.getInt(a, dataOffsets[i]);
+                    int bInt = unsafe.getInt(b, dataOffsets[i]);
+                    if (aInt != bInt) {
+                        return false;
+                    }
+                } else if (type == Boolean.TYPE) {
+                    boolean aBoolean = unsafe.getBoolean(a, dataOffsets[i]);
+                    boolean bBoolean = unsafe.getBoolean(b, dataOffsets[i]);
+                    if (aBoolean != bBoolean) {
+                        return false;
+                    }
+                } else {
+                    assert false;
+                }
+            } else {
+                Object objectA = unsafe.getObject(a, dataOffsets[i]);
+                Object objectB = unsafe.getObject(b, dataOffsets[i]);
+                if (objectA != objectB) {
+                    if (objectA != null && objectB != null) {
+                        if (!(objectA.equals(objectB))) {
+                            return false;
+                        }
+                    } else {
+                        return false;
+                    }
+                }
+            }
+        }
+        return true;
+    }
+
+    public Node get(Node node, Position pos) {
+        long offset = pos.input ? inputOffsets[pos.index] : successorOffsets[pos.index];
+        if (pos.subIndex == NOT_ITERABLE) {
+            return getNode(node, offset);
+        } else {
+            return getNodeList(node, offset).get(pos.subIndex);
+        }
+    }
+
+    public String getName(Position pos) {
+        return pos.input ? inputNames[pos.index] : successorNames[pos.index];
+    }
+
+    private void set(Node node, Position pos, Node x) {
+        long offset = pos.input ? inputOffsets[pos.index] : successorOffsets[pos.index];
+        if (pos.subIndex == NOT_ITERABLE) {
+            Node old = getNode(node,  offset);
+            assert x == null || (pos.input ? inputTypes : successorTypes)[pos.index].isAssignableFrom(x.getClass()) : this + ".set(node, pos, " + x + ") while type is " + (pos.input ? inputTypes : successorTypes)[pos.index];
+            putNode(node, offset, x);
+            if (pos.input) {
+                node.updateUsages(old, x);
+            } else {
+                node.updatePredecessors(old, x);
+            }
+        } else {
+            NodeList<Node> list = getNodeList(node, offset);
+            if (pos.subIndex < list.size()) {
+                list.set(pos.subIndex, x);
+            } else {
+                while (pos.subIndex < list.size() - 1) {
+                    list.add(null);
+                }
+                list.add(x);
+            }
+        }
+    }
+
+    public NodeInputsIterable getInputIterable(final Node node) {
+        assert clazz.isInstance(node);
+        return new NodeInputsIterable() {
+
+            @Override
+            public NodeClassIterator iterator() {
+                return new NodeClassIterator(node, inputOffsets, directInputCount);
+            }
+
+            @Override
+            public boolean contains(Node other) {
+                return inputContains(node, other);
+            }
+        };
+    }
+
+    public NodeSuccessorsIterable getSuccessorIterable(final Node node) {
+        assert clazz.isInstance(node);
+        return new NodeSuccessorsIterable() {
+            @Override
+            public NodeClassIterator iterator() {
+                return new NodeClassIterator(node, successorOffsets, directSuccessorCount);
+            }
+
+            @Override
+            public boolean contains(Node other) {
+                return successorContains(node, other);
+            }
+        };
+    }
+
+    public boolean replaceFirstInput(Node node, Node old, Node other) {
+        int index = 0;
+        while (index < directInputCount) {
+            Node input = getNode(node, inputOffsets[index]);
+            if (input == old) {
+                assert other == null || inputTypes[index].isAssignableFrom(other.getClass());
+                putNode(node, inputOffsets[index], other);
+                return true;
+            }
+            index++;
+        }
+        while (index < inputOffsets.length) {
+            NodeList<Node> list = getNodeList(node, inputOffsets[index]);
+            assert list != null : clazz;
+            if (list.replaceFirst(old, other)) {
+                return true;
+            }
+            index++;
+        }
+        return false;
+    }
+
+    public boolean replaceFirstSuccessor(Node node, Node old, Node other) {
+        int index = 0;
+        while (index < directSuccessorCount) {
+            Node successor = getNode(node, successorOffsets[index]);
+            if (successor == old) {
+                assert other == null || successorTypes[index].isAssignableFrom(other.getClass()) : successorTypes[index] + " is not compatible with " + other.getClass();
+                putNode(node, successorOffsets[index], other);
+                return true;
+            }
+            index++;
+        }
+        while (index < successorOffsets.length) {
+            NodeList<Node> list = getNodeList(node, successorOffsets[index]);
+            assert list != null : clazz + " " + successorOffsets[index] + " " + node;
+            if (list.replaceFirst(old, other)) {
+                return true;
+            }
+            index++;
+        }
+        return false;
+    }
+
+    /**
+     * Clear all inputs in the given node. This is accomplished by setting input fields to null and replacing input lists with new lists.
+     * (which is important so that this method can be used to clear the inputs of cloned nodes.)
+     * @param node the node to be cleared
+     */
+    public void clearInputs(Node node) {
+        int index = 0;
+        while (index < directInputCount) {
+            putNode(node, inputOffsets[index++], null);
+        }
+        while (index < inputOffsets.length) {
+            long curOffset = inputOffsets[index++];
+            int size = (getNodeList(node, curOffset)).initialSize;
+            // replacing with a new list object is the expected behavior!
+            putNodeList(node, curOffset, new NodeInputList<>(node, size));
+        }
+    }
+
+    /**
+     * Clear all successors in the given node. This is accomplished by setting successor fields to null and replacing successor lists with new lists.
+     * (which is important so that this method can be used to clear the successors of cloned nodes.)
+     * @param node the node to be cleared
+     */
+    public void clearSuccessors(Node node) {
+        int index = 0;
+        while (index < directSuccessorCount) {
+            putNode(node, successorOffsets[index++], null);
+        }
+        while (index < successorOffsets.length) {
+            long curOffset = successorOffsets[index++];
+            int size = getNodeList(node, curOffset).initialSize;
+            // replacing with a new list object is the expected behavior!
+            putNodeList(node, curOffset, new NodeSuccessorList<>(node, size));
+        }
+    }
+
+    /**
+     * Copies the inputs from node to newNode. The nodes are expected to be of the exact same NodeClass type.
+     * @param node the node from which the inputs should be copied.
+     * @param newNode the node to which the inputs should be copied.
+     */
+    public void copyInputs(Node node, Node newNode) {
+        assert node.getClass() == clazz && newNode.getClass() == clazz;
+
+        int index = 0;
+        while (index < directInputCount) {
+            putNode(newNode, inputOffsets[index], getNode(node, inputOffsets[index]));
+            index++;
+        }
+        while (index < inputOffsets.length) {
+            NodeList<Node> list = getNodeList(newNode, inputOffsets[index]);
+            list.copy(getNodeList(node, inputOffsets[index]));
+            index++;
+        }
+    }
+
+    /**
+     * Copies the successors from node to newNode. The nodes are expected to be of the exact same NodeClass type.
+     * @param node the node from which the successors should be copied.
+     * @param newNode the node to which the successors should be copied.
+     */
+    public void copySuccessors(Node node, Node newNode) {
+        assert node.getClass() == clazz && newNode.getClass() == clazz;
+
+        int index = 0;
+        while (index < directSuccessorCount) {
+            putNode(newNode, successorOffsets[index], getNode(node, successorOffsets[index]));
+            index++;
+        }
+        while (index < successorOffsets.length) {
+            NodeList<Node> list = getNodeList(newNode, successorOffsets[index]);
+            list.copy(getNodeList(node, successorOffsets[index]));
+            index++;
+        }
+    }
+
+    public boolean edgesEqual(Node node, Node other) {
+        assert node.getClass() == clazz && other.getClass() == clazz;
+
+        int index = 0;
+        while (index < directInputCount) {
+            if (getNode(other, inputOffsets[index]) != getNode(node, inputOffsets[index])) {
+                return false;
+            }
+            index++;
+        }
+        while (index < inputOffsets.length) {
+            NodeList<Node> list = getNodeList(other, inputOffsets[index]);
+            if (!list.equals(getNodeList(node, inputOffsets[index]))) {
+                return false;
+            }
+            index++;
+        }
+
+        index = 0;
+        while (index < directSuccessorCount) {
+            if (getNode(other, successorOffsets[index]) != getNode(node, successorOffsets[index])) {
+                return false;
+            }
+            index++;
+        }
+        while (index < successorOffsets.length) {
+            NodeList<Node> list = getNodeList(other, successorOffsets[index]);
+            if (!list.equals(getNodeList(node, successorOffsets[index]))) {
+                return false;
+            }
+            index++;
+        }
+        return true;
+    }
+
+    public boolean inputContains(Node node, Node other) {
+        assert node.getClass() == clazz;
+
+        int index = 0;
+        while (index < directInputCount) {
+            if (getNode(node, inputOffsets[index]) == other) {
+                return true;
+            }
+            index++;
+        }
+        while (index < inputOffsets.length) {
+            NodeList<Node> list = getNodeList(node, inputOffsets[index]);
+            if (list.contains(other)) {
+                return true;
+            }
+            index++;
+        }
+        return false;
+    }
+
+    public boolean successorContains(Node node, Node other) {
+        assert node.getClass() == clazz;
+
+        int index = 0;
+        while (index < directSuccessorCount) {
+            if (getNode(node, successorOffsets[index]) == other) {
+                return true;
+            }
+            index++;
+        }
+        while (index < successorOffsets.length) {
+            NodeList<Node> list = getNodeList(node, successorOffsets[index]);
+            if (list.contains(other)) {
+                return true;
+            }
+            index++;
+        }
+        return false;
+    }
+
+    public int directInputCount() {
+        return directInputCount;
+    }
+
+    public int directSuccessorCount() {
+        return directSuccessorCount;
+    }
+
+    static Map<Node, Node> addGraphDuplicate(Graph graph, Iterable<Node> nodes, Map<Node, Node> replacements) {
+        Map<Node, Node> newNodes = new IdentityHashMap<>();
+        // create node duplicates
+        for (Node node : nodes) {
+            if (node != null && !replacements.containsKey(node)) {
+                assert !node.isDeleted() : "trying to duplicate deleted node";
+                Node newNode = node.clone(graph);
+                assert newNode.getClass() == node.getClass();
+                newNodes.put(node, newNode);
+            }
+        }
+        // re-wire inputs
+        for (Entry<Node, Node> entry : newNodes.entrySet()) {
+            Node oldNode = entry.getKey();
+            Node node = entry.getValue();
+            for (NodeClassIterator iter = oldNode.inputs().iterator(); iter.hasNext();) {
+                Position pos = iter.nextPosition();
+                Node input = oldNode.getNodeClass().get(oldNode, pos);
+                Node target = replacements.get(input);
+                if (target == null) {
+                    target = newNodes.get(input);
+                }
+                node.getNodeClass().set(node, pos, target);
+            }
+        }
+        for (Entry<Node, Node> entry : replacements.entrySet()) {
+            Node oldNode = entry.getKey();
+            Node node = entry.getValue();
+            if (oldNode == node) {
+                continue;
+            }
+            for (NodeClassIterator iter = oldNode.inputs().iterator(); iter.hasNext();) {
+                Position pos = iter.nextPosition();
+                Node input = oldNode.getNodeClass().get(oldNode, pos);
+                if (newNodes.containsKey(input)) {
+                    node.getNodeClass().set(node, pos, newNodes.get(input));
+                }
+            }
+        }
+
+        // re-wire successors
+        for (Entry<Node, Node> entry : newNodes.entrySet()) {
+            Node oldNode = entry.getKey();
+            Node node = entry.getValue();
+            for (NodeClassIterator iter = oldNode.successors().iterator(); iter.hasNext();) {
+                Position pos = iter.nextPosition();
+                Node succ = oldNode.getNodeClass().get(oldNode, pos);
+                Node target = replacements.get(succ);
+                if (target == null) {
+                    target = newNodes.get(succ);
+                }
+                node.getNodeClass().set(node, pos, target);
+            }
+        }
+        for (Entry<Node, Node> entry : replacements.entrySet()) {
+            Node oldNode = entry.getKey();
+            Node node = entry.getValue();
+            if (oldNode == node) {
+                continue;
+            }
+            for (NodeClassIterator iter = oldNode.successors().iterator(); iter.hasNext();) {
+                Position pos = iter.nextPosition();
+                Node succ = oldNode.getNodeClass().get(oldNode, pos);
+                if (newNodes.containsKey(succ)) {
+                    node.getNodeClass().set(node, pos, newNodes.get(succ));
+                }
+            }
+        }
+        return newNodes;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeFlood.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.ArrayDeque;
+import java.util.Iterator;
+import java.util.Queue;
+
+
+public class NodeFlood implements Iterable<Node> {
+    private final NodeBitMap visited;
+    private final Queue<Node> worklist;
+
+    public NodeFlood(Graph graph) {
+        visited = graph.createNodeBitMap();
+        worklist = new ArrayDeque<>();
+    }
+
+    public void add(Node node) {
+        if (node != null && !visited.isMarked(node)) {
+            visited.mark(node);
+            worklist.add(node);
+        }
+    }
+
+    public void addAll(Iterable<Node> nodes) {
+        for (Node node : nodes) {
+            this.add(node);
+        }
+    }
+
+    public boolean isMarked(Node node) {
+        return visited.isMarked(node);
+    }
+
+    public boolean isNew(Node node) {
+        return visited.isNew(node);
+    }
+
+    private static class QueueConsumingIterator implements Iterator<Node> {
+        private final Queue<Node> queue;
+
+        public QueueConsumingIterator(Queue<Node> queue) {
+            this.queue = queue;
+        }
+
+        @Override
+        public boolean hasNext() {
+            return !queue.isEmpty();
+        }
+
+        @Override
+        public Node next() {
+            return queue.remove();
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    @Override
+    public Iterator<Node> iterator() {
+        return new QueueConsumingIterator(worklist);
+    }
+
+    private static class UnmarkedNodeIterator implements Iterator<Node> {
+        private final NodeBitMap visited;
+        private Iterator<Node> nodes;
+        private Node nextNode;
+
+        public UnmarkedNodeIterator(NodeBitMap visited, Iterator<Node> nodes) {
+            this.visited = visited;
+            this.nodes = nodes;
+            forward();
+        }
+
+        private void forward() {
+            do {
+                if (!nodes.hasNext()) {
+                    nextNode = null;
+                    return;
+                }
+                nextNode = nodes.next();
+            } while (visited.isMarked(nextNode));
+        }
+
+        @Override
+        public boolean hasNext() {
+            return nextNode != null;
+        }
+
+        @Override
+        public Node next() {
+            try {
+                return nextNode;
+            } finally {
+                forward();
+            }
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    public Iterable<Node> unmarkedNodes() {
+        return new Iterable<Node>() {
+            @Override
+            public Iterator<Node> iterator() {
+                return new UnmarkedNodeIterator(visited, visited.graph().getNodes().iterator());
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInfo.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface NodeInfo {
+    String shortName() default "";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInputList.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.*;
+
+
+public final class NodeInputList<T extends Node> extends NodeList<T> {
+
+    private final Node self;
+
+    public NodeInputList(Node self, int initialSize) {
+        super(initialSize);
+        this.self = self;
+    }
+
+    public NodeInputList(Node self) {
+        this.self = self;
+    }
+
+    public NodeInputList(Node self, T[] elements) {
+        super(elements);
+        assert self.usages() == null;
+        this.self = self;
+    }
+
+    public NodeInputList(Node self, List<? extends T> elements) {
+        super(elements);
+        assert self.usages() == null;
+        this.self = self;
+    }
+
+    @Override
+    protected void update(T oldNode, T newNode) {
+        self.updateUsages(oldNode, newNode);
+    }
+
+    @Override
+    public boolean add(T node) {
+        assert !node.isDeleted();
+        self.incModCount();
+        return super.add(node);
+    }
+
+    @Override
+    public T remove(int index) {
+        self.incModCount();
+        return super.remove(index);
+    }
+
+    @Override
+    public boolean remove(Object node) {
+        self.incModCount();
+        return super.remove(node);
+    }
+
+    @Override
+    public void clear() {
+        self.incModCount();
+        super.clear();
+    }
+
+    @Override
+    void copy(NodeList<T> other) {
+        self.incModCount();
+        super.copy(other);
+    }
+
+    @Override
+    public void setAll(NodeList<T> values) {
+        self.incModCount();
+        super.setAll(values);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeInputsIterable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import com.oracle.graal.graph.NodeClass.NodeClassIterator;
+import com.oracle.graal.graph.iterators.*;
+
+public abstract class NodeInputsIterable extends NodeIterable<Node> {
+    @Override
+    public abstract NodeClassIterator iterator();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeList.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,377 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+import com.oracle.graal.graph.iterators.*;
+
+public abstract class NodeList<T extends Node> extends NodeIterable<T> implements List<T> {
+
+    protected static final Node[] EMPTY_NODE_ARRAY = new Node[0];
+
+    protected Node[] nodes;
+    private int size;
+    private int modCount;
+    protected final int initialSize;
+
+    protected NodeList() {
+        this.nodes = EMPTY_NODE_ARRAY;
+        this.initialSize = 0;
+    }
+
+    protected NodeList(int initialSize) {
+        this.size = initialSize;
+        this.initialSize = initialSize;
+        this.nodes = new Node[initialSize];
+    }
+
+    protected NodeList(T[] elements) {
+        if (elements == null) {
+            this.size = 0;
+            this.nodes = EMPTY_NODE_ARRAY;
+            this.initialSize = 0;
+        } else {
+            this.size = elements.length;
+            this.initialSize = elements.length;
+            this.nodes = new Node[elements.length];
+            for (int i = 0; i < elements.length; i++) {
+                this.nodes[i] = elements[i];
+            }
+        }
+    }
+
+    protected NodeList(List<? extends T> elements) {
+        if (elements == null || elements.isEmpty()) {
+            this.size = 0;
+            this.nodes = EMPTY_NODE_ARRAY;
+            this.initialSize = 0;
+        } else {
+            this.size = elements.size();
+            this.initialSize = elements.size();
+            this.nodes = new Node[elements.size()];
+            for (int i = 0; i < elements.size(); i++) {
+                this.nodes[i] = elements.get(i);
+            }
+        }
+    }
+
+    protected abstract void update(T oldNode, T newNode);
+
+    @Override
+    public final int size() {
+        return size;
+    }
+
+    @Override
+    public final boolean isEmpty() {
+        return size == 0;
+    }
+
+    @Override
+    public boolean isNotEmpty() {
+        return size > 0;
+    }
+
+    @Override
+    public int count() {
+        return size;
+    }
+
+    protected final void incModCount() {
+        modCount++;
+    }
+
+    @Override
+    public boolean add(T node) {
+        incModCount();
+        if (size == nodes.length) {
+            nodes = Arrays.copyOf(nodes, nodes.length * 2 + 1);
+        }
+        nodes[size++] = node;
+        update(null, node);
+        return true;
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public T get(int index) {
+        assert index < size() : index + " < " + size();
+        return (T) nodes[index];
+    }
+
+    public T last() {
+        return get(size() - 1);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public T set(int index, T node) {
+        incModCount();
+        T oldValue = (T) nodes[index];
+        assert index < size();
+        update((T) nodes[index], node);
+        nodes[index] = node;
+        return oldValue;
+    }
+
+    void copy(NodeList<T> other) {
+        incModCount();
+        nodes = Arrays.copyOf(other.nodes, other.size);
+        size = other.size;
+    }
+
+    public boolean equals(NodeList<T> other) {
+        if (size != other.size) {
+            return false;
+        }
+        for (int i = 0; i < size; i++) {
+            if (nodes[i] != other.nodes[i]) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public void clear() {
+        incModCount();
+        for (int i = 0; i < size; i++) {
+            update((T) nodes[i], null);
+        }
+        nodes = EMPTY_NODE_ARRAY;
+        size = 0;
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public boolean remove(Object node) {
+        int i = 0;
+        incModCount();
+        while (i < size && nodes[i] != node) {
+            i++;
+        }
+        if (i < size) {
+            T oldValue = (T) nodes[i];
+            i++;
+            while (i < size) {
+                nodes[i - 1] = nodes[i];
+                i++;
+            }
+            nodes[--size] = null;
+            update(oldValue, null);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public T remove(int index) {
+        T oldValue = (T) nodes[index];
+        int i = index + 1;
+        incModCount();
+        while (i < size) {
+            nodes[i - 1] = nodes[i];
+            i++;
+        }
+        nodes[--size] = null;
+        update(oldValue, null);
+        return oldValue;
+    }
+
+    boolean replaceFirst(Node node, Node other) {
+        for (int i = 0; i < size; i++) {
+            if (nodes[i] == node) {
+                nodes[i] = other;
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public Iterator<T> iterator() {
+        return new Iterator<T>() {
+            private final int expectedModCount = NodeList.this.modCount;
+            private int index = 0;
+
+            @Override
+            public boolean hasNext() {
+                assert expectedModCount == NodeList.this.modCount;
+                return index < NodeList.this.size;
+            }
+
+            @SuppressWarnings("unchecked")
+            @Override
+            public T next() {
+                assert expectedModCount == NodeList.this.modCount;
+                return (T) NodeList.this.nodes[index++];
+            }
+
+            @Override
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    @Override
+    public boolean contains(T other) {
+        for (int i = 0; i < size; i++) {
+            if (nodes[i] == other) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public List<T> snapshot() {
+        return (List<T>) Arrays.asList(Arrays.copyOf(this.nodes, this.size));
+    }
+
+    @SuppressWarnings("unchecked")
+    public void setAll(NodeList<T> values) {
+        incModCount();
+        for (int i = 0; i < size(); i++) {
+            update((T) nodes[i], null);
+        }
+        nodes = Arrays.copyOf(values.nodes, values.size());
+        size = values.size();
+
+        for (int i = 0; i < size(); i++) {
+            update(null, (T) nodes[i]);
+        }
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <A> A[] toArray(A[] template) {
+        return (A[]) Arrays.copyOf(nodes, size, template.getClass());
+    }
+
+    @Override
+    public Object[] toArray() {
+        return Arrays.copyOf(nodes, size);
+    }
+
+    protected void replace(T node, T other) {
+        incModCount();
+        for (int i = 0; i < size(); i++) {
+            if (nodes[i] == node) {
+                nodes[i] = other;
+                update(node, other);
+            }
+        }
+    }
+
+    @Override
+    public int indexOf(Object node) {
+        for (int i = 0; i < size; i++) {
+            if (nodes[i] == node) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+
+    @Override
+    public boolean contains(Object o) {
+        return indexOf(o) != -1;
+    }
+
+    @Override
+    public boolean containsAll(Collection< ? > c) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public boolean addAll(Collection< ? extends T> c) {
+        for (T e : c) {
+            add(e);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean addAll(int index, Collection< ? extends T> c) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public boolean removeAll(Collection< ? > c) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public boolean retainAll(Collection< ? > c) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public void add(int index, T element) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public int lastIndexOf(Object o) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public ListIterator<T> listIterator() {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public ListIterator<T> listIterator(int index) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public List<T> subList(int fromIndex, int toIndex) {
+        throw new UnsupportedOperationException("not implemented");
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append('[');
+        for (int i = 0; i < size; i++) {
+            if (i != 0) {
+                sb.append(", ");
+            }
+            sb.append(nodes[i]);
+        }
+        sb.append(']');
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.AbstractMap.SimpleEntry;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map.Entry;
+
+
+public final class NodeMap<T> {
+    private final Graph graph;
+    private Object[] values;
+    private int size;
+
+    public NodeMap(Graph graph) {
+        this.graph = graph;
+        values = new Object[graph.nodeIdCount()];
+        size = values.length;
+    }
+
+    public NodeMap(NodeMap<T> copyFrom) {
+        this.graph = copyFrom.graph;
+        this.values = Arrays.copyOf(copyFrom.values, copyFrom.values.length);
+        this.size = copyFrom.size;
+    }
+
+    @SuppressWarnings("unchecked")
+    public T get(Node node) {
+        check(node);
+        return (T) values[node.id()];
+    }
+
+    public Graph graph() {
+        return graph;
+    }
+
+    public void set(Node node, T value) {
+        check(node);
+        values[node.id()] = value;
+    }
+
+    public int size() {
+        return size;
+    }
+
+    public boolean isNew(Node node) {
+        return node.id() >= size;
+    }
+
+    public void grow(Node upTo) {
+        if (isNew(upTo)) {
+            size = upTo.id() + 1;
+            if (values.length < size) {
+                values = Arrays.copyOf(values, size + 9); // TODO implement a better growth policy
+            }
+        }
+    }
+
+    private void check(Node node) {
+        assert node.graph() == graph : "this node is not part of the graph";
+        assert !isNew(node) : "this node was added to the graph after creating the node map : " + node;
+    }
+
+    public Iterable<Entry<Node, T>> entries() {
+        return new Iterable<Entry<Node, T>>() {
+            @Override
+            public Iterator<Entry<Node, T>> iterator() {
+                return new Iterator<Entry<Node, T>>() {
+                    int i = 0;
+                    @Override
+                    public boolean hasNext() {
+                        forward();
+                        return i < NodeMap.this.values.length;
+                    }
+
+                    @SuppressWarnings("unchecked")
+                    @Override
+                    public Entry<Node, T> next() {
+                        final int pos = i;
+                        Node key = NodeMap.this.graph.getNode(pos);
+                        T value = (T) NodeMap.this.values[pos];
+                        i++;
+                        forward();
+                        return new SimpleEntry<Node, T>(key, value){
+                            private static final long serialVersionUID = 7813842391085737738L;
+                            @Override
+                            public T setValue(T v) {
+                                T oldv = super.setValue(v);
+                                NodeMap.this.values[pos] = v;
+                                return oldv;
+                            }
+                        };
+                    }
+
+                    @Override
+                    public void remove() {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    private void forward() {
+                        while (i < NodeMap.this.values.length && (NodeMap.this.graph.getNode(i) == null || NodeMap.this.values[i] == null)) {
+                            i++;
+                        }
+                    }
+                };
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeSuccessorList.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+public final class NodeSuccessorList<T extends Node> extends NodeList<T> {
+
+    private final Node self;
+
+    public NodeSuccessorList(Node self, int initialSize) {
+        super(initialSize);
+        this.self = self;
+    }
+
+    protected NodeSuccessorList(Node self) {
+        this.self = self;
+    }
+
+    public NodeSuccessorList(Node self, T[] elements) {
+        super(elements);
+        assert self.usages() == null;
+        this.self = self;
+    }
+
+    @Override
+    protected void update(T oldNode, T newNode) {
+        self.updatePredecessors(oldNode, newNode);
+    }
+
+    @Override
+    public boolean add(T node) {
+        self.incModCount();
+        return super.add(node);
+    }
+
+    @Override
+    public T remove(int index) {
+        self.incModCount();
+        return super.remove(index);
+    }
+
+    @Override
+    public boolean remove(Object node) {
+        self.incModCount();
+        return super.remove(node);
+    }
+
+    @Override
+    public void clear() {
+        self.incModCount();
+        super.clear();
+    }
+
+    @Override
+    void copy(NodeList<T> other) {
+        self.incModCount();
+        super.copy(other);
+    }
+
+    @Override
+    public void setAll(NodeList<T> values) {
+        self.incModCount();
+        super.setAll(values);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeSuccessorsIterable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import com.oracle.graal.graph.NodeClass.NodeClassIterator;
+import com.oracle.graal.graph.iterators.*;
+
+public abstract class NodeSuccessorsIterable extends NodeIterable<Node> {
+    @Override
+    public abstract NodeClassIterator iterator();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeUsagesList.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.*;
+
+import com.oracle.graal.graph.iterators.*;
+
+public final class NodeUsagesList extends NodeIterable<Node> {
+
+    protected static final Node[] EMPTY_NODE_ARRAY = new Node[0];
+
+    protected Node[] nodes = EMPTY_NODE_ARRAY;
+    private int size;
+    private int modCount;
+
+    NodeUsagesList() {
+        this.size = 0;
+        this.nodes = EMPTY_NODE_ARRAY;
+    }
+
+    NodeUsagesList(Node[] nodes) {
+        this.size = nodes.length;
+        this.nodes = nodes;
+    }
+
+    public int size() {
+        return size;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return size == 0;
+    }
+
+    @Override
+    public boolean isNotEmpty() {
+        return size > 0;
+    }
+
+    @Override
+    public int count() {
+        return size;
+    }
+
+    protected void incModCount() {
+        modCount++;
+    }
+
+    public boolean add(Node node) {
+        incModCount();
+        if (size == nodes.length) {
+            nodes = Arrays.copyOf(nodes, nodes.length * 2 + 1);
+        }
+        nodes[size++] = node;
+        return true;
+    }
+
+    void copyAndClear(NodeUsagesList other) {
+        incModCount();
+        other.incModCount();
+        nodes = other.nodes;
+        size = other.size;
+        nodes = EMPTY_NODE_ARRAY;
+        size = 0;
+    }
+
+    public void clear() {
+        incModCount();
+        nodes = EMPTY_NODE_ARRAY;
+        size = 0;
+    }
+
+    boolean remove(Node node) {
+        int i = 0;
+        incModCount();
+        while (i < size && nodes[i] != node) {
+            i++;
+        }
+        if (i < size) {
+            i++;
+            while (i < size) {
+                nodes[i - 1] = nodes[i];
+                i++;
+            }
+            nodes[--size] = null;
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    boolean replaceFirst(Node node, Node other) {
+        for (int i = 0; i < size; i++) {
+            if (nodes[i] == node) {
+                nodes[i] = other;
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public Iterator<Node> iterator() {
+        return new Iterator<Node>() {
+            private final int expectedModCount = NodeUsagesList.this.modCount;
+            private int index = 0;
+
+            @Override
+            public boolean hasNext() {
+                assert expectedModCount == NodeUsagesList.this.modCount;
+                return index < NodeUsagesList.this.size;
+            }
+
+            @Override
+            public Node next() {
+                assert expectedModCount == NodeUsagesList.this.modCount;
+                return NodeUsagesList.this.nodes[index++];
+            }
+
+            @Override
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    @Override
+    public boolean contains(Node other) {
+        for (int i = 0; i < size; i++) {
+            if (nodes[i] == other) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public List<Node> snapshot() {
+        return Arrays.asList(Arrays.copyOf(NodeUsagesList.this.nodes, NodeUsagesList.this.size));
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder str = new StringBuilder();
+        str.append('[');
+        for (int i = 0; i < size; i++) {
+            if (i > 0) {
+                str.append(", ");
+            }
+            str.append(nodes[i]);
+        }
+        str.append(']');
+        return str.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeWorkList.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+import java.util.ArrayDeque;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.Queue;
+
+public class NodeWorkList implements Iterable<Node> {
+    private final NodeBitMap visited;
+    private final NodeBitMap inQueue;
+    private final Queue<Node> worklist;
+    private int iterationLimit = Integer.MAX_VALUE;
+    private Node firstNoChange;
+    private Node lastPull;
+    private Node lastChain;
+
+    public NodeWorkList(Graph graph) {
+        this(graph, false, -1);
+    }
+
+    public NodeWorkList(Graph graph, boolean fill, int iterationLimitPerNode) {
+        visited = graph.createNodeBitMap();
+        inQueue = graph.createNodeBitMap();
+        if (fill) {
+            ArrayDeque<Node> deque = new ArrayDeque<>(graph.getNodeCount());
+            for (Node node : graph.getNodes()) {
+                deque.add(node);
+            }
+            worklist = deque;
+        } else {
+            worklist = new ArrayDeque<>();
+        }
+        if (iterationLimitPerNode > 0) {
+            iterationLimit = iterationLimitPerNode * graph.getNodeCount();
+        }
+    }
+
+    public void addAll(Iterable<? extends Node> nodes) {
+        for (Node node : nodes) {
+            this.add(node);
+        }
+    }
+
+    public void add(Node node) {
+        if (node != null) {
+            if (visited.isNew(node)) {
+                visited.grow(node);
+                inQueue.grow(node);
+            }
+            if (!visited.isMarked(node)) {
+                addAgain(node);
+            }
+        }
+    }
+
+    public void addAgain(Node node) {
+        if (visited.isNew(node)) {
+            visited.grow(node);
+            inQueue.grow(node);
+        }
+        if (node != null && !inQueue.isMarked(node)) {
+            if (lastPull == node) {
+                if (firstNoChange == null) {
+                    firstNoChange = node;
+                    lastChain = node;
+                } else if (node == firstNoChange) {
+                    throw new InfiniteWorkException("ReAdded " + node);
+                } else {
+                    lastChain = node;
+                }
+            } else {
+                firstNoChange = null;
+            }
+            visited.mark(node);
+            inQueue.mark(node);
+            worklist.add(node);
+        }
+    }
+
+    public void clearVisited() {
+        visited.clearAll();
+    }
+
+    public void replaced(Node newNode, Node oldNode) {
+        this.replaced(newNode, oldNode, false);
+    }
+
+    public void replaced(Node newNode, Node oldNode, boolean add) {
+        worklist.remove(oldNode);
+        if (newNode == null) {
+            return;
+        }
+        if (add) {
+            this.add(newNode);
+        }
+        for (Node n : newNode.usages()) {
+            addAgain(n);
+        }
+    }
+
+    public boolean isMarked(Node node) {
+        return visited.isMarked(node);
+    }
+
+    public boolean isNew(Node node) {
+        return visited.isNew(node);
+    }
+
+    public boolean isEmpty() {
+        return worklist.isEmpty();
+    }
+
+    public boolean isInQueue(Node node) {
+        return !inQueue.isNew(node) && inQueue.isMarked(node);
+    }
+
+    private class QueueConsumingIterator implements Iterator<Node> {
+        private final Queue<Node> queue;
+
+        public QueueConsumingIterator(Queue<Node> queue) {
+            this.queue = queue;
+        }
+
+        @Override
+        public boolean hasNext() {
+            dropDeleted();
+            return iterationLimit > 0 && !queue.isEmpty();
+        }
+
+        @Override
+        public Node next() {
+            if (iterationLimit-- <= 0) {
+                throw new NoSuchElementException();
+            }
+            dropDeleted();
+            Node node = queue.remove();
+            if (lastPull != lastChain) {
+                firstNoChange = null;
+            }
+            lastPull = node;
+            inQueue.clear(node);
+            return node;
+        }
+
+        private void dropDeleted() {
+            while (!queue.isEmpty() && queue.peek().isDeleted()) {
+                queue.remove();
+            }
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    @Override
+    public Iterator<Node> iterator() {
+        return new QueueConsumingIterator(worklist);
+    }
+
+    private static class UnmarkedNodeIterator implements Iterator<Node> {
+        private final NodeBitMap visited;
+        private Iterator<Node> nodes;
+        private Node nextNode;
+
+        public UnmarkedNodeIterator(NodeBitMap visited, Iterator<Node> nodes) {
+            this.visited = visited;
+            this.nodes = nodes;
+            forward();
+        }
+
+        private void forward() {
+            do {
+                if (!nodes.hasNext()) {
+                    nextNode = null;
+                    return;
+                }
+                nextNode = nodes.next();
+            } while (visited.isMarked(nextNode));
+        }
+
+        @Override
+        public boolean hasNext() {
+            return nextNode != null;
+        }
+
+        @Override
+        public Node next() {
+            try {
+                return nextNode;
+            } finally {
+                forward();
+            }
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+
+    }
+
+    public Iterable<Node> unmarkedNodes() {
+        return new Iterable<Node>() {
+            @Override
+            public Iterator<Node> iterator() {
+                return new UnmarkedNodeIterator(visited, visited.graph().getNodes().iterator());
+            }
+        };
+    }
+
+    public static class InfiniteWorkException extends RuntimeException {
+        private static final long serialVersionUID = -5319329402219396658L;
+        public InfiniteWorkException() {
+            super();
+        }
+        public InfiniteWorkException(String message) {
+            super(message);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/VerificationError.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph;
+
+
+/**
+ * This error represents a failed verification of a node . It must only be used for conditions that should never occur during normal operation.
+ */
+public class VerificationError extends GraalInternalError {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 8459607567446819822L;
+
+    /**
+     * This constructor creates a {@link VerificationError} with a message assembled via {@link String#format(String, Object...)}.
+     * It always uses the ENGLISH locale in order to always generate the same output.
+     * @param msg the message that will be associated with the error, in String.format syntax
+     * @param args parameters to String.format - parameters that implement {@link Iterable} will be expanded into a [x, x, ...] representation.
+     */
+    public VerificationError(String msg, Object... args) {
+        super(msg, args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/FilteredNodeIterable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.iterators;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+
+public class FilteredNodeIterable<T extends Node> extends NodeIterable<T> {
+    private final NodeIterable<T> nodeIterable;
+    private NodePredicate predicate = NodePredicates.alwaysTrue();
+    private NodePredicate until = NodePredicates.isNull();
+    public FilteredNodeIterable(NodeIterable<T> nodeIterable) {
+        this.nodeIterable = nodeIterable;
+    }
+    public FilteredNodeIterable<T> and(NodePredicate nodePredicate) {
+        this.predicate = this.predicate.and(nodePredicate);
+        return this;
+    }
+    public FilteredNodeIterable<T> or(NodePredicate nodePredicate) {
+        this.predicate = this.predicate.or(nodePredicate);
+        return this;
+    }
+    @Override
+    public NodeIterable<T> until(final T u) {
+        until = until.or(NodePredicates.equals(u));
+        return this;
+    }
+    @Override
+    public NodeIterable<T> until(final Class<? extends T> clazz) {
+        until = until.or(NodePredicates.isA(clazz));
+        return this;
+    }
+    @Override
+    public Iterator<T> iterator() {
+        final Iterator<T> iterator = nodeIterable.iterator();
+        return new PredicatedProxyNodeIterator<>(until, iterator, predicate);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public <F extends T> FilteredNodeIterable<F> filter(Class<F> clazz) {
+        return (FilteredNodeIterable<F>) this.and(NodePredicates.isA(clazz));
+    }
+
+    @Override
+    public FilteredNodeIterable<T> filter(NodePredicate p) {
+        return this.and(p);
+    }
+
+    @Override
+    public FilteredNodeIterable<T> filterInterface(Class< ? > iface) {
+        return this.and(NodePredicates.isAInterface(iface));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.iterators;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+
+public abstract class NodeIterable<T extends Node> implements Iterable<T> {
+    public NodeIterable<T> until(final T u) {
+        return new FilteredNodeIterable<>(this).until(u);
+    }
+    public NodeIterable<T> until(final Class<? extends T> clazz) {
+        return new FilteredNodeIterable<>(this).until(clazz);
+    }
+    @SuppressWarnings("unchecked")
+    public <F extends T> FilteredNodeIterable<F> filter(Class<F> clazz) {
+        return (FilteredNodeIterable<F>) new FilteredNodeIterable<>(this).and(NodePredicates.isA(clazz));
+    }
+    public FilteredNodeIterable<T> filterInterface(Class<?> iface) {
+        return new FilteredNodeIterable<>(this).and(NodePredicates.isAInterface(iface));
+    }
+    public FilteredNodeIterable<T> filter(NodePredicate predicate) {
+        return new FilteredNodeIterable<>(this).and(predicate);
+    }
+    public List<T> snapshot() {
+        ArrayList<T> list = new ArrayList<>();
+        for (T n : this) {
+            list.add(n);
+        }
+        return list;
+    }
+    public T first() {
+        Iterator<T> iterator = iterator();
+        if (iterator.hasNext()) {
+            return iterator.next();
+        }
+        return null;
+    }
+    public int count() {
+        int count = 0;
+        Iterator<T> iterator = iterator();
+        while (iterator.hasNext()) {
+            iterator.next();
+            count++;
+        }
+        return count;
+    }
+    public boolean isEmpty() {
+        return count() == 0;
+    }
+    public boolean isNotEmpty() {
+        return iterator().hasNext();
+    }
+    public boolean contains(T node) {
+        return this.filter(NodePredicates.equals(node)).isNotEmpty();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.iterators;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+
+public abstract class NodeIterator<T extends Node> implements Iterator<T>{
+    protected T current;
+    protected abstract void forward();
+    @Override
+    public boolean hasNext() {
+        forward();
+        return current != null;
+    }
+    @Override
+    public T next() {
+        forward();
+        T ret = current;
+        if (current == null) {
+            throw new NoSuchElementException();
+        }
+        current = null;
+        return ret;
+    }
+    @Override
+    public void remove() {
+        throw new UnsupportedOperationException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicate.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.iterators;
+
+import com.oracle.graal.graph.*;
+
+public abstract class NodePredicate {
+
+    public abstract boolean apply(Node n);
+
+    public NodePredicate and(NodePredicate np) {
+        return NodePredicates.and(this, np);
+    }
+
+    public NodePredicate or(NodePredicate np) {
+        return NodePredicates.or(this, np);
+    }
+
+    public NodePredicate negate() {
+        return NodePredicates.not(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicates.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.iterators;
+
+import com.oracle.graal.graph.*;
+
+public abstract class NodePredicates {
+    private static final TautologyPredicate TAUTOLOGY = new TautologyPredicate();
+    private static final FalsePredicate FALSE = new FalsePredicate();
+    private static final IsNullPredicate IS_NULL = new IsNullPredicate();
+    private static final IsNotNullPredicate IS_NOT_NULL = new IsNotNullPredicate();
+
+    public static NodePredicate alwaysTrue() {
+        return TAUTOLOGY;
+    }
+
+    public static NodePredicate alwaysFalse() {
+        return FALSE;
+    }
+
+    public static NodePredicate isNull() {
+        return IS_NULL;
+    }
+
+    public static NodePredicate isNotNull() {
+        return IS_NOT_NULL;
+    }
+
+    public static NodePredicate equals(Node n) {
+        return new EqualsPredicate(n);
+    }
+
+    public static NodePredicate not(NodePredicate a) {
+        if (a == TAUTOLOGY) {
+            return FALSE;
+        }
+        if (a == FALSE) {
+            return TAUTOLOGY;
+        }
+        if (a == IS_NULL) {
+            return IS_NOT_NULL;
+        }
+        if (a == IS_NOT_NULL) {
+            return IS_NULL;
+        }
+        if (a instanceof NotPredicate) {
+            return ((NotPredicate) a).a;
+        }
+        if (a instanceof PositiveTypePredicate) {
+            return new NegativeTypePredicate((PositiveTypePredicate) a);
+        }
+        if (a instanceof NegativeTypePredicate) {
+            return new PositiveTypePredicate((NegativeTypePredicate) a);
+        }
+        if (a instanceof EqualsPredicate) {
+            return new NotEqualsPredicate(((EqualsPredicate) a).u);
+        }
+        if (a instanceof NotEqualsPredicate) {
+            return new EqualsPredicate(((NotEqualsPredicate) a).u);
+        }
+        return new NotPredicate(a);
+    }
+
+    public static NodePredicate and(NodePredicate a, NodePredicate b) {
+        if (a == TAUTOLOGY) {
+            return b;
+        }
+        if (b == TAUTOLOGY) {
+            return a;
+        }
+        if (a == FALSE || b == FALSE) {
+            return FALSE;
+        }
+        return new AndPredicate(a, b);
+    }
+
+    public static NodePredicate or(NodePredicate a, NodePredicate b) {
+        if (a == FALSE) {
+            return b;
+        }
+        if (b == FALSE) {
+            return a;
+        }
+        if (a == TAUTOLOGY || b == TAUTOLOGY) {
+            return TAUTOLOGY;
+        }
+        return new OrPredicate(a, b);
+    }
+
+    public static NegativeTypePredicate isNotA(Class<? extends Node> clazz) {
+        return new NegativeTypePredicate(clazz);
+    }
+
+    public static PositiveTypePredicate isA(Class<? extends Node> clazz) {
+        return new PositiveTypePredicate(clazz);
+    }
+
+    public static NodePredicate isAInterface(Class<?> iface) {
+        assert iface.isInterface();
+        return new PositiveTypePredicate(iface);
+    }
+
+    public static NodePredicate isNotAInterface(Class<?> iface) {
+        assert iface.isInterface();
+        return new NegativeTypePredicate(iface);
+    }
+
+    private static final class TautologyPredicate extends NodePredicate {
+        @Override
+        public boolean apply(Node n) {
+            return true;
+        }
+    }
+
+    private static final class FalsePredicate extends NodePredicate {
+        @Override
+        public boolean apply(Node n) {
+            return false;
+        }
+    }
+
+    private static final class AndPredicate extends NodePredicate {
+        private final NodePredicate a;
+        private final NodePredicate b;
+        private AndPredicate(NodePredicate a, NodePredicate b) {
+            this.a = a;
+            this.b = b;
+        }
+        @Override
+        public boolean apply(Node n) {
+            return a.apply(n) && b.apply(n);
+        }
+    }
+
+    private static final class NotPredicate extends NodePredicate {
+        private final NodePredicate a;
+        private NotPredicate(NodePredicate n) {
+            this.a = n;
+        }
+        @Override
+        public boolean apply(Node n) {
+            return !a.apply(n);
+        }
+    }
+
+    private static final class OrPredicate extends NodePredicate {
+        private final NodePredicate a;
+        private final NodePredicate b;
+        private OrPredicate(NodePredicate a, NodePredicate b) {
+            this.a = a;
+            this.b = b;
+        }
+        @Override
+        public boolean apply(Node n) {
+            return a.apply(n) || b.apply(n);
+        }
+    }
+
+    private static final class IsNullPredicate extends NodePredicate {
+        @Override
+        public boolean apply(Node n) {
+            return n == null;
+        }
+    }
+
+    private static final class IsNotNullPredicate extends NodePredicate {
+        @Override
+        public boolean apply(Node n) {
+            return n != null;
+        }
+    }
+
+    private static final class EqualsPredicate extends NodePredicate {
+        private final Node u;
+        public EqualsPredicate(Node u) {
+            this.u = u;
+        }
+        @Override
+        public boolean apply(Node n) {
+            return u == n;
+        }
+    }
+
+    private static final class NotEqualsPredicate extends NodePredicate {
+        private final Node u;
+        public NotEqualsPredicate(Node u) {
+            this.u = u;
+        }
+        @Override
+        public boolean apply(Node n) {
+            return u != n;
+        }
+    }
+
+    public static final class PositiveTypePredicate extends NodePredicate {
+        private final Class<?> type;
+        private PositiveTypePredicate or;
+        public PositiveTypePredicate(Class<?> type) {
+            this.type = type;
+        }
+        public PositiveTypePredicate(NegativeTypePredicate a) {
+            type = a.type;
+            if (a.nor != null) {
+                or = new PositiveTypePredicate(a.nor);
+            }
+        }
+        @Override
+        public boolean apply(Node n) {
+            return type.isInstance(n) || (or != null && or.apply(n));
+        }
+        public PositiveTypePredicate or(Class<? extends Node> clazz) {
+            if (or == null) {
+                or = new PositiveTypePredicate(clazz);
+            } else {
+                or.or(clazz);
+            }
+            return this;
+        }
+    }
+
+    public static final class NegativeTypePredicate extends NodePredicate {
+        private final Class<?> type;
+        private NegativeTypePredicate nor;
+        public NegativeTypePredicate(Class<?> type) {
+            this.type = type;
+        }
+        public NegativeTypePredicate(PositiveTypePredicate a) {
+            type = a.type;
+            if (a.or != null) {
+                nor = new NegativeTypePredicate(a.or);
+            }
+        }
+        @Override
+        public boolean apply(Node n) {
+            return !type.isInstance(n) && (nor == null || nor.apply(n));
+        }
+        public NegativeTypePredicate nor(Class<? extends Node> clazz) {
+            if (nor == null) {
+                nor = new NegativeTypePredicate(clazz);
+            } else {
+                nor.nor(clazz);
+            }
+            return this;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/iterators/PredicatedProxyNodeIterator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.iterators;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+
+public final class PredicatedProxyNodeIterator<T extends Node> extends NodeIterator<T> {
+    private final Iterator<T> iterator;
+    private final NodePredicate predicate;
+    private final NodePredicate until;
+    public PredicatedProxyNodeIterator(NodePredicate until, Iterator<T> iterator, NodePredicate predicate) {
+        this.until = until;
+        this.iterator = iterator;
+        this.predicate = predicate;
+    }
+    @Override
+    protected void forward() {
+        while ((current == null || !current.isAlive() || !predicate.apply(current)) && iterator.hasNext()) {
+            current = iterator.next();
+        }
+        if (current != null && (!current.isAlive() || !predicate.apply(current) || until.apply(current))) {
+            current = null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/**
+ * This package contains the Node base class and the Graph container class of the Graal IR.
+ */
+package com.oracle.graal.graph;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/test/com/oracle/graal/graph/test/TestNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.test;
+
+import com.oracle.graal.graph.*;
+
+
+public class TestNode extends Node implements Node.IterableNodeType {
+    @Data private String name;
+
+    public TestNode(String name) {
+        this.name = name;
+    }
+
+
+    public String getName() {
+        return name;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.graph/test/com/oracle/graal/graph/test/TypedNodeIteratorTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.graph.test;
+import static org.junit.Assert.*;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.graal.graph.*;
+
+
+
+public class TypedNodeIteratorTest {
+
+    @Test
+    public void singleNodeTest() {
+        Graph graph = new Graph();
+        graph.add(new TestNode("a"));
+        assertTrue(graph.hasNode(TestNode.class));
+        assertEquals("a", toString(graph.getNodes(TestNode.class)));
+    }
+
+    @Test
+    public void deletingNodeTest() {
+        TestNode testNode = new TestNode("a");
+        Graph graph = new Graph();
+        graph.add(testNode);
+        testNode.delete();
+        assertEquals("", toString(graph.getNodes(TestNode.class)));
+    }
+
+    @Test
+    public void deleteAndAddTest() {
+        TestNode testNode = new TestNode("b");
+        Graph graph = new Graph();
+        graph.add(new TestNode("a"));
+        graph.add(testNode);
+        testNode.delete();
+        assertEquals("a", toString(graph.getNodes(TestNode.class)));
+        graph.add(new TestNode("c"));
+        assertEquals("ac", toString(graph.getNodes(TestNode.class)));
+    }
+
+    @Test
+    public void iteratorBehaviorTest() {
+        Graph graph = new Graph();
+        graph.add(new TestNode("a"));
+        Iterator<TestNode> iterator = graph.getNodes(TestNode.class).iterator();
+        assertTrue(iterator.hasNext());
+        assertEquals("a", iterator.next().getName());
+        assertFalse(iterator.hasNext());
+        graph.add(new TestNode("b"));
+        assertTrue(iterator.hasNext());
+        assertEquals("b", iterator.next().getName());
+        assertFalse(iterator.hasNext());
+        TestNode c = new TestNode("c");
+        graph.add(c);
+        assertTrue(iterator.hasNext());
+        c.delete();
+        assertFalse(iterator.hasNext());
+    }
+
+    @Test
+    public void complicatedIterationTest() {
+        Graph graph = new Graph();
+        graph.add(new TestNode("a"));
+        for (TestNode tn : graph.getNodes(TestNode.class)) {
+            String name = tn.getName();
+            for (int i = 0; i < name.length(); ++i) {
+                char c = name.charAt(i);
+                if (c == 'a') {
+                    tn.delete();
+                    graph.add(new TestNode("b"));
+                    graph.add(new TestNode("c"));
+                } else if (c == 'b') {
+                    tn.delete();
+                } else if (c == 'c') {
+                    graph.add(new TestNode("d"));
+                    graph.add(new TestNode("e"));
+                    graph.add(new TestNode("d"));
+                    graph.add(new TestNode("e"));
+                    graph.add(new TestNode("e"));
+                    graph.add(new TestNode("d"));
+                    graph.add(new TestNode("e"));
+                    graph.add(new TestNode("d"));
+                } else if (c == 'd') {
+                    for (TestNode tn2 : graph.getNodes(TestNode.class)) {
+                        if (tn2.getName().equals("e")) {
+                            tn2.delete();
+                        } else if (tn2.getName().equals("c")) {
+                            tn2.delete();
+                        }
+                    }
+                } else if (c == 'e') {
+                    fail("All e nodes must have been deleted by visiting the d node");
+                }
+            }
+        }
+        assertEquals("dddd", toString(graph.getNodes(TestNode.class)));
+    }
+
+    @Test
+    public void addingNodeDuringIterationTest() {
+        Graph graph = new Graph();
+        graph.add(new TestNode("a"));
+        StringBuilder sb = new StringBuilder();
+        int z = 0;
+        for (TestNode tn : graph.getNodes(TestNode.class)) {
+            if (z == 0) {
+                graph.add(new TestNode("b"));
+            }
+            sb.append(tn.getName());
+            z++;
+        }
+        assertEquals(2, z);
+        assertEquals("ab", sb.toString());
+        z = 0;
+        for (TestNode tn : graph.getNodes(TestNode.class)) {
+            if (z == 0) {
+                graph.add(new TestNode("c"));
+            }
+            assertNotNull(tn);
+            z++;
+        }
+        assertEquals(3, z);
+    }
+
+    private String toString(Iterable<TestNode> nodes) {
+        StringBuilder sb = new StringBuilder();
+        for (TestNode tn : nodes) {
+            sb.append(tn.getName());
+        }
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/Compiler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.hotspot.bridge.*;
+import com.oracle.graal.hotspot.ri.*;
+
+public interface Compiler {
+
+    CompilerToVM getVMEntries();
+    VMToCompiler getVMExits();
+    GraalCompiler getCompiler();
+    RiType lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
+    HotSpotVMConfig getConfig();
+    GraalRuntime getRuntime();
+    CiTarget getTarget();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilerImpl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot;
+
+import java.io.*;
+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.graal.compiler.*;
+import com.oracle.graal.compiler.target.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.hotspot.bridge.*;
+import com.oracle.graal.hotspot.logging.*;
+import com.oracle.graal.hotspot.ri.*;
+import com.oracle.graal.hotspot.server.*;
+
+/**
+ * Singleton class holding the instance of the GraalCompiler.
+ */
+public final class CompilerImpl implements Compiler, Remote {
+
+    private static Compiler theInstance;
+
+    public static Compiler getInstance() {
+        if (theInstance == null) {
+            initialize();
+        }
+        return theInstance;
+    }
+
+    public static synchronized void initialize() {
+        if (theInstance != null) {
+            return;
+        }
+
+        String remote = System.getProperty("graal.remote");
+        if (remote != null) {
+            // remote compilation (will not create a local Compiler)
+            try {
+                System.out.println("Graal compiler started in client/server mode, server: " + remote);
+                Socket socket = new Socket(remote, 1199);
+                ReplacingStreams streams = new ReplacingStreams(socket.getOutputStream(), socket.getInputStream());
+                streams.getInvocation().sendResult(new CompilerToVMImpl());
+
+                theInstance = (Compiler) streams.getInvocation().waitForResult(false);
+            } catch (IOException e1) {
+                System.out.println("Connection to compilation server FAILED.");
+                throw new RuntimeException(e1);
+            } catch (ClassNotFoundException e2) {
+                System.out.println("Connection to compilation server FAILED.");
+                throw new RuntimeException(e2);
+            }
+        } else {
+            // ordinary local compilation
+            theInstance = new CompilerImpl(null);
+        }
+    }
+
+    public static Compiler initializeServer(CompilerToVM entries) {
+        assert theInstance == null;
+        theInstance = new CompilerImpl(entries);
+        return theInstance;
+    }
+
+    private final CompilerToVM vmEntries;
+    private final VMToCompiler vmExits;
+
+    private HotSpotRuntime runtime;
+    private GraalCompiler compiler;
+    private CiTarget target;
+
+    private final HotSpotVMConfig config;
+
+    public HotSpotVMConfig getConfig() {
+        return config;
+    }
+
+    private CompilerImpl(CompilerToVM initialEntries) {
+
+        CompilerToVM entries = initialEntries;
+        // initialize VMEntries
+        if (entries == null) {
+            entries = new CompilerToVMImpl();
+        }
+
+        // initialize VMExits
+        VMToCompiler exits = new VMToCompilerImpl(this);
+
+        // logging, etc.
+        if (CountingProxy.ENABLED) {
+            exits = CountingProxy.getProxy(VMToCompiler.class, exits);
+            entries = CountingProxy.getProxy(CompilerToVM.class, entries);
+        }
+        if (Logger.ENABLED) {
+            exits = LoggingProxy.getProxy(VMToCompiler.class, exits);
+            entries = LoggingProxy.getProxy(CompilerToVM.class, entries);
+        }
+
+        // set the final fields
+        vmEntries = entries;
+        vmExits = exits;
+
+        // initialize compiler
+        config = vmEntries.getConfiguration();
+        config.check();
+    }
+
+    @Override
+    public CiTarget getTarget() {
+        if (target == null) {
+            final int wordSize = 8;
+            final int stackFrameAlignment = 16;
+            target = new CiTarget(new AMD64(), true, stackFrameAlignment, config.vmPageSize, wordSize, true, true, true);
+        }
+
+        return target;
+    }
+
+    /**
+     * Factory method for getting a Graal compiler instance. This method is called via reflection.
+     */
+    public static GraalRuntime getGraalRuntime() {
+        return getInstance().getRuntime();
+    }
+
+    @Override
+    public GraalCompiler getCompiler() {
+        if (compiler == null) {
+            // these options are important - graal will not generate correct code without them
+            GraalOptions.StackShadowPages = config.stackShadowPages;
+
+            RiXirGenerator generator = new HotSpotXirGenerator(config, getTarget(), getRuntime().getGlobalStubRegisterConfig(), this);
+            if (Logger.ENABLED) {
+                generator = LoggingProxy.getProxy(RiXirGenerator.class, generator);
+            }
+
+            Backend backend = Backend.create(target.arch, runtime, target);
+            generator.initialize(backend.newXirAssembler());
+
+            compiler = new GraalCompiler(getRuntime(), getTarget(), backend, generator);
+        }
+        return compiler;
+    }
+
+    @Override
+    public CompilerToVM getVMEntries() {
+        return vmEntries;
+    }
+
+    @Override
+    public VMToCompiler getVMExits() {
+        return vmExits;
+    }
+
+    @Override
+    public RiType lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve) {
+        if (returnType.length() == 1 && vmExits instanceof VMToCompilerImpl) {
+            VMToCompilerImpl exitsNative = (VMToCompilerImpl) vmExits;
+            CiKind kind = CiKind.fromPrimitiveOrVoidTypeChar(returnType.charAt(0));
+            switch(kind) {
+                case Boolean:
+                    return exitsNative.typeBoolean;
+                case Byte:
+                    return exitsNative.typeByte;
+                case Char:
+                    return exitsNative.typeChar;
+                case Double:
+                    return exitsNative.typeDouble;
+                case Float:
+                    return exitsNative.typeFloat;
+                case Illegal:
+                    break;
+                case Int:
+                    return exitsNative.typeInt;
+                case Jsr:
+                    break;
+                case Long:
+                    return exitsNative.typeLong;
+                case Object:
+                    break;
+                case Short:
+                    return exitsNative.typeShort;
+                case Void:
+                    return exitsNative.typeVoid;
+            }
+        }
+        return vmEntries.RiSignature_lookupType(returnType, accessingClass, eagerResolve);
+    }
+
+    @Override
+    public HotSpotRuntime getRuntime() {
+        if (runtime == null) {
+            if (GraalOptions.PrintCFGToFile) {
+//                context.addCompilationObserver(new CFGPrinterObserver());
+            }
+           // if (GraalOptions.PrintIdealGraphLevel != 0 || GraalOptions.Plot || GraalOptions.PlotOnError) {
+             //   CompilationObserver observer;
+               // if (GraalOptions.PrintIdealGraphFile) {
+              //      observer = new IdealGraphPrinterObserver();
+              //  } else {
+              //      observer = new IdealGraphPrinterObserver(GraalOptions.PrintIdealGraphAddress, GraalOptions.PrintIdealGraphPort);
+              //  }
+//                context.addCompilationObserver(observer);
+                // TODO (thomaswue): Install observer.
+           // }
+            runtime = new HotSpotRuntime(config, this);
+        }
+        return runtime;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilerObject.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot;
+
+import java.io.*;
+
+
+/**
+ * Parent class for all HotSpot Ri... types.
+ */
+public abstract class CompilerObject implements Serializable {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -4551670987101214877L;
+    protected final Compiler compiler;
+
+    protected CompilerObject(Compiler compiler) {
+        this.compiler = compiler;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot;
+
+import java.util.*;
+import java.util.regex.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.printer.*;
+
+
+public class HotSpotDebugConfig implements DebugConfig {
+
+    private final String logFilter;
+    private final String meterFilter;
+    private final String timerFilter;
+    private final String dumpFilter;
+    private final String[] methodFilter;
+    private final List<DebugDumpHandler> dumpHandlers = new ArrayList<>();
+
+    public HotSpotDebugConfig(String logFilter, String meterFilter, String timerFilter, String dumpFilter, String methodFilter) {
+        this.logFilter = logFilter;
+        this.meterFilter = meterFilter;
+        this.timerFilter = timerFilter;
+        this.dumpFilter = dumpFilter;
+        this.methodFilter = methodFilter == null ? null : methodFilter.split(",");
+        if (GraalOptions.PrintIdealGraphFile) {
+            dumpHandlers.add(new IdealGraphPrinterDumpHandler());
+        } else {
+            dumpHandlers.add(new IdealGraphPrinterDumpHandler(GraalOptions.PrintIdealGraphAddress, GraalOptions.PrintIdealGraphPort));
+        }
+        dumpHandlers.add(new CFGPrinterObserver());
+    }
+
+    public boolean isLogEnabled() {
+        return isEnabled(logFilter);
+    }
+
+    public boolean isMeterEnabled() {
+        return isEnabled(meterFilter);
+    }
+
+    public boolean isDumpEnabled() {
+        return isEnabled(dumpFilter);
+    }
+
+    public boolean isTimeEnabled() {
+        return isEnabled(timerFilter);
+    }
+
+    private boolean isEnabled(String filter) {
+        return filter != null && checkContains(Debug.currentScope(), filter) && checkMethodFilter();
+    }
+
+    private static boolean checkContains(String currentScope, String filter) {
+        if (filter.contains("*")) {
+            /*filter = filter.replace("*", ".*");
+            filter = filter.replace("[", "\\[");
+            filter = filter.replace("]", "\\]");
+            filter = filter.replace(":", "\\:");*/
+            return Pattern.matches(filter, currentScope);
+        }
+        return currentScope.contains(filter);
+    }
+
+    private boolean checkMethodFilter() {
+        if (methodFilter == null) {
+            return true;
+        } else {
+            for (Object o : Debug.context()) {
+                if (o instanceof RiMethod) {
+                    String methodName = CiUtil.format("%H.%n", (RiMethod) o);
+                    for (String filter : methodFilter) {
+                        if (methodName.contains(filter)) {
+                            return true;
+                        }
+                    }
+                }
+            }
+            return false;
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("Debug config:");
+        add(sb, "Log", logFilter);
+        add(sb, "Meter", meterFilter);
+        add(sb, "Time", timerFilter);
+        add(sb, "Dump", dumpFilter);
+        add(sb, "MethodFilter", Arrays.toString(methodFilter));
+        return sb.toString();
+    }
+
+    private static void add(StringBuilder sb, String name, String filter) {
+        if (filter != null) {
+            sb.append(' ');
+            sb.append(name);
+            sb.append('=');
+            sb.append(filter);
+        }
+    }
+
+    @Override
+    public RuntimeException interceptException(Throwable e) {
+        if (e instanceof CiBailout) {
+            return null;
+        }
+        Debug.setConfig(Debug.fixedConfig(true, true, false, false, dumpHandlers));
+        // sync "Exception occured in scope: " with mx/sanitycheck.py::Test.__init__
+        Debug.log(String.format("Exception occured in scope: %s", Debug.currentScope()));
+        for (Object o : Debug.context()) {
+            Debug.log("Context obj %s", o);
+            if (o instanceof Graph) {
+                Graph graph = (Graph) o;
+                Debug.log("Found graph in context: ", graph);
+                Debug.dump(o, "Exception graph");
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public Collection<? extends DebugDumpHandler> dumpHandlers() {
+        return dumpHandlers;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.hotspot;
+
+import java.lang.reflect.*;
+
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.hotspot.logging.*;
+
+public class HotSpotOptions {
+
+    public static void setDefaultOptions() {
+        GraalOptions.MethodEndBreakpointGuards = 2;
+        GraalOptions.ResolveClassBeforeStaticInvoke = false;
+    }
+
+    public static boolean setOption(String option) {
+        if (option.length() == 0) {
+            return false;
+        }
+
+        Object value = null;
+        String fieldName = null;
+        String valueString = null;
+
+        char first = option.charAt(0);
+        if (first == '+' || first == '-') {
+            fieldName = option.substring(1);
+            value = (first == '+');
+        } else {
+            int index = option.indexOf('=');
+            if (index == -1) {
+                fieldName = option;
+                valueString = null;
+            } else {
+                fieldName = option.substring(0, index);
+                valueString = option.substring(index + 1);
+            }
+        }
+
+        Field f;
+        try {
+            f = GraalOptions.class.getField(fieldName);
+
+            if (value == null) {
+                if (f.getType() == Float.TYPE) {
+                    value = Float.parseFloat(valueString);
+                } else if (f.getType() == Double.TYPE) {
+                    value = Double.parseDouble(valueString);
+                } else if (f.getType() == Integer.TYPE) {
+                    value = Integer.parseInt(valueString);
+                } else if (f.getType() == Boolean.TYPE) {
+                    if (valueString == null || valueString.length() == 0) {
+                        value = true;
+                    } else {
+                        value = Boolean.parseBoolean(valueString);
+                    }
+                } else if (f.getType() == String.class) {
+                    if (valueString == null) {
+                        value = "";
+                    } else {
+                        value = valueString;
+                    }
+                }
+            }
+            if (value != null) {
+                f.set(null, value);
+                //Logger.info("Set option " + fieldName + " to " + value);
+            } else {
+                Logger.info("Wrong value \"" + valueString + "\" for option " + fieldName);
+                return false;
+            }
+        } catch (SecurityException e) {
+            Logger.info("Security exception when setting option " + option);
+            return false;
+        } catch (NoSuchFieldException e) {
+            Logger.info("Could not find option " + fieldName);
+            return false;
+        } catch (IllegalArgumentException e) {
+            Logger.info("Illegal value for option " + option);
+            return false;
+        } catch (IllegalAccessException e) {
+            Logger.info("Illegal access exception when setting option " + option);
+            return false;
+        }
+
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotProxy.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot;
+
+/**
+ * Provides methods to classify the HotSpot-internal identifiers.
+ */
+public final class HotSpotProxy {
+
+    private HotSpotProxy() {
+    }
+
+    private enum CompilerObjectType {
+        // this enum needs to have the same values as the one in graal_Compiler.hpp
+        STUB(0x100000000000000L),
+        METHOD(0x200000000000000L),
+        CLASS(0x300000000000000L),
+        SYMBOL(0x400000000000000L),
+        CONSTANT_POOL(0x500000000000000L),
+        CONSTANT(0x600000000000000L),
+        TYPE_MASK(0xf00000000000000L),
+        DUMMY_CONSTANT(0x6ffffffffffffffL);
+
+        public final long bits;
+
+        CompilerObjectType(long bits) {
+            this.bits = bits;
+        }
+    }
+
+    public static final Long DUMMY_CONSTANT_OBJ = CompilerObjectType.DUMMY_CONSTANT.bits;
+
+    private static boolean isType(long id, CompilerObjectType type) {
+        return (id & CompilerObjectType.TYPE_MASK.bits) == type.bits;
+    }
+
+    public static boolean isStub(long id) {
+        return isType(id, CompilerObjectType.STUB);
+    }
+
+    public static boolean isMethod(long id) {
+        return isType(id, CompilerObjectType.METHOD);
+    }
+
+    public static boolean isClass(long id) {
+        return isType(id, CompilerObjectType.CLASS);
+    }
+
+    public static boolean isSymbol(long id) {
+        return isType(id, CompilerObjectType.SYMBOL);
+    }
+
+    public static boolean isConstantPool(long id) {
+        return isType(id, CompilerObjectType.CONSTANT_POOL);
+    }
+
+    public static boolean isConstant(long id) {
+        return isType(id, CompilerObjectType.CONSTANT_POOL);
+    }
+
+    public static String toString(long id) {
+        CompilerObjectType type = null;
+        for (CompilerObjectType t : CompilerObjectType.values()) {
+            if ((id & CompilerObjectType.TYPE_MASK.bits) == t.bits) {
+                type = t;
+            }
+        }
+        long num = id & ~CompilerObjectType.TYPE_MASK.bits;
+        return type + " " + num;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
+import com.oracle.graal.hotspot.logging.*;
+import com.oracle.graal.hotspot.ri.*;
+
+/**
+ * CiTargetMethod augmented with HotSpot-specific information.
+ */
+public final class HotSpotTargetMethod extends CompilerObject {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 7807321392203253218L;
+    public final CiTargetMethod targetMethod;
+    public final HotSpotMethodResolved method; // used only for methods
+    public final String name; // used only for stubs
+
+    public final Site[] sites;
+    public final ExceptionHandler[] exceptionHandlers;
+
+    public HotSpotTargetMethod(Compiler compiler, HotSpotMethodResolved method, CiTargetMethod targetMethod) {
+        super(compiler);
+        this.method = method;
+        this.targetMethod = targetMethod;
+        this.name = null;
+
+        sites = getSortedSites(targetMethod);
+        if (targetMethod.exceptionHandlers == null) {
+            exceptionHandlers = null;
+        } else {
+            exceptionHandlers = targetMethod.exceptionHandlers.toArray(new ExceptionHandler[targetMethod.exceptionHandlers.size()]);
+        }
+    }
+
+    private HotSpotTargetMethod(Compiler compiler, CiTargetMethod targetMethod, String name) {
+        super(compiler);
+        this.method = null;
+        this.targetMethod = targetMethod;
+        this.name = name;
+
+        sites = getSortedSites(targetMethod);
+        assert targetMethod.exceptionHandlers == null || targetMethod.exceptionHandlers.size() == 0;
+        exceptionHandlers = null;
+    }
+
+    private static Site[] getSortedSites(CiTargetMethod target) {
+        List<?>[] lists = new List<?>[] {target.safepoints, target.dataReferences, target.marks};
+        int count = 0;
+        for (List<?> list : lists) {
+            count += list.size();
+        }
+        Site[] result = new Site[count];
+        int pos = 0;
+        for (List<?> list : lists) {
+            for (Object elem : list) {
+                result[pos++] = (Site) elem;
+            }
+        }
+        Arrays.sort(result, new Comparator<Site>() {
+
+            public int compare(Site s1, Site s2) {
+                if (s1.pcOffset == s2.pcOffset && (s1 instanceof Mark ^ s2 instanceof Mark)) {
+                    return s1 instanceof Mark ? -1 : 1;
+                }
+                return s1.pcOffset - s2.pcOffset;
+            }
+        });
+        if (Logger.ENABLED) {
+            for (Site site : result) {
+                Logger.log(site.pcOffset + ": " + site);
+            }
+        }
+        return result;
+    }
+
+    public static Object installStub(Compiler compiler, CiTargetMethod targetMethod, String name) {
+        return compiler.getVMEntries().installStub(new HotSpotTargetMethod(compiler, targetMethod, name));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Used to communicate configuration details, runtime offsets, etc. to graal upon compileMethod.
+ */
+public final class HotSpotVMConfig extends CompilerObject {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -4744897993263044184L;
+
+    private HotSpotVMConfig() {
+        super(null);
+    }
+
+    // os information, register layout, code generation, ...
+    public boolean windowsOs;
+    public int codeEntryAlignment;
+    public boolean verifyPointers;
+    public boolean useFastLocking;
+    public boolean useFastNewObjectArray;
+    public boolean useFastNewTypeArray;
+
+    // offsets, ...
+    public int vmPageSize;
+    public int stackShadowPages;
+    public int hubOffset;
+    public int arrayLengthOffset;
+    public int klassStateOffset;
+    public int klassStateFullyInitialized;
+    public int[] arrayOffsets;
+    public int arrayClassElementOffset;
+    public int threadTlabTopOffset;
+    public int threadTlabEndOffset;
+    public int threadObjectOffset;
+    public int instanceHeaderPrototypeOffset;
+    public int threadExceptionOopOffset;
+    public int threadExceptionPcOffset;
+    public int threadMultiNewArrayStorage;
+    public long cardtableStartAddress;
+    public int cardtableShift;
+    public long safepointPollingAddress;
+    public boolean isPollingPageFar;
+    public int classMirrorOffset;
+    public int runtimeCallStackSize;
+    public int klassModifierFlagsOffset;
+    public int klassOopOffset;
+    public int graalMirrorKlassOffset;
+    public int nmethodEntryOffset;
+    public int methodCompiledEntryOffset;
+
+    // methodData information
+    public int methodDataOopDataOffset;
+    public int dataLayoutHeaderSize;
+    public int dataLayoutTagOffset;
+    public int dataLayoutFlagsOffset;
+    public int dataLayoutBCIOffset;
+    public int dataLayoutCellsOffset;
+    public int dataLayoutCellSize;
+    public int bciProfileWidth;
+    public int typeProfileWidth;
+
+    // runtime stubs
+    public long debugStub;
+    public long instanceofStub;
+    public long newInstanceStub;
+    public long unresolvedNewInstanceStub;
+    public long newTypeArrayStub;
+    public long newObjectArrayStub;
+    public long newMultiArrayStub;
+    public long loadKlassStub;
+    public long accessFieldStub;
+    public long resolveStaticCallStub;
+    public long inlineCacheMissStub;
+    public long unwindExceptionStub;
+    public long handleExceptionStub;
+    public long handleDeoptStub;
+    public long monitorEnterStub;
+    public long monitorExitStub;
+    public long fastMonitorEnterStub;
+    public long fastMonitorExitStub;
+    public long verifyPointerStub;
+
+    public void check() {
+        assert vmPageSize >= 16;
+        assert codeEntryAlignment > 0;
+        assert stackShadowPages > 0;
+    }
+
+    public int getArrayOffset(CiKind kind) {
+        return arrayOffsets[getKindNumber(kind)];
+    }
+
+    private static int getKindNumber(CiKind kind) {
+        if (kind == CiKind.Boolean) {
+            return 0;
+        } else if (kind == CiKind.Byte) {
+            return 1;
+        } else if (kind == CiKind.Short) {
+            return 2;
+        } else if (kind == CiKind.Char) {
+            return 3;
+        } else if (kind == CiKind.Int) {
+            return 4;
+        } else if (kind == CiKind.Float) {
+            return 5;
+        } else if (kind == CiKind.Long) {
+            return 6;
+        } else if (kind == CiKind.Double) {
+            return 7;
+        } else if (kind == CiKind.Object) {
+            return 8;
+        } else {
+            throw new RuntimeException(kind + " is not a Java kind");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.hotspot.bridge;
+
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.ri.*;
+
+/**
+ * Calls from Java into HotSpot.
+ */
+public interface CompilerToVM {
+
+    // Checkstyle: stop
+
+    byte[] RiMethod_code(HotSpotMethodResolved method);
+
+    String RiMethod_signature(HotSpotMethodResolved method);
+
+    RiExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
+
+    boolean RiMethod_hasBalancedMonitors(HotSpotMethodResolved method);
+
+    RiMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
+
+    int RiMethod_invocationCount(HotSpotMethodResolved method);
+
+    HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
+
+    RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
+
+    Object RiConstantPool_lookupConstant(HotSpotTypeResolved pool, int cpi);
+
+    RiMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
+
+    RiType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
+
+    RiField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
+
+    void RiConstantPool_loadReferencedType(HotSpotTypeResolved pool, int cpi, byte byteCode);
+
+    HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode);
+
+    long installStub(HotSpotTargetMethod targetMethod);
+
+    HotSpotVMConfig getConfiguration();
+
+    RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
+
+    boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
+
+    RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
+
+    RiType getPrimitiveArrayType(CiKind kind);
+
+    RiType RiType_arrayOf(HotSpotTypeResolved klass);
+
+    RiType RiType_componentType(HotSpotTypeResolved klass);
+
+    boolean RiType_isInitialized(HotSpotTypeResolved klass);
+
+    RiType getType(Class<?> javaClass);
+
+    RiType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
+
+    RiType RiType_superType(HotSpotTypeResolved klass);
+
+    int getArrayLength(CiConstant array);
+
+    boolean compareConstantObjects(CiConstant x, CiConstant y);
+
+    RiType getRiType(CiConstant constant);
+
+    RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
+
+    boolean RiMethod_hasCompiledCode(HotSpotMethodResolved method);
+
+    int RiMethod_getCompiledCodeSize(HotSpotMethodResolved method);
+
+    RiMethod getRiMethod(Method reflectionMethod);
+
+    long getMaxCallTargetOffset(CiRuntimeCall rtcall);
+
+    String disassembleNative(byte[] code, long address);
+
+    String disassembleJava(HotSpotMethodResolved method);
+
+    Object executeCompiledMethod(HotSpotCompiledMethod method, Object arg1, Object arg2, Object arg3);
+
+    int RiMethod_vtableEntryOffset(HotSpotMethodResolved method);
+
+    // Checkstyle: resume
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.hotspot.bridge;
+
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.ri.*;
+import com.oracle.graal.hotspot.server.*;
+
+/**
+ * Entries into the HotSpot VM from Java code.
+ */
+public class CompilerToVMImpl implements CompilerToVM, Remote {
+
+    // Checkstyle: stop
+
+    @Override
+    public native RiMethod getRiMethod(Method reflectionMethod);
+
+    @Override
+    public native byte[] RiMethod_code(HotSpotMethodResolved method);
+
+    @Override
+    public native String RiMethod_signature(HotSpotMethodResolved method);
+
+    @Override
+    public native RiExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
+
+    @Override
+    public native boolean RiMethod_hasBalancedMonitors(HotSpotMethodResolved method);
+
+    @Override
+    public native RiMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
+
+    @Override
+    public native int RiMethod_invocationCount(HotSpotMethodResolved method);
+
+    @Override
+    public native RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
+
+    @Override
+    public native Object RiConstantPool_lookupConstant(HotSpotTypeResolved pool, int cpi);
+
+    @Override
+    public native RiMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
+
+    @Override
+    public native RiType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
+
+    @Override
+    public native void RiConstantPool_loadReferencedType(HotSpotTypeResolved pool, int cpi, byte byteCode);
+
+    @Override
+    public native RiField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
+
+    @Override
+    public native HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode);
+
+    @Override
+    public native long installStub(HotSpotTargetMethod targetMethod);
+
+    @Override
+    public native HotSpotVMConfig getConfiguration();
+
+    @Override
+    public native RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
+
+    @Override
+    public native boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
+
+    @Override
+    public native RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
+
+    @Override
+    public native RiType getPrimitiveArrayType(CiKind kind);
+
+    @Override
+    public native RiType RiType_arrayOf(HotSpotTypeResolved klass);
+
+    @Override
+    public native RiType RiType_componentType(HotSpotTypeResolved klass);
+
+    @Override
+    public native RiType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
+
+    @Override
+    public native RiType RiType_superType(HotSpotTypeResolved klass);
+
+    @Override
+    public native boolean RiType_isInitialized(HotSpotTypeResolved klass);
+
+    @Override
+    public native HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
+
+    @Override
+    public native RiType getType(Class<?> javaClass);
+
+    @Override
+    public int getArrayLength(CiConstant array) {
+        return Array.getLength(array.asObject());
+    }
+
+    @Override
+    public boolean compareConstantObjects(CiConstant x, CiConstant y) {
+        return x.asObject() == y.asObject();
+    }
+
+    @Override
+    public RiType getRiType(CiConstant constant) {
+        Object o = constant.asObject();
+        if (o == null) {
+            return null;
+        }
+        return getType(o.getClass());
+    }
+
+    @Override
+    public native RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
+
+    @Override
+    public native boolean RiMethod_hasCompiledCode(HotSpotMethodResolved method);
+
+    @Override
+    public native int RiMethod_getCompiledCodeSize(HotSpotMethodResolved method);
+
+    @Override
+    public native long getMaxCallTargetOffset(CiRuntimeCall rtcall);
+
+    @Override
+    public native String disassembleNative(byte[] code, long address);
+
+    @Override
+    public native String disassembleJava(HotSpotMethodResolved method);
+
+    @Override
+    public native Object executeCompiledMethod(HotSpotCompiledMethod method, Object arg1, Object arg2, Object arg3);
+
+    @Override
+    public native int RiMethod_vtableEntryOffset(HotSpotMethodResolved method);
+
+    // Checkstyle: resume
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.hotspot.bridge;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.ri.*;
+
+/**
+ * Calls from HotSpot into Java.
+ */
+public interface VMToCompiler {
+
+    boolean compileMethod(HotSpotMethodResolved method, int entryBCI, boolean blocking) throws Throwable;
+
+    void shutdownCompiler() throws Throwable;
+
+    void startCompiler() throws Throwable;
+
+    void bootstrap() throws Throwable;
+
+    RiMethod createRiMethodUnresolved(String name, String signature, RiType holder);
+
+    RiSignature createRiSignature(String signature);
+
+    RiField createRiField(RiType holder, String name, RiType type, int offset, int flags);
+
+    RiType createRiType(HotSpotConstantPool pool, String name);
+
+    RiType createRiTypePrimitive(int basicType);
+
+    RiType createRiTypeUnresolved(String name);
+
+    CiConstant createCiConstant(CiKind kind, long value);
+
+    CiConstant createCiConstantFloat(float value);
+
+    CiConstant createCiConstantDouble(double value);
+
+    CiConstant createCiConstantObject(Object object);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,454 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.hotspot.bridge;
+
+import java.lang.reflect.*;
+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.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.debug.internal.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+import com.oracle.graal.hotspot.ri.*;
+import com.oracle.graal.hotspot.server.*;
+import com.oracle.graal.hotspot.snippets.*;
+import com.oracle.graal.java.*;
+import com.oracle.graal.snippets.*;
+
+/**
+ * Exits from the HotSpot VM into Java code.
+ */
+public class VMToCompilerImpl implements VMToCompiler, Remote {
+
+    private final Compiler compiler;
+    private int compiledMethodCount;
+    private long totalCompilationTime;
+    private IntrinsifyArrayCopyPhase intrinsifyArrayCopy;
+
+    public final HotSpotTypePrimitive typeBoolean;
+    public final HotSpotTypePrimitive typeChar;
+    public final HotSpotTypePrimitive typeFloat;
+    public final HotSpotTypePrimitive typeDouble;
+    public final HotSpotTypePrimitive typeByte;
+    public final HotSpotTypePrimitive typeShort;
+    public final HotSpotTypePrimitive typeInt;
+    public final HotSpotTypePrimitive typeLong;
+    public final HotSpotTypePrimitive typeVoid;
+
+    ThreadFactory compilerThreadFactory = new ThreadFactory() {
+
+        @Override
+        public Thread newThread(Runnable r) {
+            return new CompilerThread(r);
+        }
+    };
+
+    private final class CompilerThread extends Thread {
+
+        public CompilerThread(Runnable r) {
+            super(r);
+            this.setName("GraalCompilerThread-" + this.getId());
+            this.setDaemon(true);
+        }
+
+        @Override
+        public void run() {
+            if (GraalOptions.Debug) {
+                Debug.enable();
+                HotSpotDebugConfig hotspotDebugConfig = new HotSpotDebugConfig(GraalOptions.Log, GraalOptions.Meter, GraalOptions.Time, GraalOptions.Dump, GraalOptions.MethodFilter);
+                Debug.setConfig(hotspotDebugConfig);
+            }
+            super.run();
+        }
+    }
+
+    private ThreadPoolExecutor compileQueue;
+
+    public VMToCompilerImpl(Compiler compiler) {
+        this.compiler = compiler;
+
+        typeBoolean = new HotSpotTypePrimitive(compiler, CiKind.Boolean);
+        typeChar = new HotSpotTypePrimitive(compiler, CiKind.Char);
+        typeFloat = new HotSpotTypePrimitive(compiler, CiKind.Float);
+        typeDouble = new HotSpotTypePrimitive(compiler, CiKind.Double);
+        typeByte = new HotSpotTypePrimitive(compiler, CiKind.Byte);
+        typeShort = new HotSpotTypePrimitive(compiler, CiKind.Short);
+        typeInt = new HotSpotTypePrimitive(compiler, CiKind.Int);
+        typeLong = new HotSpotTypePrimitive(compiler, CiKind.Long);
+        typeVoid = new HotSpotTypePrimitive(compiler, CiKind.Void);
+    }
+
+    public void startCompiler() throws Throwable {
+        // Make sure TTY is initialized here such that the correct System.out is used for TTY.
+        TTY.initialize();
+        if (GraalOptions.Debug) {
+            Debug.enable();
+            HotSpotDebugConfig hotspotDebugConfig = new HotSpotDebugConfig(GraalOptions.Log, GraalOptions.Meter, GraalOptions.Time, GraalOptions.Dump, GraalOptions.MethodFilter);
+            Debug.setConfig(hotspotDebugConfig);
+        }
+
+        // Install intrinsics.
+        final HotSpotRuntime runtime = (HotSpotRuntime) compiler.getCompiler().runtime;
+        if (GraalOptions.Intrinsify) {
+            Debug.scope("InstallSnippets", new DebugDumpScope("InstallSnippets"), new Runnable() {
+                @Override
+                public void run() {
+                    VMToCompilerImpl.this.intrinsifyArrayCopy = new IntrinsifyArrayCopyPhase(runtime);
+                    GraalIntrinsics.installIntrinsics(runtime, runtime.getCompiler().getTarget(), PhasePlan.DEFAULT);
+                    Snippets.install(runtime, runtime.getCompiler().getTarget(), new SystemSnippets(), PhasePlan.DEFAULT);
+                    Snippets.install(runtime, runtime.getCompiler().getTarget(), new UnsafeSnippets(), PhasePlan.DEFAULT);
+                    Snippets.install(runtime, runtime.getCompiler().getTarget(), new ArrayCopySnippets(), PhasePlan.DEFAULT);
+                }
+            });
+
+        }
+
+        // Create compilation queue.
+        compileQueue = new ThreadPoolExecutor(GraalOptions.Threads, GraalOptions.Threads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), compilerThreadFactory);
+
+        // Create queue status printing thread.
+        if (GraalOptions.PrintQueue) {
+            Thread t = new Thread() {
+
+                @Override
+                public void run() {
+                    while (true) {
+                        TTY.println(compileQueue.toString());
+                        try {
+                            Thread.sleep(1000);
+                        } catch (InterruptedException e) {
+                        }
+                    }
+                }
+            };
+            t.setDaemon(true);
+            t.start();
+        }
+    }
+
+    /**
+     * This method is the first method compiled during bootstrapping. Put any code in there that warms up compiler paths
+     * that are otherwise no exercised during bootstrapping and lead to later deoptimization when application code is
+     * compiled.
+     */
+    @SuppressWarnings("unused")
+    @Deprecated
+    private synchronized void compileWarmup() {
+        // Method is synchronized to exercise the synchronization code in the compiler.
+    }
+
+    public void bootstrap() throws Throwable {
+        TTY.print("Bootstrapping Graal");
+        TTY.flush();
+        long startTime = System.currentTimeMillis();
+
+        // Initialize compile queue with a selected set of methods.
+        Class<Object> objectKlass = Object.class;
+        enqueue(getClass().getDeclaredMethod("compileWarmup"));
+        enqueue(objectKlass.getDeclaredMethod("equals", Object.class));
+        enqueue(objectKlass.getDeclaredMethod("toString"));
+
+        // Compile until the queue is empty.
+        int z = 0;
+        while (compileQueue.getCompletedTaskCount() < Math.max(3, compileQueue.getTaskCount())) {
+            Thread.sleep(100);
+            while (z < compileQueue.getCompletedTaskCount() / 100) {
+                ++z;
+                TTY.print(".");
+                TTY.flush();
+            }
+        }
+
+        TTY.println(" in %d ms", System.currentTimeMillis() - startTime);
+        System.gc();
+    }
+
+    private void enqueue(Method m) throws Throwable {
+        RiMethod riMethod = compiler.getRuntime().getRiMethod(m);
+        assert !Modifier.isAbstract(((HotSpotMethodResolved) riMethod).accessFlags()) && !Modifier.isNative(((HotSpotMethodResolved) riMethod).accessFlags()) : riMethod;
+        compileMethod((HotSpotMethodResolved) riMethod, 0, false);
+    }
+
+    public void shutdownCompiler() throws Throwable {
+        // compiler.getCompiler().context.print();
+        // TODO (thomaswue): Print context results.
+        compileQueue.shutdown();
+
+        if (Debug.isEnabled()) {
+            List<DebugValueMap> topLevelMaps = DebugValueMap.getTopLevelMaps();
+            List<DebugValue> debugValues = KeyRegistry.getDebugValues();
+            if (debugValues.size() > 0) {
+                if (GraalOptions.SummarizeDebugValues) {
+                    printSummary(topLevelMaps, debugValues);
+                } else {
+                    for (DebugValueMap map : topLevelMaps) {
+                        TTY.println("Showing the results for thread: " + map.getName());
+                        map.group();
+                        map.normalize();
+                        printMap(map, debugValues, 0);
+                    }
+                }
+            }
+        }
+
+        if (GraalOptions.PrintCompilationStatistics) {
+            printCompilationStatistics();
+        }
+    }
+
+    private void printCompilationStatistics() {
+        TTY.println("Accumulated compilation statistics");
+        TTY.println("  Compiled methods         : %d", compiledMethodCount);
+        TTY.println("  Total compilation time   : %6.3f s", totalCompilationTime / Math.pow(10, 9));
+    }
+
+    private static void printSummary(List<DebugValueMap> topLevelMaps, List<DebugValue> debugValues) {
+        DebugValueMap result = new DebugValueMap("Summary");
+        for (int i = debugValues.size() - 1; i >= 0; i--) {
+            DebugValue debugValue = debugValues.get(i);
+            int index = debugValue.getIndex();
+            long total = collectTotal(topLevelMaps, index);
+            result.setCurrentValue(index, total);
+        }
+        printMap(result, debugValues, 0);
+    }
+
+    private static long collectTotal(List<DebugValueMap> maps, int index) {
+        long total = 0;
+        for (int i = 0; i < maps.size(); i++) {
+            DebugValueMap map = maps.get(i);
+            // the top level accumulates some counters -> do not process the children if we find a value
+            long value = map.getCurrentValue(index);
+            if (value == 0) {
+                total += collectTotal(map.getChildren(), index);
+            } else {
+                total += value;
+            }
+        }
+        return total;
+    }
+
+
+    private static void printMap(DebugValueMap map, List<DebugValue> debugValues, int level) {
+
+        printIndent(level);
+        TTY.println(map.getName());
+        for (DebugValue value : debugValues) {
+            long l = map.getCurrentValue(value.getIndex());
+            if (l != 0) {
+                printIndent(level + 1);
+                TTY.println(value.getName() + "=" + l);
+            }
+        }
+
+        for (DebugValueMap child : map.getChildren()) {
+            printMap(child, debugValues, level + 1);
+        }
+    }
+
+    private static void printIndent(int level) {
+        for (int i = 0; i < level; ++i) {
+            TTY.print("    ");
+        }
+        TTY.print("|-> ");
+    }
+
+    @Override
+    public boolean compileMethod(final HotSpotMethodResolved method, final int entryBCI, boolean blocking) throws Throwable {
+        try {
+            if (Thread.currentThread() instanceof CompilerThread) {
+                if (method.holder().name().contains("java/util/concurrent")) {
+                    // This is required to avoid deadlocking a compiler thread. The issue is that a
+                    // java.util.concurrent.BlockingQueue is used to implement the compilation worker
+                    // queues. If a compiler thread triggers a compilation, then it may be blocked trying
+                    // to add something to its own queue.
+                    return false;
+                }
+            }
+
+            Runnable runnable = new Runnable() {
+
+                public void run() {
+                    try {
+                        final PhasePlan plan = getDefaultPhasePlan();
+                        GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(compiler.getRuntime());
+                        plan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
+                        long startTime = System.nanoTime();
+                        int index = compiledMethodCount++;
+                        final boolean printCompilation = GraalOptions.PrintCompilation && !TTY.isSuppressed();
+                        if (printCompilation) {
+                            TTY.println(String.format("Graal %4d %-70s %-45s %-50s ...", index, method.holder().name(), method.name(), method.signature().asString()));
+                        }
+
+                        CiTargetMethod result = null;
+                        TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
+                        long nanoTime;
+                        try {
+                            result = Debug.scope("Compiling", new Callable<CiTargetMethod>() {
+                                @Override
+                                public CiTargetMethod call() throws Exception {
+                                    return compiler.getCompiler().compileMethod(method, -1, plan);
+                                }
+                            });
+                        } finally {
+                            filter.remove();
+                            nanoTime = System.nanoTime() - startTime;
+                            totalCompilationTime += nanoTime;
+                            if (printCompilation) {
+                                TTY.println(String.format("Graal %4d %-70s %-45s %-50s | %3d.%dms %4dnodes %5dB", index, "", "", "", nanoTime / 1000000, nanoTime % 1000000, 0, (result != null ? result.targetCodeSize()
+                                                : -1)));
+                            }
+                        }
+                        compiler.getRuntime().installMethod(method, result);
+                    } catch (CiBailout bailout) {
+                        Debug.metric("Bailouts").increment();
+                        if (GraalOptions.ExitVMOnBailout) {
+                            bailout.printStackTrace(TTY.cachedOut);
+                            System.exit(-1);
+                        }
+                    } catch (Throwable t) {
+                        if (GraalOptions.ExitVMOnException) {
+                            t.printStackTrace(TTY.cachedOut);
+                            System.exit(-1);
+                        }
+                    }
+                }
+            };
+
+            if (blocking) {
+                runnable.run();
+            } else {
+                compileQueue.execute(runnable);
+            }
+        } catch (RejectedExecutionException e) {
+            // The compile queue was already shut down.
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public RiMethod createRiMethodUnresolved(String name, String signature, RiType holder) {
+        return new HotSpotMethodUnresolved(compiler, name, signature, holder);
+    }
+
+    @Override
+    public RiSignature createRiSignature(String signature) {
+        return new HotSpotSignature(compiler, signature);
+    }
+
+    @Override
+    public RiField createRiField(RiType holder, String name, RiType type, int offset, int flags) {
+        if (offset != -1) {
+            HotSpotTypeResolved resolved = (HotSpotTypeResolved) holder;
+            return resolved.createRiField(name, type, offset, flags);
+        }
+        return new BaseUnresolvedField(holder, name, type);
+    }
+
+    @Override
+    public RiType createRiType(HotSpotConstantPool pool, String name) {
+        throw new RuntimeException("not implemented");
+    }
+
+    @Override
+    public RiType createRiTypePrimitive(int basicType) {
+        switch (basicType) {
+            case 4:
+                return typeBoolean;
+            case 5:
+                return typeChar;
+            case 6:
+                return typeFloat;
+            case 7:
+                return typeDouble;
+            case 8:
+                return typeByte;
+            case 9:
+                return typeShort;
+            case 10:
+                return typeInt;
+            case 11:
+                return typeLong;
+            case 14:
+                return typeVoid;
+            default:
+                throw new IllegalArgumentException("Unknown basic type: " + basicType);
+        }
+    }
+
+    @Override
+    public RiType createRiTypeUnresolved(String name) {
+        return new HotSpotTypeUnresolved(compiler, name);
+    }
+
+    @Override
+    public CiConstant createCiConstant(CiKind kind, long value) {
+        if (kind == CiKind.Long) {
+            return CiConstant.forLong(value);
+        } else if (kind == CiKind.Int) {
+            return CiConstant.forInt((int) value);
+        } else if (kind == CiKind.Short) {
+            return CiConstant.forShort((short) value);
+        } else if (kind == CiKind.Char) {
+            return CiConstant.forChar((char) value);
+        } else if (kind == CiKind.Byte) {
+            return CiConstant.forByte((byte) value);
+        } else if (kind == CiKind.Boolean) {
+            return (value == 0) ? CiConstant.FALSE : CiConstant.TRUE;
+        } else {
+            throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public CiConstant createCiConstantFloat(float value) {
+        return CiConstant.forFloat(value);
+    }
+
+    @Override
+    public CiConstant createCiConstantDouble(double value) {
+        return CiConstant.forDouble(value);
+    }
+
+    @Override
+    public CiConstant createCiConstantObject(Object object) {
+        return CiConstant.forObject(object);
+    }
+
+    private PhasePlan getDefaultPhasePlan() {
+        PhasePlan phasePlan = new PhasePlan();
+        if (GraalOptions.Intrinsify) {
+            phasePlan.addPhase(PhasePosition.HIGH_LEVEL, intrinsifyArrayCopy);
+        }
+        return phasePlan;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.logging;
+
+import java.lang.reflect.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+import com.oracle.graal.hotspot.server.*;
+
+/**
+ * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return
+ * values.
+ */
+public class CountingProxy<T> implements InvocationHandler {
+
+    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("graal.countcalls"));
+
+    private T delegate;
+
+    private ConcurrentHashMap<Method, AtomicLong> calls = new ConcurrentHashMap<>();
+
+    public CountingProxy(T delegate) {
+        assert ENABLED;
+        System.out.println("Counting proxy for " + delegate.getClass().getSimpleName() + " created");
+        this.delegate = delegate;
+        proxies.add(this);
+    }
+
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        int argCount = args == null ? 0 : args.length;
+        if (method.getParameterTypes().length != argCount) {
+            throw new RuntimeException("wrong parameter count");
+        }
+        final Object result;
+        if (!calls.containsKey(method)) {
+            calls.putIfAbsent(method, new AtomicLong(0));
+        }
+        AtomicLong count = calls.get(method);
+        count.incrementAndGet();
+        try {
+            if (args == null) {
+                result = method.invoke(delegate);
+            } else {
+                result = method.invoke(delegate, args);
+            }
+        } catch (InvocationTargetException e) {
+            throw e.getCause();
+        }
+        return result;
+    }
+
+    public static <T> T getProxy(Class<T> interf, T delegate) {
+        Class<?>[] interfaces = ReplacingStreams.getAllInterfaces(delegate.getClass());
+        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new CountingProxy<>(delegate));
+        return interf.cast(obj);
+    }
+
+    private static ArrayList<CountingProxy> proxies = new ArrayList<>();
+
+    static {
+        if (ENABLED) {
+            Runtime.getRuntime().addShutdownHook(new Thread() {
+
+                @Override
+                public void run() {
+                    for (CountingProxy proxy : proxies) {
+                        proxy.print();
+                    }
+                }
+            });
+        }
+    }
+
+    protected void print() {
+        long sum = 0;
+        for (Map.Entry<Method, AtomicLong> entry : calls.entrySet()) {
+            Method method = entry.getKey();
+            long count = entry.getValue().get();
+            sum += count;
+            System.out.println(delegate.getClass().getSimpleName() + "." + method.getName() + ": " + count);
+        }
+        System.out.println(delegate.getClass().getSimpleName() + " calls: " + sum);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/Logger.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.logging;
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * Scoped logging class used to display the call hierarchy of VMEntries/VMExits calls.
+ */
+public class Logger {
+
+    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("graal.debug"));
+    private static final int SPACING = 4;
+    private static Deque<Boolean> openStack = new LinkedList<>();
+    private static boolean open = false;
+    private static int level = 0;
+
+    private static final PrintStream out;
+
+    static {
+        PrintStream ps = null;
+        String filename = System.getProperty("graal.info_file");
+        if (filename != null && !"".equals(filename)) {
+            try {
+                ps = new PrintStream(new FileOutputStream(filename));
+            } catch (FileNotFoundException e) {
+                e.printStackTrace();
+                ps = null;
+            }
+        }
+        out = ps;
+        if (out != null) {
+            out.println("start: " + new Date());
+        }
+    }
+
+    public static void info(String message) {
+        if (ENABLED) {
+            log(message);
+        } else {
+            System.out.println(message);
+        }
+        if (out != null) {
+            out.println(message);
+            out.flush();
+        }
+    }
+
+    public static void log(String message) {
+        if (ENABLED) {
+            for (String line : message.split("\n")) {
+                if (open) {
+                    System.out.println("...");
+                    open = false;
+                }
+                System.out.print(space(level));
+                System.out.println(line);
+            }
+        }
+    }
+
+    public static void startScope(String message) {
+        if (ENABLED) {
+            if (open) {
+                System.out.println("...");
+                open = false;
+            }
+            System.out.print(space(level));
+            System.out.print(message);
+            openStack.push(open);
+            open = true;
+            level++;
+        }
+    }
+
+    public static void endScope(String message) {
+        if (ENABLED) {
+            level--;
+            if (open) {
+                System.out.println(message);
+            } else {
+                System.out.println(space(level) + "..." + message);
+            }
+            open = openStack.pop();
+        }
+    }
+
+    private static String[] spaces = new String[50];
+
+    private static String space(int count) {
+        assert count >= 0;
+        String result;
+        if (count >= spaces.length || spaces[count] == null) {
+            StringBuilder str = new StringBuilder();
+            for (int i = 0; i < count * SPACING; i++) {
+                str.append(' ');
+            }
+            result = str.toString();
+            if (count < spaces.length) {
+                spaces[count] = result;
+            }
+        } else {
+            result = spaces[count];
+        }
+        return result;
+    }
+
+    public static String pretty(Object value) {
+        if (value == null) {
+            return "null";
+        }
+
+        Class<?> klass = value.getClass();
+        if (value instanceof Void) {
+            return "void";
+        } else if (value instanceof String) {
+            return "\"" + value + "\"";
+        } else if (value instanceof Method) {
+            return "method \"" + ((Method) value).getName() + "\"";
+        } else if (value instanceof Class<?>) {
+            return "class \"" + ((Class<?>) value).getSimpleName() + "\"";
+        } else if (value instanceof Integer) {
+            if ((Integer) value < 10) {
+                return value.toString();
+            }
+            return value + " (0x" + Integer.toHexString((Integer) value) + ")";
+        } else if (value instanceof Long) {
+            if ((Long) value < 10) {
+                return value + "l";
+            }
+            return value + "l (0x" + Long.toHexString((Long) value) + "l)";
+        } else if (klass.isArray()) {
+            StringBuilder str = new StringBuilder();
+            int dimensions = 0;
+            while (klass.isArray()) {
+                dimensions++;
+                klass = klass.getComponentType();
+            }
+            str.append(klass.getSimpleName()).append('[').append(Array.getLength(value)).append(']');
+            for (int i = 1; i < dimensions; i++) {
+                str.append("[]");
+            }
+            return str.toString();
+        }
+
+        return value.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/LoggingProxy.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.logging;
+
+import java.lang.reflect.*;
+
+import com.oracle.graal.hotspot.server.*;
+
+/**
+ * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return values.
+ */
+public class LoggingProxy<T> implements InvocationHandler {
+
+    private T delegate;
+
+    public LoggingProxy(T delegate) {
+        this.delegate = delegate;
+    }
+
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        int argCount = args == null ? 0 : args.length;
+        if (method.getParameterTypes().length != argCount) {
+            throw new RuntimeException("wrong parameter count");
+        }
+        StringBuilder str = new StringBuilder();
+        str.append(method.getReturnType().getSimpleName() + " " + method.getDeclaringClass().getSimpleName() + "." + method.getName() + "(");
+        for (int i = 0; i < argCount; i++) {
+            str.append(i == 0 ? "" : ", ");
+            str.append(Logger.pretty(args[i]));
+        }
+        str.append(")");
+        Logger.startScope(str.toString());
+        final Object result;
+        try {
+            if (args == null) {
+                result = method.invoke(delegate);
+            } else {
+                result = method.invoke(delegate, args);
+            }
+        } catch (InvocationTargetException e) {
+            Logger.endScope(" = Exception " + e.getMessage());
+            throw e.getCause();
+        }
+        Logger.endScope(" = " + Logger.pretty(result));
+        return result;
+    }
+
+    /**
+     * The object returned by this method will implement all interfaces that are implemented by delegate.
+     */
+    public static <T> T getProxy(Class<T> interf, T delegate) {
+        Class<?>[] interfaces = ReplacingStreams.getAllInterfaces(delegate.getClass());
+        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new LoggingProxy<>(delegate));
+        return interf.cast(obj);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+/**
+ * Logging framework for the HotSpot CRI implementation.
+ */
+package com.oracle.graal.hotspot.logging;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ArrayWriteBarrier.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.spi.*;
+
+public final class ArrayWriteBarrier extends WriteBarrier implements LIRLowerable {
+
+    @Input private ValueNode object;
+    @Input private LocationNode location;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public LocationNode location() {
+        return location;
+    }
+
+    public ArrayWriteBarrier(ValueNode object, LocationNode location) {
+        this.object = object;
+        this.location = location;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        CiValue obj = gen.emitLea(gen.makeAddress(location(), object()));
+        generateBarrier(obj, gen);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.nodes;
+
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public final class CurrentThread extends FloatingNode implements LIRLowerable {
+
+    private int threadObjectOffset;
+
+    public CurrentThread(int threadObjectOffset) {
+        super(StampFactory.forKind(CiKind.Object));
+        this.threadObjectOffset = threadObjectOffset;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        generator.setResult(this, generator.emitLoad(new CiAddress(CiKind.Object, AMD64.r15.asValue(generator.target().wordKind), threadObjectOffset), false));
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static Object get(int threadObjectOffset) {
+        throw new UnsupportedOperationException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/FieldWriteBarrier.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+public final class FieldWriteBarrier extends WriteBarrier implements LIRLowerable {
+
+    @Input private ValueNode object;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public FieldWriteBarrier(ValueNode object) {
+        this.object = object;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        CiValue obj = generator.newVariable(generator.target().wordKind);
+        generator.emitMove(generator.operand(object()), obj);
+        generateBarrier(obj, generator);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.nodes;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.target.amd64.*;
+import com.oracle.graal.java.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * Performs a tail call to the specified target compiled method, with the parameter taken from the supplied FrameState.
+ */
+public class TailcallNode extends FixedWithNextNode implements LIRLowerable {
+
+    @Input private final FrameState frameState;
+    @Input private final ValueNode target;
+
+    /**
+     * Creates a TailcallNode.
+     * @param target points to the start of an nmethod
+     * @param frameState the parameters will be taken from this FrameState
+     */
+    public TailcallNode(ValueNode target, FrameState frameState) {
+        super(StampFactory.illegal());
+        this.target = target;
+        this.frameState = frameState;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        LIRGenerator gen = (LIRGenerator) generator;
+        HotSpotVMConfig config = CompilerImpl.getInstance().getConfig();
+        RiResolvedMethod method = frameState.method();
+        boolean isStatic = Modifier.isStatic(method.accessFlags());
+
+        CiKind[] signature = CiUtil.signatureToKinds(method.signature(), isStatic ? null : method.holder().kind(true));
+        CiCallingConvention cc = gen.frameMap().registerConfig.getCallingConvention(CiCallingConvention.Type.JavaCall, signature, gen.target(), false);
+        gen.frameMap().callsMethod(cc, CiCallingConvention.Type.JavaCall); // TODO (aw): I think this is unnecessary for a tail call.
+        List<ValueNode> parameters = new ArrayList<>();
+        for (int i = 0, slot = 0; i < cc.locations.length; i++, slot += FrameStateBuilder.stackSlots(frameState.localAt(slot).kind())) {
+            parameters.add(frameState.localAt(slot));
+        }
+        List<CiValue> argList = gen.visitInvokeArguments(cc, parameters);
+
+        CiValue entry = gen.emitLoad(new CiAddress(CiKind.Long, gen.operand(target), config.nmethodEntryOffset), false);
+
+        gen.append(new AMD64TailcallOp(argList, entry, cc.locations));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public abstract class WriteBarrier extends FixedWithNextNode {
+
+    public WriteBarrier() {
+        super(StampFactory.illegal());
+    }
+
+    protected void generateBarrier(CiValue obj, LIRGeneratorTool gen) {
+        HotSpotVMConfig config = CompilerImpl.getInstance().getConfig();
+        CiValue base = gen.emitUShr(obj, CiConstant.forInt(config.cardtableShift));
+
+        long startAddress = config.cardtableStartAddress;
+        int displacement = 0;
+        if (((int) startAddress) == startAddress) {
+            displacement = (int) startAddress;
+        } else {
+            base = gen.emitAdd(base, CiConstant.forLong(config.cardtableStartAddress));
+        }
+        gen.emitStore(new CiAddress(CiKind.Boolean, base, displacement), CiConstant.FALSE, false);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * 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 containing the runtime interface (defined in the CRI project) implementation for HotSpot.
+ * There is a class that bridges from the C++ to the Java side (VMExitsNative.java) and one that bridges
+ * from the Java to the C++ side (VMEntriesNative.java).
+ */
+package com.oracle.graal.hotspot;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Implementation of RiCompiledMethod for HotSpot. Stores a reference to the nmethod which contains the compiled code.
+ */
+public class HotSpotCompiledMethod extends CompilerObject implements RiCompiledMethod {
+
+    private static final long serialVersionUID = 156632908220561612L;
+
+    private final RiResolvedMethod method;
+    public long nmethod;
+
+    public HotSpotCompiledMethod(Compiler compiler, RiResolvedMethod method) {
+        super(compiler);
+        this.method = method;
+    }
+
+    @Override
+    public RiResolvedMethod method() {
+        return method;
+    }
+
+    @Override
+    public boolean isValid() {
+        return nmethod != 0;
+    }
+
+    @Override
+    public String toString() {
+        return "compiled method " + method + " @" + nmethod;
+    }
+
+    @Override
+    public Object execute(Object arg1, Object arg2, Object arg3) {
+        assert method.signature().argumentCount(!Modifier.isStatic(method.accessFlags())) == 3;
+        assert method.signature().argumentKindAt(0, false) == CiKind.Object;
+        assert method.signature().argumentKindAt(1, false) == CiKind.Object;
+        assert !Modifier.isStatic(method.accessFlags()) || method.signature().argumentKindAt(2, false) == CiKind.Object;
+        return compiler.getVMEntries().executeCompiledMethod(this, arg1, arg2, arg3);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotConstantPool.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Implementation of RiConstantPool for HotSpot.
+ */
+public class HotSpotConstantPool extends CompilerObject implements RiConstantPool {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -5443206401485234850L;
+    private final HotSpotTypeResolvedImpl type;
+
+    public HotSpotConstantPool(Compiler compiler, HotSpotTypeResolvedImpl type) {
+        super(compiler);
+        this.type = type;
+    }
+
+    @Override
+    public Object lookupConstant(int cpi) {
+        Object constant = compiler.getVMEntries().RiConstantPool_lookupConstant(type, cpi);
+        return constant;
+    }
+
+    @Override
+    public RiSignature lookupSignature(int cpi) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public RiMethod lookupMethod(int cpi, int byteCode) {
+        return compiler.getVMEntries().RiConstantPool_lookupMethod(type, cpi, (byte) byteCode);
+    }
+
+    @Override
+    public RiType lookupType(int cpi, int opcode) {
+        return compiler.getVMEntries().RiConstantPool_lookupType(type, cpi);
+    }
+
+    @Override
+    public RiField lookupField(int cpi, int opcode) {
+        return compiler.getVMEntries().RiConstantPool_lookupField(type, cpi, (byte) opcode);
+    }
+
+    @Override
+    public void loadReferencedType(int cpi, int bytecode) {
+        compiler.getVMEntries().RiConstantPool_loadReferencedType(type, cpi, (byte) bytecode);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotExceptionHandler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+
+
+public final class HotSpotExceptionHandler extends CompilerObject implements RiExceptionHandler {
+    /**
+     *
+     */
+    private static final long serialVersionUID = 7110038548061733686L;
+    private int startBci;
+    private int endBci;
+    private int handlerBci;
+    private int catchClassIndex;
+    private RiType catchClass;
+
+    private HotSpotExceptionHandler() {
+        super(null);
+    }
+
+    @Override
+    public int startBCI() {
+        return startBci;
+    }
+
+    @Override
+    public int endBCI() {
+        return endBci;
+    }
+
+    @Override
+    public int handlerBCI() {
+        return handlerBci;
+    }
+
+    @Override
+    public int catchTypeCPI() {
+        return catchClassIndex;
+    }
+
+    @Override
+    public boolean isCatchAll() {
+        return catchClassIndex == 0;
+    }
+
+    @Override
+    public RiType catchType() {
+        return catchClass;
+    }
+
+    @Override
+    public String toString() {
+        return String.format("HotSpotExceptionHandler[startBci=%d, endBci=%d, handlerBci=%d, catchClassIndex=%d, catchClass=%s", startBci, endBci, handlerBci, catchClassIndex, catchClass);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.hotspot.ri;
+
+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.graal.compiler.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Represents a field in a HotSpot type.
+ */
+public class HotSpotField extends CompilerObject implements RiResolvedField {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 7692985878836955683L;
+    private final RiResolvedType holder;
+    private final String name;
+    private final RiType type;
+    private final int offset;
+    private final int accessFlags;
+    private CiConstant constant;                // Constant part only valid for static fields.
+
+    public HotSpotField(Compiler compiler, RiResolvedType holder, String name, RiType type, int offset, int accessFlags) {
+        super(compiler);
+        this.holder = holder;
+        this.name = name;
+        this.type = type;
+        assert offset != -1;
+        this.offset = offset;
+        this.accessFlags = accessFlags;
+    }
+
+    @Override
+    public int accessFlags() {
+        return accessFlags;
+    }
+
+    @Override
+    public CiConstant constantValue(CiConstant receiver) {
+        if (receiver == null) {
+            assert Modifier.isStatic(accessFlags);
+            if (constant == null) {
+                if (holder.isInitialized() && holder.toJava() != System.class) {
+                    if (Modifier.isFinal(accessFlags()) || assumeStaticFieldsFinal(holder.toJava())) {
+                        CiConstant encoding = holder.getEncoding(Representation.StaticFields);
+                        constant = this.kind(false).readUnsafeConstant(encoding.asObject(), offset);
+                    }
+                }
+            }
+            return constant;
+        } else {
+            assert !Modifier.isStatic(accessFlags);
+            // TODO (chaeubl) HotSpot does not trust final non-static fields (see ciField.cpp)
+            if (Modifier.isFinal(accessFlags())) {
+                return this.kind(false).readUnsafeConstant(receiver.asObject(), offset);
+            }
+        }
+        return null;
+    }
+
+    private static boolean assumeStaticFieldsFinal(Class< ? > clazz) {
+        return clazz == GraalOptions.class;
+    }
+
+    @Override
+    public RiResolvedType holder() {
+        return holder;
+    }
+
+    @Override
+    public CiKind kind(boolean architecture) {
+        return type().kind(architecture);
+    }
+
+    @Override
+    public String name() {
+        return name;
+    }
+
+    @Override
+    public RiType type() {
+        return type;
+    }
+
+    public int offset() {
+        return offset;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotField<" + CiUtil.format("%h.%n", this) + ":" + offset + ">";
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        Field javaField = toJava();
+        if (javaField != null) {
+            return javaField.getAnnotation(annotationClass);
+        }
+        return null;
+    }
+
+    private Field toJava() {
+        try {
+            return holder.toJava().getDeclaredField(name);
+        } catch (NoSuchFieldException e) {
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethod.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+public abstract class HotSpotMethod extends CompilerObject implements RiMethod {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 7167491397941960839L;
+    protected String name;
+
+    protected HotSpotMethod(Compiler compiler) {
+        super(compiler);
+    }
+
+    @Override
+    public final String name() {
+        return name;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodData.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,577 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import java.util.*;
+
+import sun.misc.*;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+
+public final class HotSpotMethodData extends CompilerObject {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -8873133496591225071L;
+
+    static {
+        config = CompilerImpl.getInstance().getConfig();
+    }
+
+    // TODO (chaeubl) use same logic as in NodeClass?
+    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static final HotSpotMethodDataAccessor NO_DATA_NO_EXCEPTION_ACCESSOR = new NoMethodData(RiExceptionSeen.FALSE);
+    private static final HotSpotMethodDataAccessor NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR = new NoMethodData(RiExceptionSeen.NOT_SUPPORTED);
+    private static final HotSpotVMConfig config;
+    // sorted by tag
+    private static final HotSpotMethodDataAccessor[] PROFILE_DATA_ACCESSORS = {
+        null, new BitData(), new CounterData(), new JumpData(),
+        new TypeCheckData(), new VirtualCallData(), new RetData(),
+        new BranchData(), new MultiBranchData(), new ArgInfoData()
+    };
+
+    private Object hotspotMirror;
+    private int normalDataSize;
+    private int extraDataSize;
+
+    private HotSpotMethodData(Compiler compiler) {
+        super(compiler);
+        throw new IllegalStateException("this constructor is never actually called, because the objects are allocated from within the VM");
+    }
+
+    public boolean hasNormalData() {
+        return normalDataSize > 0;
+    }
+
+    public boolean hasExtraData() {
+        return extraDataSize > 0;
+    }
+
+    public int getExtraDataBeginOffset() {
+        return normalDataSize;
+    }
+
+    public boolean isWithin(int position) {
+        return position >= 0 && position < normalDataSize + extraDataSize;
+    }
+
+    public HotSpotMethodDataAccessor getNormalData(int position) {
+        if (position >= normalDataSize) {
+            return null;
+        }
+
+        HotSpotMethodDataAccessor result = getData(position);
+        assert result != null : "NO_DATA tag is not allowed";
+        return result;
+    }
+
+    public HotSpotMethodDataAccessor getExtraData(int position) {
+        if (position >= normalDataSize + extraDataSize) {
+            return null;
+        }
+        return getData(position);
+    }
+
+    public static HotSpotMethodDataAccessor getNoDataAccessor(boolean exceptionPossiblyNotRecorded) {
+        if (exceptionPossiblyNotRecorded) {
+            return NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR;
+        } else {
+            return NO_DATA_NO_EXCEPTION_ACCESSOR;
+        }
+    }
+
+    private HotSpotMethodDataAccessor getData(int position) {
+        assert position >= 0 : "out of bounds";
+        int tag = AbstractMethodData.readTag(this, position);
+        assert tag >= 0 && tag < PROFILE_DATA_ACCESSORS.length : "illegal tag";
+        return PROFILE_DATA_ACCESSORS[tag];
+    }
+
+    private int readUnsignedByte(int position, int offsetInBytes) {
+        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
+        return unsafe.getByte(hotspotMirror, fullOffsetInBytes) & 0xFF;
+    }
+
+    private int readUnsignedShort(int position, int offsetInBytes) {
+        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
+        return unsafe.getShort(hotspotMirror, fullOffsetInBytes) & 0xFFFF;
+    }
+
+    private long readUnsignedInt(int position, int offsetInBytes) {
+        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
+        return unsafe.getInt(hotspotMirror, fullOffsetInBytes) & 0xFFFFFFFFL;
+    }
+
+    private int readUnsignedIntAsSignedInt(int position, int offsetInBytes) {
+        long value = readUnsignedInt(position, offsetInBytes);
+        return truncateLongToInt(value);
+    }
+
+    private int readInt(int position, int offsetInBytes) {
+        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
+        return unsafe.getInt(hotspotMirror, fullOffsetInBytes);
+    }
+
+    private Object readObject(int position, int offsetInBytes) {
+        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
+        return unsafe.getObject(hotspotMirror, fullOffsetInBytes);
+    }
+
+    private static int truncateLongToInt(long value) {
+        return value > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) value;
+    }
+
+    private static int computeFullOffset(int position, int offsetInBytes) {
+        return config.methodDataOopDataOffset + position + offsetInBytes;
+    }
+
+    private static int cellIndexToOffset(int cells) {
+        return config.dataLayoutHeaderSize + cellsToBytes(cells);
+    }
+
+    private static int cellsToBytes(int cells) {
+        return cells * config.dataLayoutCellSize;
+    }
+
+    private abstract static class AbstractMethodData implements HotSpotMethodDataAccessor {
+        private static final int EXCEPTIONS_MASK = 0x80;
+
+        private final int tag;
+        private final int staticSize;
+
+        protected AbstractMethodData(int tag, int staticSize) {
+            this.tag = tag;
+            this.staticSize = staticSize;
+        }
+
+        public int getTag() {
+            return tag;
+        }
+
+        public static int readTag(HotSpotMethodData data, int position) {
+            return data.readUnsignedByte(position, config.dataLayoutTagOffset);
+        }
+
+        @Override
+        public int getBCI(HotSpotMethodData data, int position) {
+            return data.readUnsignedShort(position, config.dataLayoutBCIOffset);
+        }
+
+        @Override
+        public int getSize(HotSpotMethodData data, int position) {
+            return staticSize + getDynamicSize(data, position);
+        }
+
+        @Override
+        public RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
+            return RiExceptionSeen.get((getFlags(data, position) & EXCEPTIONS_MASK) != 0);
+        }
+
+        @Override
+        public RiTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
+            return null;
+        }
+
+        @Override
+        public double getBranchTakenProbability(HotSpotMethodData data, int position) {
+            return -1;
+        }
+
+        @Override
+        public double[] getSwitchProbabilities(HotSpotMethodData data, int position) {
+            return null;
+        }
+
+        @Override
+        public int getExecutionCount(HotSpotMethodData data, int position) {
+            return -1;
+        }
+
+        protected int getFlags(HotSpotMethodData data, int position) {
+            return data.readUnsignedByte(position, config.dataLayoutFlagsOffset);
+        }
+
+        protected int getDynamicSize(@SuppressWarnings("unused") HotSpotMethodData data, @SuppressWarnings("unused") int position) {
+            return 0;
+        }
+    }
+
+    private static class NoMethodData extends AbstractMethodData {
+        private static final int NO_DATA_TAG = 0;
+        private static final int NO_DATA_SIZE = cellIndexToOffset(0);
+
+        private final RiExceptionSeen exceptionSeen;
+
+        protected NoMethodData(RiExceptionSeen exceptionSeen) {
+            super(NO_DATA_TAG, NO_DATA_SIZE);
+            this.exceptionSeen = exceptionSeen;
+        }
+
+        @Override
+        public int getBCI(HotSpotMethodData data, int position) {
+            return -1;
+        }
+
+
+        @Override
+        public RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
+            return exceptionSeen;
+        }
+    }
+
+    private static class BitData extends AbstractMethodData {
+        private static final int BIT_DATA_TAG = 1;
+        private static final int BIT_DATA_SIZE = cellIndexToOffset(0);
+        private static final int BIT_DATA_NULL_SEEN_FLAG = 0x01;
+
+        private BitData() {
+            super(BIT_DATA_TAG, BIT_DATA_SIZE);
+        }
+
+        protected BitData(int tag, int staticSize) {
+            super(tag, staticSize);
+        }
+
+        @SuppressWarnings("unused")
+        public boolean getNullSeen(HotSpotMethodData data, int position) {
+            return (getFlags(data, position) & BIT_DATA_NULL_SEEN_FLAG) != 0;
+        }
+    }
+
+    private static class CounterData extends BitData {
+        private static final int COUNTER_DATA_TAG = 2;
+        private static final int COUNTER_DATA_SIZE = cellIndexToOffset(1);
+        private static final int COUNTER_DATA_COUNT_OFFSET = cellIndexToOffset(0);
+
+        public CounterData() {
+            super(COUNTER_DATA_TAG, COUNTER_DATA_SIZE);
+        }
+
+        protected CounterData(int tag, int staticSize) {
+            super(tag, staticSize);
+        }
+
+        @Override
+        public int getExecutionCount(HotSpotMethodData data, int position) {
+            return getCounterValue(data, position);
+        }
+
+        protected int getCounterValue(HotSpotMethodData data, int position) {
+            return data.readUnsignedIntAsSignedInt(position, COUNTER_DATA_COUNT_OFFSET);
+        }
+    }
+
+    private static class JumpData extends AbstractMethodData {
+        private static final int JUMP_DATA_TAG = 3;
+        private static final int JUMP_DATA_SIZE = cellIndexToOffset(2);
+        protected static final int TAKEN_COUNT_OFFSET = cellIndexToOffset(0);
+        protected static final int TAKEN_DISPLACEMENT_OFFSET = cellIndexToOffset(1);
+
+        public JumpData() {
+            super(JUMP_DATA_TAG, JUMP_DATA_SIZE);
+        }
+
+        protected JumpData(int tag, int staticSize) {
+            super(tag, staticSize);
+        }
+
+        @Override
+        public double getBranchTakenProbability(HotSpotMethodData data, int position) {
+            return getExecutionCount(data, position) != 0 ? 1 : 0;
+        }
+
+        @Override
+        public int getExecutionCount(HotSpotMethodData data, int position) {
+            return data.readUnsignedIntAsSignedInt(position, TAKEN_COUNT_OFFSET);
+        }
+
+        @SuppressWarnings("unused")
+        public int getTakenDisplacement(HotSpotMethodData data, int position) {
+            return data.readInt(position, TAKEN_DISPLACEMENT_OFFSET);
+        }
+    }
+
+    private abstract static class AbstractTypeData extends CounterData {
+        private static final int RECEIVER_TYPE_DATA_ROW_SIZE = cellsToBytes(2);
+        private static final int RECEIVER_TYPE_DATA_SIZE = cellIndexToOffset(1) + RECEIVER_TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
+        private static final int RECEIVER_TYPE_DATA_FIRST_RECEIVER_OFFSET = cellIndexToOffset(1);
+        private static final int RECEIVER_TYPE_DATA_FIRST_COUNT_OFFSET = cellIndexToOffset(2);
+
+        protected AbstractTypeData(int tag) {
+            super(tag, RECEIVER_TYPE_DATA_SIZE);
+        }
+
+        @Override
+        public RiTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
+            int typeProfileWidth = config.typeProfileWidth;
+
+            RiResolvedType[] sparseTypes = new RiResolvedType[typeProfileWidth];
+            double[] counts = new double[typeProfileWidth];
+            long totalCount = 0;
+            int entries = 0;
+
+            for (int i = 0; i < typeProfileWidth; i++) {
+                Object receiverKlassOop = data.readObject(position, getReceiverOffset(i));
+                if (receiverKlassOop != null) {
+                    Object graalMirror = unsafe.getObject(receiverKlassOop, (long) config.graalMirrorKlassOffset);
+                    if (graalMirror == null) {
+                        Class<?> javaClass = (Class<?>) unsafe.getObject(receiverKlassOop, (long) config.classMirrorOffset);
+                        graalMirror = CompilerImpl.getInstance().getVMEntries().getType(javaClass);
+                        assert graalMirror != null : "must not return null";
+                    }
+                    sparseTypes[entries] = (RiResolvedType) graalMirror;
+
+                    long count = data.readUnsignedInt(position, getCountOffset(i));
+                    totalCount += count;
+                    counts[entries] = count;
+
+                    entries++;
+                }
+            }
+
+            totalCount += getTypesNotRecordedExecutionCount(data, position);
+            return createRiTypeProfile(sparseTypes, counts, totalCount, entries);
+        }
+
+        protected long getTypesNotRecordedExecutionCount(HotSpotMethodData data, int position) {
+            // checkcast/aastore/instanceof profiling in the HotSpot template-based interpreter was adjusted so that the counter
+            // is incremented to indicate the polymorphic case instead of decrementing it for failed type checks
+            return getCounterValue(data, position);
+        }
+
+        private static RiTypeProfile createRiTypeProfile(RiResolvedType[] sparseTypes, double[] counts, long totalCount, int entries) {
+            RiResolvedType[] types;
+            double[] probabilities;
+
+            if (entries <= 0 || totalCount < GraalOptions.MatureExecutionsTypeProfile) {
+                return null;
+            } else if (entries < sparseTypes.length) {
+                types = Arrays.copyOf(sparseTypes, entries);
+                probabilities = new double[entries];
+            } else {
+                types = sparseTypes;
+                probabilities = counts;
+            }
+
+            double totalProbability = 0.0;
+            for (int i = 0; i < entries; i++) {
+                double p = counts[i] / totalCount;
+                probabilities[i] = p;
+                totalProbability += p;
+            }
+
+            double notRecordedTypeProbability = entries < config.typeProfileWidth ? 0.0 : Math.min(1.0, Math.max(0.0, 1.0 - totalProbability));
+            return new RiTypeProfile(types, notRecordedTypeProbability, probabilities);
+        }
+
+        private static int getReceiverOffset(int row) {
+            return RECEIVER_TYPE_DATA_FIRST_RECEIVER_OFFSET + row * RECEIVER_TYPE_DATA_ROW_SIZE;
+        }
+
+        protected static int getCountOffset(int row) {
+            return RECEIVER_TYPE_DATA_FIRST_COUNT_OFFSET + row * RECEIVER_TYPE_DATA_ROW_SIZE;
+        }
+    }
+
+    private static class TypeCheckData extends AbstractTypeData {
+        private static final int RECEIVER_TYPE_DATA_TAG = 4;
+
+        public TypeCheckData() {
+            super(RECEIVER_TYPE_DATA_TAG);
+        }
+
+        @Override
+        public int getExecutionCount(HotSpotMethodData data, int position) {
+            return -1;
+        }
+    }
+
+    private static class VirtualCallData extends AbstractTypeData {
+        private static final int VIRTUAL_CALL_DATA_TAG = 5;
+
+        public VirtualCallData() {
+            super(VIRTUAL_CALL_DATA_TAG);
+        }
+
+        @Override
+        public int getExecutionCount(HotSpotMethodData data, int position) {
+            int typeProfileWidth = config.typeProfileWidth;
+
+            long total = 0;
+            for (int i = 0; i < typeProfileWidth; i++) {
+                total += data.readUnsignedInt(position, getCountOffset(i));
+            }
+
+            total += getCounterValue(data, position);
+            return truncateLongToInt(total);
+        }
+    }
+
+    private static class RetData extends CounterData {
+        private static final int RET_DATA_TAG = 6;
+        private static final int RET_DATA_ROW_SIZE = cellsToBytes(3);
+        private static final int RET_DATA_SIZE = cellIndexToOffset(1) + RET_DATA_ROW_SIZE * config.bciProfileWidth;
+
+        public RetData() {
+            super(RET_DATA_TAG, RET_DATA_SIZE);
+        }
+    }
+
+    private static class BranchData extends JumpData {
+        private static final int BRANCH_DATA_TAG = 7;
+        private static final int BRANCH_DATA_SIZE = cellIndexToOffset(3);
+        private static final int NOT_TAKEN_COUNT_OFFSET = cellIndexToOffset(2);
+
+        public BranchData() {
+            super(BRANCH_DATA_TAG, BRANCH_DATA_SIZE);
+        }
+
+        @Override
+        public double getBranchTakenProbability(HotSpotMethodData data, int position) {
+            long takenCount = data.readUnsignedInt(position, TAKEN_COUNT_OFFSET);
+            long notTakenCount = data.readUnsignedInt(position, NOT_TAKEN_COUNT_OFFSET);
+            long total = takenCount + notTakenCount;
+
+            if (total < GraalOptions.MatureExecutionsBranch) {
+                return -1;
+            } else {
+                return takenCount / (double) total;
+            }
+        }
+
+        @Override
+        public int getExecutionCount(HotSpotMethodData data, int position) {
+            long count = data.readUnsignedInt(position, TAKEN_COUNT_OFFSET) + data.readUnsignedInt(position, NOT_TAKEN_COUNT_OFFSET);
+            return truncateLongToInt(count);
+        }
+    }
+
+    private static class ArrayData extends AbstractMethodData {
+        private static final int ARRAY_DATA_LENGTH_OFFSET = cellIndexToOffset(0);
+        protected static final int ARRAY_DATA_START_OFFSET = cellIndexToOffset(1);
+
+        public ArrayData(int tag, int staticSize) {
+            super(tag, staticSize);
+        }
+
+        @Override
+        protected int getDynamicSize(HotSpotMethodData data, int position) {
+            return cellsToBytes(getLength(data, position));
+        }
+
+        protected static int getLength(HotSpotMethodData data, int position) {
+            return data.readInt(position, ARRAY_DATA_LENGTH_OFFSET);
+        }
+    }
+
+    private static class MultiBranchData extends ArrayData {
+        private static final int MULTI_BRANCH_DATA_TAG = 8;
+        private static final int MULTI_BRANCH_DATA_SIZE = cellIndexToOffset(1);
+        private static final int MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS = 2;
+        private static final int MULTI_BRANCH_DATA_ROW_SIZE = cellsToBytes(MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS);
+        private static final int MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(0);
+        private static final int MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(1);
+
+        public MultiBranchData() {
+            super(MULTI_BRANCH_DATA_TAG, MULTI_BRANCH_DATA_SIZE);
+        }
+
+        @Override
+        public double[] getSwitchProbabilities(HotSpotMethodData data, int position) {
+            int arrayLength = getLength(data, position);
+            assert arrayLength > 0 : "switch must have at least the default case";
+            assert arrayLength % MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS == 0 : "array must have full rows";
+
+            int length = arrayLength / MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS;
+            long totalCount = 0;
+            double[] result = new double[length];
+
+            // default case is first in HotSpot but last for the compiler
+            long count = readCount(data, position, 0);
+            totalCount += count;
+            result[length - 1] = count;
+
+            for (int i = 1; i < length; i++) {
+                count = readCount(data, position, i);
+                totalCount += count;
+                result[i - 1] = count;
+            }
+
+            if (totalCount < GraalOptions.MatureExecutionsPerSwitchCase * length) {
+                return null;
+            } else {
+                for (int i = 0; i < length; i++) {
+                    result[i] = result[i] / totalCount;
+                }
+                return result;
+            }
+        }
+
+        private static long readCount(HotSpotMethodData data, int position, int i) {
+            int offset;
+            long count;
+            offset = getCountOffset(i);
+            count = data.readUnsignedInt(position, offset);
+            return count;
+        }
+
+        @Override
+        public int getExecutionCount(HotSpotMethodData data, int position) {
+            int arrayLength = getLength(data, position);
+            assert arrayLength > 0 : "switch must have at least the default case";
+            assert arrayLength % MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS == 0 : "array must have full rows";
+
+            int length = arrayLength / MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS;
+            long totalCount = 0;
+            for (int i = 0; i < length; i++) {
+                int offset = getCountOffset(i);
+                totalCount += data.readUnsignedInt(position, offset);
+            }
+
+            return truncateLongToInt(totalCount);
+        }
+
+        private static int getCountOffset(int index) {
+            return MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET + index * MULTI_BRANCH_DATA_ROW_SIZE;
+        }
+
+        @SuppressWarnings("unused")
+        private static int getDisplacementOffset(int index) {
+            return MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET + index * MULTI_BRANCH_DATA_ROW_SIZE;
+        }
+    }
+
+    private static class ArgInfoData extends ArrayData {
+        private static final int ARG_INFO_DATA_TAG = 9;
+        private static final int ARG_INFO_DATA_SIZE = cellIndexToOffset(1);
+
+        public ArgInfoData() {
+            super(ARG_INFO_DATA_TAG, ARG_INFO_DATA_SIZE);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodDataAccessor.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * Interface for accessor objects that encapsulate the logic for accessing the different kinds of data in a HotSpot methodDataOop.
+ * This interface is similar to the interface {@link RiProfilingInfo}, but most methods require a MethodDataObject and the
+ * exact position within the methodData.
+ */
+public interface HotSpotMethodDataAccessor {
+    /**
+     * Returns the tag stored in the LayoutData header.
+     * @return An integer >= 0 or -1 if not supported.
+     */
+    int getTag();
+
+    /**
+     * Returns the BCI stored in the LayoutData header.
+     * @return An integer >= 0 and <= Short.MAX_VALUE, or -1 if not supported.
+     */
+    int getBCI(HotSpotMethodData data, int position);
+
+    /**
+     * Computes the size for the specific data at the given position.
+     * @return An integer > 0.
+     */
+    int getSize(HotSpotMethodData data, int position);
+
+    RiTypeProfile getTypeProfile(HotSpotMethodData data, int position);
+    double getBranchTakenProbability(HotSpotMethodData data, int position);
+    double[] getSwitchProbabilities(HotSpotMethodData data, int position);
+    RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position);
+    int getExecutionCount(HotSpotMethodData data, int position);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolved.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.server.*;
+
+public interface HotSpotMethodResolved extends RiResolvedMethod, Remote {
+
+    RiResolvedMethod uniqueConcreteMethod();
+    void dumpProfile();
+    int vtableEntryOffset();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+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.graal.java.bytecode.*;
+
+/**
+ * Implementation of RiMethod for resolved HotSpot methods.
+ */
+public final class HotSpotMethodResolvedImpl extends HotSpotMethod implements HotSpotMethodResolved {
+
+    private static final long serialVersionUID = -5486975070147586588L;
+
+    /** DO NOT USE IN JAVA CODE! */
+    @SuppressWarnings("unused")
+    @Deprecated
+    private Object javaMirror;
+
+    // cached values
+    private final int codeSize;
+    private final int accessFlags;
+    private final int maxLocals;
+    private final int maxStackSize;
+    private RiSignature signature;
+    private Boolean hasBalancedMonitors;
+    private Map<Object, Object> compilerStorage;
+    private RiResolvedType holder;
+    private HotSpotMethodData methodData;
+    private byte[] code;
+    private boolean canBeInlined;
+    private CiGenericCallback callback;
+    private int compilationComplexity;
+
+    private HotSpotMethodResolvedImpl() {
+        super(null);
+        throw new IllegalStateException("this constructor is never actually called, because the objects are allocated from within the VM");
+    }
+
+    @Override
+    public RiResolvedType holder() {
+        return holder;
+    }
+
+    @Override
+    public int accessFlags() {
+        return accessFlags;
+    }
+
+    @Override
+    public boolean canBeStaticallyBound() {
+        return isLeafMethod() || Modifier.isStatic(accessFlags());
+    }
+
+    @Override
+    public byte[] code() {
+        if (code == null) {
+            code = compiler.getVMEntries().RiMethod_code(this);
+            assert code.length == codeSize : "expected: " + codeSize + ", actual: " + code.length;
+        }
+        return code;
+    }
+
+    @Override
+    public int codeSize() {
+        return codeSize;
+    }
+
+    @Override
+    public RiExceptionHandler[] exceptionHandlers() {
+        return compiler.getVMEntries().RiMethod_exceptionHandlers(this);
+    }
+
+    @Override
+    public boolean hasBalancedMonitors() {
+        if (hasBalancedMonitors == null) {
+            hasBalancedMonitors = compiler.getVMEntries().RiMethod_hasBalancedMonitors(this);
+        }
+        return hasBalancedMonitors;
+    }
+
+    @Override
+    public boolean isClassInitializer() {
+        return "<clinit>".equals(name) && Modifier.isStatic(accessFlags());
+    }
+
+    @Override
+    public boolean isConstructor() {
+        return "<init>".equals(name) && !Modifier.isStatic(accessFlags());
+    }
+
+    @Override
+    public boolean isLeafMethod() {
+        return Modifier.isFinal(accessFlags()) || Modifier.isPrivate(accessFlags());
+    }
+
+    @Override
+    public boolean isOverridden() {
+        throw new UnsupportedOperationException("isOverridden");
+    }
+
+    @Override
+    public boolean noSafepointPolls() {
+        return false;
+    }
+
+    @Override
+    public String jniSymbol() {
+        throw new UnsupportedOperationException("jniSymbol");
+    }
+
+    public CiBitMap[] livenessMap() {
+        return null;
+    }
+
+    @Override
+    public int maxLocals() {
+        return maxLocals;
+    }
+
+    @Override
+    public int maxStackSize() {
+        return maxStackSize;
+    }
+
+    @Override
+    public StackTraceElement toStackTraceElement(int bci) {
+        return CiUtil.toStackTraceElement(this, bci);
+    }
+
+    @Override
+    public RiResolvedMethod uniqueConcreteMethod() {
+        return (RiResolvedMethod) compiler.getVMEntries().RiMethod_uniqueConcreteMethod(this);
+    }
+
+    @Override
+    public RiSignature signature() {
+        if (signature == null) {
+            signature = new HotSpotSignature(compiler, compiler.getVMEntries().RiMethod_signature(this));
+        }
+        return signature;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotMethod<" + CiUtil.format("%h.%n", this) + ">";
+    }
+
+    public boolean hasCompiledCode() {
+        return compiler.getVMEntries().RiMethod_hasCompiledCode(this);
+    }
+
+    public int compiledCodeSize() {
+        return compiler.getVMEntries().RiMethod_getCompiledCodeSize(this);
+    }
+
+    @Override
+    public RiResolvedType accessor() {
+        return null;
+    }
+
+    @Override
+    public String intrinsic() {
+        return null;
+    }
+
+    @Override
+    public int invocationCount() {
+        return compiler.getVMEntries().RiMethod_invocationCount(this);
+    }
+
+    @Override
+    public int compilationComplexity() {
+        if (compilationComplexity <= 0 && codeSize() > 0) {
+            BytecodeStream s = new BytecodeStream(code());
+            int result = 0;
+            int currentBC;
+            while ((currentBC = s.currentBC()) != Bytecodes.END) {
+                result += Bytecodes.compilationComplexity(currentBC);
+                s.next();
+            }
+            assert result > 0;
+            compilationComplexity = result;
+        }
+        return compilationComplexity;
+    }
+
+    @Override
+    public RiProfilingInfo profilingInfo() {
+        if (methodData == null) {
+            methodData = compiler.getVMEntries().RiMethod_methodData(this);
+        }
+
+        if (methodData == null) {
+            return new HotSpotNoProfilingInfo(compiler);
+        } else {
+            return new HotSpotProfilingInfo(compiler, methodData);
+        }
+    }
+
+    @Override
+    public Map<Object, Object> compilerStorage() {
+        if (compilerStorage == null) {
+            compilerStorage = new ConcurrentHashMap<>();
+        }
+        return compilerStorage;
+    }
+
+    @Override
+    public RiConstantPool getConstantPool() {
+        return ((HotSpotTypeResolvedImpl) holder()).constantPool();
+    }
+
+    @Override
+    public void dumpProfile() {
+        TTY.println("profile info for %s", this);
+        TTY.println("canBeStaticallyBound: " + canBeStaticallyBound());
+        TTY.println("invocationCount: " + invocationCount());
+        RiProfilingInfo profilingInfo = this.profilingInfo();
+        for (int i = 0; i < codeSize(); i++) {
+            if (profilingInfo.getExecutionCount(i) != -1) {
+                TTY.println("  executionCount@%d: %d", i, profilingInfo.getExecutionCount(i));
+            }
+
+            if (profilingInfo.getBranchTakenProbability(i) != -1) {
+                TTY.println("  branchProbability@%d: %f", i, profilingInfo.getBranchTakenProbability(i));
+            }
+
+            double[] switchProbabilities = profilingInfo.getSwitchProbabilities(i);
+            if (switchProbabilities != null) {
+                TTY.print("  switchProbabilities@%d:", i);
+                for (int j = 0; j < switchProbabilities.length; j++) {
+                    TTY.print(" %f", switchProbabilities[j]);
+                }
+                TTY.println();
+            }
+
+            if (profilingInfo.getExceptionSeen(i) != RiExceptionSeen.FALSE) {
+                TTY.println("  exceptionSeen@%d: %s", i, profilingInfo.getExceptionSeen(i).name());
+            }
+
+            RiTypeProfile typeProfile = profilingInfo.getTypeProfile(i);
+            if (typeProfile != null) {
+                RiResolvedType[] types = typeProfile.getTypes();
+                double[] probabilities = typeProfile.getProbabilities();
+                if (types != null && probabilities != null) {
+                    assert types.length == probabilities.length : "length must match";
+                    TTY.print("  types@%d:", i);
+                    for (int j = 0; j < types.length; j++) {
+                        TTY.print(" %s (%f)", types[j], probabilities[j]);
+                    }
+                    TTY.println(" not recorded (%f)", typeProfile.getNotRecordedProbability());
+                }
+            }
+        }
+    }
+
+    @Override
+    public Annotation[][] getParameterAnnotations() {
+        if (isConstructor()) {
+            Constructor javaConstructor = toJavaConstructor();
+            return javaConstructor == null ? null : javaConstructor.getParameterAnnotations();
+        }
+        Method javaMethod = toJava();
+        return javaMethod == null ? null : javaMethod.getParameterAnnotations();
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        if (isConstructor()) {
+            Constructor<?> javaConstructor = toJavaConstructor();
+            return javaConstructor == null ? null : javaConstructor.getAnnotation(annotationClass);
+        }
+        Method javaMethod = toJava();
+        return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass);
+    }
+
+    @Override
+    public Type getGenericReturnType() {
+        if (isConstructor()) {
+            return void.class;
+        }
+        Method javaMethod = toJava();
+        return javaMethod == null ? null : javaMethod.getGenericReturnType();
+    }
+
+    @Override
+    public Type[] getGenericParameterTypes() {
+        if (isConstructor()) {
+            Constructor javaConstructor = toJavaConstructor();
+            return javaConstructor == null ? null : javaConstructor.getGenericParameterTypes();
+        }
+        Method javaMethod = toJava();
+        return javaMethod == null ? null : javaMethod.getGenericParameterTypes();
+    }
+
+    private Method toJava() {
+        try {
+            return holder.toJava().getDeclaredMethod(name, CiUtil.signatureToTypes(signature(), holder));
+        } catch (NoSuchMethodException e) {
+            return null;
+        }
+    }
+
+    private Constructor toJavaConstructor() {
+        try {
+            return holder.toJava().getDeclaredConstructor(CiUtil.signatureToTypes(signature(), holder));
+        } catch (NoSuchMethodException e) {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean canBeInlined() {
+        return canBeInlined && callback == null;
+    }
+    public void neverInline() {
+        this.canBeInlined = false;
+    }
+
+    public CiGenericCallback callback() {
+        return callback;
+    }
+    public void setCallback(CiGenericCallback callback) {
+        this.callback = callback;
+    }
+
+    @Override
+    public int vtableEntryOffset() {
+        return compiler.getVMEntries().RiMethod_vtableEntryOffset(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodUnresolved.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Implementation of RiMethod for unresolved HotSpot methods.
+ */
+public final class HotSpotMethodUnresolved extends HotSpotMethod {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 5610263481791970079L;
+    private final RiSignature signature;
+    protected RiType holder;
+
+    public HotSpotMethodUnresolved(Compiler compiler, String name, String signature, RiType holder) {
+        super(compiler);
+        this.name = name;
+        this.holder = holder;
+        this.signature = new HotSpotSignature(compiler, signature);
+    }
+
+    @Override
+    public RiSignature signature() {
+        return signature;
+    }
+
+    @Override
+    public RiType holder() {
+        return holder;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotMethod<" + holder.name() + ". " + name + ", unresolved>";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotNoProfilingInfo.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Dummy profiling information in case that a method was not executed frequently enough so that
+ * no profiling information does exist yet.
+ */
+public final class HotSpotNoProfilingInfo extends CompilerObject implements RiProfilingInfo {
+    /**
+     *
+     */
+    private static final long serialVersionUID = 4357945025049704109L;
+    // Be optimistic and return false for exceptionSeen. A methodDataOop is allocated in case of a deoptimization.
+    private static final HotSpotMethodDataAccessor noData = HotSpotMethodData.getNoDataAccessor(false);
+
+    public HotSpotNoProfilingInfo(Compiler compiler) {
+        super(compiler);
+    }
+
+    @Override
+    public RiTypeProfile getTypeProfile(int bci) {
+        return noData.getTypeProfile(null, -1);
+    }
+
+    @Override
+    public double getBranchTakenProbability(int bci) {
+        return noData.getBranchTakenProbability(null, -1);
+    }
+
+    @Override
+    public double[] getSwitchProbabilities(int bci) {
+        return noData.getSwitchProbabilities(null, -1);
+    }
+
+    @Override
+    public RiExceptionSeen getExceptionSeen(int bci) {
+        return noData.getExceptionSeen(null, -1);
+    }
+
+    @Override
+    public int getExecutionCount(int bci) {
+        return noData.getExecutionCount(null, -1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+
+public final class HotSpotProfilingInfo extends CompilerObject implements RiProfilingInfo {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -8307682725047864875L;
+    private static final DebugMetric metricInsufficentSpace = Debug.metric("InsufficientSpaceForProfilingData");
+
+    private int position;
+    private int hintPosition;
+    private int hintBCI;
+    private HotSpotMethodDataAccessor dataAccessor;
+    private HotSpotMethodData methodData;
+
+    public HotSpotProfilingInfo(Compiler compiler, HotSpotMethodData methodData) {
+        super(compiler);
+        this.methodData = methodData;
+        hintPosition = 0;
+        hintBCI = -1;
+    }
+
+    @Override
+    public RiTypeProfile getTypeProfile(int bci) {
+        findBCI(bci, false);
+        return dataAccessor.getTypeProfile(methodData, position);
+    }
+
+    @Override
+    public double getBranchTakenProbability(int bci) {
+        findBCI(bci, false);
+        return dataAccessor.getBranchTakenProbability(methodData, position);
+    }
+
+    @Override
+    public double[] getSwitchProbabilities(int bci) {
+        findBCI(bci, false);
+        return dataAccessor.getSwitchProbabilities(methodData, position);
+    }
+
+    @Override
+    public RiExceptionSeen getExceptionSeen(int bci) {
+        findBCI(bci, true);
+        return dataAccessor.getExceptionSeen(methodData, position);
+    }
+
+    @Override
+    public int getExecutionCount(int bci) {
+        findBCI(bci, false);
+        return dataAccessor.getExecutionCount(methodData, position);
+    }
+
+    private void findBCI(int targetBCI, boolean searchExtraData) {
+        assert targetBCI >= 0 : "invalid BCI";
+
+        if (methodData.hasNormalData()) {
+            int currentPosition = targetBCI < hintBCI ? 0 : hintPosition;
+            HotSpotMethodDataAccessor currentAccessor;
+            while ((currentAccessor = methodData.getNormalData(currentPosition)) != null) {
+                int currentBCI = currentAccessor.getBCI(methodData, currentPosition);
+                if (currentBCI == targetBCI) {
+                    normalDataFound(currentAccessor, currentPosition, currentBCI);
+                    return;
+                } else if (currentBCI > targetBCI) {
+                    break;
+                }
+                currentPosition = currentPosition + currentAccessor.getSize(methodData, currentPosition);
+            }
+        }
+
+        boolean exceptionPossiblyNotRecorded = false;
+        if (searchExtraData && methodData.hasExtraData()) {
+            int currentPosition = methodData.getExtraDataBeginOffset();
+            HotSpotMethodDataAccessor currentAccessor;
+            while ((currentAccessor = methodData.getExtraData(currentPosition)) != null) {
+                int currentBCI = currentAccessor.getBCI(methodData, currentPosition);
+                if (currentBCI == targetBCI) {
+                    extraDataFound(currentAccessor, currentPosition);
+                    return;
+                }
+                currentPosition = currentPosition + currentAccessor.getSize(methodData, currentPosition);
+            }
+
+            if (!methodData.isWithin(currentPosition)) {
+                exceptionPossiblyNotRecorded = true;
+                metricInsufficentSpace.increment();
+            }
+        }
+
+        noDataFound(exceptionPossiblyNotRecorded);
+    }
+
+    private void normalDataFound(HotSpotMethodDataAccessor data, int pos, int bci) {
+        setCurrentData(data, pos);
+        this.hintPosition = position;
+        this.hintBCI = bci;
+    }
+
+    private void extraDataFound(HotSpotMethodDataAccessor data, int pos) {
+        setCurrentData(data, pos);
+    }
+
+    private void noDataFound(boolean exceptionPossiblyNotRecorded) {
+        HotSpotMethodDataAccessor accessor = HotSpotMethodData.getNoDataAccessor(exceptionPossiblyNotRecorded);
+        setCurrentData(accessor, -1);
+    }
+
+    private void setCurrentData(HotSpotMethodDataAccessor dataAccessor, int position) {
+        this.dataAccessor = dataAccessor;
+        this.position = position;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRegisterConfig.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import static com.oracle.max.asm.target.amd64.AMD64.*;
+
+import java.util.*;
+
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiCallingConvention.Type;
+import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.hotspot.*;
+
+public class HotSpotRegisterConfig implements RiRegisterConfig {
+
+    // be careful - the contents of this array are duplicated in graal_CodeInstaller.cpp
+    private final CiRegister[] allocatable = {
+        rax, rbx, rcx, rdx, rsi, rdi, r8, r9, /* r10, */r11, r12, r13, r14, /*r15*/
+        xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
+        xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
+    };
+
+    private final EnumMap<RegisterFlag, CiRegister[]> categorized = CiRegister.categorize(allocatable);
+
+    private final RiRegisterAttributes[] attributesMap;
+
+    @Override
+    public CiRegister[] getAllocatableRegisters() {
+        return allocatable;
+    }
+
+    @Override
+    public EnumMap<RegisterFlag, CiRegister[]> getCategorizedAllocatableRegisters() {
+        return categorized;
+    }
+
+    @Override
+    public RiRegisterAttributes[] getAttributesMap() {
+        return attributesMap;
+    }
+
+    private final CiRegister[] generalParameterRegisters;
+    private final CiRegister[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7};
+    private final CiRegister[] allParameterRegisters;
+
+    private final CiRegister[] rsaRegs = {
+        rax,  rcx,  rdx,   rbx,   rsp,   rbp,   rsi,   rdi,
+        r8,   r9,   r10,   r11,   r12,   r13,   r14,   r15,
+        xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
+        xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
+    };
+
+    private final CiCalleeSaveLayout registerSaveArea;
+
+    public HotSpotRegisterConfig(HotSpotVMConfig config, boolean globalStubConfig) {
+        if (config.windowsOs) {
+            generalParameterRegisters = new CiRegister[] {rdx, r8, r9, rdi, rsi, rcx};
+        } else {
+            generalParameterRegisters = new CiRegister[] {rsi, rdx, rcx, r8, r9, rdi};
+        }
+
+        if (globalStubConfig) {
+            registerSaveArea = new CiCalleeSaveLayout(0, -1, 8, rsaRegs);
+        } else {
+            registerSaveArea = new CiCalleeSaveLayout(0, 8, 8, new CiRegister[0]);
+        }
+
+        attributesMap = RiRegisterAttributes.createMap(this, AMD64.allRegisters);
+        allParameterRegisters = Arrays.copyOf(generalParameterRegisters, generalParameterRegisters.length + xmmParameterRegisters.length);
+        System.arraycopy(xmmParameterRegisters, 0, allParameterRegisters, generalParameterRegisters.length, xmmParameterRegisters.length);
+    }
+
+    @Override
+    public CiRegister[] getCallerSaveRegisters() {
+        return getAllocatableRegisters();
+    }
+
+    @Override
+    public CiRegister getRegisterForRole(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public CiCallingConvention getCallingConvention(Type type, CiKind[] parameters, CiTarget target, boolean stackOnly) {
+        if (type == Type.NativeCall) {
+            throw new UnsupportedOperationException();
+        }
+        return callingConvention(parameters, type, target, stackOnly);
+    }
+
+    public CiRegister[] getCallingConventionRegisters(Type type, RegisterFlag flag) {
+        return allParameterRegisters;
+    }
+
+    private CiCallingConvention callingConvention(CiKind[] types, Type type, CiTarget target, boolean stackOnly) {
+        CiValue[] locations = new CiValue[types.length];
+
+        int currentGeneral = 0;
+        int currentXMM = 0;
+        int currentStackOffset = 0;
+
+        for (int i = 0; i < types.length; i++) {
+            final CiKind kind = types[i];
+
+            switch (kind) {
+                case Byte:
+                case Boolean:
+                case Short:
+                case Char:
+                case Int:
+                case Long:
+                case Object:
+                    if (!stackOnly && currentGeneral < generalParameterRegisters.length) {
+                        CiRegister register = generalParameterRegisters[currentGeneral++];
+                        locations[i] = register.asValue(kind);
+                    }
+                    break;
+                case Float:
+                case Double:
+                    if (!stackOnly && currentXMM < xmmParameterRegisters.length) {
+                        CiRegister register = xmmParameterRegisters[currentXMM++];
+                        locations[i] = register.asValue(kind);
+                    }
+                    break;
+                default:
+                    throw GraalInternalError.shouldNotReachHere();
+            }
+
+            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);
+    }
+
+    @Override
+    public CiRegister getReturnRegister(CiKind kind) {
+        switch (kind) {
+            case Boolean:
+            case Byte:
+            case Char:
+            case Short:
+            case Int:
+            case Long:
+            case Object:
+                return rax;
+            case Float:
+            case Double:
+                return xmm0;
+            case Void:
+            case Illegal:
+                return null;
+            default:
+                throw new UnsupportedOperationException("no return register for type " + kind);
+        }
+    }
+
+    @Override
+    public CiRegister getScratchRegister() {
+        return r10;
+    }
+
+    @Override
+    public CiRegister getFrameRegister() {
+        return rsp;
+    }
+
+    public CiCalleeSaveLayout getCalleeSaveLayout() {
+        return registerSaveArea;
+    }
+
+    @Override
+    public String toString() {
+        String res = String.format(
+             "Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" +
+             "CallerSave:  " + Arrays.toString(getCallerSaveRegisters()) + "%n" +
+             "CalleeSave:  " + getCalleeSaveLayout() + "%n" +
+             "Scratch:     " + getScratchRegister() + "%n");
+        return res;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,495 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.Call;
+import com.oracle.max.cri.ci.CiTargetMethod.DataPatch;
+import com.oracle.max.cri.ci.CiTargetMethod.Safepoint;
+import com.oracle.max.cri.ci.CiUtil.RefMapFormatter;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.Representation;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.phases.PhasePlan.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+import com.oracle.graal.hotspot.nodes.*;
+import com.oracle.graal.java.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.snippets.nodes.*;
+
+/**
+ * CRI runtime implementation for the HotSpot VM.
+ */
+public class HotSpotRuntime implements GraalRuntime {
+    final HotSpotVMConfig config;
+    final HotSpotRegisterConfig regConfig;
+    private final HotSpotRegisterConfig globalStubRegConfig;
+    private final Compiler compiler;
+
+    public HotSpotRuntime(HotSpotVMConfig config, Compiler compiler) {
+        this.config = config;
+        this.compiler = compiler;
+        regConfig = new HotSpotRegisterConfig(config, false);
+        globalStubRegConfig = new HotSpotRegisterConfig(config, true);
+    }
+
+    @Override
+    public int codeOffset() {
+        return 0;
+    }
+
+
+    public Compiler getCompiler() {
+        return compiler;
+    }
+
+    @Override
+    public String disassemble(byte[] code, long address) {
+        return compiler.getVMEntries().disassembleNative(code, address);
+    }
+
+    @Override
+    public String disassemble(CiTargetMethod tm) {
+        byte[] code = Arrays.copyOf(tm.targetCode(), tm.targetCodeSize());
+        CiTarget target = compiler.getTarget();
+        HexCodeFile hcf = new HexCodeFile(code, 0L, target.arch.name, target.wordSize * 8);
+        HexCodeFile.addAnnotations(hcf, tm.annotations());
+        addExceptionHandlersComment(tm, hcf);
+        CiRegister fp = regConfig.getFrameRegister();
+        RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0);
+        for (Safepoint safepoint : tm.safepoints) {
+            if (safepoint instanceof Call) {
+                Call call = (Call) safepoint;
+                if (call.debugInfo != null) {
+                    hcf.addComment(call.pcOffset + call.size, CiUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString());
+                }
+                addOperandComment(hcf, call.pcOffset, "{" + call.target + "}");
+            } else {
+                if (safepoint.debugInfo != null) {
+                    hcf.addComment(safepoint.pcOffset, CiUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString());
+                }
+                addOperandComment(hcf, safepoint.pcOffset, "{safepoint}");
+            }
+        }
+        for (DataPatch site : tm.dataReferences) {
+            hcf.addOperandComment(site.pcOffset, "{" + site.constant + "}");
+        }
+        return hcf.toEmbeddedString();
+    }
+
+    private static void addExceptionHandlersComment(CiTargetMethod tm, HexCodeFile hcf) {
+        if (!tm.exceptionHandlers.isEmpty()) {
+            String nl = HexCodeFile.NEW_LINE;
+            StringBuilder buf = new StringBuilder("------ Exception Handlers ------").append(nl);
+            for (CiTargetMethod.ExceptionHandler e : tm.exceptionHandlers) {
+                buf.append("    ").
+                    append(e.pcOffset).append(" -> ").
+                    append(e.handlerPos).
+                    append(nl);
+            }
+            hcf.addComment(0, buf.toString());
+        }
+    }
+
+    private static void addOperandComment(HexCodeFile hcf, int pos, String comment) {
+        String oldValue = hcf.addOperandComment(pos, comment);
+        assert oldValue == null : "multiple comments for operand of instruction at " + pos + ": " + comment + ", " + oldValue;
+    }
+
+    @Override
+    public String disassemble(RiResolvedMethod method) {
+        return compiler.getVMEntries().disassembleJava((HotSpotMethodResolved) method);
+    }
+
+    @Override
+    public RiResolvedType asRiType(CiKind kind) {
+        return (RiResolvedType) compiler.getVMEntries().getType(kind.toJavaClass());
+    }
+
+    @Override
+    public RiResolvedType getTypeOf(CiConstant constant) {
+        return (RiResolvedType) compiler.getVMEntries().getRiType(constant);
+    }
+
+    @Override
+    public boolean isExceptionType(RiResolvedType type) {
+        return type.isSubtypeOf((RiResolvedType) compiler.getVMEntries().getType(Throwable.class));
+    }
+
+    @Override
+    public Object registerCompilerStub(CiTargetMethod targetMethod, String name) {
+        return HotSpotTargetMethod.installStub(compiler, targetMethod, name);
+    }
+
+    @Override
+    public int sizeOfLockData() {
+        // TODO shouldn't be hard coded
+        return 8;
+    }
+
+    @Override
+    public int sizeOfBasicObjectLock() {
+        // TODO shouldn't be hard coded
+        return 2 * 8;
+    }
+
+    @Override
+    public int basicObjectLockOffsetInBytes() {
+        return 8;
+    }
+
+    @Override
+    public boolean areConstantObjectsEqual(CiConstant x, CiConstant y) {
+        return compiler.getVMEntries().compareConstantObjects(x, y);
+    }
+
+    @Override
+    public RiRegisterConfig getRegisterConfig(RiMethod method) {
+        return regConfig;
+    }
+
+    /**
+     * HotSpots needs an area suitable for storing a program counter for temporary use during the deoptimization process.
+     */
+    @Override
+    public int getCustomStackAreaSize() {
+        // TODO shouldn't be hard coded
+        return 8;
+    }
+
+    @Override
+    public int getMinimumOutgoingSize() {
+        return config.runtimeCallStackSize;
+    }
+
+    @Override
+    public int getArrayLength(CiConstant array) {
+        return compiler.getVMEntries().getArrayLength(array);
+    }
+
+    @Override
+    public Class<?> asJavaClass(CiConstant c) {
+        return (Class<?>) c.asObject();
+    }
+
+    @Override
+    public Object asJavaObject(CiConstant c) {
+        return c.asObject();
+    }
+
+    @Override
+    public void lower(Node n, CiLoweringTool tool) {
+        if (!GraalOptions.Lower) {
+            return;
+        }
+        StructuredGraph graph = (StructuredGraph) n.graph();
+
+        if (n instanceof ArrayLengthNode) {
+            ArrayLengthNode arrayLengthNode = (ArrayLengthNode) n;
+            SafeReadNode safeReadArrayLength = safeReadArrayLength(arrayLengthNode.graph(), arrayLengthNode.array());
+            graph.replaceFixedWithFixed(arrayLengthNode, safeReadArrayLength);
+            safeReadArrayLength.lower(tool);
+        } else if (n instanceof LoadFieldNode) {
+            LoadFieldNode field = (LoadFieldNode) n;
+            if (field.isVolatile()) {
+                return;
+            }
+            int displacement = ((HotSpotField) field.field()).offset();
+            assert field.kind() != CiKind.Illegal;
+            ReadNode memoryRead = graph.add(new ReadNode(field.field().kind(true).stackKind(), field.object(), LocationNode.create(field.field(), field.field().kind(true), displacement, graph)));
+            memoryRead.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(field.object(), false))));
+            graph.replaceFixedWithFixed(field, memoryRead);
+        } else if (n instanceof StoreFieldNode) {
+            StoreFieldNode storeField = (StoreFieldNode) n;
+            if (storeField.isVolatile()) {
+                return;
+            }
+            HotSpotField field = (HotSpotField) storeField.field();
+            WriteNode memoryWrite = graph.add(new WriteNode(storeField.object(), storeField.value(), LocationNode.create(storeField.field(), storeField.field().kind(true), field.offset(), graph)));
+            memoryWrite.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(storeField.object(), false))));
+            memoryWrite.setStateAfter(storeField.stateAfter());
+            graph.replaceFixedWithFixed(storeField, memoryWrite);
+
+            if (field.kind(true) == CiKind.Object && !memoryWrite.value().isNullConstant()) {
+                graph.addAfterFixed(memoryWrite, graph.add(new FieldWriteBarrier(memoryWrite.object())));
+            }
+        } else if (n instanceof LoadIndexedNode) {
+            LoadIndexedNode loadIndexed = (LoadIndexedNode) n;
+            GuardNode boundsCheck = createBoundsCheck(loadIndexed, tool);
+
+            CiKind elementKind = loadIndexed.elementKind();
+            LocationNode arrayLocation = createArrayLocation(graph, elementKind, loadIndexed.index());
+            ReadNode memoryRead = graph.add(new ReadNode(elementKind.stackKind(), loadIndexed.array(), arrayLocation));
+            memoryRead.setGuard(boundsCheck);
+            graph.replaceFixedWithFixed(loadIndexed, memoryRead);
+        } else if (n instanceof StoreIndexedNode) {
+            StoreIndexedNode storeIndexed = (StoreIndexedNode) n;
+            GuardNode boundsCheck = createBoundsCheck(storeIndexed, tool);
+
+            CiKind elementKind = storeIndexed.elementKind();
+            LocationNode arrayLocation = createArrayLocation(graph, elementKind, storeIndexed.index());
+            ValueNode value = storeIndexed.value();
+            ValueNode array = storeIndexed.array();
+            if (elementKind == CiKind.Object && !value.isNullConstant()) {
+                // Store check!
+                if (array.exactType() != null) {
+                    RiResolvedType elementType = array.exactType().componentType();
+                    if (elementType.superType() != null) {
+                        AnchorNode anchor = graph.add(new AnchorNode());
+                        graph.addBeforeFixed(storeIndexed, anchor);
+                        ConstantNode type = ConstantNode.forCiConstant(elementType.getEncoding(Representation.ObjectHub), this, graph);
+                        value = graph.unique(new CheckCastNode(anchor, type, elementType, value));
+                    } else {
+                        assert elementType.name().equals("Ljava/lang/Object;") : elementType.name();
+                    }
+                } else {
+                    AnchorNode anchor = graph.add(new AnchorNode());
+                    graph.addBeforeFixed(storeIndexed, anchor);
+                    GuardNode guard = (GuardNode) tool.createGuard(graph.unique(new NullCheckNode(array, false)));
+                    ReadNode arrayClass = graph.add(new ReadNode(CiKind.Object, array, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.hubOffset, graph)));
+                    arrayClass.setGuard(guard);
+                    graph.addBeforeFixed(storeIndexed, arrayClass);
+                    ReadNode arrayElementKlass = graph.add(new ReadNode(CiKind.Object, arrayClass, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.arrayClassElementOffset, graph)));
+                    value = graph.unique(new CheckCastNode(anchor, arrayElementKlass, null, value));
+                }
+            }
+            WriteNode memoryWrite = graph.add(new WriteNode(array, value, arrayLocation));
+            memoryWrite.setGuard(boundsCheck);
+            memoryWrite.setStateAfter(storeIndexed.stateAfter());
+
+            graph.replaceFixedWithFixed(storeIndexed, memoryWrite);
+
+            if (elementKind == CiKind.Object && !value.isNullConstant()) {
+                graph.addAfterFixed(memoryWrite, graph.add(new ArrayWriteBarrier(array, arrayLocation)));
+            }
+        } else if (n instanceof UnsafeLoadNode) {
+            UnsafeLoadNode load = (UnsafeLoadNode) n;
+            assert load.kind() != CiKind.Illegal;
+            IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, load.loadKind(), load.displacement(), load.offset(), graph);
+            location.setIndexScalingEnabled(false);
+            ReadNode memoryRead = graph.add(new ReadNode(load.kind(), load.object(), location));
+            memoryRead.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(load.object(), false))));
+            graph.replaceFixedWithFixed(load, memoryRead);
+        } else if (n instanceof UnsafeStoreNode) {
+            UnsafeStoreNode store = (UnsafeStoreNode) n;
+            IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, store.storeKind(), store.displacement(), store.offset(), graph);
+            location.setIndexScalingEnabled(false);
+            WriteNode write = graph.add(new WriteNode(store.object(), store.value(), location));
+            FieldWriteBarrier barrier = graph.add(new FieldWriteBarrier(store.object()));
+            write.setStateAfter(store.stateAfter());
+            graph.replaceFixedWithFixed(store, write);
+            graph.addBeforeFixed(write, barrier);
+        } else if (n instanceof ArrayHeaderSizeNode) {
+            ArrayHeaderSizeNode arrayHeaderSize = (ArrayHeaderSizeNode) n;
+            graph.replaceFloating(arrayHeaderSize, ConstantNode.forLong(config.getArrayOffset(arrayHeaderSize.elementKind()), n.graph()));
+        } else if (n instanceof ReadHubNode) {
+            ReadHubNode objectClassNode = (ReadHubNode) n;
+            LocationNode location = LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.hubOffset, graph);
+            ReadNode memoryRead = graph.add(new ReadNode(CiKind.Object, objectClassNode.object(), location));
+            memoryRead.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(objectClassNode.object(), false))));
+            graph.replaceFixed(objectClassNode, memoryRead);
+        }
+    }
+
+    private IndexedLocationNode createArrayLocation(Graph graph, CiKind elementKind, ValueNode index) {
+        return IndexedLocationNode.create(LocationNode.getArrayLocation(elementKind), elementKind, config.getArrayOffset(elementKind), index, graph);
+    }
+
+    private static GuardNode createBoundsCheck(AccessIndexedNode n, CiLoweringTool tool) {
+        return (GuardNode) tool.createGuard(n.graph().unique(new CompareNode(n.index(), Condition.BT, n.length())));
+    }
+
+    @Override
+    public StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List<? extends Node> parameters) {
+        RiType holder = method.holder();
+        String fullName = method.name() + method.signature().asString();
+        String holderName = holder.name();
+        if (holderName.equals("Ljava/lang/Object;")) {
+            if (fullName.equals("getClass()Ljava/lang/Class;")) {
+                ValueNode obj = (ValueNode) parameters.get(0);
+                if (obj.stamp().nonNull() && obj.stamp().exactType() != null) {
+                    StructuredGraph graph = new StructuredGraph();
+                    ValueNode result = ConstantNode.forObject(obj.stamp().exactType().toJava(), this, graph);
+                    ReturnNode ret = graph.add(new ReturnNode(result));
+                    graph.start().setNext(ret);
+                    return graph;
+                }
+                StructuredGraph graph = new StructuredGraph();
+                LocalNode receiver = graph.unique(new LocalNode(CiKind.Object, 0));
+                SafeReadNode klassOop = safeReadHub(graph, receiver);
+                ReadNode result = graph.add(new ReadNode(CiKind.Object, klassOop, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.classMirrorOffset, graph)));
+                ReturnNode ret = graph.add(new ReturnNode(result));
+                graph.start().setNext(klassOop);
+                klassOop.setNext(ret);
+                return graph;
+            }
+        } else if (holderName.equals("Ljava/lang/Class;")) {
+            if (fullName.equals("getModifiers()I")) {
+                StructuredGraph graph = new StructuredGraph();
+                LocalNode receiver = graph.unique(new LocalNode(CiKind.Object, 0));
+                SafeReadNode klassOop = safeRead(graph, CiKind.Object, receiver, config.klassOopOffset);
+                graph.start().setNext(klassOop);
+                // TODO (thomaswue): Care about primitive classes! Crashes for primitive classes at the moment (klassOop == null)
+                ReadNode result = graph.add(new ReadNode(CiKind.Int, klassOop, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Int, config.klassModifierFlagsOffset, graph)));
+                ReturnNode ret = graph.add(new ReturnNode(result));
+                klassOop.setNext(ret);
+                return graph;
+            }
+        } else if (holderName.equals("Ljava/lang/Thread;")) {
+            if (fullName.equals("currentThread()Ljava/lang/Thread;")) {
+                StructuredGraph graph = new StructuredGraph();
+                ReturnNode ret = graph.add(new ReturnNode(graph.unique(new CurrentThread(config.threadObjectOffset))));
+                graph.start().setNext(ret);
+                return graph;
+            }
+        }
+        return null;
+    }
+
+    private SafeReadNode safeReadHub(Graph graph, ValueNode value) {
+        return safeRead(graph, CiKind.Object, value, config.hubOffset);
+    }
+
+    private SafeReadNode safeReadArrayLength(Graph graph, ValueNode value) {
+        return safeRead(graph, CiKind.Int, value, config.arrayLengthOffset);
+    }
+
+    private static SafeReadNode safeRead(Graph graph, CiKind kind, ValueNode value, int offset) {
+        return graph.add(new SafeReadNode(kind, value, LocationNode.create(LocationNode.FINAL_LOCATION, kind, offset, graph)));
+    }
+
+    public RiResolvedType getType(Class<?> clazz) {
+        return (RiResolvedType) compiler.getVMEntries().getType(clazz);
+    }
+
+    public Object asCallTarget(Object target) {
+        return target;
+    }
+
+    public long getMaxCallTargetOffset(CiRuntimeCall rtcall) {
+        return compiler.getVMEntries().getMaxCallTargetOffset(rtcall);
+    }
+
+    public RiResolvedMethod getRiMethod(Method reflectionMethod) {
+        return (RiResolvedMethod) compiler.getVMEntries().getRiMethod(reflectionMethod);
+    }
+
+    @Override
+    public void installMethod(RiResolvedMethod method, CiTargetMethod code) {
+        synchronized (method) {
+            if (((HotSpotMethodResolvedImpl) method).callback() == null) {
+                compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), true);
+            } else {
+                // callback stub is installed.
+            }
+        }
+    }
+
+    @Override
+    public RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code) {
+        return compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), false);
+    }
+
+    public void installMethodCallback(RiResolvedMethod method, CiGenericCallback callback) {
+        synchronized (method) {
+            ((HotSpotMethodResolvedImpl) method).setCallback(callback);
+            CiTargetMethod callbackStub = createCallbackStub(method, callback);
+            compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, callbackStub), true);
+        }
+    }
+
+    @Override
+    public RiRegisterConfig getGlobalStubRegisterConfig() {
+        return globalStubRegConfig;
+    }
+
+    private CiTargetMethod createCallbackStub(RiResolvedMethod method, CiGenericCallback callback) {
+        StructuredGraph graph = new StructuredGraph();
+        FrameStateBuilder frameState = new FrameStateBuilder(method, graph, false);
+        ValueNode local0 = frameState.loadLocal(0);
+
+        FrameState initialFrameState = frameState.create(0);
+        graph.start().setStateAfter(initialFrameState);
+
+        ConstantNode callbackNode = ConstantNode.forObject(callback, this, graph);
+
+        RuntimeCallNode runtimeCall = graph.add(new RuntimeCallNode(CiRuntimeCall.GenericCallback, new ValueNode[] {callbackNode, local0}));
+        runtimeCall.setStateAfter(initialFrameState.duplicateModified(0, false, CiKind.Void, runtimeCall));
+
+        @SuppressWarnings("unused")
+        HotSpotCompiledMethod hotSpotCompiledMethod = new HotSpotCompiledMethod(null, null); // initialize class...
+        RiResolvedType compiledMethodClass = getType(HotSpotCompiledMethod.class);
+        RiResolvedField nmethodField = null;
+        for (RiResolvedField field : compiledMethodClass.declaredFields()) {
+            if (field.name().equals("nmethod")) {
+                nmethodField = field;
+                break;
+            }
+        }
+        assert nmethodField != null;
+        LoadFieldNode loadField = graph.add(new LoadFieldNode(runtimeCall, nmethodField));
+
+        CompareNode compare = graph.unique(new CompareNode(loadField, Condition.EQ, ConstantNode.forLong(0, graph)));
+
+        IfNode ifNull = graph.add(new IfNode(compare, 0.01));
+
+        BeginNode beginInvalidated = graph.add(new BeginNode());
+        DeoptimizeNode deoptInvalidated = graph.add(new DeoptimizeNode(DeoptAction.None));
+
+        BeginNode beginTailcall = graph.add(new BeginNode());
+        TailcallNode tailcall = graph.add(new TailcallNode(loadField, initialFrameState));
+        DeoptimizeNode deoptEnd = graph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile));
+
+        graph.start().setNext(runtimeCall);
+        runtimeCall.setNext(loadField);
+        loadField.setNext(ifNull);
+        ifNull.setTrueSuccessor(beginInvalidated);
+        ifNull.setFalseSuccessor(beginTailcall);
+        beginInvalidated.setNext(deoptInvalidated);
+        beginTailcall.setNext(tailcall);
+        tailcall.setNext(deoptEnd);
+
+        CiTargetMethod result = compiler.getCompiler().compileMethod(method, graph, -1, PhasePlan.DEFAULT);
+        return result;
+    }
+
+    @Override
+    public CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph) {
+        final PhasePlan plan = new PhasePlan();
+        GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(compiler.getRuntime());
+        plan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
+        return compiler.getCompiler().compileMethod(method, graph, -1, plan);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotSignature.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+import com.oracle.graal.java.*;
+
+/**
+ * Represents a method signature.
+ */
+public class HotSpotSignature extends CompilerObject implements RiSignature {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -2890917956072366116L;
+    private final List<String> arguments = new ArrayList<>();
+    private final String returnType;
+    private final String originalString;
+    private RiType[] argumentTypes;
+    private RiType returnTypeCache;
+
+    public HotSpotSignature(Compiler compiler, String signature) {
+        super(compiler);
+        assert signature.length() > 0;
+        this.originalString = signature;
+
+        if (signature.charAt(0) == '(') {
+            int cur = 1;
+            while (cur < signature.length() && signature.charAt(cur) != ')') {
+                int nextCur = parseSignature(signature, cur);
+                arguments.add(signature.substring(cur, nextCur));
+                cur = nextCur;
+            }
+
+            cur++;
+            int nextCur = parseSignature(signature, cur);
+            returnType = signature.substring(cur, nextCur);
+            assert nextCur == signature.length();
+        } else {
+            returnType = null;
+        }
+    }
+
+    private static int parseSignature(String signature, int start) {
+        int cur = start;
+        char first;
+        do {
+            first = signature.charAt(cur++);
+        } while (first == '[');
+
+        switch (first) {
+            case 'L':
+                while (signature.charAt(cur) != ';') {
+                    cur++;
+                }
+                cur++;
+                break;
+            case 'V':
+            case 'I':
+            case 'B':
+            case 'C':
+            case 'D':
+            case 'F':
+            case 'J':
+            case 'S':
+            case 'Z':
+                break;
+            default:
+                assert false;
+        }
+        return cur;
+    }
+
+    @Override
+    public int argumentCount(boolean withReceiver) {
+        return arguments.size() + (withReceiver ? 1 : 0);
+    }
+
+    @Override
+    public CiKind argumentKindAt(int index, boolean architecture) {
+        return CiKind.fromTypeString(arguments.get(index));
+    }
+
+    @Override
+    public int argumentSlots(boolean withReceiver) {
+        int argSlots = 0;
+        for (int i = 0; i < argumentCount(false); i++) {
+            argSlots += FrameStateBuilder.stackSlots(argumentKindAt(i, false));
+        }
+        return argSlots + (withReceiver ? 1 : 0);
+    }
+
+    @Override
+    public RiType argumentTypeAt(int index, RiResolvedType accessingClass) {
+        if (argumentTypes == null) {
+            argumentTypes = new RiType[arguments.size()];
+        }
+        RiType type = argumentTypes[index];
+        if (type == null || !(type instanceof RiResolvedType)) {
+            type = compiler.lookupType(arguments.get(index), (HotSpotTypeResolved) accessingClass, true);
+            argumentTypes[index] = type;
+        }
+        return type;
+    }
+
+    @Override
+    public String asString() {
+        return originalString;
+    }
+
+    @Override
+    public CiKind returnKind(boolean architecture) {
+        return CiKind.fromTypeString(returnType);
+    }
+
+    @Override
+    public RiType returnType(RiType accessingClass) {
+        if (returnTypeCache == null) {
+            returnTypeCache = compiler.lookupType(returnType, (HotSpotTypeResolved) accessingClass, false);
+        }
+        return returnTypeCache;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotSignature<" + originalString + ">";
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotType.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Common interface for all HotSpot RiType-implementations.
+ */
+public abstract class HotSpotType extends CompilerObject implements RiType {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -4252886265301910771L;
+    protected String name;
+
+    protected HotSpotType(Compiler compiler) {
+        super(compiler);
+    }
+
+    @Override
+    public final String name() {
+        return name;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Implementation of RiType for primitive HotSpot types.
+ */
+public final class HotSpotTypePrimitive extends HotSpotType implements RiResolvedType {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -6208552348908071473L;
+    private CiKind kind;
+
+
+    public HotSpotTypePrimitive(Compiler compiler, CiKind kind) {
+        super(compiler);
+        this.kind = kind;
+        this.name = kind.toString();
+    }
+
+    @Override
+    public int accessFlags() {
+        assert kind != null && kind.toJavaClass() != null;
+        return Modifier.ABSTRACT | Modifier.FINAL | Modifier.PUBLIC;
+    }
+
+    @Override
+    public RiResolvedType arrayOf() {
+        return (RiResolvedType) compiler.getVMEntries().getPrimitiveArrayType(kind);
+    }
+
+    @Override
+    public RiResolvedType componentType() {
+        return null;
+    }
+
+    @Override
+    public RiResolvedType exactType() {
+        return this;
+    }
+
+    @Override
+    public RiResolvedType superType() {
+        return null;
+    }
+
+    @Override
+    public RiResolvedType leastCommonAncestor(RiResolvedType otherType) {
+        return null;
+    }
+
+    @Override
+    public CiConstant getEncoding(Representation r) {
+        throw GraalInternalError.unimplemented("HotSpotTypePrimitive.getEncoding");
+    }
+
+    @Override
+    public CiKind getRepresentationKind(Representation r) {
+        return kind;
+    }
+
+    @Override
+    public boolean hasFinalizableSubclass() {
+        return false;
+    }
+
+    @Override
+    public boolean hasFinalizer() {
+        return false;
+    }
+
+    @Override
+    public boolean hasSubclass() {
+        return false;
+    }
+
+    @Override
+    public boolean isArrayClass() {
+        return false;
+    }
+
+    @Override
+    public boolean isInitialized() {
+        return true;
+    }
+
+    @Override
+    public boolean isInstance(CiConstant obj) {
+        return false;
+    }
+
+    @Override
+    public boolean isInstanceClass() {
+        return false;
+    }
+
+    @Override
+    public boolean isInterface() {
+        return false;
+    }
+
+    @Override
+    public boolean isSubtypeOf(RiResolvedType other) {
+        return false;
+    }
+
+    @Override
+    public CiKind kind(boolean architecture) {
+        return kind;
+    }
+
+    @Override
+    public RiResolvedMethod resolveMethodImpl(RiResolvedMethod method) {
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotTypePrimitive<" + kind + ">";
+    }
+
+    @Override
+    public RiResolvedType uniqueConcreteSubtype() {
+        return this;
+    }
+
+    @Override
+    public RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method) {
+        return null;
+    }
+
+    @Override
+    public RiResolvedField[] declaredFields() {
+        return null;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return toJava().getAnnotation(annotationClass);
+    }
+
+    @Override
+    public Class< ? > toJava() {
+        return kind.toJavaClass();
+    }
+
+    @Override
+    public RiResolvedType resolve(RiResolvedType accessingClass) {
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolved.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.server.*;
+
+public interface HotSpotTypeResolved extends RiResolvedType, Remote {
+
+    String toString();
+
+    RiConstantPool constantPool();
+
+    int instanceSize();
+
+    RiField createRiField(String name, RiType type, int offset, int flags);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+
+/**
+ * Implementation of RiType for resolved non-primitive HotSpot classes.
+ */
+public final class HotSpotTypeResolvedImpl extends HotSpotType implements HotSpotTypeResolved {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 3481514353553840471L;
+    private Class javaMirror;
+    private String simpleName;
+    private int accessFlags;
+    private boolean hasFinalizer;
+    private boolean hasSubclass;
+    private boolean hasFinalizableSubclass;
+    private boolean isArrayClass;
+    private boolean isInstanceClass;
+    private boolean isInterface;
+    private int instanceSize;
+    private HashMap<Long, RiResolvedField> fieldCache;
+    private RiResolvedType superType;
+    private boolean superTypeSet;
+    private RiResolvedField[] fields;
+    private RiConstantPool constantPool;
+    private boolean isInitialized;
+    private RiResolvedType arrayOfType;
+
+    private HotSpotTypeResolvedImpl() {
+        super(null);
+    }
+
+    @Override
+    public int accessFlags() {
+        return accessFlags;
+    }
+
+    @Override
+    public RiResolvedType arrayOf() {
+        if (arrayOfType == null) {
+           arrayOfType = (RiResolvedType) compiler.getVMEntries().RiType_arrayOf(this);
+        }
+        return arrayOfType;
+    }
+
+    @Override
+    public RiResolvedType componentType() {
+        assert isArrayClass();
+        return (RiResolvedType) compiler.getVMEntries().RiType_componentType(this);
+    }
+
+    @Override
+    public RiResolvedType uniqueConcreteSubtype() {
+        if (isArrayClass()) {
+            return Modifier.isFinal(componentType().accessFlags()) ? this : null;
+        } else {
+            return (RiResolvedType) compiler.getVMEntries().RiType_uniqueConcreteSubtype(this);
+        }
+    }
+
+    @Override
+    public RiResolvedType superType() {
+        if (!superTypeSet) {
+            superType = (RiResolvedType) compiler.getVMEntries().RiType_superType(this);
+            superTypeSet = true;
+        }
+        return superType;
+    }
+
+    @Override
+    public RiResolvedType leastCommonAncestor(RiResolvedType otherType) {
+        if (otherType instanceof HotSpotTypePrimitive) {
+            return null;
+        } else {
+            return (RiResolvedType) compiler.getVMEntries().RiType_leastCommonAncestor(this, (HotSpotTypeResolved) otherType);
+        }
+    }
+
+    @Override
+    public RiResolvedType exactType() {
+        if (Modifier.isFinal(accessFlags)) {
+            return this;
+        }
+        return null;
+    }
+
+    @Override
+    public CiConstant getEncoding(Representation r) {
+        switch (r) {
+            case JavaClass:
+                return CiConstant.forObject(javaMirror);
+            case ObjectHub:
+                return CiConstant.forObject(this);
+            case StaticFields:
+                return CiConstant.forObject(javaMirror);
+            case TypeInfo:
+                return CiConstant.forObject(this);
+            default:
+                return null;
+        }
+    }
+
+    @Override
+    public CiKind getRepresentationKind(Representation r) {
+        return CiKind.Object;
+    }
+
+    @Override
+    public boolean hasFinalizableSubclass() {
+        return hasFinalizableSubclass;
+    }
+
+    @Override
+    public boolean hasFinalizer() {
+        return hasFinalizer;
+    }
+
+    @Override
+    public boolean hasSubclass() {
+        return hasSubclass;
+    }
+
+    @Override
+    public boolean isArrayClass() {
+        return isArrayClass;
+    }
+
+    @Override
+    public boolean isInitialized() {
+        if (!isInitialized) {
+            isInitialized = compiler.getVMEntries().RiType_isInitialized(this);
+        }
+        return isInitialized;
+    }
+
+    @Override
+    public boolean isInstance(CiConstant obj) {
+        return javaMirror.isInstance(obj);
+    }
+
+    @Override
+    public boolean isInstanceClass() {
+        return isInstanceClass;
+    }
+
+    @Override
+    public boolean isInterface() {
+        return isInterface;
+    }
+
+    @Override
+    public boolean isSubtypeOf(RiResolvedType other) {
+        if (other instanceof HotSpotTypeResolved) {
+            return compiler.getVMEntries().RiType_isSubtypeOf(this, other);
+        }
+        // No resolved type is a subtype of an unresolved type.
+        return false;
+    }
+
+    @Override
+    public CiKind kind(boolean architecture) {
+        return CiKind.Object;
+    }
+
+    @Override
+    public RiResolvedMethod resolveMethodImpl(RiResolvedMethod method) {
+        assert method instanceof HotSpotMethod;
+        return (RiResolvedMethod) compiler.getVMEntries().RiType_resolveMethodImpl(this, method.name(), method.signature().asString());
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotType<" + simpleName + ", resolved>";
+    }
+
+    @Override
+    public RiConstantPool constantPool() {
+        if (constantPool == null) {
+            constantPool = new HotSpotConstantPool(compiler, this);
+        }
+        return constantPool;
+    }
+
+    @Override
+    public int instanceSize() {
+        return instanceSize;
+    }
+
+    @Override
+    public synchronized RiResolvedField createRiField(String fieldName, RiType type, int offset, int flags) {
+        RiResolvedField result = null;
+
+        long id = offset + ((long) flags << 32);
+
+        // (thomaswue) Must cache the fields, because the local load elimination only works if the objects from two field lookups are equal.
+        if (fieldCache == null) {
+            fieldCache = new HashMap<>(8);
+        } else {
+            result = fieldCache.get(id);
+        }
+
+        if (result == null) {
+            result = new HotSpotField(compiler, this, fieldName, type, offset, flags);
+            fieldCache.put(id, result);
+        } else {
+            assert result.name().equals(fieldName);
+            assert result.accessFlags() == flags;
+        }
+
+        return result;
+    }
+
+    @Override
+    public RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method) {
+        return ((HotSpotMethodResolved) method).uniqueConcreteMethod();
+    }
+
+    @Override
+    public RiResolvedField[] declaredFields() {
+        if (fields == null) {
+            fields = compiler.getVMEntries().RiType_fields(this);
+        }
+        return fields;
+    }
+
+    @Override
+    public Class< ? > toJava() {
+        return javaMirror;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return toJava().getAnnotation(annotationClass);
+    }
+
+    @Override
+    public RiResolvedType resolve(RiResolvedType accessingClass) {
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeUnresolved.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.hotspot.Compiler;
+
+/**
+ * Implementation of RiType for unresolved HotSpot classes.
+ */
+public class HotSpotTypeUnresolved extends HotSpotType {
+
+    private static final long serialVersionUID = -2320936267633521314L;
+    public final String simpleName;
+    public final int dimensions;
+
+    /**
+     * Creates a new unresolved type for a specified type descriptor.
+     */
+    public HotSpotTypeUnresolved(Compiler compiler, String name) {
+        super(compiler);
+        assert name.length() > 0 : "name cannot be empty";
+
+        int dims = 0;
+        int startIndex = 0;
+        while (name.charAt(startIndex) == '[') {
+            startIndex++;
+            dims++;
+        }
+
+        // Decode name if necessary.
+        if (name.charAt(name.length() - 1) == ';') {
+            assert name.charAt(startIndex) == 'L';
+            this.simpleName = name.substring(startIndex + 1, name.length() - 1);
+            this.name = name;
+        } else {
+            this.simpleName = name;
+            this.name = getFullName(name, dims);
+        }
+
+        this.dimensions = dims;
+    }
+
+    public HotSpotTypeUnresolved(Compiler compiler, String name, int dimensions) {
+        super(compiler);
+        assert dimensions >= 0;
+        this.simpleName = name;
+        this.dimensions = dimensions;
+        this.name = getFullName(name, dimensions);
+    }
+
+    private static String getFullName(String name, int dimensions) {
+        StringBuilder str = new StringBuilder(name.length() + dimensions + 2);
+        for (int i = 0; i < dimensions; i++) {
+            str.append('[');
+        }
+        str.append('L').append(name).append(';');
+        return str.toString();
+    }
+
+    @Override
+    public RiType componentType() {
+        assert dimensions > 0 : "no array class" + name();
+        return new HotSpotTypeUnresolved(compiler, simpleName, dimensions - 1);
+    }
+
+    @Override
+    public RiType arrayOf() {
+        return new HotSpotTypeUnresolved(compiler, simpleName, dimensions + 1);
+    }
+
+    @Override
+    public CiKind kind(boolean architecture) {
+        return CiKind.Object;
+    }
+
+    @Override
+    public int hashCode() {
+        return simpleName.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        return o == this;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotType<" + simpleName + ", unresolved>";
+    }
+
+    @Override
+    public CiKind getRepresentationKind(RiType.Representation r) {
+        return CiKind.Object;
+    }
+
+    @Override
+    public RiResolvedType resolve(RiResolvedType accessingClass) {
+        return (RiResolvedType) compiler.lookupType(name, (HotSpotTypeResolved) accessingClass, true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,1578 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.hotspot.ri.TemplateFlag.*;
+
+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.graal.compiler.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+
+public class HotSpotXirGenerator implements RiXirGenerator {
+
+    // this needs to correspond to graal_CodeInstaller.hpp
+    // @formatter:off
+    private static final Integer MARK_VERIFIED_ENTRY            = 0x0001;
+    private static final Integer MARK_UNVERIFIED_ENTRY          = 0x0002;
+    private static final Integer MARK_OSR_ENTRY                 = 0x0003;
+    private static final Integer MARK_UNWIND_ENTRY              = 0x0004;
+    private static final Integer MARK_EXCEPTION_HANDLER_ENTRY   = 0x0005;
+    private static final Integer MARK_DEOPT_HANDLER_ENTRY       = 0x0006;
+
+    private static final Integer MARK_STATIC_CALL_STUB          = 0x1000;
+
+    private static final Integer MARK_INVOKEINTERFACE           = 0x2001;
+    private static final Integer MARK_INVOKESTATIC              = 0x2002;
+    private static final Integer MARK_INVOKESPECIAL             = 0x2003;
+    private static final Integer MARK_INVOKEVIRTUAL             = 0x2004;
+
+    private static final Integer MARK_IMPLICIT_NULL             = 0x3000;
+    private static final Integer MARK_POLL_NEAR                 = 0x3001;
+    private static final Integer MARK_POLL_RETURN_NEAR          = 0x3002;
+    private static final Integer MARK_POLL_FAR                  = 0x3003;
+    private static final Integer MARK_POLL_RETURN_FAR           = 0x3004;
+
+    // @formatter:on
+
+    private final HotSpotVMConfig config;
+    private final CiTarget target;
+    private final RiRegisterConfig registerConfig;
+    private final Compiler compiler;
+
+    private CiXirAssembler globalAsm;
+
+    public HotSpotXirGenerator(HotSpotVMConfig config, CiTarget target, RiRegisterConfig registerConfig, Compiler compiler) {
+        this.config = config;
+        this.target = target;
+        this.registerConfig = registerConfig;
+        this.compiler = compiler;
+    }
+
+    private XirConstant wordConst(CiXirAssembler asm, long value) {
+        if (target.wordKind == CiKind.Long) {
+            return asm.createConstant(CiConstant.forLong(value));
+        } else {
+            assert target.wordKind == CiKind.Int;
+            return asm.createConstant(CiConstant.forInt((int) value));
+        }
+    }
+
+    private XirArgument wordArg(long value) {
+        if (target.wordKind == CiKind.Long) {
+            return XirArgument.forLong(value);
+        } else {
+            assert target.wordKind == CiKind.Int;
+            return XirArgument.forInt((int) value);
+        }
+    }
+
+    private SimpleTemplates prologueTemplates = new SimpleTemplates(STATIC_METHOD) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart(CiKind.Void);
+            XirOperand framePointer = asm.createRegisterTemp("frame pointer", target.wordKind, AMD64.rbp);
+            XirOperand stackPointer = asm.createRegisterTemp("stack pointer", target.wordKind, AMD64.rsp);
+            XirLabel unverifiedStub = null;
+
+            asm.mark(MARK_OSR_ENTRY);
+            asm.mark(MARK_UNVERIFIED_ENTRY);
+            if (!is(STATIC_METHOD, flags)) {
+                unverifiedStub = asm.createOutOfLineLabel("unverified");
+
+                XirOperand temp = asm.createRegisterTemp("temp (r10)", target.wordKind, AMD64.r10);
+                XirOperand cache = asm.createRegisterTemp("cache (rax)", target.wordKind, AMD64.rax);
+
+                CiCallingConvention conventions = registerConfig.getCallingConvention(JavaCallee, new CiKind[] {CiKind.Object}, target, false);
+                XirOperand receiver = asm.createRegister("receiver", target.wordKind, asRegister(conventions.locations[0]));
+
+                asm.pload(target.wordKind, temp, receiver, asm.i(config.hubOffset), false);
+                asm.jneq(unverifiedStub, cache, temp);
+            }
+            asm.align(config.codeEntryAlignment);
+            asm.mark(MARK_VERIFIED_ENTRY);
+            asm.stackOverflowCheck();
+            asm.push(framePointer);
+            asm.mov(framePointer, stackPointer);
+            // Compensate for the push of framePointer (the XIR instruction pushFrame is not flexible enough to reduce the frame size, wait until XIR goes away to fix this).
+            asm.add(stackPointer, stackPointer,  asm.i(8));
+            asm.pushFrame();
+
+            // -- out of line -------------------------------------------------------
+            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
+            XirOperand exceptionOop = asm.createTemp("exception oop", CiKind.Object);
+            XirLabel unwind = asm.createOutOfLineLabel("unwind");
+            asm.bindOutOfLine(unwind);
+
+            asm.mark(MARK_UNWIND_ENTRY);
+
+            asm.pload(CiKind.Object, exceptionOop, thread, asm.i(config.threadExceptionOopOffset), false);
+            asm.pstore(CiKind.Object, thread, asm.i(config.threadExceptionOopOffset), asm.createConstant(CiConstant.NULL_OBJECT), false);
+            asm.pstore(CiKind.Long, thread, asm.i(config.threadExceptionPcOffset), asm.l(0), false);
+
+            asm.callRuntime(config.unwindExceptionStub, null, exceptionOop);
+            asm.shouldNotReachHere();
+
+            asm.mark(MARK_EXCEPTION_HANDLER_ENTRY);
+            asm.callRuntime(config.handleExceptionStub, null);
+            asm.shouldNotReachHere();
+
+            asm.mark(MARK_DEOPT_HANDLER_ENTRY);
+            asm.callRuntime(config.handleDeoptStub, null);
+            asm.shouldNotReachHere();
+
+            if (!is(STATIC_METHOD, flags)) {
+                asm.bindOutOfLine(unverifiedStub);
+                asm.jmpRuntime(config.inlineCacheMissStub);
+            }
+
+            return asm.finishTemplate(is(STATIC_METHOD, flags) ? "static prologue" : "prologue");
+        }
+    };
+
+    private SimpleTemplates epilogueTemplates = new SimpleTemplates(STATIC_METHOD, SYNCHRONIZED) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart(CiKind.Void);
+            XirOperand framePointer = asm.createRegisterTemp("frame pointer", target.wordKind, AMD64.rbp);
+            XirOperand stackPointer = asm.createRegisterTemp("stack pointer", target.wordKind, AMD64.rsp);
+
+            asm.popFrame();
+            asm.pload(CiKind.Long, framePointer, stackPointer, asm.i(-8), false);
+
+            if (GraalOptions.GenSafepoints) {
+                XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.r10);
+                if (config.isPollingPageFar) {
+                    asm.mov(temp, wordConst(asm, config.safepointPollingAddress));
+                    asm.mark(MARK_POLL_RETURN_FAR);
+                    asm.pload(target.wordKind, temp, temp, true);
+                } else {
+                    XirOperand rip = asm.createRegister("rip", target.wordKind, AMD64.rip);
+                    asm.mark(MARK_POLL_RETURN_NEAR);
+                    asm.pload(target.wordKind, temp, rip, asm.i(0xEFBEADDE), true);
+                }
+            }
+
+            return asm.finishTemplate("epilogue");
+        }
+    };
+
+    private SimpleTemplates safepointTemplates = new SimpleTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart(CiKind.Void);
+
+            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.r10);
+            if (config.isPollingPageFar) {
+                asm.mov(temp, wordConst(asm, config.safepointPollingAddress));
+                asm.mark(MARK_POLL_FAR);
+                asm.pload(target.wordKind, temp, temp, true);
+            } else {
+                XirOperand rip = asm.createRegister("rip", target.wordKind, AMD64.rip);
+                asm.mark(MARK_POLL_NEAR);
+                asm.pload(target.wordKind, temp, rip, asm.i(0xEFBEADDE), true);
+            }
+
+            return asm.finishTemplate("safepoint");
+        }
+    };
+
+    private SimpleTemplates exceptionObjectTemplates = new SimpleTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            XirOperand result = asm.restart(CiKind.Object);
+            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
+
+            asm.pload(CiKind.Object, result, thread, asm.i(config.threadExceptionOopOffset), false);
+            asm.pstore(CiKind.Object, thread, asm.i(config.threadExceptionOopOffset), asm.o(null), false);
+            asm.pstore(CiKind.Long, thread, asm.i(config.threadExceptionPcOffset), asm.l(0), false);
+
+            return asm.finishTemplate("exception object");
+        }
+    };
+
+    private SimpleTemplates invokeInterfaceTemplates = new SimpleTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart();
+            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
+            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
+            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
+            XirOperand tempO = asm.createRegister("tempO", CiKind.Object, AMD64.rax);
+
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+                asm.pload(target.wordKind, temp, receiver, true);
+            }
+            asm.mark(MARK_INVOKEINTERFACE);
+            asm.mov(tempO, asm.createConstant(CiConstant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
+
+            return asm.finishTemplate(addr, "invokeinterface");
+        }
+    };
+
+    private SimpleTemplates invokeVirtualTemplates = new SimpleTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart();
+            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
+            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
+            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
+            XirOperand tempO = asm.createRegister("tempO", CiKind.Object, AMD64.rax);
+
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+                asm.pload(target.wordKind, temp, receiver, true);
+            }
+            asm.mark(MARK_INVOKEVIRTUAL);
+            asm.mov(tempO, asm.createConstant(CiConstant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
+
+            return asm.finishTemplate(addr, "invokevirtual");
+        }
+    };
+
+    private IndexTemplates inlinedInvokeVirtualTemplates = new IndexTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, int vtableEntryOffset) {
+            asm.restart();
+            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
+            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
+            XirOperand method = asm.createRegisterTemp("method", CiKind.Object, AMD64.rbx);
+
+            // load class from receiver
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+            }
+            asm.pload(target.wordKind, temp, receiver, asm.i(config.hubOffset), true);
+            // load vtable entry
+            asm.pload(target.wordKind, method, temp, asm.i(vtableEntryOffset), false);
+            // load entry point from methodOop
+            asm.mark(MARK_IMPLICIT_NULL);
+            asm.pload(target.wordKind, temp, method, asm.i(config.methodCompiledEntryOffset), true);
+            asm.mark(MARK_INVOKEVIRTUAL);
+
+            return asm.finishTemplate(temp, "invokevirtual");
+        }
+    };
+
+    private SimpleTemplates invokeSpecialTemplates = new SimpleTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart();
+            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
+            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
+            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
+            XirLabel stub = asm.createOutOfLineLabel("call stub");
+
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+                asm.pload(target.wordKind, temp, receiver, true);
+            }
+            asm.mark(MARK_INVOKESPECIAL);
+
+            // -- out of line -------------------------------------------------------
+            asm.bindOutOfLine(stub);
+            XirOperand method = asm.createRegisterTemp("method", target.wordKind, AMD64.rbx);
+            asm.mark(MARK_STATIC_CALL_STUB, XirMark.CALLSITE);
+            asm.mov(method, wordConst(asm, 0));
+            XirLabel dummy = asm.createOutOfLineLabel("dummy");
+            asm.jmp(dummy);
+            asm.bindOutOfLine(dummy);
+
+            return asm.finishTemplate(addr, "invokespecial");
+        }
+    };
+
+    private SimpleTemplates invokeStaticTemplates = new SimpleTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart();
+            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
+
+            XirLabel stub = asm.createOutOfLineLabel("call stub");
+            asm.mark(MARK_INVOKESTATIC);
+
+            // -- out of line -------------------------------------------------------
+            asm.bindOutOfLine(stub);
+            XirOperand method = asm.createRegisterTemp("method", target.wordKind, AMD64.rbx);
+            asm.mark(MARK_STATIC_CALL_STUB, XirMark.CALLSITE);
+            asm.mov(method, wordConst(asm, 0));
+            XirLabel dummy = asm.createOutOfLineLabel("dummy");
+            asm.jmp(dummy);
+            asm.bindOutOfLine(dummy);
+
+            return asm.finishTemplate(addr, "invokestatic");
+        }
+    };
+
+    private SimpleTemplates monitorEnterTemplates = new SimpleTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart(CiKind.Void);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+            XirParameter lock = asm.createInputParameter("lock", target.wordKind);
+
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+                asm.pload(target.wordKind, asm.createTemp("temp", target.wordKind), object, true);
+            }
+
+
+            // (thomaswue) It is important to use for this runtime call the debug info AFTER the monitor enter. Otherwise the monitor object
+            // is not correctly garbage collected.
+            final boolean useInfoAfter = true;
+
+            if (config.useFastLocking) {
+                useRegisters(asm, AMD64.rax, AMD64.rbx);
+                useRegisters(asm, getGeneralParameterRegister(0));
+                useRegisters(asm, getGeneralParameterRegister(1));
+                asm.callRuntime(config.fastMonitorEnterStub, null, useInfoAfter, object, lock);
+            } else {
+                asm.reserveOutgoingStack(target.wordSize * 2);
+                XirOperand rsp = asm.createRegister("rsp", target.wordKind, asRegister(AMD64.RSP));
+                asm.pstore(CiKind.Object, rsp, asm.i(target.wordSize), object, false);
+                asm.pstore(target.wordKind, rsp, asm.i(0), lock, false);
+                asm.callRuntime(config.monitorEnterStub, null, useInfoAfter);
+            }
+
+            return asm.finishTemplate("monitorEnter");
+        }
+    };
+
+    private CiRegister getGeneralParameterRegister(int index) {
+        return registerConfig.getCallingConventionRegisters(CiCallingConvention.Type.RuntimeCall, RegisterFlag.CPU)[index];
+    }
+
+    private SimpleTemplates monitorExitTemplates = new SimpleTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            asm.restart(CiKind.Void);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+            XirParameter lock = asm.createInputParameter("lock", target.wordKind);
+
+            if (config.useFastLocking) {
+                useRegisters(asm, AMD64.rax, AMD64.rbx);
+                useRegisters(asm, getGeneralParameterRegister(0));
+                useRegisters(asm, getGeneralParameterRegister(1));
+                asm.callRuntime(config.fastMonitorExitStub, null, object, lock);
+            } else {
+                asm.reserveOutgoingStack(target.wordSize);
+                asm.pstore(target.wordKind, asm.createRegister("rsp", target.wordKind, asRegister(AMD64.RSP)), asm.i(0), lock, false);
+                asm.callRuntime(config.monitorExitStub, null);
+            }
+
+            return asm.finishTemplate("monitorExit");
+        }
+    };
+
+    private KindTemplates getFieldTemplates = new KindTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
+            XirOperand result = asm.restart(kind);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+
+            XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+            }
+            asm.pload(kind, result, object, fieldOffset, is(NULL_CHECK, flags));
+            return asm.finishTemplate("getfield<" + kind + ">");
+        }
+    };
+
+    private KindTemplates writeBarrierTemplate = new KindTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
+            asm.restart(CiKind.Void);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+
+            // Need temp operand, because the write barrier destroys the object pointer.
+            XirOperand temp = asm.createTemp("temp", target.wordKind);
+            asm.mov(temp, object);
+
+            writeBarrier(asm, temp);
+            return asm.finishTemplate("writeBarrier");
+        }
+    };
+
+    private KindTemplates putFieldTemplates = new KindTemplates(WRITE_BARRIER, NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
+            asm.restart(CiKind.Void);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+            XirParameter value = asm.createInputParameter("value", kind);
+            XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
+            if (kind == CiKind.Object) {
+                verifyPointer(asm, value);
+            }
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+            }
+            asm.pstore(kind, object, fieldOffset, value, is(NULL_CHECK, flags));
+            if (is(WRITE_BARRIER, flags) && kind == CiKind.Object) {
+                XirOperand temp = asm.createTemp("temp", target.wordKind);
+                asm.mov(temp, object);
+                writeBarrier(asm, temp);
+            }
+            return asm.finishTemplate("putfield<" + kind + ">");
+        }
+    };
+
+    private final IndexTemplates newInstanceTemplates = new IndexTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, int size) {
+            XirOperand result = asm.restart(target.wordKind);
+            XirOperand type = asm.createInputParameter("type", CiKind.Object);
+
+            XirOperand temp1 = asm.createRegisterTemp("temp1", target.wordKind, AMD64.rcx);
+            XirOperand temp1o = asm.createRegister("temp1o", CiKind.Object, AMD64.rcx);
+            XirOperand temp2 = asm.createRegisterTemp("temp2", target.wordKind, AMD64.rbx);
+            XirOperand temp2i = asm.createRegister("temp2i", CiKind.Int, AMD64.rbx);
+            useRegisters(asm, AMD64.rsi);
+            XirLabel tlabFull = asm.createOutOfLineLabel("tlab full");
+            XirLabel resume = asm.createInlineLabel("resume");
+
+            // check if the class is already initialized
+            asm.pload(CiKind.Int, temp2i, type, asm.i(config.klassStateOffset), false);
+            asm.jneq(tlabFull, temp2i, asm.i(config.klassStateFullyInitialized));
+
+            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
+            asm.pload(target.wordKind, result, thread, asm.i(config.threadTlabTopOffset), false);
+            asm.add(temp1, result, wordConst(asm, size));
+            asm.pload(target.wordKind, temp2, thread, asm.i(config.threadTlabEndOffset), false);
+
+            asm.jgt(tlabFull, temp1, temp2);
+            asm.pstore(target.wordKind, thread, asm.i(config.threadTlabTopOffset), temp1, false);
+
+            asm.bindInline(resume);
+
+            asm.pload(target.wordKind, temp1, type, asm.i(config.instanceHeaderPrototypeOffset), false);
+            asm.pstore(target.wordKind, result, temp1, false);
+            asm.mov(temp1o, type); // need a temporary register since Intel cannot store 64-bit constants to memory
+            asm.pstore(CiKind.Object, result, asm.i(config.hubOffset), temp1o, false);
+
+            if (size > 2 * target.wordSize) {
+                asm.mov(temp1, wordConst(asm, 0));
+                for (int offset = 2 * target.wordSize; offset < size; offset += target.wordSize) {
+                    asm.pstore(target.wordKind, result, asm.i(offset), temp1, false);
+                }
+            }
+
+            // -- out of line -------------------------------------------------------
+            asm.bindOutOfLine(tlabFull);
+            XirOperand arg = asm.createRegisterTemp("runtime call argument", CiKind.Object, AMD64.rdx);
+            asm.mov(arg, type);
+            useRegisters(asm, AMD64.rax);
+            asm.callRuntime(config.newInstanceStub, result);
+            asm.jmp(resume);
+
+            return asm.finishTemplate("new instance");
+        }
+    };
+
+    private SimpleTemplates newObjectArrayCloneTemplates = new SimpleTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            XirOperand result = asm.restart(CiKind.Object);
+            XirParameter lengthParam = asm.createInputParameter("length", CiKind.Int, true);
+            XirParameter src = asm.createInputParameter("src", CiKind.Object);
+
+            // Set up length and hub.
+            XirOperand length = asm.createRegisterTemp("length", CiKind.Int, AMD64.rbx);
+            XirOperand hub = asm.createRegisterTemp("hub", CiKind.Object, AMD64.rdx);
+            asm.pload(CiKind.Object, hub, src, asm.i(config.hubOffset), false);
+            asm.mov(length, lengthParam);
+
+            useRegisters(asm, AMD64.rsi, AMD64.rcx, AMD64.rdi, AMD64.rax);
+            asm.callRuntime(config.newObjectArrayStub, result);
+            return asm.finishTemplate("objectArrayClone");
+        }
+    };
+
+    private SimpleTemplates newObjectArrayTemplates = new SimpleTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            emitNewTypeArray(asm, CiKind.Object, config.useFastNewObjectArray, config.newObjectArrayStub);
+            return asm.finishTemplate("newObjectArray");
+        }
+    };
+
+    private void emitNewTypeArray(CiXirAssembler asm, CiKind kind, boolean useFast, long slowPathStub) {
+        XirOperand result = asm.restart(target.wordKind);
+
+        XirParameter lengthParam = asm.createInputParameter("length", CiKind.Int, true);
+
+        XirOperand length = asm.createRegisterTemp("length", CiKind.Int, AMD64.rbx);
+        XirOperand hub = asm.createRegisterTemp("hub", CiKind.Object, AMD64.rdx);
+
+        // Registers rsi, rcx, rdi, and rax are needed by the runtime call.
+        // Hub needs to be on rdx, length on rbx.
+        XirOperand temp1 = asm.createRegisterTemp("temp1", target.wordKind, AMD64.rcx);
+        XirOperand temp1o = asm.createRegister("temp1o", CiKind.Object, AMD64.rcx);
+        XirOperand temp2 = asm.createRegisterTemp("temp2", target.wordKind, AMD64.rax);
+        XirOperand temp3 = asm.createRegisterTemp("temp3", target.wordKind, AMD64.rdi);
+        XirOperand size = asm.createRegisterTemp("size", CiKind.Int, AMD64.rsi);
+
+        asm.mov(hub, asm.createConstantInputParameter("hub", CiKind.Object));
+        asm.mov(length, lengthParam);
+
+        if (useFast) {
+
+            XirLabel slowPath = asm.createOutOfLineLabel("slowPath");
+
+            XirLabel done = asm.createInlineLabel("done");
+
+            // Check for negative array size.
+            // TODO: Also check for upper bound
+            asm.jlt(slowPath, length, asm.i(0));
+
+            final int aligning = target.wordSize;
+            final int arrayLengthOffset = target.wordSize * 2;
+            final int arrayElementOffset = config.getArrayOffset(kind);
+
+            // Calculate aligned size
+            asm.mov(size, length);
+            int scale = CiUtil.log2(target.sizeInBytes(kind));
+            if (scale != 0) {
+                asm.shl(size, size, asm.i(scale));
+            }
+            asm.add(size, size, asm.i(arrayElementOffset + aligning - 1));
+            long mask = 0xFFFFFFFFL;
+            mask <<= CiUtil.log2(aligning);
+            asm.and(size, size, asm.i((int) mask));
+
+            // Try tlab allocation
+            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
+            asm.pload(target.wordKind, result, thread, asm.i(config.threadTlabTopOffset), false);
+            asm.add(temp1, result, size);
+            asm.pload(target.wordKind, temp2, thread, asm.i(config.threadTlabEndOffset), false);
+            asm.jgt(slowPath, temp1, temp2);
+            asm.pstore(target.wordKind, thread, asm.i(config.threadTlabTopOffset), temp1, false);
+
+            // Now the new object is in result, store mark word and klass
+            asm.pload(target.wordKind, temp1, hub, asm.i(config.instanceHeaderPrototypeOffset), false);
+            asm.pstore(target.wordKind, result, temp1, false);
+            asm.mov(temp1o, hub); // need a temporary register since Intel cannot store 64-bit constants to memory
+            asm.pstore(CiKind.Object, result, asm.i(config.hubOffset), temp1o, false);
+
+            // Store array length
+            asm.pstore(CiKind.Int, result, asm.i(arrayLengthOffset), length, false);
+
+            // Initialize with 0
+            XirLabel top = asm.createInlineLabel("top");
+            asm.sub(size, size, asm.i(arrayElementOffset));
+            asm.shr(size, size, asm.i(Scale.Times8.log2));
+            asm.jeq(done, size, asm.i(0));
+            asm.xor(temp3, temp3, temp3);
+            asm.bindInline(top);
+            asm.pstore(target.wordKind, result, size, temp3, arrayElementOffset - target.wordSize, Scale.Times8, false);
+            asm.decAndJumpNotZero(top, size);
+
+            asm.bindInline(done);
+
+            // Slow path
+            asm.bindOutOfLine(slowPath);
+            asm.callRuntime(slowPathStub, result);
+            asm.jmp(done);
+        } else {
+            asm.callRuntime(slowPathStub, result);
+        }
+    }
+
+    private KindTemplates newTypeArrayTemplates = new KindTemplates() {
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
+            emitNewTypeArray(asm, kind, config.useFastNewTypeArray, config.newTypeArrayStub);
+            return asm.finishTemplate("newTypeArray<" + kind.toString() + ">");
+        }
+    };
+
+    private final IndexTemplates multiNewArrayTemplate = new IndexTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, int dimensions) {
+            XirOperand result = asm.restart(CiKind.Object);
+
+            XirOperand hub = asm.createRegisterTemp("hub", CiKind.Object, AMD64.rax);
+            XirOperand rank = asm.createRegisterTemp("rank", CiKind.Int, AMD64.rbx);
+            XirOperand sizes = asm.createRegisterTemp("sizes", CiKind.Long, AMD64.rcx);
+            XirOperand thread = asm.createRegisterTemp("thread", CiKind.Long, AMD64.r15);
+            asm.add(sizes, thread, asm.l(config.threadMultiNewArrayStorage));
+            for (int i = 0; i < dimensions; i++) {
+                XirParameter length = asm.createInputParameter("length" + i, CiKind.Int, true);
+                asm.pstore(CiKind.Int, sizes, asm.i(i * target.sizeInBytes(CiKind.Int)), length, false);
+            }
+
+            asm.mov(hub, asm.createConstantInputParameter("hub", CiKind.Object));
+
+            asm.mov(rank, asm.i(dimensions));
+            // not necessary because we already have a temp in rax:  useRegisters(asm, AMD64.rax);
+            asm.callRuntime(config.newMultiArrayStub, result);
+            return asm.finishTemplate("multiNewArray" + dimensions);
+        }
+    };
+
+    private IndexTemplates checkCastTemplates = new IndexTemplates(NULL_CHECK, EXACT_HINTS) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, int hintCount) {
+            asm.restart(CiKind.Void);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+            final XirOperand hub = is(EXACT_HINTS, flags) ? null : asm.createConstantInputParameter("hub", CiKind.Object);
+
+            XirOperand objHub = asm.createTemp("objHub", CiKind.Object);
+
+            XirLabel end = asm.createInlineLabel("end");
+            XirLabel slowPath = asm.createOutOfLineLabel("slow path");
+
+            if (is(NULL_CHECK, flags)) {
+                // null can be cast to anything
+                asm.jeq(end, object, asm.o(null));
+            }
+
+            asm.pload(CiKind.Object, objHub, object, asm.i(config.hubOffset), false);
+            if (hintCount == 0) {
+                assert !is(EXACT_HINTS, flags);
+                checkSubtype(asm, objHub, objHub, hub);
+                asm.jeq(slowPath, objHub, asm.o(null));
+                asm.bindInline(end);
+
+                // -- out of line -------------------------------------------------------
+                asm.bindOutOfLine(slowPath);
+            } else {
+                XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
+                // if we get an exact match: succeed immediately
+                for (int i = 0; i < hintCount; i++) {
+                    XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object);
+                    asm.mov(scratchObject, hintHub);
+                    if (i < hintCount - 1) {
+                        asm.jeq(end, objHub, scratchObject);
+                    } else {
+                        asm.jneq(slowPath, objHub, scratchObject);
+                    }
+                }
+                asm.bindInline(end);
+
+                // -- out of line -------------------------------------------------------
+                asm.bindOutOfLine(slowPath);
+                if (!is(EXACT_HINTS, flags)) {
+                    checkSubtype(asm, objHub, objHub, hub);
+                    asm.jneq(end, objHub, asm.o(null));
+                }
+            }
+            XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
+
+            asm.mov(scratch, wordConst(asm, 2));
+
+            asm.callRuntime(CiRuntimeCall.Deoptimize, null);
+            asm.shouldNotReachHere();
+
+            return asm.finishTemplate("checkcast");
+        }
+    };
+
+    private IndexTemplates instanceOfTemplates = new IndexTemplates(NULL_CHECK, EXACT_HINTS) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, int hintCount) {
+            asm.restart(CiKind.Void);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+            final XirOperand hub = is(EXACT_HINTS, flags) ? null : asm.createConstantInputParameter("hub", CiKind.Object);
+
+            XirOperand objHub = asm.createTemp("objHub", CiKind.Object);
+
+            XirLabel trueSucc = asm.createInlineLabel(XirLabel.TrueSuccessor);
+            XirLabel falseSucc = asm.createInlineLabel(XirLabel.FalseSuccessor);
+
+            if (is(NULL_CHECK, flags)) {
+                // null isn't "instanceof" anything
+                asm.jeq(falseSucc, object, asm.o(null));
+            }
+
+            asm.pload(CiKind.Object, objHub, object, asm.i(config.hubOffset), false);
+            if (hintCount == 0) {
+                assert !is(EXACT_HINTS, flags);
+                checkSubtype(asm, objHub, objHub, hub);
+                asm.jeq(falseSucc, objHub, asm.o(null));
+                asm.jmp(trueSucc);
+            } else {
+                XirLabel slowPath = null;
+                XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
+
+                // if we get an exact match: succeed immediately
+                for (int i = 0; i < hintCount; i++) {
+                    XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object);
+                    asm.mov(scratchObject, hintHub);
+                    if (i < hintCount - 1) {
+                        asm.jeq(trueSucc, objHub, scratchObject);
+                    } else {
+                        if (is(EXACT_HINTS, flags)) {
+                            asm.jneq(falseSucc, objHub, scratchObject);
+                            asm.jmp(trueSucc);
+                        } else {
+                            slowPath = asm.createOutOfLineLabel("slow path");
+                            asm.jneq(slowPath, objHub, scratchObject);
+                            asm.jmp(trueSucc);
+                        }
+                    }
+                }
+
+                // -- out of line -------------------------------------------------------
+                if (slowPath != null) {
+                    asm.bindOutOfLine(slowPath);
+                    checkSubtype(asm, objHub, objHub, hub);
+                    asm.jeq(falseSucc, objHub, asm.o(null));
+                    asm.jmp(trueSucc);
+                }
+            }
+
+            return asm.finishTemplate("instanceof");
+        }
+    };
+
+    private IndexTemplates materializeInstanceOfTemplates = new IndexTemplates(NULL_CHECK, EXACT_HINTS) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, int hintCount) {
+            XirOperand result = asm.restart(CiKind.Int);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+            final XirOperand hub = is(EXACT_HINTS, flags) ? null : asm.createConstantInputParameter("hub", CiKind.Object);
+            XirOperand trueValue = asm.createInputParameter("trueValue", CiKind.Int);
+            XirOperand falseValue = asm.createInputParameter("falseValue", CiKind.Int);
+
+            XirOperand objHub = asm.createTemp("objHub", CiKind.Object);
+
+            XirLabel end = asm.createInlineLabel("end");
+            XirLabel falseSucc = asm.createInlineLabel("ko");
+
+            if (is(NULL_CHECK, flags)) {
+                // null isn't "instanceof" anything
+                asm.jeq(falseSucc, object, asm.o(null));
+            }
+
+            asm.pload(CiKind.Object, objHub, object, asm.i(config.hubOffset), false);
+            asm.mov(result, trueValue);
+
+            if (hintCount == 0) {
+                assert !is(EXACT_HINTS, flags);
+                checkSubtype(asm, objHub, objHub, hub);
+                asm.jneq(end, objHub, asm.o(null));
+                asm.bindInline(falseSucc);
+                asm.mov(result, falseValue);
+                asm.bindInline(end);
+            } else {
+                XirLabel slowPath = null;
+                XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
+
+                // if we get an exact match: succeed immediately
+                for (int i = 0; i < hintCount; i++) {
+                    XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object);
+                    asm.mov(scratchObject, hintHub);
+                    if (i < hintCount - 1) {
+                        asm.jeq(end, objHub, scratchObject);
+                    } else {
+                        if (is(EXACT_HINTS, flags)) {
+                            asm.jeq(end, objHub, scratchObject);
+                        } else {
+                            slowPath = asm.createOutOfLineLabel("slow path");
+                            asm.jeq(end, objHub, scratchObject);
+                            asm.jmp(slowPath);
+                        }
+                    }
+                }
+                asm.bindInline(falseSucc);
+                asm.mov(result, falseValue);
+                asm.bindInline(end);
+
+                // -- out of line -------------------------------------------------------
+                if (slowPath != null) {
+                    asm.bindOutOfLine(slowPath);
+                    checkSubtype(asm, objHub, objHub, hub);
+                    asm.jeq(falseSucc, objHub, asm.o(null));
+                    asm.jmp(end);
+                }
+            }
+
+            return asm.finishTemplate("instanceof");
+        }
+    };
+
+    private XirOperand genArrayLength(CiXirAssembler asm, XirOperand array, boolean implicitNullException) {
+        XirOperand length = asm.createTemp("length", CiKind.Int);
+        genArrayLength(asm, length, array, implicitNullException);
+        return length;
+    }
+
+    private void genArrayLength(CiXirAssembler asm, XirOperand length, XirOperand array, boolean implicitNullException) {
+        if (implicitNullException) {
+            asm.mark(MARK_IMPLICIT_NULL);
+        }
+        asm.pload(CiKind.Int, length, array, asm.i(config.arrayLengthOffset), implicitNullException);
+    }
+
+    private KindTemplates arrayLoadTemplates = new KindTemplates(NULL_CHECK, READ_BARRIER, BOUNDS_CHECK, GIVEN_LENGTH) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
+            XirOperand result = asm.restart(kind);
+            XirParameter array = asm.createInputParameter("array", CiKind.Object);
+            XirParameter index = asm.createInputParameter("index", CiKind.Int, true);
+            XirLabel failBoundsCheck = null;
+            // if the length is known the array cannot be null
+            boolean implicitNullException = is(NULL_CHECK, flags);
+
+            if (is(BOUNDS_CHECK, flags)) {
+                // load the array length and check the index
+                failBoundsCheck = asm.createOutOfLineLabel("failBoundsCheck");
+                XirOperand length;
+                if (is(GIVEN_LENGTH, flags)) {
+                    length = asm.createInputParameter("length", CiKind.Int, true);
+                } else {
+                    length = genArrayLength(asm, array, implicitNullException);
+                }
+                asm.jugteq(failBoundsCheck, index, length);
+                implicitNullException = false;
+            }
+            int elemSize = target.sizeInBytes(kind);
+            if (implicitNullException) {
+                asm.mark(MARK_IMPLICIT_NULL);
+            }
+            asm.pload(kind, result, array, index, config.getArrayOffset(kind), Scale.fromInt(elemSize), implicitNullException);
+            if (is(BOUNDS_CHECK, flags)) {
+                asm.bindOutOfLine(failBoundsCheck);
+                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
+                asm.mov(scratch, wordConst(asm, 0));
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
+                asm.shouldNotReachHere();
+            }
+            return asm.finishTemplate("arrayload<" + kind + ">");
+        }
+    };
+
+    private SimpleTemplates getClassTemplates = new SimpleTemplates() {
+       @Override
+       protected XirTemplate create(CiXirAssembler asm, long flags) {
+           XirOperand result = asm.restart(CiKind.Object);
+           XirOperand object = asm.createInputParameter("object", CiKind.Object);
+           asm.pload(CiKind.Object, result, object, asm.i(config.hubOffset), is(NULL_CHECK, flags));
+           asm.pload(CiKind.Object, result, result, asm.i(config.classMirrorOffset), false);
+           return asm.finishTemplate("getClass");
+       }
+    };
+
+    private SimpleTemplates currentThreadTemplates = new SimpleTemplates() {
+       @Override
+       protected XirTemplate create(CiXirAssembler asm, long flags) {
+           XirOperand result = asm.restart(CiKind.Object);
+           XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
+           asm.pload(CiKind.Object, result, thread, asm.i(config.threadObjectOffset), false);
+           return asm.finishTemplate("currentThread");
+       }
+    };
+
+    @Override
+    public XirSnippet genCurrentThread(XirSite site) {
+        return new XirSnippet(currentThreadTemplates.get(site));
+    }
+
+    @Override
+    public XirSnippet genGetClass(XirSite site, XirArgument object) {
+        return new XirSnippet(getClassTemplates.get(site), object);
+    }
+
+    private KindTemplates arrayCopyTemplates = new KindTemplates() {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
+            asm.restart(CiKind.Void);
+            XirParameter src = asm.createInputParameter("src", CiKind.Object);
+            XirParameter srcPos = asm.createInputParameter("srcPos", CiKind.Int, true);
+            XirParameter dest = asm.createInputParameter("dest", CiKind.Object);
+            XirParameter destPos = asm.createInputParameter("destPos", CiKind.Int, true);
+            XirParameter length = asm.createInputParameter("length", CiKind.Int, true);
+
+            XirOperand tempSrc = asm.createTemp("tempSrc", target.wordKind);
+            XirOperand tempDest = asm.createTemp("tempDest", target.wordKind);
+            XirOperand lengthOperand = asm.createRegisterTemp("lengthOperand", CiKind.Int, AMD64.rax);
+
+            XirOperand compHub = null;
+            XirOperand valueHub = null;
+            XirOperand temp = null;
+            XirLabel store = null;
+            XirLabel slowStoreCheck = null;
+
+            if (is(STORE_CHECK, flags) && kind == CiKind.Object) {
+                valueHub = asm.createRegisterTemp("valueHub", target.wordKind, AMD64.rdi);
+                compHub = asm.createRegisterTemp("compHub", target.wordKind, AMD64.rsi);
+                temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.r10);
+            }
+
+            // Calculate the factor for the repeat move instruction.
+            int elementSize = target.sizeInBytes(kind);
+            int factor;
+            boolean wordSize;
+            if (elementSize >= target.wordSize) {
+                assert elementSize % target.wordSize == 0;
+                wordSize = true;
+                factor = elementSize / target.wordSize;
+            } else {
+                factor = elementSize;
+                wordSize = false;
+            }
+
+            // Adjust the length if the factor is not 1.
+            if (factor != 1) {
+                asm.shl(lengthOperand, length, asm.i(CiUtil.log2(factor)));
+            } else {
+                asm.mov(lengthOperand, length);
+            }
+
+            // Set the start and the end pointer.
+            asm.lea(tempSrc, src, srcPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
+            asm.lea(tempDest, dest, destPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
+
+            XirLabel reverse = null;
+            XirLabel normal = null;
+
+            if (is(STORE_CHECK, flags)) {
+                reverse = asm.createInlineLabel("reverse");
+                asm.jneq(reverse, src, dest);
+            }
+
+            if (!is(STORE_CHECK, flags) && !is(INPUTS_DIFFERENT, flags) && !is(INPUTS_SAME, flags)) {
+                normal = asm.createInlineLabel("normal");
+                asm.jneq(normal, src, dest);
+            }
+
+            if (!is(INPUTS_DIFFERENT, flags)) {
+                if (reverse == null) {
+                    reverse = asm.createInlineLabel("reverse");
+                }
+                asm.jlt(reverse, srcPos, destPos);
+            }
+
+            if (!is(STORE_CHECK, flags) && !is(INPUTS_DIFFERENT, flags) && !is(INPUTS_SAME, flags)) {
+                asm.bindInline(normal);
+            }
+
+            // Everything set up => repeat mov.
+            if (wordSize) {
+                asm.repmov(tempSrc, tempDest, lengthOperand);
+            } else {
+                asm.repmovb(tempSrc, tempDest, lengthOperand);
+            }
+
+            if (!is(INPUTS_DIFFERENT, flags) || is(STORE_CHECK, flags)) {
+
+                XirLabel end = asm.createInlineLabel("end");
+                asm.jmp(end);
+
+                // Implement reverse copy, because srcPos < destPos and src == dest.
+                asm.bindInline(reverse);
+
+                if (is(STORE_CHECK, flags)) {
+                    asm.pload(CiKind.Object, compHub, dest, asm.i(config.hubOffset), false);
+                    asm.pload(CiKind.Object, compHub, compHub, asm.i(config.arrayClassElementOffset), false);
+                }
+
+                CiKind copyKind = wordSize ? CiKind.Object : CiKind.Byte;
+                XirOperand tempValue = asm.createTemp("tempValue", copyKind);
+                XirLabel start = asm.createInlineLabel("start");
+                asm.bindInline(start);
+                asm.sub(lengthOperand, lengthOperand, asm.i(1));
+                asm.jlt(end, lengthOperand, asm.i(0));
+
+                Scale scale = wordSize ? Scale.fromInt(target.wordSize) : Scale.Times1;
+                asm.pload(copyKind, tempValue, tempSrc, lengthOperand, 0, scale, false);
+
+                if (is(STORE_CHECK, flags)) {
+                    slowStoreCheck = asm.createOutOfLineLabel("slowStoreCheck");
+                    store = asm.createInlineLabel("store");
+                    asm.jeq(store, tempValue, asm.o(null)); // first check if value is null
+                    asm.pload(CiKind.Object, valueHub, tempValue, asm.i(config.hubOffset), false);
+                    asm.jneq(slowStoreCheck, compHub, valueHub); // then check component hub matches value hub
+                    asm.bindInline(store);
+                }
+
+                asm.pstore(copyKind, tempDest, lengthOperand, tempValue, 0, scale, false);
+
+                asm.jmp(start);
+                asm.bindInline(end);
+            }
+
+            if (kind == CiKind.Object) {
+                // Do write barriers
+                asm.lea(tempDest, dest, destPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
+                asm.shr(tempDest, tempDest, asm.i(config.cardtableShift));
+                asm.pstore(CiKind.Boolean, wordConst(asm, config.cardtableStartAddress), tempDest, asm.b(false), false);
+
+                XirOperand tempDestEnd = tempSrc; // Reuse src temp
+                asm.lea(tempDestEnd, dest, destPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
+                asm.add(tempDestEnd, tempDestEnd, length);
+                asm.shr(tempDestEnd, tempDestEnd, asm.i(config.cardtableShift));
+
+                // Jump to out-of-line write barrier loop if the array is big.
+                XirLabel writeBarrierLoop = asm.createOutOfLineLabel("writeBarrierLoop");
+                asm.jneq(writeBarrierLoop, tempDest, tempSrc);
+                XirLabel back = asm.createInlineLabel("back");
+                asm.bindInline(back);
+
+                asm.bindOutOfLine(writeBarrierLoop);
+                asm.pstore(CiKind.Boolean, wordConst(asm, config.cardtableStartAddress), tempDestEnd, asm.b(false), false);
+                asm.sub(tempDestEnd, tempDestEnd, asm.i(1));
+                asm.jneq(writeBarrierLoop, tempDestEnd, tempDest);
+                asm.jmp(back);
+            }
+
+            if (is(STORE_CHECK, flags)) {
+                assert kind == CiKind.Object;
+                useRegisters(asm, AMD64.rax);
+                asm.bindOutOfLine(slowStoreCheck);
+                checkSubtype(asm, temp, valueHub, compHub);
+                asm.jneq(store, temp, wordConst(asm, 0));
+                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
+                asm.mov(scratch, wordConst(asm, 0));
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
+                asm.jmp(store);
+            }
+
+            return asm.finishTemplate("arraycopy<" + kind + ">");
+        }
+    };
+
+    private KindTemplates arrayStoreTemplates = new KindTemplates(NULL_CHECK, WRITE_BARRIER, BOUNDS_CHECK, STORE_CHECK, GIVEN_LENGTH) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
+            asm.restart(CiKind.Void);
+            XirParameter array = asm.createInputParameter("array", CiKind.Object);
+            XirParameter index = asm.createInputParameter("index", CiKind.Int, true);
+            XirParameter value = asm.createInputParameter("value", kind, kind != CiKind.Object);
+            XirOperand temp = asm.createTemp("temp", target.wordKind);
+            XirOperand valueHub = null;
+            XirOperand compHub = null;
+            XirLabel store = asm.createInlineLabel("store");
+            XirLabel failBoundsCheck = null;
+            XirLabel slowStoreCheck = null;
+            // if the length is known the array cannot be null
+            boolean implicitNullException = is(NULL_CHECK, flags);
+
+            if (is(BOUNDS_CHECK, flags)) {
+                // load the array length and check the index
+                failBoundsCheck = asm.createOutOfLineLabel("failBoundsCheck");
+                XirOperand length;
+                if (is(GIVEN_LENGTH, flags)) {
+                    length = asm.createInputParameter("length", CiKind.Int);
+                } else {
+                    length = asm.createTemp("length", CiKind.Int);
+                    if (implicitNullException) {
+                        asm.mark(MARK_IMPLICIT_NULL);
+                    }
+                    asm.pload(CiKind.Int, length, array, asm.i(config.arrayLengthOffset), implicitNullException);
+                    implicitNullException = false;
+                }
+                asm.jugteq(failBoundsCheck, index, length);
+
+            }
+            if (is(STORE_CHECK, flags) && kind == CiKind.Object) {
+                slowStoreCheck = asm.createOutOfLineLabel("slowStoreCheck");
+                asm.jeq(store, value, asm.o(null)); // first check if value is null
+                valueHub = asm.createTemp("valueHub", CiKind.Object);
+                compHub = asm.createTemp("compHub", CiKind.Object);
+                if (implicitNullException) {
+                    asm.mark(MARK_IMPLICIT_NULL);
+                }
+                asm.pload(CiKind.Object, compHub, array, asm.i(config.hubOffset), implicitNullException);
+                asm.pload(CiKind.Object, compHub, compHub, asm.i(config.arrayClassElementOffset), false);
+                asm.pload(CiKind.Object, valueHub, value, asm.i(config.hubOffset), false);
+                asm.jneq(slowStoreCheck, compHub, valueHub); // then check component hub matches value hub
+
+                implicitNullException = false;
+            }
+            asm.bindInline(store);
+            int elemSize = target.sizeInBytes(kind);
+
+            if (implicitNullException) {
+                asm.mark(MARK_IMPLICIT_NULL);
+            }
+            int disp = config.getArrayOffset(kind);
+            Scale scale = Scale.fromInt(elemSize);
+            if (kind == CiKind.Object) {
+                verifyPointer(asm, value);
+            }
+            if (is(WRITE_BARRIER, flags) && kind == CiKind.Object) {
+                asm.lea(temp, array, index, disp, scale);
+                asm.pstore(kind, temp, value, implicitNullException);
+                writeBarrier(asm, temp);
+            } else {
+                asm.pstore(kind, array, index, value, disp, scale, implicitNullException);
+            }
+
+            // -- out of line -------------------------------------------------------
+            if (is(BOUNDS_CHECK, flags)) {
+                asm.bindOutOfLine(failBoundsCheck);
+                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
+                asm.mov(scratch, wordConst(asm, 0));
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
+                asm.shouldNotReachHere();
+            }
+            if (is(STORE_CHECK, flags) && kind == CiKind.Object) {
+                useRegisters(asm, AMD64.rax);
+                asm.bindOutOfLine(slowStoreCheck);
+                checkSubtype(asm, temp, valueHub, compHub);
+                asm.jneq(store, temp, wordConst(asm, 0));
+                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
+                asm.mov(scratch, wordConst(asm, 0));
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
+                asm.shouldNotReachHere();
+            }
+            return asm.finishTemplate("arraystore<" + kind + ">");
+        }
+    };
+
+    private SimpleTemplates arrayLengthTemplates = new SimpleTemplates(NULL_CHECK) {
+
+        @Override
+        protected XirTemplate create(CiXirAssembler asm, long flags) {
+            XirOperand result = asm.restart(CiKind.Int);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
+            if (is(NULL_CHECK, flags)) {
+                asm.mark(MARK_IMPLICIT_NULL);
+            }
+            verifyPointer(asm, object);
+            asm.pload(CiKind.Int, result, object, asm.i(config.arrayLengthOffset), true);
+            return asm.finishTemplate("arrayLength");
+        }
+    };
+
+    private SimpleTemplates typeCheckTemplates = new SimpleTemplates(NULL_CHECK) {
+       @Override
+       protected XirTemplate create(CiXirAssembler asm, long flags) {
+           asm.restart(CiKind.Void);
+           XirParameter objHub = asm.createInputParameter("objectHub", CiKind.Object);
+           XirOperand hub = asm.createConstantInputParameter("hub", CiKind.Object);
+           XirLabel falseSucc = asm.createInlineLabel(XirLabel.FalseSuccessor);
+
+           XirOperand checkHub = asm.createTemp("checkHub", CiKind.Object);
+
+           if (is(NULL_CHECK, flags)) {
+               asm.mark(MARK_IMPLICIT_NULL);
+           }
+
+           asm.mov(checkHub, hub);
+           // if we get an exact match: continue.
+           asm.jneq(falseSucc, objHub, checkHub);
+
+           return asm.finishTemplate("typeCheck");
+       }
+    };
+
+    @Override
+    public XirSnippet genPrologue(XirSite site, RiResolvedMethod method) {
+        boolean staticMethod = Modifier.isStatic(method.accessFlags());
+        return new XirSnippet(staticMethod ? prologueTemplates.get(site, STATIC_METHOD) : prologueTemplates.get(site));
+    }
+
+    @Override
+    public XirSnippet genEpilogue(XirSite site, RiResolvedMethod method) {
+        return new XirSnippet(epilogueTemplates.get(site));
+    }
+
+    @Override
+    public XirSnippet genSafepointPoll(XirSite site) {
+        return new XirSnippet(safepointTemplates.get(site));
+    }
+
+    @Override
+    public XirSnippet genExceptionObject(XirSite site) {
+        return new XirSnippet(exceptionObjectTemplates.get(site));
+    }
+
+    @Override
+    public XirSnippet genResolveClass(XirSite site, RiType type, Representation rep) {
+        throw new CiBailout("Xir ResolveClass not available");
+    }
+
+    @Override
+    public XirSnippet genIntrinsic(XirSite site, XirArgument[] arguments, RiMethod method) {
+        return null;
+    }
+
+    @Override
+    public XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, RiMethod method) {
+        return new XirSnippet(invokeInterfaceTemplates.get(site), receiver, wordArg(0));
+    }
+
+    @Override
+    public XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, RiMethod method, boolean megamorph) {
+        int vtableEntryOffset = 0;
+
+        if (GraalOptions.InlineVTableStubs && (GraalOptions.AlwaysInlineVTableStubs || megamorph)) {
+            HotSpotMethodResolved hsMethod = (HotSpotMethodResolved) method;
+            if (!hsMethod.holder().isInterface()) {
+                vtableEntryOffset = hsMethod.vtableEntryOffset();
+            }
+        }
+        if (vtableEntryOffset > 0) {
+            return new XirSnippet(inlinedInvokeVirtualTemplates.get(site, vtableEntryOffset), receiver);
+        } else {
+            return new XirSnippet(invokeVirtualTemplates.get(site), receiver, wordArg(0));
+        }
+    }
+
+    @Override
+    public XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, RiMethod method) {
+        return new XirSnippet(invokeSpecialTemplates.get(site), receiver, wordArg(0));
+    }
+
+    @Override
+    public XirSnippet genInvokeStatic(XirSite site, RiMethod method) {
+        return new XirSnippet(invokeStaticTemplates.get(site), wordArg(0));
+    }
+
+    @Override
+    public XirSnippet genMonitorEnter(XirSite site, XirArgument receiver, XirArgument lockAddress) {
+        return new XirSnippet(monitorEnterTemplates.get(site), receiver, lockAddress);
+    }
+
+    @Override
+    public XirSnippet genMonitorExit(XirSite site, XirArgument receiver, XirArgument lockAddress) {
+        return new XirSnippet(monitorExitTemplates.get(site), receiver, lockAddress);
+    }
+
+    @Override
+    public XirSnippet genGetField(XirSite site, XirArgument object, RiField field) {
+        return new XirSnippet(getFieldTemplates.get(site, field.kind(false)), object, XirArgument.forInt(((HotSpotField) field).offset()));
+    }
+
+    @Override
+    public XirSnippet genWriteBarrier(XirArgument object) {
+        return new XirSnippet(writeBarrierTemplate.get(null, CiKind.Void), object);
+    }
+
+    @Override
+    public XirSnippet genPutField(XirSite site, XirArgument object, RiField field, XirArgument value) {
+        return new XirSnippet(putFieldTemplates.get(site, field.kind(false)), object, value, XirArgument.forInt(((HotSpotField) field).offset()));
+    }
+
+    @Override
+    public XirSnippet genGetStatic(XirSite site, XirArgument object, RiField field) {
+        return new XirSnippet(getFieldTemplates.get(site, field.kind(false)), object, XirArgument.forInt(((HotSpotField) field).offset()));
+    }
+
+    @Override
+    public XirSnippet genPutStatic(XirSite site, XirArgument object, RiField field, XirArgument value) {
+        return new XirSnippet(putFieldTemplates.get(site, field.kind(false)), object, value, XirArgument.forInt(((HotSpotField) field).offset()));
+    }
+
+    @Override
+    public XirSnippet genNewInstance(XirSite site, RiType type) {
+        int instanceSize = ((HotSpotTypeResolved) type).instanceSize();
+        return new XirSnippet(newInstanceTemplates.get(site, instanceSize), XirArgument.forObject(type));
+    }
+
+    @Override
+    public XirSnippet genNewArray(XirSite site, XirArgument length, CiKind elementKind, RiType componentType, RiType arrayType) {
+        if (elementKind == CiKind.Object) {
+            assert arrayType instanceof RiResolvedType;
+            return new XirSnippet(newObjectArrayTemplates.get(site), length, XirArgument.forObject(arrayType));
+        } else {
+            assert arrayType == null;
+            RiType primitiveArrayType = compiler.getVMEntries().getPrimitiveArrayType(elementKind);
+            return new XirSnippet(newTypeArrayTemplates.get(site, elementKind), length, XirArgument.forObject(primitiveArrayType));
+        }
+    }
+
+    @Override
+    public XirSnippet genNewObjectArrayClone(XirSite site, XirArgument newLength, XirArgument referenceArray) {
+        return new XirSnippet(newObjectArrayCloneTemplates.get(site), newLength, referenceArray);
+    }
+
+    @Override
+    public XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType type) {
+        XirArgument[] params = Arrays.copyOf(lengths, lengths.length + 1);
+        params[lengths.length] = XirArgument.forObject(type);
+        return new XirSnippet(multiNewArrayTemplate.get(site, lengths.length), params);
+    }
+
+    @Override
+    public XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, RiType type, RiResolvedType[] hints, boolean hintsExact) {
+        if (hints == null || hints.length == 0) {
+            return new XirSnippet(checkCastTemplates.get(site, 0), receiver, hub);
+        } else {
+            XirArgument[] params = new XirArgument[hints.length + (hintsExact ? 1 : 2)];
+            int i = 0;
+            params[i++] = receiver;
+            if (!hintsExact) {
+                params[i++] = hub;
+            }
+            for (RiResolvedType hint : hints) {
+                params[i++] = XirArgument.forObject(hint);
+            }
+            XirTemplate template = hintsExact ? checkCastTemplates.get(site, hints.length, EXACT_HINTS) : checkCastTemplates.get(site, hints.length);
+            return new XirSnippet(template, params);
+        }
+    }
+
+    @Override
+    public XirSnippet genInstanceOf(XirSite site, XirArgument object, XirArgument hub, RiType type, RiResolvedType[] hints, boolean hintsExact) {
+        if (hints == null || hints.length == 0) {
+            return new XirSnippet(instanceOfTemplates.get(site, 0), object, hub);
+        } else {
+            XirArgument[] params = new XirArgument[hints.length + (hintsExact ? 1 : 2)];
+            int i = 0;
+            params[i++] = object;
+            if (!hintsExact) {
+                params[i++] = hub;
+            }
+            for (RiResolvedType hint : hints) {
+                params[i++] = XirArgument.forObject(hint);
+            }
+            XirTemplate template = hintsExact ? instanceOfTemplates.get(site, hints.length, EXACT_HINTS) : instanceOfTemplates.get(site, hints.length);
+            return new XirSnippet(template, params);
+        }
+    }
+
+    @Override
+    public XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument object, XirArgument hub, XirArgument trueValue, XirArgument falseValue, RiType type, RiResolvedType[] hints, boolean hintsExact) {
+        if (hints == null || hints.length == 0) {
+            return new XirSnippet(materializeInstanceOfTemplates.get(site, 0), object, hub, trueValue, falseValue);
+        } else {
+            XirArgument[] params = new XirArgument[hints.length + (hintsExact ? 3 : 4)];
+            int i = 0;
+            params[i++] = object;
+            if (!hintsExact) {
+                params[i++] = hub;
+            }
+            params[i++] = trueValue;
+            params[i++] = falseValue;
+            for (RiResolvedType hint : hints) {
+                params[i++] = XirArgument.forObject(hint);
+            }
+            XirTemplate template = hintsExact ? materializeInstanceOfTemplates.get(site, hints.length, EXACT_HINTS) : materializeInstanceOfTemplates.get(site, hints.length);
+            return new XirSnippet(template, params);
+        }
+    }
+
+    @Override
+    public XirSnippet genArrayLoad(XirSite site, XirArgument array, XirArgument index, CiKind elementKind, RiType elementType) {
+        return new XirSnippet(arrayLoadTemplates.get(site, elementKind), array, index);
+    }
+
+    @Override
+    public XirSnippet genArrayStore(XirSite site, XirArgument array, XirArgument index, XirArgument value, CiKind elementKind, RiType elementType) {
+        return new XirSnippet(arrayStoreTemplates.get(site, elementKind), array, index, value);
+    }
+
+    @Override
+    public XirSnippet genArrayCopy(XirSite site, XirArgument src, XirArgument srcPos, XirArgument dest, XirArgument destPos, XirArgument length, RiType elementType, boolean inputsSame, boolean inputsDifferent) {
+        if (elementType == null) {
+            return null;
+        }
+        assert !inputsDifferent || !inputsSame;
+        XirTemplate template = null;
+        if (inputsDifferent) {
+            template = arrayCopyTemplates.get(site, elementType.kind(true), INPUTS_DIFFERENT);
+        } else if (inputsSame) {
+            template = arrayCopyTemplates.get(site, elementType.kind(true), INPUTS_SAME);
+        } else {
+            template = arrayCopyTemplates.get(site, elementType.kind(true));
+        }
+        return new XirSnippet(template, src, srcPos, dest, destPos, length);
+    }
+
+    @Override
+    public XirSnippet genArrayLength(XirSite site, XirArgument array) {
+        return new XirSnippet(arrayLengthTemplates.get(site), array);
+    }
+
+    @Override
+    public XirSnippet genTypeBranch(XirSite site, XirArgument thisHub, XirArgument otherHub, RiType type) {
+        assert type instanceof RiResolvedType;
+        return new XirSnippet(typeCheckTemplates.get(site), thisHub, otherHub);
+    }
+
+    @Override
+    public void initialize(CiXirAssembler asm) {
+        this.globalAsm = asm;
+    }
+
+    private void verifyPointer(CiXirAssembler asm, XirOperand pointer) {
+        if (config.verifyPointers) {
+            // The verify pointer stub wants the argument in a fixed register.
+            XirOperand fixed = asm.createRegisterTemp("fixed", CiKind.Object, AMD64.r13);
+            asm.push(fixed);
+            asm.mov(fixed, pointer);
+            asm.callRuntime(config.verifyPointerStub, null);
+            asm.pop(fixed);
+        }
+    }
+
+    private void checkSubtype(CiXirAssembler asm, XirOperand result, XirOperand objHub, XirOperand hub) {
+        asm.push(objHub);
+        asm.push(hub);
+        asm.callRuntime(config.instanceofStub, null);
+        asm.pop(result);
+        asm.pop(result);
+    }
+
+    private static void useRegisters(CiXirAssembler asm, CiRegister... registers) {
+        if (registers != null) {
+            for (CiRegister register : registers) {
+                asm.createRegisterTemp("reg", CiKind.Illegal, register);
+            }
+        }
+    }
+
+    private void writeBarrier(CiXirAssembler asm, XirOperand base) {
+        asm.shr(base, base, asm.i(config.cardtableShift));
+        asm.pstore(CiKind.Boolean, wordConst(asm, config.cardtableStartAddress), base, asm.b(false), false);
+    }
+
+    public boolean is(TemplateFlag check, long flags) {
+        return (flags & check.bits()) == check.bits();
+    }
+
+    /**
+     * Base class for all the ondemand template generators. It is not normally subclassed directly, but through one of
+     * its subclasses (SimpleTemplates, KindTemplates, IndexTemplates).
+     */
+    private abstract class Templates {
+
+        private ConcurrentHashMap<Long, XirTemplate> templates = new ConcurrentHashMap<>();
+        private final long mask;
+
+        /**
+         * Each flag passed to this method will cause templates with and without it to be generated.
+         */
+        public Templates(TemplateFlag... flags) {
+            this.mask = getBits((int) INDEX_MASK, null, flags);
+        }
+
+        protected abstract XirTemplate create(CiXirAssembler asm, long flags);
+
+        protected long getBits(int index, XirSite site, TemplateFlag... flags) {
+            long bits = index;
+            if (site != null) {
+                bits |= site.requiresNullCheck() ? NULL_CHECK.bits() : 0;
+                bits |= site.requiresReadBarrier() ? READ_BARRIER.bits() : 0;
+                bits |= site.requiresWriteBarrier() ? WRITE_BARRIER.bits() : 0;
+                bits |= site.requiresArrayStoreCheck() ? STORE_CHECK.bits() : 0;
+                bits |= site.requiresBoundsCheck() ? BOUNDS_CHECK.bits() : 0;
+            }
+            if (flags != null) {
+                for (TemplateFlag flag : flags) {
+                    bits |= flag.bits();
+                }
+            }
+            return bits;
+        }
+
+        protected XirTemplate getInternal(long flags) {
+            long maskedFlags = flags & mask;
+            XirTemplate template = templates.get(maskedFlags);
+            if (template == null) {
+                template = create(HotSpotXirGenerator.this.globalAsm.copy(), maskedFlags);
+                templates.put(maskedFlags, template);
+            }
+            return template;
+        }
+    }
+
+    private abstract class SimpleTemplates extends Templates {
+
+        public SimpleTemplates(TemplateFlag... flags) {
+            super(flags);
+        }
+
+        public XirTemplate get(XirSite site, TemplateFlag... flags) {
+            return getInternal(getBits(0, site, flags));
+        }
+    }
+
+    private abstract class IndexTemplates extends Templates {
+
+        public IndexTemplates(TemplateFlag... flags) {
+            super(flags);
+        }
+
+        @Override
+        protected final XirTemplate create(CiXirAssembler asm, long flags) {
+            return create(asm, flags & FLAGS_MASK, (int) (flags & INDEX_MASK));
+        }
+
+        protected abstract XirTemplate create(CiXirAssembler asm, long flags, int index);
+
+        public XirTemplate get(XirSite site, int size, TemplateFlag... flags) {
+            return getInternal(getBits(size, site, flags));
+        }
+    }
+
+    private abstract class KindTemplates extends Templates {
+
+        public KindTemplates(TemplateFlag... flags) {
+            super(flags);
+        }
+
+        @Override
+        protected final XirTemplate create(CiXirAssembler asm, long flags) {
+            return create(asm, flags & FLAGS_MASK, CiKind.VALUES[(int) (flags & INDEX_MASK)]);
+        }
+
+        protected abstract XirTemplate create(CiXirAssembler asm, long flags, CiKind kind);
+
+        public XirTemplate get(XirSite site, CiKind kind, TemplateFlag... flags) {
+            return getInternal(getBits(kind.ordinal(), site, flags));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/TemplateFlag.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.ri;
+
+enum TemplateFlag {
+    NULL_CHECK, READ_BARRIER, WRITE_BARRIER, STORE_CHECK, BOUNDS_CHECK, GIVEN_LENGTH, INPUTS_DIFFERENT, INPUTS_SAME, STATIC_METHOD, SYNCHRONIZED, EXACT_HINTS;
+
+    private static final long FIRST_FLAG = 0x0000000100000000L;
+    public static final long FLAGS_MASK = 0x0000FFFF00000000L;
+    public static final long INDEX_MASK = 0x00000000FFFFFFFFL;
+
+    public long bits() {
+        assert ((FIRST_FLAG << ordinal()) & FLAGS_MASK) != 0;
+        return FIRST_FLAG << ordinal();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/CompilationServer.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.server;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+import javax.net.*;
+
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.hotspot.Compiler;
+import com.oracle.graal.hotspot.bridge.*;
+import com.oracle.graal.hotspot.logging.*;
+
+/**
+ * Server side of the client/server compilation model. The server listens for connections on the hardcoded port 1199.
+ */
+public class CompilationServer implements Runnable {
+
+    public static void main(String[] args) throws Exception {
+        new CompilationServer(false).run();
+    }
+
+    public interface ConnectionObserver {
+
+        void connectionStarted(Compiler compiler);
+
+        void connectionFinished(Compiler compiler);
+    }
+
+    private final boolean multiple;
+    private final ArrayList<ConnectionObserver> observers = new ArrayList<>();
+
+    /**
+     * Creates a new Compilation server. The server is activated by calling {@link #run()} directly or via a new
+     * {@link Thread}.
+     *
+     * @param multiple true if the server should server should serve an infinite amount of consecutive connections,
+     *            false if it should terminate after the first connection ends.
+     */
+    public CompilationServer(boolean multiple) {
+        this.multiple = multiple;
+        HotSpotOptions.setDefaultOptions();
+    }
+
+    public void addConnectionObserver(ConnectionObserver observer) {
+        observers.add(observer);
+    }
+
+    public void removeConnectionObserver(ConnectionObserver observer) {
+        observers.remove(observer);
+    }
+
+    public void run() {
+        final ServerSocket serverSocket;
+        try {
+            serverSocket = ServerSocketFactory.getDefault().createServerSocket(1199);
+        } catch (IOException e) {
+            throw new RuntimeException("Couldn't create compilation server", e);
+        }
+        do {
+            Socket socket = null;
+            try {
+                Logger.log("Compilation server ready, waiting for client to connect...");
+                socket = serverSocket.accept();
+                Logger.log("Connected to " + socket.getRemoteSocketAddress());
+
+                ReplacingStreams streams = new ReplacingStreams(socket.getOutputStream(), socket.getInputStream());
+
+                // get the VMEntries proxy from the client
+                CompilerToVM entries = (CompilerToVM) streams.getInvocation().waitForResult(false);
+
+                // return the initialized compiler to the client
+                Compiler compiler = CompilerImpl.initializeServer(entries);
+                compiler.getCompiler();
+                streams.getInvocation().sendResult(compiler);
+
+                for (ConnectionObserver observer : observers) {
+                    observer.connectionStarted(compiler);
+                }
+
+                streams.getInvocation().waitForResult(true);
+
+                for (ConnectionObserver observer : observers) {
+                    observer.connectionFinished(compiler);
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            } catch (ClassNotFoundException e) {
+                throw new RuntimeException(e);
+            } finally {
+                if (socket != null) {
+                    try {
+                        socket.close();
+                    } catch (IOException e) {
+                    }
+                }
+            }
+        } while (multiple);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/InvocationSocket.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.server;
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.graal.hotspot.logging.*;
+
+/**
+ * A collection of java.lang.reflect proxies that communicate over a socket connection.
+ *
+ * Calling a method sends the method name and the parameters through the socket. Afterwards this class waits for a
+ * result. While waiting for a result three types of objects can arrive through the socket: a method invocation, a
+ * method result or an exception. Method invocation can thus be recursive.
+ */
+public class InvocationSocket {
+
+    private static final boolean DEBUG = false;
+    private static final boolean COUNT_CALLS = false;
+
+    private static final HashSet<String> cachedMethodNames = new HashSet<>();
+    private static final HashSet<String> forbiddenMethodNames = new HashSet<>();
+
+    static {
+        cachedMethodNames.add("name");
+        cachedMethodNames.add("kind");
+        cachedMethodNames.add("isResolved");
+        cachedMethodNames.add("getVMEntries");
+        cachedMethodNames.add("exactType");
+        cachedMethodNames.add("isInitialized");
+        forbiddenMethodNames.add("javaClass");
+    }
+
+    private final ObjectOutputStream output;
+    private final ObjectInputStream input;
+
+    private final Map<String, Integer> counts = new HashMap<>();
+
+    public InvocationSocket(ObjectOutputStream output, ObjectInputStream input) {
+        this.output = output;
+        this.input = input;
+
+        if (COUNT_CALLS) {
+            Runtime.getRuntime().addShutdownHook(new Thread() {
+                @Override
+                public void run() {
+                    SortedMap<Integer, String> sorted = new TreeMap<>();
+                    for (Map.Entry<String, Integer> entry : counts.entrySet()) {
+                        sorted.put(entry.getValue(), entry.getKey());
+                    }
+                    for (Map.Entry<Integer, String> entry : sorted.entrySet()) {
+                        System.out.println(entry.getKey() + ": " + entry.getValue());
+                    }
+                }
+            });
+        }
+    }
+
+    /**
+     * Represents one invocation of a method that is transferred via the socket connection.
+     *
+     */
+    private static class Invocation implements Serializable {
+
+        /**
+         * 
+         */
+        private static final long serialVersionUID = -799162779226626066L;
+        public Object receiver;
+        public String methodName;
+        public Object[] args;
+
+        public Invocation(Object receiver, String methodName, Object[] args) {
+            this.receiver = receiver;
+            this.methodName = methodName;
+            this.args = args;
+        }
+    }
+
+    /**
+     * Represents the result of an invocation that is transferred via the socket connection.
+     *
+     */
+    private static class Result implements Serializable {
+
+        /**
+         * 
+         */
+        private static final long serialVersionUID = -7496058356272415814L;
+        public Object result;
+
+        public Result(Object result) {
+            this.result = result;
+        }
+    }
+
+    private void incCount(String name, Object[] args) {
+        if (COUNT_CALLS) {
+            String nameAndArgCount = name + (args == null ? 0 : args.length);
+            if (counts.get(nameAndArgCount) != null) {
+                counts.put(nameAndArgCount, counts.get(nameAndArgCount) + 1);
+            } else {
+                counts.put(nameAndArgCount, 1);
+            }
+        }
+    }
+
+    /**
+     * Each instance of this class handles remote invocations for one instance of a Remote class. It will forward all
+     * interface methods to the other end of the socket and cache the results of calls to certain methods.
+     *
+     */
+    public class Handler implements InvocationHandler {
+
+        private final Object receiver;
+        private final HashMap<String, Object> cache = new HashMap<>();
+
+        public Handler(Object receiver) {
+            this.receiver = receiver;
+        }
+
+        @Override
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+            // only interface methods can be transferred, java.lang.Object methods
+            if (method.getDeclaringClass() == Object.class) {
+                return method.invoke(receiver, args);
+            }
+            String methodName = method.getName();
+            // check if the result of this zero-arg method was cached
+            if (args == null || args.length == 0) {
+                if (cache.containsKey(methodName)) {
+                    return cache.get(methodName);
+                }
+            }
+            if (forbiddenMethodNames.contains(methodName)) {
+                throw new IllegalAccessException(methodName + " not allowed");
+            }
+            Object result = null;
+            try {
+                if (DEBUG) {
+                    Logger.startScope("invoking remote " + methodName);
+                }
+                incCount(methodName, args);
+
+                output.writeObject(new Invocation(receiver, methodName, args));
+                output.flush();
+                result = waitForResult(false);
+
+                // result caching for selected methods
+                if ((args == null || args.length == 0) && cachedMethodNames.contains(methodName)) {
+                    cache.put(methodName, result);
+                }
+                return result;
+            } catch (Throwable t) {
+                t.printStackTrace();
+                throw t;
+            } finally {
+                if (DEBUG) {
+                    Logger.endScope(" = " + result);
+                }
+            }
+        }
+    }
+
+    /**
+     * Waits for the result of a remote method invocation. Invocations that should be executed in this VM might arrive
+     * while waiting for the result, and these invocations will be executed before again waiting fort he result.
+     */
+    @SuppressWarnings("unused")
+    public Object waitForResult(boolean eofExpected) throws IOException, ClassNotFoundException {
+        while (true) {
+            Object in;
+            try {
+                in = input.readObject();
+            } catch (EOFException e) {
+                if (eofExpected) {
+                    return null;
+                }
+                throw e;
+            }
+            if (in instanceof Result) {
+                return ((Result) in).result;
+            } else if (in instanceof RuntimeException) {
+                throw (RuntimeException) in;
+            } else if (in instanceof Throwable) {
+                throw new RuntimeException((Throwable) in);
+            }
+
+            Invocation invoke = (Invocation) in;
+            Method method = null;
+            for (Class<?> clazz = invoke.receiver.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
+                for (Method m : clazz.getDeclaredMethods()) {
+                    if (invoke.methodName.equals(m.getName())) {
+                        method = m;
+                        break;
+                    }
+                }
+            }
+            if (method == null) {
+                Exception e = new UnsupportedOperationException("unknown method " + invoke.methodName);
+                e.printStackTrace();
+                output.writeObject(e);
+                output.flush();
+            } else {
+                Object result = null;
+                try {
+                    if (invoke.args == null) {
+                        if (DEBUG) {
+                            Logger.startScope("invoking local " + invoke.methodName);
+                        }
+                        result = method.invoke(invoke.receiver);
+                    } else {
+                        if (Logger.ENABLED && DEBUG) {
+                            StringBuilder str = new StringBuilder();
+                            str.append("invoking local " + invoke.methodName + "(");
+                            for (int i = 0; i < invoke.args.length; i++) {
+                                str.append(i == 0 ? "" : ", ");
+                                str.append(Logger.pretty(invoke.args[i]));
+                            }
+                            str.append(")");
+                            Logger.startScope(str.toString());
+                        }
+                        result = method.invoke(invoke.receiver, invoke.args);
+                    }
+                    result = new Result(result);
+                } catch (IllegalArgumentException e) {
+                    System.out.println("error while invoking " + invoke.methodName);
+                    e.getCause().printStackTrace();
+                    result = e.getCause();
+                } catch (InvocationTargetException e) {
+                    System.out.println("error while invoking " + invoke.methodName);
+                    e.getCause().printStackTrace();
+                    result = e.getCause();
+                } catch (IllegalAccessException e) {
+                    System.out.println("error while invoking " + invoke.methodName);
+                    e.getCause().printStackTrace();
+                    result = e.getCause();
+                } finally {
+                    if (DEBUG) {
+                        if (result instanceof Result) {
+                            Logger.endScope(" = " + ((Result) result).result);
+                        } else {
+                            Logger.endScope(" = " + result);
+                        }
+                    }
+                }
+                output.writeObject(result);
+                output.flush();
+            }
+        }
+    }
+
+    /**
+     * Sends a result without invoking a method, used by CompilationServer startup code.
+     */
+    public void sendResult(Object obj) throws IOException {
+        output.writeObject(new Result(obj));
+        output.flush();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/Remote.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.server;
+
+
+public interface Remote {
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/ReplacingStreams.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.server;
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.hotspot.*;
+
+public class ReplacingStreams {
+
+    private IdentityHashMap<Object, Placeholder> objectMap = new IdentityHashMap<>();
+    private ArrayList<Object> objectList = new ArrayList<>();
+
+    private ReplacingOutputStream output;
+    private ReplacingInputStream input;
+
+    private InvocationSocket invocation;
+
+    public ReplacingStreams(OutputStream outputStream, InputStream inputStream) throws IOException {
+        output = new ReplacingOutputStream(new BufferedOutputStream(outputStream));
+        // required, because creating an ObjectOutputStream writes a header, but doesn't flush the stream
+        output.flush();
+        input = new ReplacingInputStream(new BufferedInputStream(inputStream));
+        invocation = new InvocationSocket(output, input);
+
+        addStaticObject(CiValue.IllegalValue);
+        addStaticObject(HotSpotProxy.DUMMY_CONSTANT_OBJ);
+    }
+
+    public void setInvocationSocket(InvocationSocket invocation) {
+        this.invocation = invocation;
+    }
+
+    public ReplacingOutputStream getOutput() {
+        return output;
+    }
+
+    public ReplacingInputStream getInput() {
+        return input;
+    }
+
+    public InvocationSocket getInvocation() {
+        return invocation;
+    }
+
+    private void addStaticObject(Object obj) {
+        int id = objectList.size();
+        objectList.add(obj);
+        objectMap.put(obj, new Placeholder(id));
+    }
+
+    public static class Placeholder implements Serializable {
+
+        /**
+         *
+         */
+        private static final long serialVersionUID = 6071894297788156945L;
+        public final int id;
+
+        public Placeholder(int id) {
+            this.id = id;
+        }
+
+        @Override
+        public String toString() {
+            return "#<" + id + ">";
+        }
+    }
+
+    public static class NewRemoteCallPlaceholder implements Serializable {
+
+        /**
+         *
+         */
+        private static final long serialVersionUID = 3084101671389500206L;
+        public final Class<?>[] interfaces;
+
+        public NewRemoteCallPlaceholder(Class<?>[] interfaces) {
+            this.interfaces = interfaces;
+        }
+    }
+
+    public static class NewDummyPlaceholder implements Serializable {
+
+        /**
+         *
+         */
+        private static final long serialVersionUID = 2692666726573532288L;
+    }
+
+    /**
+     * Replaces certain cir objects that cannot easily be made Serializable.
+     */
+    public class ReplacingInputStream extends ObjectInputStream {
+
+        public ReplacingInputStream(InputStream in) throws IOException {
+            super(in);
+            enableResolveObject(true);
+        }
+
+        @Override
+        protected Object resolveObject(Object obj) throws IOException {
+            // see ReplacingInputStream.replaceObject for details on when these types of objects are created
+
+            if (obj instanceof Placeholder) {
+                Placeholder placeholder = (Placeholder) obj;
+                Object resolvedObj = objectList.get(placeholder.id);
+                return resolvedObj;
+            }
+
+            if (obj instanceof NewRemoteCallPlaceholder) {
+                NewRemoteCallPlaceholder newPlaceholder = (NewRemoteCallPlaceholder) obj;
+                Placeholder placeholder = new Placeholder(objectList.size());
+                Object resolvedObj = Proxy.newProxyInstance(getClass().getClassLoader(), newPlaceholder.interfaces, invocation.new Handler(placeholder));
+                objectMap.put(resolvedObj, placeholder);
+                objectList.add(resolvedObj);
+                return resolvedObj;
+            }
+
+            if (obj instanceof NewDummyPlaceholder) {
+                Object resolvedObj = new Placeholder(objectList.size());
+                objectMap.put(resolvedObj, (Placeholder) resolvedObj);
+                objectList.add(resolvedObj);
+                return resolvedObj;
+            }
+
+            return obj;
+        }
+    }
+
+    /**
+     * Replaces certain cir objects that cannot easily be made Serializable.
+     */
+    public class ReplacingOutputStream extends ObjectOutputStream {
+
+        public ReplacingOutputStream(OutputStream out) throws IOException {
+            super(out);
+            enableReplaceObject(true);
+        }
+
+        @Override
+        protected Object replaceObject(Object obj) throws IOException {
+            // is the object a known instance?
+            Placeholder placeholder = objectMap.get(obj);
+            if (placeholder != null) {
+                return placeholder;
+            }
+
+            // is the object an instance of a class that will always be executed remotely?
+            if (obj instanceof Remote) {
+                return createRemoteCallPlaceholder(obj);
+            }
+
+            // is the object a constant of object type?
+            if (obj.getClass() == CiConstant.class) {
+                CiConstant constant = (CiConstant) obj;
+                if (constant.kind != CiKind.Object) {
+                    return obj;
+                }
+                Object contents = constant.asObject();
+                if (contents == null) {
+                    return obj;
+                }
+                // don't replace if the object already is a placeholder
+                if (contents instanceof Placeholder || contents instanceof Long) {
+                    return obj;
+                }
+                placeholder = objectMap.get(contents);
+                if (placeholder != null) {
+                    return CiConstant.forObject(placeholder);
+                }
+                if (contents instanceof Remote) {
+                    return CiConstant.forObject(createRemoteCallPlaceholder(contents));
+                }
+                return CiConstant.forObject(createDummyPlaceholder(contents));
+            }
+            return obj;
+        }
+    }
+
+    public static Class<?>[] getAllInterfaces(Class<?> clazz) {
+        HashSet<Class< ? >> interfaces = new HashSet<>();
+        getAllInterfaces(clazz, interfaces);
+        return interfaces.toArray(new Class<?>[interfaces.size()]);
+    }
+
+    private static void getAllInterfaces(Class<?> clazz, HashSet<Class<?>> interfaces) {
+        for (Class< ? > iface : clazz.getInterfaces()) {
+            if (!interfaces.contains(iface)) {
+                interfaces.add(iface);
+                getAllInterfaces(iface, interfaces);
+            }
+        }
+        if (clazz.getSuperclass() != null) {
+            getAllInterfaces(clazz.getSuperclass(), interfaces);
+        }
+    }
+
+    private Object createRemoteCallPlaceholder(Object obj) {
+        // collect all interfaces that this object's class implements (proxies only support interfaces)
+        objectMap.put(obj, new Placeholder(objectList.size()));
+        objectList.add(obj);
+        return new NewRemoteCallPlaceholder(getAllInterfaces(obj.getClass()));
+    }
+
+    public Object createDummyPlaceholder(Object obj) {
+        objectMap.put(obj, new Placeholder(objectList.size()));
+        objectList.add(obj);
+        return new NewDummyPlaceholder();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/server/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+/**
+ * Implementation of a compilation server socket that delegates incoming requests to Graal.
+ */
+package com.oracle.graal.hotspot.server;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopySnippets.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,458 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.snippets;
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.hotspot.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+import com.oracle.graal.snippets.*;
+import com.oracle.graal.snippets.nodes.*;
+
+
+public class ArrayCopySnippets implements SnippetsInterface{
+
+    @Snippet
+    public static void arraycopy(byte[] src, int srcPos, byte[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            if ((length & 0x01) == 0) {
+                if ((length & 0x02) == 0) {
+                    if ((length & 0x04) == 0) {
+                        copyLongsDown(src, srcPos, dest, destPos, length >> 3);
+                    } else {
+                        copyIntsDown(src, srcPos, dest, destPos, length >> 2);
+                    }
+                } else {
+                    copyShortsDown(src, srcPos, dest, destPos, length >> 1);
+                }
+            } else {
+                copyBytesDown(src, srcPos, dest, destPos, length);
+            }
+        } else {
+            if ((length & 0x01) == 0) {
+                if ((length & 0x02) == 0) {
+                    if ((length & 0x04) == 0) {
+                        copyLongsUp(src, srcPos, dest, destPos, length >> 3);
+                    } else {
+                        copyIntsUp(src, srcPos, dest, destPos, length >> 2);
+                    }
+                } else {
+                    copyShortsUp(src, srcPos, dest, destPos, length >> 1);
+                }
+            } else {
+                copyBytesUp(src, srcPos, dest, destPos, length);
+            }
+        }
+    }
+
+    @Snippet
+    public static void arraycopy(char[] src, int srcPos, char[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            if ((length & 0x01) == 0) {
+                if ((length & 0x02) == 0) {
+                    copyLongsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
+                } else {
+                    copyIntsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
+                }
+            } else {
+                copyShortsDown(src, srcPos * 2L, dest, destPos * 2L, length);
+            }
+        } else {
+            if ((length & 0x01) == 0) {
+                if ((length & 0x02) == 0) {
+                    copyLongsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
+                } else {
+                    copyIntsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
+                }
+            } else {
+                copyShortsUp(src, srcPos * 2L, dest, destPos * 2L, length);
+            }
+        }
+    }
+
+    @Snippet
+    public static void arraycopy(short[] src, int srcPos, short[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            if ((length & 0x01) == 0) {
+                if ((length & 0x02) == 0) {
+                    copyLongsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
+                } else {
+                    copyIntsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
+                }
+            } else {
+                copyShortsDown(src, srcPos * 2L, dest, destPos * 2L, length);
+            }
+        } else {
+            if ((length & 0x01) == 0) {
+                if ((length & 0x02) == 0) {
+                    copyLongsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
+                } else {
+                    copyIntsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
+                }
+            } else {
+                copyShortsUp(src, srcPos * 2L, dest, destPos * 2L, length);
+            }
+        }
+    }
+
+    @Snippet
+    public static void arraycopy(int[] src, int srcPos, int[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            if ((length & 0x01) == 0) {
+                copyLongsDown(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
+            } else {
+                copyIntsDown(src, srcPos * 4L, dest, destPos * 4L, length);
+            }
+        } else {
+            if ((length & 0x01) == 0) {
+                copyLongsUp(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
+            } else {
+                copyIntsUp(src, srcPos * 4L, dest, destPos * 4L, length);
+            }
+        }
+    }
+
+    @Snippet
+    public static void arraycopy(float[] src, int srcPos, float[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            if ((length & 0x01) == 0) {
+                copyLongsDown(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
+            } else {
+                copyIntsDown(src, srcPos * 4L, dest, destPos * 4L, length);
+            }
+        } else {
+            if ((length & 0x01) == 0) {
+                copyLongsUp(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
+            } else {
+                copyIntsUp(src, srcPos * 4L, dest, destPos * 4L, length);
+            }
+        }
+    }
+
+    @Snippet
+    public static void arraycopy(long[] src, int srcPos, long[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            copyLongsDown(src, srcPos * 8L, dest, destPos * 8L, length);
+        } else {
+            copyLongsUp(src, srcPos * 8L, dest, destPos * 8L, length);
+        }
+    }
+
+    @Snippet
+    public static void arraycopy(double[] src, int srcPos, double[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            copyLongsDown(src, srcPos * 8L, dest, destPos * 8L, length);
+        } else {
+            copyLongsUp(src, srcPos * 8L, dest, destPos * 8L, length);
+        }
+    }
+
+    // Does NOT perform store checks
+    @Snippet
+    public static void arraycopy(Object[] src, int srcPos, Object[] dest, int destPos, int length) {
+        if (src == null || dest == null) {
+            throw new NullPointerException();
+        }
+        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (src == dest && srcPos < destPos) { // bad aliased case
+            copyObjectsDown(src, srcPos * 8L, dest, destPos * 8L, length);
+        } else {
+            copyObjectsUp(src, srcPos * 8L, dest, destPos * 8L, length);
+        }
+        if (length > 0) {
+            long header = ArrayHeaderSizeNode.sizeFor(CiKind.Object);
+            int cardShift = CardTableShiftNode.get();
+            long cardStart = CardTableStartNode.get();
+            long dstAddr = GetObjectAddressNode.get(dest);
+            long start = (dstAddr + header + destPos * 8L) >>> cardShift;
+            long end = (dstAddr + header + (destPos + length - 1) * 8L) >>> cardShift;
+            long count = end - start + 1;
+            while (count-- > 0) {
+                DirectStoreNode.store((start + cardStart) + count, false);
+            }
+        }
+    }
+
+    @Snippet
+    public static void copyBytesDown(Object src, int srcPos, Object dest, int destPos, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Byte);
+        for (long i = length - 1; i >= 0; i--) {
+            Byte a = UnsafeLoadNode.load(src, i + (srcPos + header), CiKind.Byte);
+            UnsafeStoreNode.store(dest, i + (destPos + header), a.byteValue(), CiKind.Byte);
+        }
+    }
+
+    @Snippet
+    public static void copyShortsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Short);
+        for (long i = (length - 1) * 2; i >= 0; i -= 2) {
+            Character a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Short);
+            UnsafeStoreNode.store(dest, i + (destOffset + header), a.charValue(), CiKind.Short);
+        }
+    }
+
+    @Snippet
+    public static void copyIntsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Int);
+        for (long i = (length - 1) * 4; i >= 0; i -= 4) {
+            Integer a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Int);
+            UnsafeStoreNode.store(dest, i + (destOffset + header), a.intValue(), CiKind.Int);
+        }
+    }
+
+    @Snippet
+    public static void copyLongsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Long);
+        for (long i = (length - 1) * 8; i >= 0; i -= 8) {
+            Long a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Long);
+            UnsafeStoreNode.store(dest, i + (destOffset + header), a.longValue(), CiKind.Long);
+        }
+    }
+
+    // Does NOT perform store checks
+    @Snippet
+    public static void copyObjectsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Object);
+        for (long i = (length - 1) * 8; i >= 0; i -= 8) {
+            Object a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Object);
+            DirectObjectStoreNode.store(dest, i + (destOffset + header), a);
+        }
+    }
+    /**
+     * Copies {@code length} bytes from {@code src} starting at {@code srcPos} to {@code dest} starting at {@code destPos}.
+     * @param src source object
+     * @param srcPos source offset
+     * @param dest destination object
+     * @param destPos destination offset
+     * @param length number of bytes to copy
+     */
+    @Snippet
+    public static void copyBytesUp(Object src, int srcPos, Object dest, int destPos, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Byte);
+        for (long i = 0; i < length; i++) {
+            Byte a = UnsafeLoadNode.load(src, i + (srcPos + header), CiKind.Byte);
+            UnsafeStoreNode.store(dest, i + (destPos + header), a.byteValue(), CiKind.Byte);
+        }
+    }
+
+    /**
+     * Copies {@code length} shorts from {@code src} starting at offset {@code srcOffset} (in bytes) to {@code dest} starting at offset {@code destOffset} (in bytes).
+     * @param src
+     * @param srcOffset (in bytes)
+     * @param dest
+     * @param destOffset (in bytes)
+     * @param length  (in shorts)
+     */
+    @Snippet
+    public static void copyShortsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Short);
+        for (long i = 0; i < length * 2L; i += 2) {
+            Character a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Short);
+            UnsafeStoreNode.store(dest, i + (destOffset + header), a.charValue(), CiKind.Short);
+        }
+    }
+
+    @Snippet
+    public static void copyIntsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Int);
+        for (long i = 0; i < length * 4L; i += 4) {
+            Integer a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Int);
+            UnsafeStoreNode.store(dest, i + (destOffset + header), a.intValue(), CiKind.Int);
+        }
+    }
+
+    @Snippet
+    public static void copyLongsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Long);
+        for (long i = 0; i < length * 8L; i += 8) {
+            Long a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Long);
+            UnsafeStoreNode.store(dest, i + (destOffset + header), a.longValue(), CiKind.Long);
+        }
+    }
+
+    // Does NOT perform store checks
+    @Snippet
+    public static void copyObjectsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
+        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Object);
+        for (long i = 0; i < length * 8L; i += 8) {
+            Object a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Object);
+            DirectObjectStoreNode.store(dest, i + (destOffset + header), a);
+        }
+    }
+    private static class GetObjectAddressNode extends FixedWithNextNode implements LIRLowerable {
+        @Input private ValueNode object;
+
+        public GetObjectAddressNode(ValueNode obj) {
+            super(StampFactory.forKind(CiKind.Long));
+            this.object = obj;
+        }
+
+        @SuppressWarnings("unused")
+        @NodeIntrinsic
+        public static long get(Object array) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void generate(LIRGeneratorTool gen) {
+            CiValue obj = gen.newVariable(gen.target().wordKind);
+            gen.emitMove(gen.operand(object), obj);
+            gen.setResult(this, obj);
+        }
+    }
+    private static class DirectStoreNode extends FixedWithNextNode implements LIRLowerable {
+        @Input private ValueNode address;
+        @Input private ValueNode value;
+
+        public DirectStoreNode(ValueNode address, ValueNode value) {
+            super(StampFactory.illegal());
+            this.address = address;
+            this.value = value;
+        }
+
+        @SuppressWarnings("unused")
+        @NodeIntrinsic
+        public static void store(long address, long value) {
+            throw new UnsupportedOperationException();
+        }
+
+        @SuppressWarnings("unused")
+        @NodeIntrinsic
+        public static void store(long address, boolean value) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void generate(LIRGeneratorTool gen) {
+            CiValue v = gen.operand(value);
+            gen.emitStore(new CiAddress(v.kind, gen.operand(address)), v, false);
+        }
+    }
+
+    private static class DirectObjectStoreNode extends FixedWithNextNode implements Lowerable {
+        @Input private ValueNode object;
+        @Input private ValueNode value;
+        @Input private ValueNode offset;
+
+        public DirectObjectStoreNode(ValueNode object, ValueNode offset, ValueNode value) {
+            super(StampFactory.illegal());
+            this.object = object;
+            this.value = value;
+            this.offset = offset;
+        }
+
+        @SuppressWarnings("unused")
+        @NodeIntrinsic
+        public static void store(Object obj, long offset, long value) {
+            throw new UnsupportedOperationException();
+        }
+
+        @SuppressWarnings("unused")
+        @NodeIntrinsic
+        public static void store(Object obj, long offset, boolean value) {
+            throw new UnsupportedOperationException();
+        }
+
+        @SuppressWarnings("unused")
+        @NodeIntrinsic
+        public static void store(Object obj, long offset, Object value) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void lower(CiLoweringTool tool) {
+            StructuredGraph graph = (StructuredGraph) this.graph();
+            IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, value.kind(), 0, offset, graph, false);
+            WriteNode write = graph.add(new WriteNode(object, value, location));
+            graph.replaceFixedWithFixed(this, write);
+        }
+    }
+
+    private static class CardTableShiftNode extends ConstantNode {
+        public CardTableShiftNode() {
+            super(CiConstant.forInt(CompilerImpl.getInstance().getConfig().cardtableShift));
+        }
+
+        @NodeIntrinsic
+        public static int get() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    private static class CardTableStartNode extends ConstantNode {
+        public CardTableStartNode() {
+            super(CiConstant.forLong(CompilerImpl.getInstance().getConfig().cardtableStartAddress));
+        }
+
+        @NodeIntrinsic
+        public static long get() {
+            throw new UnsupportedOperationException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.snippets;
+
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
+
+public class IntrinsifyArrayCopyPhase extends Phase {
+    private final GraalRuntime runtime;
+    private RiResolvedMethod arrayCopy;
+    private RiResolvedMethod byteArrayCopy;
+    private RiResolvedMethod shortArrayCopy;
+    private RiResolvedMethod charArrayCopy;
+    private RiResolvedMethod intArrayCopy;
+    private RiResolvedMethod longArrayCopy;
+    private RiResolvedMethod floatArrayCopy;
+    private RiResolvedMethod doubleArrayCopy;
+    private RiResolvedMethod objectArrayCopy;
+
+    public IntrinsifyArrayCopyPhase(GraalRuntime runtime) {
+        this.runtime = runtime;
+        try {
+            byteArrayCopy = getArrayCopySnippet(runtime, byte.class);
+            charArrayCopy = getArrayCopySnippet(runtime, char.class);
+            shortArrayCopy = getArrayCopySnippet(runtime, short.class);
+            intArrayCopy = getArrayCopySnippet(runtime, int.class);
+            longArrayCopy = getArrayCopySnippet(runtime, long.class);
+            floatArrayCopy = getArrayCopySnippet(runtime, float.class);
+            doubleArrayCopy = getArrayCopySnippet(runtime, double.class);
+            objectArrayCopy = getArrayCopySnippet(runtime, Object.class);
+            arrayCopy = runtime.getRiMethod(System.class.getDeclaredMethod("arraycopy", Object.class, int.class, Object.class, int.class, int.class));
+        } catch (SecurityException e) {
+            e.printStackTrace();
+        } catch (NoSuchMethodException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static RiResolvedMethod getArrayCopySnippet(RiRuntime runtime, Class<?> componentClass) throws NoSuchMethodException {
+        Class<?> arrayClass = Array.newInstance(componentClass, 0).getClass();
+        return runtime.getRiMethod(ArrayCopySnippets.class.getDeclaredMethod("arraycopy", arrayClass, int.class, arrayClass, int.class, int.class));
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        boolean hits = false;
+        for (MethodCallTargetNode methodCallTarget : graph.getNodes(MethodCallTargetNode.class)) {
+            RiResolvedMethod targetMethod = methodCallTarget.targetMethod();
+            RiResolvedMethod snippetMethod = null;
+            if (targetMethod == arrayCopy) {
+                ValueNode src = methodCallTarget.arguments().get(0);
+                ValueNode dest = methodCallTarget.arguments().get(2);
+                assert src != null && dest != null;
+                RiResolvedType srcDeclaredType = src.declaredType();
+                RiResolvedType destDeclaredType = dest.declaredType();
+                if (srcDeclaredType != null
+                                && srcDeclaredType.isArrayClass()
+                                && destDeclaredType != null
+                                && destDeclaredType.isArrayClass()) {
+                    CiKind componentKind = srcDeclaredType.componentType().kind(false);
+                    if (srcDeclaredType.componentType() == destDeclaredType.componentType()) {
+                        if (componentKind == CiKind.Int) {
+                            snippetMethod = intArrayCopy;
+                        } else if (componentKind == CiKind.Char) {
+                            snippetMethod = charArrayCopy;
+                        } else if (componentKind == CiKind.Long) {
+                            snippetMethod = longArrayCopy;
+                        } else if (componentKind == CiKind.Byte) {
+                            snippetMethod = byteArrayCopy;
+                        } else if (componentKind == CiKind.Short) {
+                            snippetMethod = shortArrayCopy;
+                        } else if (componentKind == CiKind.Float) {
+                            snippetMethod = floatArrayCopy;
+                        } else if (componentKind == CiKind.Double) {
+                            snippetMethod = doubleArrayCopy;
+                        } else if (componentKind == CiKind.Object) {
+                            snippetMethod = objectArrayCopy;
+                        }
+                    } else if (componentKind == CiKind.Object
+                                    && srcDeclaredType.componentType().isSubtypeOf(destDeclaredType.componentType())) {
+                        snippetMethod = objectArrayCopy;
+                    }
+                }
+            }
+
+            if (snippetMethod != null) {
+                StructuredGraph snippetGraph = (StructuredGraph) snippetMethod.compilerStorage().get(Graph.class);
+                assert snippetGraph != null : "ArrayCopySnippets should be installed";
+                hits = true;
+                Debug.log("%s > Intinsify (%s)", Debug.currentScope(), snippetMethod.signature().argumentTypeAt(0, snippetMethod.holder()).componentType());
+                InliningUtil.inline(methodCallTarget.invoke(), snippetGraph, false);
+            }
+        }
+        if (GraalOptions.OptCanonicalizer && hits) {
+            new CanonicalizerPhase(null, runtime, null).apply(graph);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.snippets;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.snippets.*;
+
+/**
+ * Snippets for {@link java.lang.System} methods.
+ */
+@ClassSubstitution(java.lang.System.class)
+public class SystemSnippets implements SnippetsInterface {
+
+    public static long currentTimeMillis() {
+        return RuntimeCallNode.performCall(CiRuntimeCall.JavaTimeMillis);
+    }
+
+    public static long nanoTime() {
+        return RuntimeCallNode.performCall(CiRuntimeCall.JavaTimeNanos);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/UnsafeSnippets.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.snippets;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.util.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.snippets.*;
+
+/**
+ * Snippets for {@link sun.misc.Unsafe} methods.
+ */
+@ClassSubstitution(sun.misc.Unsafe.class)
+public class UnsafeSnippets implements SnippetsInterface {
+
+    public boolean compareAndSwapObject(Object o, long offset, Object expected, Object x) {
+        return CompareAndSwapNode.compareAndSwap(o, offset, expected, x);
+    }
+
+    public boolean compareAndSwapInt(Object o, long offset, int expected, int x) {
+        return CompareAndSwapNode.compareAndSwap(o, offset, expected, x);
+    }
+
+    public boolean compareAndSwapLong(Object o, long offset, long expected, long x) {
+        return CompareAndSwapNode.compareAndSwap(o, offset, expected, x);
+    }
+
+    public Object getObject(Object o, long offset) {
+        return UnsafeLoadNode.load(o, offset, CiKind.Object);
+    }
+
+    public Object getObjectVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        Object result = getObject(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putObject(Object o, long offset, Object x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Object);
+    }
+
+    public void putObjectVolatile(Object o, long offset, Object x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putObject(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public int getInt(Object o, long offset) {
+        Integer value = UnsafeLoadNode.load(o, offset, CiKind.Int);
+        return value;
+    }
+
+    public int getIntVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        int result = getInt(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putInt(Object o, long offset, int x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Int);
+    }
+
+    public void putIntVolatile(Object o, long offset, int x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putInt(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public boolean getBoolean(Object o, long offset) {
+        @JavacBug(id = 6995200)
+        Boolean result = UnsafeLoadNode.load(o, offset, CiKind.Boolean);
+        return result;
+    }
+
+    public boolean getBooleanVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        boolean result = getBoolean(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putBoolean(Object o, long offset, boolean x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Boolean);
+    }
+
+    public void putBooleanVolatile(Object o, long offset, boolean x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putBoolean(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public byte getByte(Object o, long offset) {
+        @JavacBug(id = 6995200)
+        Byte result = UnsafeLoadNode.load(o, offset, CiKind.Byte);
+        return result;
+    }
+
+    public byte getByteVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        byte result = getByte(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putByte(Object o, long offset, byte x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Byte);
+    }
+
+    public void putByteVolatile(Object o, long offset, byte x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putByte(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public short getShort(Object o, long offset) {
+        @JavacBug(id = 6995200)
+        Short result = UnsafeLoadNode.load(o, offset, CiKind.Short);
+        return result;
+    }
+
+    public short getShortVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        short result = getShort(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putShort(Object o, long offset, short x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Short);
+    }
+
+    public void putShortVolatile(Object o, long offset, short x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putShort(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public char getChar(Object o, long offset) {
+        @JavacBug(id = 6995200)
+        Character result = UnsafeLoadNode.load(o, offset, CiKind.Char);
+        return result;
+    }
+
+    public char getCharVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        char result = getChar(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putChar(Object o, long offset, char x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Char);
+    }
+
+    public void putCharVolatile(Object o, long offset, char x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putChar(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public long getLong(Object o, long offset) {
+        @JavacBug(id = 6995200)
+        Long result = UnsafeLoadNode.load(o, offset, CiKind.Long);
+        return result;
+    }
+
+    public long getLongVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        long result = getLong(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putLong(Object o, long offset, long x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Long);
+    }
+
+    public void putLongVolatile(Object o, long offset, long x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putLong(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public float getFloat(Object o, long offset) {
+        @JavacBug(id = 6995200)
+        Float result = UnsafeLoadNode.load(o, offset, CiKind.Float);
+        return result;
+    }
+
+    public float getFloatVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        float result = getFloat(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putFloat(Object o, long offset, float x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Float);
+    }
+
+    public void putFloatVolatile(Object o, long offset, float x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putFloat(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+
+    public double getDouble(Object o, long offset) {
+        @JavacBug(id = 6995200)
+        Double result = UnsafeLoadNode.load(o, offset, CiKind.Double);
+        return result;
+    }
+
+    public double getDoubleVolatile(Object o, long offset) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
+        double result = getDouble(o, offset);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
+        return result;
+    }
+
+    public void putDouble(Object o, long offset, double x) {
+        UnsafeStoreNode.store(o, offset, x, CiKind.Double);
+    }
+
+    public void putDoubleVolatile(Object o, long offset, double x) {
+        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
+        putDouble(o, offset, x);
+        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64TailcallOp.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.target.amd64;
+
+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.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.amd64.*;
+import com.oracle.graal.lir.asm.*;
+
+/**
+ * Performs a hard-coded tail call to the specified target, which normally should be an RiCompiledCode instance.
+ */
+public class AMD64TailcallOp extends AMD64LIRInstruction {
+
+    public AMD64TailcallOp(List<CiValue> parameters, CiValue target, CiValue[] callingConvention) {
+        super("TAILCALL", LIRInstruction.NO_OPERANDS, null, toArray(parameters, target), LIRInstruction.NO_OPERANDS, callingConvention.clone());
+        assert inputs.length == temps.length + 1;
+
+        for (int i = 0; i < temps.length; i++) {
+            assert isRegister(temps[i]) : "too many parameters for tail call";
+            assert sameRegister(temps[i], inputs[i]) : "inputs do not match calling convention";
+        }
+    }
+
+    private static CiValue[] toArray(List<CiValue> parameters, CiValue target) {
+        CiValue[] result = new CiValue[parameters.size() + 1];
+        parameters.toArray(result);
+        result[parameters.size()] = target;
+        return result;
+    }
+
+    @Override
+    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+        // destroy the current frame (now the return address is the top of stack)
+        masm.leave();
+
+        // jump to the target method
+        masm.jmp(asRegister(inputs[inputs.length - 1]));
+        masm.ensureUniquePC();
+    }
+
+    @Override
+    protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+        if (mode == OperandMode.Input) {
+            return EnumSet.of(OperandFlag.Register);
+        } else if (mode == OperandMode.Temp) {
+            return EnumSet.of(OperandFlag.Register);
+        }
+        throw GraalInternalError.shouldNotReachHere();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,813 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java;
+
+import static com.oracle.graal.java.bytecode.Bytecodes.*;
+
+import java.util.*;
+
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.java.bytecode.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * Builds a mapping between bytecodes and basic blocks and builds a conservative control flow
+ * graph. Note that this class serves a similar role to C1's {@code BlockListBuilder}, but makes fewer assumptions about
+ * what the compiler interface provides. It builds all basic blocks for the control flow graph without requiring the
+ * compiler interface to provide a bitmap of the beginning of basic blocks. It makes two linear passes; one over the
+ * bytecodes to build block starts and successor lists, and one pass over the block map to build the CFG.
+ *
+ * Note that the CFG built by this class is <i>not</i> connected to the actual {@code BlockBegin} instances; this class
+ * does, however, compute and assign the reverse postorder number of the blocks. This comment needs refinement. (MJJ)
+ *
+ * <H2>More Details on {@link BciBlockMapping#build}</H2>
+ *
+ * If the method has any exception handlers the {@linkplain #exceptionMap exception map} will be created (TBD).
+ *
+ * The bytecodes are then scanned linearly looking for bytecodes that contain control transfers, e.g., {@code GOTO},
+ * {@code RETURN}, {@code IFGE}, and creating the corresponding entries in {@link #successorMap} and {@link #blockMap}.
+ * In addition, if {@link #exceptionMap} is not null, entries are made for any bytecode that can cause an exception.
+ * More TBD.
+ *
+ * Observe that this process finds bytecodes that terminate basic blocks, so the {@link #moveSuccessorLists} method is
+ * called to reassign the successors to the {@code BlockBegin} node that actually starts the block.
+ *
+ * <H3>Example</H3>
+ *
+ * Consider the following source code:
+ *
+ * <pre>
+ * <code>
+ *     public static int test(int arg1, int arg2) {
+ *         int x = 0;
+ *         while (arg2 > 0) {
+ *             if (arg1 > 0) {
+ *                 x += 1;
+ *             } else if (arg1 < 0) {
+ *                 x -= 1;
+ *             }
+ *         }
+ *         return x;
+ *     }
+ * </code>
+ * </pre>
+ *
+ * This is translated by javac to the following bytecode:
+ *
+ * <pre>
+ * <code>
+ *    0:   iconst_0
+ *    1:   istore_2
+ *    2:   goto    22
+ *    5:   iload_0
+ *    6:   ifle    15
+ *    9:   iinc    2, 1
+ *    12:  goto    22
+ *    15:  iload_0
+ *    16:  ifge    22
+ *    19:  iinc    2, -1
+ *    22:  iload_1
+ *    23:  ifgt    5
+ *    26:  iload_2
+ *    27:  ireturn
+ *    </code>
+ * </pre>
+ *
+ * There are seven basic blocks in this method, 0..2, 5..6, 9..12, 15..16, 19..19, 22..23 and 26..27. Therefore, before
+ * the call to {@code moveSuccessorLists}, the {@code blockMap} array has {@code BlockBegin} nodes at indices 0, 5, 9,
+ * 15, 19, 22 and 26. The {@code successorMap} array has entries at 2, 6, 12, 16, 23, 27 corresponding to the control
+ * transfer bytecodes. The entry at index 6, for example, is a length two array of {@code BlockBegin} nodes for indices
+ * 9 and 15, which are the successors for the basic block 5..6. After the call to {@code moveSuccessors}, {@code
+ * successorMap} has entries at 0, 5, 9, 15, 19, 22 and 26, i.e, matching {@code blockMap}.
+ * <p>
+ * Next the blocks are numbered using <a href="http://en.wikipedia.org/wiki/Depth-first_search#Vertex_orderings">reverse
+ * post-order</a>. For the above example this results in the numbering 2, 4, 7, 5, 6, 3, 8. Also loop header blocks are
+ * detected during the traversal by detecting a repeat visit to a block that is still being processed. This causes the
+ * block to be flagged as a loop header and also added to the {@link #loopBlocks} list. The {@code loopBlocks} list
+ * contains the blocks at 0, 5, 9, 15, 19, 22, with 22 as the loop header. (N.B. the loop header block is added multiple
+ * (4) times to this list). (Should 0 be in? It's not inside the loop).
+ *
+ * If the {@code computeStoresInLoops} argument to {@code build} is true, the {@code loopBlocks} list is processed to
+ * mark all local variables that are stored in the blocks in the list.
+ */
+public final class BciBlockMapping {
+
+    public static class Block implements Cloneable {
+        public int startBci;
+        public int endBci;
+        public boolean isExceptionEntry;
+        public boolean isLoopHeader;
+        public int blockID;
+
+        public FixedWithNextNode firstInstruction;
+        public FrameStateBuilder entryState;
+
+        public ArrayList<Block> successors = new ArrayList<>(2);
+        public int normalSuccessors;
+
+        private boolean visited;
+        private boolean active;
+        public long loops;
+
+        public HashMap<JsrScope, Block> jsrAlternatives;
+        public JsrScope jsrScope = JsrScope.EMPTY_SCOPE;
+        public Block jsrSuccessor;
+        public int jsrReturnBci;
+        public Block retSuccessor;
+        public boolean endsWithRet = false;
+
+        public BitMap localsLiveIn;
+        public BitMap localsLiveOut;
+        private BitMap localsLiveGen;
+        private BitMap localsLiveKill;
+
+        public Block copy() {
+            try {
+                Block block = (Block) super.clone();
+                block.successors = new ArrayList<>(successors);
+                return block;
+            } catch (CloneNotSupportedException e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder("B").append(blockID);
+            sb.append('[').append(startBci).append("->").append(endBci);
+            if (isLoopHeader || isExceptionEntry) {
+                sb.append(' ');
+                if (isLoopHeader) {
+                    sb.append('L');
+                }
+                if (isExceptionEntry) {
+                    sb.append('!');
+                }
+            }
+            sb.append(']');
+            return sb.toString();
+        }
+    }
+
+    public static class ExceptionBlock extends Block {
+        public RiExceptionHandler handler;
+        public int deoptBci;
+    }
+
+    /**
+     * The blocks found in this method, in reverse postorder.
+     */
+    public final List<Block> blocks;
+
+    public final RiResolvedMethod method;
+
+    private final BytecodeStream stream;
+
+    private final RiExceptionHandler[] exceptionHandlers;
+
+    private Block[] blockMap;
+
+    public final BitSet canTrap;
+
+    public boolean hasJsrBytecodes;
+
+    public Block startBlock;
+
+    public final boolean useBranchPrediction;
+
+    /**
+     * Creates a new BlockMap instance from bytecode of the given method .
+     * @param method the compiler interface method containing the code
+     */
+    public BciBlockMapping(RiResolvedMethod method, boolean useBranchPrediction) {
+        this.method = method;
+        exceptionHandlers = method.exceptionHandlers();
+        stream = new BytecodeStream(method.code());
+        this.blockMap = new Block[method.codeSize()];
+        this.canTrap = new BitSet(blockMap.length);
+        this.blocks = new ArrayList<>();
+        this.useBranchPrediction = useBranchPrediction;
+    }
+
+    public RiExceptionHandler[] exceptionHandlers() {
+        return exceptionHandlers;
+    }
+
+    /**
+     * Builds the block map and conservative CFG and numbers blocks.
+     */
+    public void build() {
+        makeExceptionEntries();
+        iterateOverBytecodes();
+        addExceptionEdges();
+        if (hasJsrBytecodes) {
+            if (!GraalOptions.SupportJsrBytecodes) {
+                throw new JsrNotSupportedBailout("jsr/ret parsing disabled");
+            }
+            createJsrAlternatives(blockMap[0]);
+        }
+        computeBlockOrder();
+
+        initializeBlockIds();
+
+        startBlock = blockMap[0];
+
+        // Discard big arrays so that they can be GCed
+        blockMap = null;
+
+        if (GraalOptions.OptLivenessAnalysis) {
+            Debug.scope("LivenessAnalysis", new Runnable() {
+                @Override
+                public void run() {
+                    computeLiveness();
+                }
+            });
+        }
+    }
+
+    private void initializeBlockIds() {
+        for (int i = 0; i < blocks.size(); i++) {
+            blocks.get(i).blockID = i;
+        }
+    }
+
+    private void makeExceptionEntries() {
+        // start basic blocks at all exception handler blocks and mark them as exception entries
+        for (RiExceptionHandler h : this.exceptionHandlers) {
+            Block xhandler = makeBlock(h.handlerBCI());
+            xhandler.isExceptionEntry = true;
+        }
+    }
+
+    private void iterateOverBytecodes() {
+        // iterate over the bytecodes top to bottom.
+        // mark the entrypoints of basic blocks and build lists of successors for
+        // all bytecodes that end basic blocks (i.e. goto, ifs, switches, throw, jsr, returns, ret)
+        RiProfilingInfo profilingInfo = method.profilingInfo();
+        Block current = null;
+        stream.setBCI(0);
+        while (stream.currentBC() != Bytecodes.END) {
+            int bci = stream.currentBCI();
+
+            if (current == null || blockMap[bci] != null) {
+                Block b = makeBlock(bci);
+                if (current != null) {
+                    setSuccessors(current.endBci, b);
+                }
+                current = b;
+            }
+            blockMap[bci] = current;
+            current.endBci = bci;
+
+            switch (stream.currentBC()) {
+                case IRETURN: // fall through
+                case LRETURN: // fall through
+                case FRETURN: // fall through
+                case DRETURN: // fall through
+                case ARETURN: // fall through
+                case RETURN: {
+                    current = null;
+                    break;
+                }
+                case ATHROW: {
+                    current = null;
+                    canTrap.set(bci);
+                    break;
+                }
+                case IFEQ:      // fall through
+                case IFNE:      // fall through
+                case IFLT:      // fall through
+                case IFGE:      // fall through
+                case IFGT:      // fall through
+                case IFLE:      // fall through
+                case IF_ICMPEQ: // fall through
+                case IF_ICMPNE: // fall through
+                case IF_ICMPLT: // fall through
+                case IF_ICMPGE: // fall through
+                case IF_ICMPGT: // fall through
+                case IF_ICMPLE: // fall through
+                case IF_ACMPEQ: // fall through
+                case IF_ACMPNE: // fall through
+                case IFNULL:    // fall through
+                case IFNONNULL: {
+                    current = null;
+                    setSuccessors(bci, makeBlock(stream.readBranchDest()), makeBlock(stream.nextBCI()));
+                    break;
+                }
+                case GOTO:
+                case GOTO_W: {
+                    current = null;
+                    setSuccessors(bci, makeBlock(stream.readBranchDest()));
+                    break;
+                }
+                case TABLESWITCH: {
+                    current = null;
+                    BytecodeTableSwitch sw = new BytecodeTableSwitch(stream, bci);
+                    setSuccessors(bci, makeSwitchSuccessors(sw));
+                    break;
+                }
+                case LOOKUPSWITCH: {
+                    current = null;
+                    BytecodeLookupSwitch sw = new BytecodeLookupSwitch(stream, bci);
+                    setSuccessors(bci, makeSwitchSuccessors(sw));
+                    break;
+                }
+                case JSR:
+                case JSR_W: {
+                    hasJsrBytecodes = true;
+                    int target = stream.readBranchDest();
+                    if (target == 0) {
+                        throw new JsrNotSupportedBailout("jsr target bci 0 not allowed");
+                    }
+                    Block b1 = makeBlock(target);
+                    current.jsrSuccessor = b1;
+                    current.jsrReturnBci = stream.nextBCI();
+                    current = null;
+                    setSuccessors(bci, b1);
+                    break;
+                }
+                case RET: {
+                    current.endsWithRet = true;
+                    current = null;
+                    break;
+                }
+                case INVOKEINTERFACE:
+                case INVOKESPECIAL:
+                case INVOKESTATIC:
+                case INVOKEVIRTUAL: {
+                    current = null;
+                    setSuccessors(bci, makeBlock(stream.nextBCI()));
+                    canTrap.set(bci);
+                    break;
+                }
+                case IASTORE:
+                case LASTORE:
+                case FASTORE:
+                case DASTORE:
+                case AASTORE:
+                case BASTORE:
+                case CASTORE:
+                case SASTORE:
+                case IALOAD:
+                case LALOAD:
+                case FALOAD:
+                case DALOAD:
+                case AALOAD:
+                case BALOAD:
+                case CALOAD:
+                case SALOAD:
+                case PUTFIELD:
+                case GETFIELD: {
+                    if (GraalOptions.AllowExplicitExceptionChecks && profilingInfo.getExceptionSeen(bci) != RiExceptionSeen.FALSE) {
+                        canTrap.set(bci);
+                    }
+                }
+            }
+            stream.next();
+        }
+    }
+
+    private Block makeBlock(int startBci) {
+        Block oldBlock = blockMap[startBci];
+        if (oldBlock == null) {
+            Block newBlock = new Block();
+            newBlock.startBci = startBci;
+            blockMap[startBci] = newBlock;
+            return newBlock;
+
+        } else if (oldBlock.startBci != startBci) {
+            // Backward branch into the middle of an already processed block.
+            // Add the correct fall-through successor.
+            Block newBlock = new Block();
+            newBlock.startBci = startBci;
+            newBlock.endBci = oldBlock.endBci;
+            newBlock.successors.addAll(oldBlock.successors);
+            newBlock.normalSuccessors = oldBlock.normalSuccessors;
+
+            oldBlock.endBci = startBci - 1;
+            oldBlock.successors.clear();
+            oldBlock.successors.add(newBlock);
+            oldBlock.normalSuccessors = 1;
+
+            for (int i = startBci; i <= newBlock.endBci; i++) {
+                blockMap[i] = newBlock;
+            }
+            return newBlock;
+
+        } else {
+            return oldBlock;
+        }
+    }
+
+    private Block[] makeSwitchSuccessors(BytecodeSwitch tswitch) {
+        int max = tswitch.numberOfCases();
+        Block[] successors = new Block[max + 1];
+        for (int i = 0; i < max; i++) {
+            successors[i] = makeBlock(tswitch.targetAt(i));
+        }
+        successors[max] = makeBlock(tswitch.defaultTarget());
+        return successors;
+    }
+
+    private void setSuccessors(int predBci, Block... successors) {
+        Block predecessor = blockMap[predBci];
+        assert predecessor.successors.size() == 0;
+        for (Block sux : successors) {
+            if (sux.isExceptionEntry) {
+                throw new CiBailout("Exception handler can be reached by both normal and exceptional control flow");
+            }
+            predecessor.successors.add(sux);
+        }
+        predecessor.normalSuccessors = successors.length;
+    }
+
+    private final HashSet<Block> jsrVisited = new HashSet<>();
+
+    private void createJsrAlternatives(Block block) {
+        jsrVisited.add(block);
+        JsrScope scope = block.jsrScope;
+
+        if (block.endsWithRet) {
+            block.retSuccessor = blockMap[scope.nextReturnAddress()];
+            block.successors.add(block.retSuccessor);
+            assert block.retSuccessor != block.jsrSuccessor;
+        }
+        Debug.log("JSR alternatives block %s  sux %s  jsrSux %s  retSux %s  jsrScope %s", block, block.successors, block.jsrSuccessor, block.retSuccessor, block.jsrScope);
+
+        if (block.jsrSuccessor != null || !scope.isEmpty()) {
+            for (int i = 0; i < block.successors.size(); i++) {
+                Block successor = block.successors.get(i);
+                JsrScope nextScope = scope;
+                if (successor == block.jsrSuccessor) {
+                    nextScope = scope.push(block.jsrReturnBci);
+                }
+                if (successor == block.retSuccessor) {
+                    nextScope = scope.pop();
+                }
+                if (!successor.jsrScope.isPrefixOf(nextScope)) {
+                    throw new JsrNotSupportedBailout("unstructured control flow  (" + successor.jsrScope + " " + nextScope + ")");
+                }
+                if (!nextScope.isEmpty()) {
+                    Block clone;
+                    if (successor.jsrAlternatives != null && successor.jsrAlternatives.containsKey(nextScope)) {
+                        clone = successor.jsrAlternatives.get(nextScope);
+                    } else {
+                        if (successor.jsrAlternatives == null) {
+                            successor.jsrAlternatives = new HashMap<>();
+                        }
+                        clone = successor.copy();
+                        clone.jsrScope = nextScope;
+                        successor.jsrAlternatives.put(nextScope, clone);
+                    }
+                    block.successors.set(i, clone);
+                    if (successor == block.jsrSuccessor) {
+                        block.jsrSuccessor = clone;
+                    }
+                    if (successor == block.retSuccessor) {
+                        block.retSuccessor = clone;
+                    }
+                }
+            }
+        }
+        for (Block successor : block.successors) {
+            if (!jsrVisited.contains(successor)) {
+                createJsrAlternatives(successor);
+            }
+        }
+    }
+
+    private HashMap<RiExceptionHandler, ExceptionBlock> exceptionDispatch = new HashMap<>();
+
+    private Block makeExceptionDispatch(List<RiExceptionHandler> handlers, int index, int bci) {
+        RiExceptionHandler handler = handlers.get(index);
+        if (handler.isCatchAll()) {
+            return blockMap[handler.handlerBCI()];
+        }
+        ExceptionBlock block = exceptionDispatch.get(handler);
+        if (block == null) {
+            block = new ExceptionBlock();
+            block.startBci = -1;
+            block.endBci = -1;
+            block.deoptBci = bci;
+            block.handler = handler;
+            block.successors.add(blockMap[handler.handlerBCI()]);
+            if (index < handlers.size() - 1) {
+                block.successors.add(makeExceptionDispatch(handlers, index + 1, bci));
+            }
+            exceptionDispatch.put(handler, block);
+        }
+        return block;
+    }
+
+    private void addExceptionEdges() {
+        for (int bci = canTrap.nextSetBit(0); bci >= 0; bci = canTrap.nextSetBit(bci + 1)) {
+            Block block = blockMap[bci];
+
+            ArrayList<RiExceptionHandler> handlers = null;
+            for (RiExceptionHandler h : this.exceptionHandlers) {
+                if (h.startBCI() <= bci && bci < h.endBCI()) {
+                    if (handlers == null) {
+                        handlers = new ArrayList<>();
+                    }
+                    handlers.add(h);
+                    if (h.isCatchAll()) {
+                        break;
+                    }
+                }
+            }
+            if (handlers != null) {
+                Block dispatch = makeExceptionDispatch(handlers, 0, bci);
+                block.successors.add(dispatch);
+            }
+        }
+    }
+
+    private void computeBlockOrder() {
+        long loop = computeBlockOrder(blockMap[0]);
+
+        if (loop != 0) {
+            // There is a path from a loop end to the method entry that does not pass the loop header.
+            // Therefore, the loop is non reducible (has more than one entry).
+            // We don't want to compile such methods because the IR only supports structured loops.
+            throw new CiBailout("Non-reducible loop");
+        }
+
+        // Convert postorder to the desired reverse postorder.
+        Collections.reverse(blocks);
+    }
+
+    /**
+     * The next available loop number.
+     */
+    private int nextLoop;
+
+    /**
+     * Mark the block as a loop header, using the next available loop number.
+     * Also checks for corner cases that we don't want to compile.
+     */
+    private void makeLoopHeader(Block block) {
+        if (!block.isLoopHeader) {
+            block.isLoopHeader = true;
+
+            if (block.isExceptionEntry) {
+                // Loops that are implicitly formed by an exception handler lead to all sorts of corner cases.
+                // Don't compile such methods for now, until we see a concrete case that allows checking for correctness.
+                throw new CiBailout("Loop formed by an exception handler");
+            }
+            if (nextLoop >= Long.SIZE) {
+                // This restriction can be removed by using a fall-back to a BitSet in case we have more than 64 loops
+                // Don't compile such methods for now, until we see a concrete case that allows checking for correctness.
+                throw new CiBailout("Too many loops in method");
+            }
+
+            assert block.loops == 0;
+            block.loops = (long) 1 << (long) nextLoop;
+            nextLoop++;
+        }
+        assert Long.bitCount(block.loops) == 1;
+    }
+
+    /**
+     * Depth-first traversal of the control flow graph. The flag {@linkplain Block#visited} is used to
+     * visit every block only once. The flag {@linkplain Block#active} is used to detect cycles (backward
+     * edges).
+     */
+    private long computeBlockOrder(Block block) {
+        if (block.visited) {
+            if (block.active) {
+                // Reached block via backward branch.
+                makeLoopHeader(block);
+            }
+            // Return cached loop information for this block.
+            return block.loops;
+        }
+
+        block.visited = true;
+        block.active = true;
+
+        int loops = 0;
+        for (Block successor : block.successors) {
+            // Recursively process successors.
+            loops |= computeBlockOrder(successor);
+        }
+
+        if (block.isLoopHeader) {
+            assert Long.bitCount(block.loops) == 1;
+            loops &= ~block.loops;
+        }
+
+        block.loops = loops;
+        block.active = false;
+        blocks.add(block);
+
+        return loops;
+    }
+
+
+    private void computeLiveness() {
+        for (Block block : blocks) {
+            computeLocalLiveness(block);
+        }
+
+        boolean changed;
+        int iteration = 0;
+        do {
+            Debug.log("Iteration %d", iteration);
+            changed = false;
+            for (int i = blocks.size() - 1; i >= 0; i--) {
+                Block block = blocks.get(i);
+                Debug.log("  start B%d  [%d, %d]  in: %s  out: %s  gen: %s  kill: %s", block.blockID, block.startBci, block.endBci, block.localsLiveIn, block.localsLiveOut, block.localsLiveGen, block.localsLiveKill);
+
+                boolean blockChanged = (iteration == 0);
+                for (Block sux : block.successors) {
+                    Debug.log("    Successor B%d: %s", sux.blockID, sux.localsLiveIn);
+                    blockChanged = block.localsLiveOut.setUnionWithResult(sux.localsLiveIn) || blockChanged;
+                }
+
+                if (blockChanged) {
+                    block.localsLiveIn.setFrom(block.localsLiveOut);
+                    block.localsLiveIn.setDifference(block.localsLiveKill);
+                    block.localsLiveIn.setUnion(block.localsLiveGen);
+
+                    for (Block sux : block.successors) {
+                        if (sux instanceof ExceptionBlock) {
+                            // Exception handler blocks can be reached from anywhere within the block jumping to them,
+                            // so we conservatively assume local variables require by the exception handler are live both
+                            // at the beginning and end of the block.
+                            blockChanged = block.localsLiveIn.setUnionWithResult(sux.localsLiveIn) || blockChanged;
+                        }
+                    }
+                    Debug.log("  end   B%d  [%d, %d]  in: %s  out: %s  gen: %s  kill: %s", block.blockID, block.startBci, block.endBci, block.localsLiveIn, block.localsLiveOut, block.localsLiveGen, block.localsLiveKill);
+                }
+                changed |= blockChanged;
+            }
+            iteration++;
+        } while (changed);
+    }
+
+    private void computeLocalLiveness(Block block) {
+        block.localsLiveIn = new BitMap(method.maxLocals());
+        block.localsLiveOut = new BitMap(method.maxLocals());
+        block.localsLiveGen = new BitMap(method.maxLocals());
+        block.localsLiveKill = new BitMap(method.maxLocals());
+
+        if (block.startBci < 0 || block.endBci < 0) {
+            return;
+        }
+
+        stream.setBCI(block.startBci);
+        while (stream.currentBCI() <= block.endBci) {
+            switch (stream.currentBC()) {
+                case RETURN:
+                    if (method.isConstructor() && method.holder().superType() == null) {
+                        // return from Object.init implicitly registers a finalizer
+                        // for the receiver if needed, so keep it alive.
+                        loadOne(block, 0);
+                    }
+                    break;
+
+                case LLOAD:
+                case DLOAD:
+                    loadTwo(block, stream.readLocalIndex());
+                    break;
+                case LLOAD_0:
+                case DLOAD_0:
+                    loadTwo(block, 0);
+                    break;
+                case LLOAD_1:
+                case DLOAD_1:
+                    loadTwo(block, 1);
+                    break;
+                case LLOAD_2:
+                case DLOAD_2:
+                    loadTwo(block, 2);
+                    break;
+                case LLOAD_3:
+                case DLOAD_3:
+                    loadTwo(block, 3);
+                    break;
+                case ILOAD:
+                case IINC:
+                case FLOAD:
+                case ALOAD:
+                case RET:
+                    loadOne(block, stream.readLocalIndex());
+                    break;
+                case ILOAD_0:
+                case FLOAD_0:
+                case ALOAD_0:
+                    loadOne(block, 0);
+                    break;
+                case ILOAD_1:
+                case FLOAD_1:
+                case ALOAD_1:
+                    loadOne(block, 1);
+                    break;
+                case ILOAD_2:
+                case FLOAD_2:
+                case ALOAD_2:
+                    loadOne(block, 2);
+                    break;
+                case ILOAD_3:
+                case FLOAD_3:
+                case ALOAD_3:
+                    loadOne(block, 3);
+                    break;
+
+                case LSTORE:
+                case DSTORE:
+                    storeTwo(block, stream.readLocalIndex());
+                    break;
+                case LSTORE_0:
+                case DSTORE_0:
+                    storeTwo(block, 0);
+                    break;
+                case LSTORE_1:
+                case DSTORE_1:
+                    storeTwo(block, 1);
+                    break;
+                case LSTORE_2:
+                case DSTORE_2:
+                    storeTwo(block, 2);
+                    break;
+                case LSTORE_3:
+                case DSTORE_3:
+                    storeTwo(block, 3);
+                    break;
+                case ISTORE:
+                case FSTORE:
+                case ASTORE:
+                    storeOne(block, stream.readLocalIndex());
+                    break;
+                case ISTORE_0:
+                case FSTORE_0:
+                case ASTORE_0:
+                    storeOne(block, 0);
+                    break;
+                case ISTORE_1:
+                case FSTORE_1:
+                case ASTORE_1:
+                    storeOne(block, 1);
+                    break;
+                case ISTORE_2:
+                case FSTORE_2:
+                case ASTORE_2:
+                    storeOne(block, 2);
+                    break;
+                case ISTORE_3:
+                case FSTORE_3:
+                case ASTORE_3:
+                    storeOne(block, 3);
+                    break;
+            }
+            stream.next();
+        }
+    }
+
+    private static void loadTwo(Block block, int local) {
+        loadOne(block, local);
+        loadOne(block, local + 1);
+    }
+
+    private static void loadOne(Block block, int local) {
+        if (!block.localsLiveKill.get(local)) {
+            block.localsLiveGen.set(local);
+        }
+    }
+
+    private static void storeTwo(Block block, int local) {
+        storeOne(block, local);
+        storeOne(block, local + 1);
+    }
+
+    private static void storeOne(Block block, int local) {
+        if (!block.localsLiveGen.get(local)) {
+            block.localsLiveKill.set(local);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,548 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java;
+
+import static com.oracle.graal.nodes.ValueUtil.*;
+import static java.lang.reflect.Modifier.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.Verbosity;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.PhiNode.PhiType;
+import com.oracle.graal.nodes.type.*;
+
+public class FrameStateBuilder {
+    private final RiResolvedMethod method;
+    private final StructuredGraph graph;
+
+    private final ValueNode[] locals;
+    private final ValueNode[] stack;
+    private int stackSize;
+    private boolean rethrowException;
+
+    public FrameStateBuilder(RiResolvedMethod method, StructuredGraph graph, boolean eagerResolve) {
+        assert graph != null;
+        this.method = method;
+        this.graph = graph;
+        this.locals = new ValueNode[method.maxLocals()];
+        // we always need at least one stack slot (for exceptions)
+        this.stack = new ValueNode[Math.max(1, method.maxStackSize())];
+
+        int javaIndex = 0;
+        int index = 0;
+        if (!isStatic(method.accessFlags())) {
+            // add the receiver
+            LocalNode local = graph.unique(new LocalNode(javaIndex, StampFactory.declaredNonNull(method.holder())));
+            storeLocal(javaIndex, local);
+            javaIndex = 1;
+            index = 1;
+        }
+        RiSignature sig = method.signature();
+        int max = sig.argumentCount(false);
+        RiResolvedType accessingClass = method.holder();
+        for (int i = 0; i < max; i++) {
+            RiType type = sig.argumentTypeAt(i, accessingClass);
+            if (eagerResolve) {
+                type = type.resolve(accessingClass);
+            }
+            CiKind kind = type.kind(false).stackKind();
+            Stamp stamp;
+            if (kind == CiKind.Object && type instanceof RiResolvedType) {
+                RiResolvedType resolvedType = (RiResolvedType) type;
+                stamp = StampFactory.declared(resolvedType);
+            } else {
+                stamp = StampFactory.forKind(kind);
+            }
+            LocalNode local = graph.unique(new LocalNode(index, stamp));
+            storeLocal(javaIndex, local);
+            javaIndex += stackSlots(kind);
+            index++;
+        }
+    }
+
+    private FrameStateBuilder(RiResolvedMethod method, StructuredGraph graph, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException) {
+        assert locals.length == method.maxLocals();
+        assert stack.length == Math.max(1, method.maxStackSize());
+
+        this.method = method;
+        this.graph = graph;
+        this.locals = locals;
+        this.stack = stack;
+        this.stackSize = stackSize;
+        this.rethrowException = rethrowException;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("[locals: [");
+        for (int i = 0; i < locals.length; i++) {
+            sb.append(i == 0 ? "" : ",").append(locals[i] == null ? "_" : locals[i].toString(Verbosity.Id));
+        }
+        sb.append("] stack: [");
+        for (int i = 0; i < stackSize; i++) {
+            sb.append(i == 0 ? "" : ",").append(stack[i] == null ? "_" : stack[i].toString(Verbosity.Id));
+        }
+        sb.append("]");
+        if (rethrowException) {
+            sb.append(" rethrowException");
+        }
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public FrameState create(int bci) {
+        return graph.add(new FrameState(method, bci, locals, stack, stackSize, rethrowException, false));
+    }
+
+    public FrameState duplicateWithoutStack(int bci) {
+        return graph.add(new FrameState(method, bci, locals, new ValueNode[0], 0, false, false));
+    }
+
+
+    public FrameStateBuilder copy() {
+        return new FrameStateBuilder(method, graph, Arrays.copyOf(locals, locals.length), Arrays.copyOf(stack, stack.length), stackSize, rethrowException);
+    }
+
+    public FrameStateBuilder copyWithException(ValueNode exceptionObject) {
+        ValueNode[] newStack = new ValueNode[stack.length];
+        newStack[0] = exceptionObject;
+        return new FrameStateBuilder(method, graph, Arrays.copyOf(locals, locals.length), newStack, 1, true);
+    }
+
+
+    public boolean isCompatibleWith(FrameStateBuilder other) {
+        assert method == other.method && graph == other.graph && localsSize() == other.localsSize() : "Can only compare frame states of the same method";
+
+        if (stackSize() != other.stackSize()) {
+            return false;
+        }
+        for (int i = 0; i < stackSize(); i++) {
+            ValueNode x = stackAt(i);
+            ValueNode y = other.stackAt(i);
+            if (x != y && ValueUtil.typeMismatch(x, y)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public void merge(MergeNode block, FrameStateBuilder other) {
+        assert isCompatibleWith(other);
+
+        for (int i = 0; i < localsSize(); i++) {
+            storeLocal(i, merge(localAt(i), other.localAt(i), block));
+        }
+        for (int i = 0; i < stackSize(); i++) {
+            storeStack(i, merge(stackAt(i), other.stackAt(i), block));
+        }
+    }
+
+    private ValueNode merge(ValueNode currentValue, ValueNode otherValue, MergeNode block) {
+        if (currentValue == null) {
+            return null;
+
+        } else if (block.isPhiAtMerge(currentValue)) {
+            if (otherValue == null || currentValue.kind() != otherValue.kind()) {
+                deletePhi(currentValue);
+                return null;
+            }
+            ((PhiNode) currentValue).addInput(otherValue);
+            return currentValue;
+
+        } else if (currentValue != otherValue) {
+            assert !(block instanceof LoopBeginNode) : "Phi functions for loop headers are create eagerly for all locals and stack slots";
+            if (otherValue == null || currentValue.kind() != otherValue.kind()) {
+                return null;
+            }
+
+            PhiNode phi = graph.unique(new PhiNode(currentValue.kind(), block, PhiType.Value));
+            for (int i = 0; i < block.phiPredecessorCount(); i++) {
+                phi.addInput(currentValue);
+            }
+            phi.addInput(otherValue);
+            assert phi.valueCount() == block.phiPredecessorCount() + 1 : "valueCount=" + phi.valueCount() + " predSize= " + block.phiPredecessorCount();
+            return phi;
+
+        } else {
+            return currentValue;
+        }
+    }
+
+    private void deletePhi(Node phi) {
+        if (phi.isDeleted()) {
+            return;
+        }
+        // Collect all phi functions that use this phi so that we can delete them recursively (after we delete ourselfs to avoid circles).
+        List<Node> phiUsages = phi.usages().filter(NodePredicates.isA(PhiNode.class)).snapshot();
+
+        // Remove the phi function from all FrameStates where it is used and then delete it.
+        assert phi.usages().filter(NodePredicates.isNotA(FrameState.class)).filter(NodePredicates.isNotA(PhiNode.class)).isEmpty() : "phi function that gets deletes must only be used in frame states";
+        phi.replaceAtUsages(null);
+        phi.safeDelete();
+
+        for (Node phiUsage : phiUsages) {
+            deletePhi(phiUsage);
+        }
+    }
+
+    public void insertLoopPhis(LoopBeginNode loopBegin) {
+        for (int i = 0; i < localsSize(); i++) {
+            storeLocal(i, createLoopPhi(loopBegin, localAt(i)));
+        }
+        for (int i = 0; i < stackSize(); i++) {
+            storeStack(i, createLoopPhi(loopBegin, stackAt(i)));
+        }
+    }
+
+    private PhiNode createLoopPhi(MergeNode block, ValueNode value) {
+        if (value == null) {
+            return null;
+        }
+        assert !block.isPhiAtMerge(value) : "phi function for this block already created";
+
+        PhiNode phi = graph.unique(new PhiNode(value.kind(), block, PhiType.Value));
+        phi.addInput(value);
+        return phi;
+    }
+
+    public void cleanupDeletedPhis() {
+        for (int i = 0; i < localsSize(); i++) {
+            if (localAt(i) != null && localAt(i).isDeleted()) {
+                assert localAt(i) instanceof PhiNode : "Only phi functions can be deleted during parsing";
+                storeLocal(i, null);
+            }
+        }
+    }
+
+    public void clearNonLiveLocals(BitMap liveness) {
+        if (liveness == null) {
+            return;
+        }
+        assert liveness.size() == locals.length;
+        for (int i = 0; i < locals.length; i++) {
+            if (!liveness.get(i)) {
+                locals[i] = null;
+            }
+        }
+    }
+
+    public boolean rethrowException() {
+        return rethrowException;
+    }
+
+    public void setRethrowException(boolean b) {
+        rethrowException = b;
+    }
+
+
+    /**
+     * Returns the size of the local variables.
+     *
+     * @return the size of the local variables
+     */
+    public int localsSize() {
+        return locals.length;
+    }
+
+    /**
+     * Gets the current size (height) of the stack.
+     */
+    public int stackSize() {
+        return stackSize;
+    }
+
+    /**
+     * Gets the value in the local variables at the specified index, without any sanity checking.
+     *
+     * @param i the index into the locals
+     * @return the instruction that produced the value for the specified local
+     */
+    protected final ValueNode localAt(int i) {
+        return locals[i];
+    }
+
+    /**
+     * Get the value on the stack at the specified stack index.
+     *
+     * @param i the index into the stack, with {@code 0} being the bottom of the stack
+     * @return the instruction at the specified position in the stack
+     */
+    protected final ValueNode stackAt(int i) {
+        return stack[i];
+    }
+
+    /**
+     * Loads the local variable at the specified index, checking that the returned value is non-null
+     * and that two-stack values are properly handled.
+     *
+     * @param i the index of the local variable to load
+     * @return the instruction that produced the specified local
+     */
+    public ValueNode loadLocal(int i) {
+        ValueNode x = locals[i];
+        assert !x.isDeleted();
+        assert !isTwoSlot(x.kind()) || locals[i + 1] == null;
+        assert i == 0 || locals[i - 1] == null || !isTwoSlot(locals[i - 1].kind());
+        return x;
+    }
+
+    /**
+     * Stores a given local variable at the specified index. If the value is a {@linkplain CiKind#isDoubleWord() double word},
+     * then the next local variable index is also overwritten.
+     *
+     * @param i the index at which to store
+     * @param x the instruction which produces the value for the local
+     */
+    public void storeLocal(int i, ValueNode x) {
+        assert x == null || x.kind() != CiKind.Void && x.kind() != CiKind.Illegal : "unexpected value: " + x;
+        locals[i] = x;
+        if (x != null && isTwoSlot(x.kind())) {
+            // if this is a double word, then kill i+1
+            locals[i + 1] = null;
+        }
+        if (x != null && i > 0) {
+            ValueNode p = locals[i - 1];
+            if (p != null && isTwoSlot(p.kind())) {
+                // if there was a double word at i - 1, then kill it
+                locals[i - 1] = null;
+            }
+        }
+    }
+
+    private void storeStack(int i, ValueNode x) {
+        assert x == null || stack[i] == null || x.kind() == stack[i].kind() : "Method does not handle changes from one-slot to two-slot values";
+        stack[i] = x;
+    }
+
+    /**
+     * Pushes an instruction onto the stack with the expected type.
+     * @param kind the type expected for this instruction
+     * @param x the instruction to push onto the stack
+     */
+    public void push(CiKind kind, ValueNode x) {
+        assert !x.isDeleted() && x.kind() != CiKind.Void && x.kind() != CiKind.Illegal;
+        xpush(assertKind(kind, x));
+        if (isTwoSlot(kind)) {
+            xpush(null);
+        }
+    }
+
+    /**
+     * Pushes a value onto the stack without checking the type.
+     * @param x the instruction to push onto the stack
+     */
+    public void xpush(ValueNode x) {
+        assert x == null || (!x.isDeleted() && x.kind() != CiKind.Void && x.kind() != CiKind.Illegal);
+        stack[stackSize++] = x;
+    }
+
+    /**
+     * Pushes a value onto the stack and checks that it is an int.
+     * @param x the instruction to push onto the stack
+     */
+    public void ipush(ValueNode x) {
+        xpush(assertInt(x));
+    }
+
+    /**
+     * Pushes a value onto the stack and checks that it is a float.
+     * @param x the instruction to push onto the stack
+     */
+    public void fpush(ValueNode x) {
+        xpush(assertFloat(x));
+    }
+
+    /**
+     * Pushes a value onto the stack and checks that it is an object.
+     * @param x the instruction to push onto the stack
+     */
+    public void apush(ValueNode x) {
+        xpush(assertObject(x));
+    }
+
+    /**
+     * Pushes a value onto the stack and checks that it is a JSR return address.
+     * @param x the instruction to push onto the stack
+     */
+    public void jpush(ValueNode x) {
+        xpush(assertJsr(x));
+    }
+
+    /**
+     * Pushes a value onto the stack and checks that it is a long.
+     *
+     * @param x the instruction to push onto the stack
+     */
+    public void lpush(ValueNode x) {
+        xpush(assertLong(x));
+        xpush(null);
+    }
+
+    /**
+     * Pushes a value onto the stack and checks that it is a double.
+     * @param x the instruction to push onto the stack
+     */
+    public void dpush(ValueNode x) {
+        xpush(assertDouble(x));
+        xpush(null);
+    }
+
+    public void pushReturn(CiKind kind, ValueNode x) {
+        if (kind != CiKind.Void) {
+            push(kind.stackKind(), x);
+        }
+    }
+
+    /**
+     * Pops an instruction off the stack with the expected type.
+     * @param kind the expected type
+     * @return the instruction on the top of the stack
+     */
+    public ValueNode pop(CiKind kind) {
+        assert kind != CiKind.Void;
+        if (isTwoSlot(kind)) {
+            xpop();
+        }
+        return assertKind(kind, xpop());
+    }
+
+    /**
+     * Pops a value off of the stack without checking the type.
+     * @return x the instruction popped off the stack
+     */
+    public ValueNode xpop() {
+        ValueNode result = stack[--stackSize];
+        assert result == null || !result.isDeleted();
+        return result;
+    }
+
+    /**
+     * Pops a value off of the stack and checks that it is an int.
+     * @return x the instruction popped off the stack
+     */
+    public ValueNode ipop() {
+        return assertInt(xpop());
+    }
+
+    /**
+     * Pops a value off of the stack and checks that it is a float.
+     * @return x the instruction popped off the stack
+     */
+    public ValueNode fpop() {
+        return assertFloat(xpop());
+    }
+
+    /**
+     * Pops a value off of the stack and checks that it is an object.
+     * @return x the instruction popped off the stack
+     */
+    public ValueNode apop() {
+        return assertObject(xpop());
+    }
+
+    /**
+     * Pops a value off of the stack and checks that it is a JSR return address.
+     * @return x the instruction popped off the stack
+     */
+    public ValueNode jpop() {
+        return assertJsr(xpop());
+    }
+
+    /**
+     * Pops a value off of the stack and checks that it is a long.
+     * @return x the instruction popped off the stack
+     */
+    public ValueNode lpop() {
+        assertHigh(xpop());
+        return assertLong(xpop());
+    }
+
+    /**
+     * Pops a value off of the stack and checks that it is a double.
+     * @return x the instruction popped off the stack
+     */
+    public ValueNode dpop() {
+        assertHigh(xpop());
+        return assertDouble(xpop());
+    }
+
+    /**
+     * Pop the specified number of slots off of this stack and return them as an array of instructions.
+     * @param size the number of arguments off of the stack
+     * @return an array containing the arguments off of the stack
+     */
+    public ValueNode[] popArguments(int slotSize, int argSize) {
+        int base = stackSize - slotSize;
+        ValueNode[] r = new ValueNode[argSize];
+        int argIndex = 0;
+        int stackindex = 0;
+        while (stackindex < slotSize) {
+            ValueNode element = stack[base + stackindex];
+            assert element != null;
+            r[argIndex++] = element;
+            stackindex += stackSlots(element.kind());
+        }
+        stackSize = base;
+        return r;
+    }
+
+    /**
+     * Peeks an element from the operand stack.
+     * @param argumentNumber The number of the argument, relative from the top of the stack (0 = top).
+     *        Long and double arguments only count as one argument, i.e., null-slots are ignored.
+     * @return The peeked argument.
+     */
+    public ValueNode peek(int argumentNumber) {
+        int idx = stackSize() - 1;
+        for (int i = 0; i < argumentNumber; i++) {
+            if (stackAt(idx) == null) {
+                idx--;
+                assert isTwoSlot(stackAt(idx).kind());
+            }
+            idx--;
+        }
+        return stackAt(idx);
+    }
+
+    /**
+     * Clears all values on this stack.
+     */
+    public void clearStack() {
+        stackSize = 0;
+    }
+
+    public static int stackSlots(CiKind kind) {
+        return isTwoSlot(kind) ? 2 : 1;
+    }
+
+    public static boolean isTwoSlot(CiKind kind) {
+        assert kind != CiKind.Void && kind != CiKind.Illegal;
+        return kind == CiKind.Long || kind == CiKind.Double;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+
+public class GraphBuilderConfiguration {
+
+    public static enum ResolvePolicy {
+        Default, EagerForSnippets, Eager,
+    }
+
+    private final boolean useBranchPrediction;
+    private final ResolvePolicy resolving;
+    private final PhasePlan plan;
+    private RiResolvedType[] skippedExceptionTypes;
+
+    public GraphBuilderConfiguration(boolean useBranchPrediction, ResolvePolicy resolving, PhasePlan plan) {
+        this.useBranchPrediction = useBranchPrediction;
+        this.resolving = resolving;
+        this.plan = plan;
+    }
+
+    public boolean useBranchPrediction() {
+        return useBranchPrediction;
+    }
+
+
+    public void setSkippedExceptionTypes(RiResolvedType[] skippedExceptionTypes) {
+        this.skippedExceptionTypes = skippedExceptionTypes;
+    }
+
+    public RiResolvedType[] getSkippedExceptionTypes() {
+        return skippedExceptionTypes;
+    }
+
+    public boolean eagerResolvingForSnippets() {
+        return (resolving == ResolvePolicy.EagerForSnippets || resolving == ResolvePolicy.Eager);
+    }
+
+    public boolean eagerResolving() {
+        return (resolving == ResolvePolicy.Eager);
+    }
+
+    public PhasePlan plan() {
+        return plan;
+    }
+
+    public static GraphBuilderConfiguration getDefault() {
+        return getDefault(null);
+    }
+
+    public static GraphBuilderConfiguration getDefault(PhasePlan plan) {
+        return new GraphBuilderConfiguration(GraalOptions.UseBranchPrediction, ResolvePolicy.Default, plan);
+    }
+
+    public static GraphBuilderConfiguration getSnippetDefault() {
+        return getSnippetDefault(null);
+    }
+
+    public static GraphBuilderConfiguration getSnippetDefault(PhasePlan plan) {
+        return new GraphBuilderConfiguration(false, ResolvePolicy.EagerForSnippets, plan);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,1766 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java;
+
+import static com.oracle.graal.java.bytecode.Bytecodes.*;
+import static java.lang.reflect.Modifier.*;
+
+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.Representation;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.java.BciBlockMapping.Block;
+import com.oracle.graal.java.BciBlockMapping.ExceptionBlock;
+import com.oracle.graal.java.bytecode.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+import com.oracle.graal.nodes.PhiNode.PhiType;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code GraphBuilder} class parses the bytecode of a method and builds the IR graph.
+ */
+public final class GraphBuilderPhase extends Phase {
+
+    /**
+     * The minimum value to which {@link GraalOptions#TraceBytecodeParserLevel} must be set to trace
+     * the bytecode instructions as they are parsed.
+     */
+    public static final int TRACELEVEL_INSTRUCTIONS = 1;
+
+    /**
+     * The minimum value to which {@link GraalOptions#TraceBytecodeParserLevel} must be set to trace
+     * the frame state before each bytecode instruction as it is parsed.
+     */
+    public static final int TRACELEVEL_STATE = 2;
+
+    private StructuredGraph currentGraph;
+
+    private final RiRuntime runtime;
+    private RiConstantPool constantPool;
+    private RiExceptionHandler[] exceptionHandlers;
+    private RiResolvedMethod method;
+    private RiProfilingInfo profilingInfo;
+
+    private BytecodeStream stream;           // the bytecode stream
+    private final LogStream log;
+
+    private FrameStateBuilder frameState;          // the current execution state
+    private Block currentBlock;
+
+    private ValueNode methodSynchronizedObject;
+    private ExceptionBlock unwindBlock;
+    private Block returnBlock;
+
+    private FixedWithNextNode lastInstr;                 // the last instruction added
+
+    private BitSet canTrapBitSet;
+
+    public static final Map<RiMethod, StructuredGraph> cachedGraphs = new WeakHashMap<>();
+
+    private final GraphBuilderConfiguration config;
+
+
+    /**
+     * Node that marks the begin of block during bytecode parsing.  When a block is identified the first
+     * time as a jump target, the placeholder is created and used as the successor for the jump.  When the
+     * block is seen the second time, a MergeNode is created to correctly merge the now two different
+     * predecessor states.
+     */
+    private static class BlockPlaceholderNode extends FixedWithNextNode implements Node.IterableNodeType {
+        public BlockPlaceholderNode() {
+            super(StampFactory.illegal());
+        }
+    }
+
+
+    public GraphBuilderPhase(RiRuntime runtime) {
+        this(runtime, GraphBuilderConfiguration.getDefault());
+    }
+
+    public GraphBuilderPhase(RiRuntime runtime, GraphBuilderConfiguration config) {
+        this.config = config;
+        this.runtime = runtime;
+        this.log = GraalOptions.TraceBytecodeParserLevel > 0 ? new LogStream(TTY.out()) : null;
+    }
+
+    @Override
+    protected void run(StructuredGraph graph) {
+        method = graph.method();
+        profilingInfo = method.profilingInfo();
+        assert method.code() != null : "method must contain bytecodes: " + method;
+        this.stream = new BytecodeStream(method.code());
+        this.constantPool = method.getConstantPool();
+        unwindBlock = null;
+        returnBlock = null;
+        methodSynchronizedObject = null;
+        exceptionHandlers = null;
+        this.currentGraph = graph;
+        this.frameState = new FrameStateBuilder(method, graph, config.eagerResolving());
+        build();
+    }
+
+    @Override
+    protected String getDetailedName() {
+        return getName() + " " + CiUtil.format("%H.%n(%p):%r", method);
+    }
+
+    private BciBlockMapping createBlockMap() {
+        BciBlockMapping map = new BciBlockMapping(method, config.useBranchPrediction());
+        map.build();
+        Debug.dump(map, CiUtil.format("After block building %f %R %H.%n(%P)", method));
+
+        return map;
+    }
+
+    private void build() {
+        if (log != null) {
+            log.println();
+            log.println("Compiling " + method);
+        }
+
+        if (GraalOptions.PrintProfilingInformation) {
+            method.dumpProfile();
+        }
+
+        // compute the block map, setup exception handlers and get the entrypoint(s)
+        BciBlockMapping blockMap = createBlockMap();
+        this.canTrapBitSet = blockMap.canTrap;
+
+        exceptionHandlers = blockMap.exceptionHandlers();
+
+        lastInstr = currentGraph.start();
+        if (isSynchronized(method.accessFlags())) {
+            // add a monitor enter to the start block
+            currentGraph.start().setStateAfter(frameState.create(FrameState.BEFORE_BCI));
+            methodSynchronizedObject = synchronizedObject(frameState, method);
+            lastInstr = genMonitorEnter(methodSynchronizedObject);
+        }
+        frameState.clearNonLiveLocals(blockMap.startBlock.localsLiveIn);
+
+        // finish the start block
+        ((AbstractStateSplit) lastInstr).setStateAfter(frameState.create(0));
+        if (blockMap.startBlock.isLoopHeader) {
+            appendGoto(createTarget(blockMap.startBlock, frameState));
+        } else {
+            blockMap.startBlock.firstInstruction = lastInstr;
+            blockMap.startBlock.entryState = frameState;
+        }
+
+        for (Block block : blockMap.blocks) {
+            processBlock(block);
+        }
+        processBlock(returnBlock);
+        processBlock(unwindBlock);
+
+        Debug.dump(currentGraph, "After bytecode parsing");
+
+        connectLoopEndToBegin();
+
+        // remove Placeholders (except for loop exits)
+        for (BlockPlaceholderNode n : currentGraph.getNodes(BlockPlaceholderNode.class)) {
+            currentGraph.removeFixed(n);
+        }
+
+        // remove dead FrameStates
+        for (Node n : currentGraph.getNodes(FrameState.class)) {
+            if (n.usages().size() == 0 && n.predecessor() == null) {
+                n.safeDelete();
+            }
+        }
+
+        if (GraalOptions.CacheGraphs && !currentGraph.hasNode(DeoptimizeNode.class)) {
+            cachedGraphs.put(method, currentGraph.copy());
+        }
+    }
+
+    private Block unwindBlock(int bci) {
+        if (unwindBlock == null) {
+            unwindBlock = new ExceptionBlock();
+            unwindBlock.startBci = -1;
+            unwindBlock.endBci = -1;
+            unwindBlock.deoptBci = bci;
+            unwindBlock.blockID = Integer.MAX_VALUE;
+        }
+        return unwindBlock;
+    }
+
+    private Block returnBlock(int bci) {
+        if (returnBlock == null) {
+            returnBlock = new Block();
+            returnBlock.startBci = bci;
+            returnBlock.endBci = bci;
+            returnBlock.blockID = Integer.MAX_VALUE;
+        }
+        return returnBlock;
+    }
+
+    public BytecodeStream stream() {
+        return stream;
+    }
+
+    public int bci() {
+        return stream.currentBCI();
+    }
+
+    private void loadLocal(int index, CiKind kind) {
+        frameState.push(kind, frameState.loadLocal(index));
+    }
+
+    private void storeLocal(CiKind kind, int index) {
+        frameState.storeLocal(index, frameState.pop(kind));
+    }
+
+    public static boolean covers(RiExceptionHandler handler, int bci) {
+        return handler.startBCI() <= bci && bci < handler.endBCI();
+    }
+
+    public static boolean isCatchAll(RiExceptionHandler handler) {
+        return handler.catchTypeCPI() == 0;
+    }
+
+    private BeginNode handleException(ValueNode exceptionObject, int bci) {
+        assert bci == FrameState.BEFORE_BCI || bci == bci() : "invalid bci";
+
+        if (GraalOptions.UseExceptionProbability) {
+            // be conservative if information was not recorded (could result in endless recompiles otherwise)
+            if (bci != FrameState.BEFORE_BCI && exceptionObject == null && profilingInfo.getExceptionSeen(bci) == RiExceptionSeen.FALSE) {
+                return null;
+            } else {
+                Debug.log("Creating exception edges at %d, exception object=%s, exception seen=%s", bci, exceptionObject, profilingInfo.getExceptionSeen(bci));
+            }
+        }
+
+        RiExceptionHandler firstHandler = null;
+        // join with all potential exception handlers
+        if (exceptionHandlers != null) {
+            for (RiExceptionHandler handler : exceptionHandlers) {
+                if (covers(handler, bci)) {
+                    firstHandler = handler;
+                    break;
+                }
+            }
+        }
+
+        Block dispatchBlock = null;
+        if (firstHandler == null) {
+            dispatchBlock = unwindBlock(bci);
+        } else {
+            for (int i = currentBlock.normalSuccessors; i < currentBlock.successors.size(); i++) {
+                Block block = currentBlock.successors.get(i);
+                if (block instanceof ExceptionBlock && ((ExceptionBlock) block).handler == firstHandler) {
+                    dispatchBlock = block;
+                    break;
+                }
+                if (isCatchAll(firstHandler) && block.startBci == firstHandler.handlerBCI()) {
+                    dispatchBlock = block;
+                    break;
+                }
+            }
+        }
+
+        // TODO (thomaswue): Merge BeginNode with ExceptionObject node to get a correct and uniform FrameState.
+        BeginNode p = currentGraph.add(new BeginNode());
+        p.setStateAfter(frameState.duplicateWithoutStack(bci));
+
+        ValueNode currentExceptionObject;
+        ExceptionObjectNode newObj = null;
+        if (exceptionObject == null) {
+            newObj = currentGraph.add(new ExceptionObjectNode());
+            currentExceptionObject = newObj;
+        } else {
+            currentExceptionObject = exceptionObject;
+        }
+        FrameStateBuilder stateWithException = frameState.copyWithException(currentExceptionObject);
+        if (newObj != null) {
+            newObj.setStateAfter(stateWithException.create(bci));
+        }
+        FixedNode target = createTarget(dispatchBlock, stateWithException);
+        if (exceptionObject == null) {
+            ExceptionObjectNode eObj = (ExceptionObjectNode) currentExceptionObject;
+            eObj.setNext(target);
+            p.setNext(eObj);
+        } else {
+            p.setNext(target);
+        }
+        return p;
+    }
+
+    private void genLoadConstant(int cpi, int opcode) {
+        Object con = lookupConstant(cpi, opcode);
+
+        if (con instanceof RiType) {
+            // this is a load of class constant which might be unresolved
+            RiType riType = (RiType) con;
+            if (riType instanceof RiResolvedType) {
+                frameState.push(CiKind.Object, append(ConstantNode.forCiConstant(((RiResolvedType) riType).getEncoding(Representation.JavaClass), runtime, currentGraph)));
+            } else {
+                append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+                frameState.push(CiKind.Object, append(ConstantNode.forObject(null, runtime, currentGraph)));
+            }
+        } else if (con instanceof CiConstant) {
+            CiConstant constant = (CiConstant) con;
+            frameState.push(constant.kind.stackKind(), appendConstant(constant));
+        } else {
+            throw new Error("lookupConstant returned an object of incorrect type");
+        }
+    }
+
+    private void genLoadIndexed(CiKind kind) {
+        emitExplicitExceptions(frameState.peek(1), frameState.peek(0));
+
+        ValueNode index = frameState.ipop();
+        ValueNode array = frameState.apop();
+        ValueNode length = append(currentGraph.add(new ArrayLengthNode(array)));
+        ValueNode v = append(currentGraph.add(new LoadIndexedNode(array, index, length, kind)));
+        frameState.push(kind.stackKind(), v);
+    }
+
+    private void genStoreIndexed(CiKind kind) {
+        emitExplicitExceptions(frameState.peek(2), frameState.peek(1));
+
+        ValueNode value = frameState.pop(kind.stackKind());
+        ValueNode index = frameState.ipop();
+        ValueNode array = frameState.apop();
+        ValueNode length = append(currentGraph.add(new ArrayLengthNode(array)));
+        StoreIndexedNode result = currentGraph.add(new StoreIndexedNode(array, index, length, kind, value));
+        append(result);
+    }
+
+    private void stackOp(int opcode) {
+        switch (opcode) {
+            case POP: {
+                frameState.xpop();
+                break;
+            }
+            case POP2: {
+                frameState.xpop();
+                frameState.xpop();
+                break;
+            }
+            case DUP: {
+                ValueNode w = frameState.xpop();
+                frameState.xpush(w);
+                frameState.xpush(w);
+                break;
+            }
+            case DUP_X1: {
+                ValueNode w1 = frameState.xpop();
+                ValueNode w2 = frameState.xpop();
+                frameState.xpush(w1);
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                break;
+            }
+            case DUP_X2: {
+                ValueNode w1 = frameState.xpop();
+                ValueNode w2 = frameState.xpop();
+                ValueNode w3 = frameState.xpop();
+                frameState.xpush(w1);
+                frameState.xpush(w3);
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                break;
+            }
+            case DUP2: {
+                ValueNode w1 = frameState.xpop();
+                ValueNode w2 = frameState.xpop();
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                break;
+            }
+            case DUP2_X1: {
+                ValueNode w1 = frameState.xpop();
+                ValueNode w2 = frameState.xpop();
+                ValueNode w3 = frameState.xpop();
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                frameState.xpush(w3);
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                break;
+            }
+            case DUP2_X2: {
+                ValueNode w1 = frameState.xpop();
+                ValueNode w2 = frameState.xpop();
+                ValueNode w3 = frameState.xpop();
+                ValueNode w4 = frameState.xpop();
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                frameState.xpush(w4);
+                frameState.xpush(w3);
+                frameState.xpush(w2);
+                frameState.xpush(w1);
+                break;
+            }
+            case SWAP: {
+                ValueNode w1 = frameState.xpop();
+                ValueNode w2 = frameState.xpop();
+                frameState.xpush(w1);
+                frameState.xpush(w2);
+                break;
+            }
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+
+    }
+
+    private void genArithmeticOp(CiKind result, int opcode, boolean canTrap) {
+        ValueNode y = frameState.pop(result);
+        ValueNode x = frameState.pop(result);
+        boolean isStrictFP = isStrict(method.accessFlags());
+        ArithmeticNode v;
+        switch(opcode){
+            case IADD:
+            case LADD: v = new IntegerAddNode(result, x, y); break;
+            case FADD:
+            case DADD: v = new FloatAddNode(result, x, y, isStrictFP); break;
+            case ISUB:
+            case LSUB: v = new IntegerSubNode(result, x, y); break;
+            case FSUB:
+            case DSUB: v = new FloatSubNode(result, x, y, isStrictFP); break;
+            case IMUL:
+            case LMUL: v = new IntegerMulNode(result, x, y); break;
+            case FMUL:
+            case DMUL: v = new FloatMulNode(result, x, y, isStrictFP); break;
+            case IDIV:
+            case LDIV: v = new IntegerDivNode(result, x, y); break;
+            case FDIV:
+            case DDIV: v = new FloatDivNode(result, x, y, isStrictFP); break;
+            case IREM:
+            case LREM: v = new IntegerRemNode(result, x, y); break;
+            case FREM:
+            case DREM: v = new FloatRemNode(result, x, y, isStrictFP); break;
+            default:
+                throw new GraalInternalError("should not reach");
+        }
+        ValueNode result1 = append(currentGraph.unique(v));
+        if (canTrap) {
+            append(currentGraph.add(new ValueAnchorNode(result1)));
+        }
+        frameState.push(result, result1);
+    }
+
+    private void genNegateOp(CiKind kind) {
+        frameState.push(kind, append(currentGraph.unique(new NegateNode(frameState.pop(kind)))));
+    }
+
+    private void genShiftOp(CiKind kind, int opcode) {
+        ValueNode s = frameState.ipop();
+        ValueNode x = frameState.pop(kind);
+        ShiftNode v;
+        switch(opcode){
+            case ISHL:
+            case LSHL: v = new LeftShiftNode(kind, x, s); break;
+            case ISHR:
+            case LSHR: v = new RightShiftNode(kind, x, s); break;
+            case IUSHR:
+            case LUSHR: v = new UnsignedRightShiftNode(kind, x, s); break;
+            default:
+                throw new GraalInternalError("should not reach");
+        }
+        frameState.push(kind, append(currentGraph.unique(v)));
+    }
+
+    private void genLogicOp(CiKind kind, int opcode) {
+        ValueNode y = frameState.pop(kind);
+        ValueNode x = frameState.pop(kind);
+        LogicNode v;
+        switch(opcode){
+            case IAND:
+            case LAND: v = new AndNode(kind, x, y); break;
+            case IOR:
+            case LOR: v = new OrNode(kind, x, y); break;
+            case IXOR:
+            case LXOR: v = new XorNode(kind, x, y); break;
+            default:
+                throw new GraalInternalError("should not reach");
+        }
+        frameState.push(kind, append(currentGraph.unique(v)));
+    }
+
+    private void genCompareOp(CiKind kind, boolean isUnorderedLess) {
+        ValueNode y = frameState.pop(kind);
+        ValueNode x = frameState.pop(kind);
+        frameState.ipush(append(currentGraph.unique(new NormalizeCompareNode(x, y, isUnorderedLess))));
+    }
+
+    private void genConvert(ConvertNode.Op opcode) {
+        ValueNode input = frameState.pop(opcode.from.stackKind());
+        frameState.push(opcode.to.stackKind(), append(currentGraph.unique(new ConvertNode(opcode, input))));
+    }
+
+    private void genIncrement() {
+        int index = stream().readLocalIndex();
+        int delta = stream().readIncrement();
+        ValueNode x = frameState.loadLocal(index);
+        ValueNode y = append(ConstantNode.forInt(delta, currentGraph));
+        frameState.storeLocal(index, append(currentGraph.unique(new IntegerAddNode(CiKind.Int, x, y))));
+    }
+
+    private void genGoto() {
+        double probability = profilingInfo.getBranchTakenProbability(bci());
+        if (probability < 0) {
+            probability = 1;
+        }
+        appendGoto(createTarget(probability, currentBlock.successors.get(0), frameState));
+        assert currentBlock.normalSuccessors == 1;
+    }
+
+    private void ifNode(ValueNode x, Condition cond, ValueNode y) {
+        assert !x.isDeleted() && !y.isDeleted();
+        assert currentBlock.normalSuccessors == 2 : currentBlock.normalSuccessors;
+        Block trueBlock = currentBlock.successors.get(0);
+        Block falseBlock = currentBlock.successors.get(1);
+        if (trueBlock == falseBlock) {
+            appendGoto(createTarget(trueBlock, frameState));
+            return;
+        }
+
+        double probability = profilingInfo.getBranchTakenProbability(bci());
+        if (probability < 0) {
+            assert probability == -1 : "invalid probability";
+            Debug.log("missing probability in %s at bci %d", method, bci());
+            probability = 0.5;
+        }
+
+        CompareNode condition = currentGraph.unique(new CompareNode(x, cond, y));
+        BeginNode trueSuccessor = createBlockTarget(probability, trueBlock, frameState);
+        BeginNode falseSuccessor = createBlockTarget(1 - probability, falseBlock, frameState);
+        append(currentGraph.add(new IfNode(condition, trueSuccessor, falseSuccessor, probability)));
+    }
+
+    private void genIfZero(Condition cond) {
+        ValueNode y = appendConstant(CiConstant.INT_0);
+        ValueNode x = frameState.ipop();
+        ifNode(x, cond, y);
+    }
+
+    private void genIfNull(Condition cond) {
+        ValueNode y = appendConstant(CiConstant.NULL_OBJECT);
+        ValueNode x = frameState.apop();
+        ifNode(x, cond, y);
+    }
+
+    private void genIfSame(CiKind kind, Condition cond) {
+        ValueNode y = frameState.pop(kind);
+        ValueNode x = frameState.pop(kind);
+        assert !x.isDeleted() && !y.isDeleted();
+        ifNode(x, cond, y);
+    }
+
+    private void genThrow(int bci) {
+        ValueNode exception = frameState.apop();
+        FixedGuardNode node = currentGraph.add(new FixedGuardNode(currentGraph.unique(new NullCheckNode(exception, false))));
+        append(node);
+        append(handleException(exception, bci));
+    }
+
+    private RiType lookupType(int cpi, int bytecode) {
+        eagerResolvingForSnippets(cpi, bytecode);
+        RiType result = constantPool.lookupType(cpi, bytecode);
+        assert !config.eagerResolvingForSnippets() || result instanceof RiResolvedType;
+        return result;
+    }
+
+    private RiMethod lookupMethod(int cpi, int opcode) {
+        eagerResolvingForSnippets(cpi, opcode);
+        RiMethod result = constantPool.lookupMethod(cpi, opcode);
+        assert !config.eagerResolvingForSnippets() || ((result instanceof RiResolvedMethod) && ((RiResolvedMethod) result).holder().isInitialized());
+        return result;
+    }
+
+    private RiField lookupField(int cpi, int opcode) {
+        eagerResolvingForSnippets(cpi, opcode);
+        RiField result = constantPool.lookupField(cpi, opcode);
+        assert !config.eagerResolvingForSnippets() || (result instanceof RiResolvedField && ((RiResolvedField) result).holder().isInitialized());
+        return result;
+    }
+
+    private Object lookupConstant(int cpi, int opcode) {
+        eagerResolving(cpi, opcode);
+        Object result = constantPool.lookupConstant(cpi);
+        assert !config.eagerResolving() || !(result instanceof RiType) || (result instanceof RiResolvedType);
+        return result;
+    }
+
+    private void eagerResolving(int cpi, int bytecode) {
+        if (config.eagerResolving()) {
+            constantPool.loadReferencedType(cpi, bytecode);
+        }
+    }
+
+    private void eagerResolvingForSnippets(int cpi, int bytecode) {
+        if (config.eagerResolvingForSnippets()) {
+            constantPool.loadReferencedType(cpi, bytecode);
+        }
+    }
+
+    private static final RiResolvedType[] EMPTY_TYPE_ARRAY = new RiResolvedType[0];
+
+    private RiResolvedType[] getTypeCheckHints(RiResolvedType type, int maxHints) {
+        if (!GraalOptions.UseTypeCheckHints || Util.isFinalClass(type)) {
+            return new RiResolvedType[] {type};
+        } else {
+            RiResolvedType uniqueSubtype = type.uniqueConcreteSubtype();
+            if (uniqueSubtype != null) {
+                return new RiResolvedType[] {uniqueSubtype};
+            } else {
+                RiTypeProfile typeProfile = profilingInfo.getTypeProfile(bci());
+                if (typeProfile != null) {
+                    double notRecordedTypes = typeProfile.getNotRecordedProbability();
+                    RiResolvedType[] types = typeProfile.getTypes();
+
+                    if (notRecordedTypes == 0 && types != null && types.length > 0 && types.length <= maxHints) {
+                        RiResolvedType[] hints = new RiResolvedType[types.length];
+                        int hintCount = 0;
+                        for (RiResolvedType hint : types) {
+                            if (hint.isSubtypeOf(type)) {
+                                hints[hintCount++] = hint;
+                            }
+                        }
+                        return Arrays.copyOf(hints, Math.min(maxHints, hintCount));
+                    }
+                }
+                return EMPTY_TYPE_ARRAY;
+            }
+        }
+    }
+
+    private void genCheckCast() {
+        int cpi = stream().readCPI();
+        RiType type = lookupType(cpi, CHECKCAST);
+        boolean initialized = type instanceof RiResolvedType;
+        if (initialized) {
+            ConstantNode typeInstruction = genTypeOrDeopt(RiType.Representation.ObjectHub, type, true);
+            ValueNode object = frameState.apop();
+            AnchorNode anchor = currentGraph.add(new AnchorNode());
+            append(anchor);
+            CheckCastNode checkCast;
+            RiResolvedType[] hints = getTypeCheckHints((RiResolvedType) type, 2);
+            checkCast = currentGraph.unique(new CheckCastNode(anchor, typeInstruction, (RiResolvedType) type, object, hints, Util.isFinalClass((RiResolvedType) type)));
+            append(currentGraph.add(new ValueAnchorNode(checkCast)));
+            frameState.apush(checkCast);
+        } else {
+            ValueNode object = frameState.apop();
+            append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new CompareNode(object, Condition.EQ, ConstantNode.forObject(null, runtime, currentGraph))))));
+            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
+        }
+    }
+
+    private void genInstanceOf() {
+        int cpi = stream().readCPI();
+        RiType type = lookupType(cpi, INSTANCEOF);
+        ValueNode object = frameState.apop();
+        if (type instanceof RiResolvedType) {
+            RiResolvedType resolvedType = (RiResolvedType) type;
+            ConstantNode hub = appendConstant(resolvedType.getEncoding(RiType.Representation.ObjectHub));
+
+            RiResolvedType[] hints = getTypeCheckHints(resolvedType, 1);
+            InstanceOfNode instanceOfNode = new InstanceOfNode(hub, (RiResolvedType) type, object, hints, Util.isFinalClass(resolvedType), false);
+            frameState.ipush(append(MaterializeNode.create(currentGraph.unique(instanceOfNode), currentGraph)));
+        } else {
+            BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode());
+            DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile));
+            IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new NullCheckNode(object, true)), trueSucc, deopt, 1));
+            append(ifNode);
+            lastInstr = trueSucc;
+            frameState.ipush(appendConstant(CiConstant.INT_0));
+        }
+    }
+
+    void genNewInstance(int cpi) {
+        RiType type = lookupType(cpi, NEW);
+        if (type instanceof RiResolvedType) {
+            NewInstanceNode n = currentGraph.add(new NewInstanceNode((RiResolvedType) type));
+            frameState.apush(append(n));
+        } else {
+            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
+        }
+    }
+
+    /**
+     * Gets the kind of array elements for the array type code that appears
+     * in a {@link Bytecodes#NEWARRAY} bytecode.
+     * @param code the array type code
+     * @return the kind from the array type code
+     */
+    public static CiKind arrayTypeCodeToKind(int code) {
+        // Checkstyle: stop
+        switch (code) {
+            case 4:  return CiKind.Boolean;
+            case 5:  return CiKind.Char;
+            case 6:  return CiKind.Float;
+            case 7:  return CiKind.Double;
+            case 8:  return CiKind.Byte;
+            case 9:  return CiKind.Short;
+            case 10: return CiKind.Int;
+            case 11: return CiKind.Long;
+            default: throw new IllegalArgumentException("unknown array type code: " + code);
+        }
+        // Checkstyle: resume
+    }
+
+    private void genNewTypeArray(int typeCode) {
+        CiKind kind = arrayTypeCodeToKind(typeCode);
+        RiResolvedType elementType = runtime.asRiType(kind);
+        NewTypeArrayNode nta = currentGraph.add(new NewTypeArrayNode(frameState.ipop(), elementType));
+        frameState.apush(append(nta));
+    }
+
+    private void genNewObjectArray(int cpi) {
+        RiType type = lookupType(cpi, ANEWARRAY);
+        ValueNode length = frameState.ipop();
+        if (type instanceof RiResolvedType) {
+            NewArrayNode n = currentGraph.add(new NewObjectArrayNode((RiResolvedType) type, length));
+            frameState.apush(append(n));
+        } else {
+            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
+        }
+
+    }
+
+    private void genNewMultiArray(int cpi) {
+        RiType type = lookupType(cpi, MULTIANEWARRAY);
+        int rank = stream().readUByte(bci() + 3);
+        ValueNode[] dims = new ValueNode[rank];
+        for (int i = rank - 1; i >= 0; i--) {
+            dims[i] = frameState.ipop();
+        }
+        if (type instanceof RiResolvedType) {
+            FixedWithNextNode n = currentGraph.add(new NewMultiArrayNode((RiResolvedType) type, dims));
+            frameState.apush(append(n));
+        } else {
+            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
+        }
+    }
+
+    private void genGetField(RiField field) {
+        emitExplicitExceptions(frameState.peek(0), null);
+
+        CiKind kind = field.kind(false);
+        ValueNode receiver = frameState.apop();
+        if ((field instanceof RiResolvedField) && ((RiResolvedField) field).holder().isInitialized()) {
+            LoadFieldNode load = currentGraph.add(new LoadFieldNode(receiver, (RiResolvedField) field));
+            appendOptimizedLoadField(kind, load);
+        } else {
+            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+            frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
+        }
+    }
+
+    public static class ExceptionInfo {
+
+        public final FixedWithNextNode exceptionEdge;
+        public final ValueNode exception;
+
+        public ExceptionInfo(FixedWithNextNode exceptionEdge, ValueNode exception) {
+            this.exceptionEdge = exceptionEdge;
+            this.exception = exception;
+        }
+    }
+
+    private ExceptionInfo emitNullCheck(ValueNode receiver) {
+        BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode());
+        BlockPlaceholderNode falseSucc = currentGraph.add(new BlockPlaceholderNode());
+        IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new NullCheckNode(receiver, false)), trueSucc, falseSucc, 1));
+
+        append(ifNode);
+        lastInstr = trueSucc;
+
+        if (GraalOptions.OmitHotExceptionStacktrace) {
+            ValueNode exception = ConstantNode.forObject(new NullPointerException(), runtime, currentGraph);
+            return new ExceptionInfo(falseSucc, exception);
+        } else {
+            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(CiRuntimeCall.CreateNullPointerException));
+            call.setStateAfter(frameState.create(bci()));
+            falseSucc.setNext(call);
+            return new ExceptionInfo(call, call);
+        }
+    }
+
+    private ExceptionInfo emitBoundsCheck(ValueNode index, ValueNode length) {
+        BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode());
+        BlockPlaceholderNode falseSucc = currentGraph.add(new BlockPlaceholderNode());
+        IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new CompareNode(index, Condition.BT, length)), trueSucc, falseSucc, 1));
+
+        append(ifNode);
+        lastInstr = trueSucc;
+
+        if (GraalOptions.OmitHotExceptionStacktrace) {
+            ValueNode exception = ConstantNode.forObject(new ArrayIndexOutOfBoundsException(), runtime, currentGraph);
+            return new ExceptionInfo(falseSucc, exception);
+        } else {
+            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(CiRuntimeCall.CreateOutOfBoundsException, new ValueNode[] {index}));
+            call.setStateAfter(frameState.create(bci()));
+            falseSucc.setNext(call);
+            return new ExceptionInfo(call, call);
+        }
+    }
+
+    private void emitExplicitExceptions(ValueNode receiver, ValueNode outOfBoundsIndex) {
+        assert receiver != null;
+
+        if (canTrapBitSet.get(bci()) && GraalOptions.AllowExplicitExceptionChecks) {
+            ArrayList<ExceptionInfo> exceptions = new ArrayList<>(2);
+            exceptions.add(emitNullCheck(receiver));
+            if (outOfBoundsIndex != null) {
+                ArrayLengthNode length = currentGraph.add(new ArrayLengthNode(receiver));
+                append(length);
+                exceptions.add(emitBoundsCheck(outOfBoundsIndex, length));
+            }
+            final ExceptionInfo exception;
+            if (exceptions.size() == 1) {
+                exception = exceptions.get(0);
+            } else {
+                assert exceptions.size() > 1;
+                MergeNode merge = currentGraph.add(new MergeNode());
+                PhiNode phi = currentGraph.unique(new PhiNode(CiKind.Object, merge, PhiType.Value));
+                for (ExceptionInfo info : exceptions) {
+                    EndNode end = currentGraph.add(new EndNode());
+                    info.exceptionEdge.setNext(end);
+                    merge.addForwardEnd(end);
+                    phi.addInput(info.exception);
+                }
+                merge.setStateAfter(frameState.create(bci()));
+                exception = new ExceptionInfo(merge, phi);
+            }
+
+            FixedNode entry = handleException(exception.exception, bci());
+            if (entry != null) {
+                exception.exceptionEdge.setNext(entry);
+            } else {
+                exception.exceptionEdge.setNext(createTarget(unwindBlock(bci()), frameState.copyWithException(exception.exception)));
+            }
+            Debug.metric("ExplicitExceptions").increment();
+        }
+    }
+
+    private void genPutField(RiField field) {
+        emitExplicitExceptions(frameState.peek(1), null);
+
+        ValueNode value = frameState.pop(field.kind(false).stackKind());
+        ValueNode receiver = frameState.apop();
+        if (field instanceof RiResolvedField && ((RiResolvedField) field).holder().isInitialized()) {
+            StoreFieldNode store = currentGraph.add(new StoreFieldNode(receiver, (RiResolvedField) field, value));
+            appendOptimizedStoreField(store);
+        } else {
+            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+        }
+    }
+
+    private void genGetStatic(RiField field) {
+        RiType holder = field.holder();
+        boolean isInitialized = (field instanceof RiResolvedField) && ((RiResolvedType) holder).isInitialized();
+        CiConstant constantValue = null;
+        if (isInitialized) {
+            constantValue = ((RiResolvedField) field).constantValue(null);
+        }
+        if (constantValue != null) {
+            frameState.push(constantValue.kind.stackKind(), appendConstant(constantValue));
+        } else {
+            ValueNode container = genTypeOrDeopt(RiType.Representation.StaticFields, holder, isInitialized);
+            CiKind kind = field.kind(false);
+            if (container != null) {
+                LoadFieldNode load = currentGraph.add(new LoadFieldNode(container, (RiResolvedField) field));
+                appendOptimizedLoadField(kind, load);
+            } else {
+                // deopt will be generated by genTypeOrDeopt, not needed here
+                frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
+            }
+        }
+    }
+
+    private void genPutStatic(RiField field) {
+        RiType holder = field.holder();
+        ValueNode container = genTypeOrDeopt(RiType.Representation.StaticFields, holder, field instanceof RiResolvedField && ((RiResolvedType) holder).isInitialized());
+        ValueNode value = frameState.pop(field.kind(false).stackKind());
+        if (container != null) {
+            StoreFieldNode store = currentGraph.add(new StoreFieldNode(container, (RiResolvedField) field, value));
+            appendOptimizedStoreField(store);
+        } else {
+            // deopt will be generated by genTypeOrDeopt, not needed here
+        }
+    }
+
+    private ConstantNode genTypeOrDeopt(RiType.Representation representation, RiType holder, boolean initialized) {
+        if (initialized) {
+            return appendConstant(((RiResolvedType) holder).getEncoding(representation));
+        } else {
+            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+            return null;
+        }
+    }
+
+    private void appendOptimizedStoreField(StoreFieldNode store) {
+        append(store);
+    }
+
+    private void appendOptimizedLoadField(CiKind kind, LoadFieldNode load) {
+        // append the load to the instruction
+        ValueNode optimized = append(load);
+        frameState.push(kind.stackKind(), optimized);
+    }
+
+    private void genInvokeStatic(RiMethod target) {
+        if (target instanceof RiResolvedMethod) {
+            RiResolvedMethod resolvedTarget = (RiResolvedMethod) target;
+            RiResolvedType holder = resolvedTarget.holder();
+            if (!holder.isInitialized() && GraalOptions.ResolveClassBeforeStaticInvoke) {
+                genInvokeDeopt(target, false);
+            } else {
+                ValueNode[] args = frameState.popArguments(resolvedTarget.signature().argumentSlots(false), resolvedTarget.signature().argumentCount(false));
+                appendInvoke(InvokeKind.Static, resolvedTarget, args);
+            }
+        } else {
+            genInvokeDeopt(target, false);
+        }
+    }
+
+    private void genInvokeInterface(RiMethod target) {
+        if (target instanceof RiResolvedMethod) {
+            ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
+            genInvokeIndirect(InvokeKind.Interface, (RiResolvedMethod) target, args);
+        } else {
+            genInvokeDeopt(target, true);
+        }
+    }
+
+    private void genInvokeVirtual(RiMethod target) {
+        if (target instanceof RiResolvedMethod) {
+            ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
+            genInvokeIndirect(InvokeKind.Virtual, (RiResolvedMethod) target, args);
+        } else {
+            genInvokeDeopt(target, true);
+        }
+
+    }
+
+    private void genInvokeSpecial(RiMethod target) {
+        if (target instanceof RiResolvedMethod) {
+            assert target != null;
+            assert target.signature() != null;
+            ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
+            invokeDirect((RiResolvedMethod) target, args);
+        } else {
+            genInvokeDeopt(target, true);
+        }
+    }
+
+    private void genInvokeDeopt(RiMethod unresolvedTarget, boolean withReceiver) {
+        append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+        frameState.popArguments(unresolvedTarget.signature().argumentSlots(withReceiver), unresolvedTarget.signature().argumentCount(withReceiver));
+        CiKind kind = unresolvedTarget.signature().returnKind(false);
+        if (kind != CiKind.Void) {
+            frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
+        }
+    }
+
+    private void genInvokeIndirect(InvokeKind invokeKind, RiResolvedMethod target, ValueNode[] args) {
+        ValueNode receiver = args[0];
+        // attempt to devirtualize the call
+        RiResolvedType klass = target.holder();
+
+        // 0. check for trivial cases
+        if (target.canBeStaticallyBound() && !isAbstract(target.accessFlags())) {
+            // check for trivial cases (e.g. final methods, nonvirtual methods)
+            invokeDirect(target, args);
+            return;
+        }
+        // 1. check if the exact type of the receiver can be determined
+        RiResolvedType exact = getExactType(klass, receiver);
+        if (exact != null) {
+            // either the holder class is exact, or the receiver object has an exact type
+            invokeDirect(exact.resolveMethodImpl(target), args);
+            return;
+        }
+        // devirtualization failed, produce an actual invokevirtual
+        appendInvoke(invokeKind, target, args);
+    }
+
+    private void invokeDirect(RiResolvedMethod target, ValueNode[] args) {
+        appendInvoke(InvokeKind.Special, target, args);
+    }
+
+    private void appendInvoke(InvokeKind invokeKind, RiResolvedMethod targetMethod, ValueNode[] args) {
+        CiKind resultType = targetMethod.signature().returnKind(false);
+        if (GraalOptions.DeoptALot) {
+            DeoptimizeNode deoptimize = currentGraph.add(new DeoptimizeNode(DeoptAction.None));
+            deoptimize.setMessage("invoke " + targetMethod.name());
+            append(deoptimize);
+            frameState.pushReturn(resultType, ConstantNode.defaultForKind(resultType, currentGraph));
+        } else {
+            MethodCallTargetNode callTarget = currentGraph.add(new MethodCallTargetNode(invokeKind, targetMethod, args, targetMethod.signature().returnType(method.holder())));
+            BeginNode exceptionEdge = handleException(null, bci());
+            ValueNode result;
+            if (exceptionEdge != null) {
+                InvokeWithExceptionNode invoke = currentGraph.add(new InvokeWithExceptionNode(callTarget, exceptionEdge, bci()));
+                result = append(invoke);
+                frameState.pushReturn(resultType, result);
+                Block nextBlock = currentBlock.successors.get(0);
+
+                assert bci() == currentBlock.endBci;
+                frameState.clearNonLiveLocals(currentBlock.localsLiveOut);
+
+                invoke.setNext(createTarget(nextBlock, frameState));
+                invoke.setStateAfter(frameState.create(nextBlock.startBci));
+            } else {
+                result = appendWithBCI(currentGraph.add(new InvokeNode(callTarget, bci())));
+                frameState.pushReturn(resultType, result);
+            }
+        }
+    }
+
+    private RiResolvedType getExactType(RiResolvedType staticType, ValueNode receiver) {
+        RiResolvedType exact = staticType.exactType();
+        if (exact == null) {
+            exact = receiver.exactType();
+            if (exact == null) {
+                if (receiver.isConstant()) {
+                    exact = runtime.getTypeOf(receiver.asConstant());
+                }
+                if (exact == null) {
+                    RiResolvedType declared = receiver.declaredType();
+                    if (declared != null) {
+                        exact = declared.exactType();
+                    }
+                }
+            }
+        }
+        return exact;
+    }
+
+    private void callRegisterFinalizer() {
+        // append a call to the finalizer registration
+        append(currentGraph.add(new RegisterFinalizerNode(frameState.loadLocal(0))));
+    }
+
+    private void genReturn(ValueNode x) {
+        frameState.clearStack();
+        if (x != null) {
+            frameState.push(x.kind(), x);
+        }
+        appendGoto(createTarget(returnBlock(bci()), frameState));
+    }
+
+    private MonitorEnterNode genMonitorEnter(ValueNode x) {
+        MonitorEnterNode monitorEnter = currentGraph.add(new MonitorEnterNode(x));
+        appendWithBCI(monitorEnter);
+        return monitorEnter;
+    }
+
+    private MonitorExitNode genMonitorExit(ValueNode x) {
+        MonitorExitNode monitorExit = currentGraph.add(new MonitorExitNode(x));
+        appendWithBCI(monitorExit);
+        return monitorExit;
+    }
+
+    private void genJsr(int dest) {
+        Block successor = currentBlock.jsrSuccessor;
+        assert successor.startBci == dest : successor.startBci + " != " + dest + " @" + bci();
+        JsrScope scope = currentBlock.jsrScope;
+        if (!successor.jsrScope.pop().equals(scope)) {
+            throw new JsrNotSupportedBailout("unstructured control flow (internal limitation)");
+        }
+        if (successor.jsrScope.nextReturnAddress() != stream().nextBCI()) {
+            throw new JsrNotSupportedBailout("unstructured control flow (internal limitation)");
+        }
+        frameState.push(CiKind.Jsr, ConstantNode.forJsr(stream().nextBCI(), currentGraph));
+        appendGoto(createTarget(successor, frameState));
+    }
+
+    private void genRet(int localIndex) {
+        Block successor = currentBlock.retSuccessor;
+        ValueNode local = frameState.loadLocal(localIndex);
+        JsrScope scope = currentBlock.jsrScope;
+        int retAddress = scope.nextReturnAddress();
+        append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new CompareNode(local, Condition.EQ, ConstantNode.forJsr(retAddress, currentGraph))))));
+        if (!successor.jsrScope.equals(scope.pop())) {
+            throw new JsrNotSupportedBailout("unstructured control flow (ret leaves more than one scope)");
+        }
+        appendGoto(createTarget(successor, frameState));
+    }
+
+    private void genTableswitch() {
+        int bci = bci();
+        ValueNode value = frameState.ipop();
+        BytecodeTableSwitch ts = new BytecodeTableSwitch(stream(), bci);
+
+        int nofCases = ts.numberOfCases() + 1; // including default case
+        assert currentBlock.normalSuccessors == nofCases;
+
+        double[] probabilities = switchProbability(nofCases, bci);
+        TableSwitchNode tableSwitch = currentGraph.add(new TableSwitchNode(value, ts.lowKey(), probabilities));
+        for (int i = 0; i < nofCases; ++i) {
+            tableSwitch.setBlockSuccessor(i, createBlockTarget(probabilities[i], currentBlock.successors.get(i), frameState));
+        }
+        append(tableSwitch);
+    }
+
+    private double[] switchProbability(int numberOfCases, int bci) {
+        double[] prob = profilingInfo.getSwitchProbabilities(bci);
+        if (prob != null) {
+            assert prob.length == numberOfCases;
+        } else {
+            Debug.log("Missing probability (switch) in %s at bci %d", method, bci);
+            prob = new double[numberOfCases];
+            for (int i = 0; i < numberOfCases; i++) {
+                prob[i] = 1.0d / numberOfCases;
+            }
+        }
+        return prob;
+    }
+
+    private void genLookupswitch() {
+        int bci = bci();
+        ValueNode value = frameState.ipop();
+        BytecodeLookupSwitch ls = new BytecodeLookupSwitch(stream(), bci);
+
+        int nofCases = ls.numberOfCases() + 1; // including default case
+        assert currentBlock.normalSuccessors == nofCases;
+
+        int[] keys = new int[nofCases - 1];
+        for (int i = 0; i < nofCases - 1; ++i) {
+            keys[i] = ls.keyAt(i);
+        }
+        double[] probabilities = switchProbability(nofCases, bci);
+        LookupSwitchNode lookupSwitch = currentGraph.add(new LookupSwitchNode(value, keys, probabilities));
+        for (int i = 0; i < nofCases; ++i) {
+            lookupSwitch.setBlockSuccessor(i, createBlockTarget(probabilities[i], currentBlock.successors.get(i), frameState));
+        }
+        append(lookupSwitch);
+    }
+
+    private ConstantNode appendConstant(CiConstant constant) {
+        return ConstantNode.forCiConstant(constant, runtime, currentGraph);
+    }
+
+    private ValueNode append(FixedNode fixed) {
+        lastInstr.setNext(fixed);
+        lastInstr = null;
+        return fixed;
+    }
+
+    private ValueNode append(FixedWithNextNode x) {
+        return appendWithBCI(x);
+    }
+
+    private static ValueNode append(ValueNode v) {
+        return v;
+    }
+
+    private ValueNode appendWithBCI(FixedWithNextNode x) {
+        assert x.predecessor() == null : "instruction should not have been appended yet";
+        assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")";
+        lastInstr.setNext(x);
+        lastInstr = x;
+        return x;
+    }
+
+    private FixedNode createTarget(double probability, Block block, FrameStateBuilder stateAfter) {
+        assert probability >= 0 && probability <= 1;
+        if (probability == 0 && config.useBranchPrediction()) {
+            return currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile));
+        } else {
+            return createTarget(block, stateAfter);
+        }
+    }
+
+    private FixedNode createTarget(Block block, FrameStateBuilder stateAfter) {
+        assert block != null && stateAfter != null;
+        assert !block.isExceptionEntry || stateAfter.stackSize() == 1;
+
+        if (block.firstInstruction == null) {
+            // This is the first time we see this block as a branch target.
+            // Create and return a placeholder that later can be replaced with a MergeNode when we see this block again.
+            block.firstInstruction = currentGraph.add(new BlockPlaceholderNode());
+            block.entryState = stateAfter.copy();
+            block.entryState.clearNonLiveLocals(block.localsLiveIn);
+
+            Debug.log("createTarget %s: first visit, result: %s", block, block.firstInstruction);
+            return block.firstInstruction;
+        }
+
+        // We already saw this block before, so we have to merge states.
+        if (!block.entryState.isCompatibleWith(stateAfter)) {
+            throw new CiBailout("stacks do not match; bytecodes would not verify");
+        }
+
+        if (block.firstInstruction instanceof LoopBeginNode) {
+            assert block.isLoopHeader && currentBlock.blockID >= block.blockID : "must be backward branch";
+            // Backward loop edge. We need to create a special LoopEndNode and merge with the loop begin node created before.
+            LoopBeginNode loopBegin = (LoopBeginNode) block.firstInstruction;
+            LoopEndNode result = currentGraph.add(new LoopEndNode(loopBegin));
+            block.entryState.merge(loopBegin, stateAfter);
+
+            Debug.log("createTarget %s: merging backward branch to loop header %s, result: %s", block, loopBegin, result);
+            return result;
+        }
+        assert currentBlock == null || currentBlock.blockID < block.blockID : "must not be backward branch";
+        assert block.firstInstruction.next() == null : "bytecodes already parsed for block";
+
+        if (block.firstInstruction instanceof BlockPlaceholderNode) {
+            // This is the second time we see this block. Create the actual MergeNode and the End Node for the already existing edge.
+            // For simplicity, we leave the placeholder in the graph and just append the new nodes after the placeholder.
+            BlockPlaceholderNode placeholder = (BlockPlaceholderNode) block.firstInstruction;
+
+            // The EndNode for the already existing edge.
+            EndNode end = currentGraph.add(new EndNode());
+            // The MergeNode that replaces the placeholder.
+            MergeNode mergeNode  = currentGraph.add(new MergeNode());
+            FixedNode next = placeholder.next();
+
+            placeholder.setNext(end);
+            mergeNode.addForwardEnd(end);
+            mergeNode.setNext(next);
+
+            block.firstInstruction = mergeNode;
+        }
+
+        MergeNode mergeNode = (MergeNode) block.firstInstruction;
+
+        // The EndNode for the newly merged edge.
+        EndNode result = currentGraph.add(new EndNode());
+        block.entryState.merge(mergeNode, stateAfter);
+        mergeNode.addForwardEnd(result);
+
+        Debug.log("createTarget %s: merging state, result: %s", block, result);
+        return result;
+    }
+
+    /**
+     * Returns a block begin node with the specified state.  If the specified probability is 0, the block
+     * deoptimizes immediately.
+     */
+    private BeginNode createBlockTarget(double probability, Block block, FrameStateBuilder stateAfter) {
+        FixedNode target = createTarget(probability, block, stateAfter);
+        assert !(target instanceof BeginNode);
+        BeginNode begin = currentGraph.add(new BeginNode());
+        begin.setNext(target);
+
+        assert !(target instanceof DeoptimizeNode && begin.stateAfter() != null) :
+            "We are not allowed to set the stateAfter of the begin node, because we have to deoptimize to a bci _before_ the actual if, so that the interpreter can update the profiling information.";
+        return begin;
+    }
+
+    private ValueNode synchronizedObject(FrameStateBuilder state, RiResolvedMethod target) {
+        if (isStatic(target.accessFlags())) {
+            return append(ConstantNode.forCiConstant(target.holder().getEncoding(Representation.JavaClass), runtime, currentGraph));
+        } else {
+            return state.loadLocal(0);
+        }
+    }
+
+    private void processBlock(Block block) {
+        // Ignore blocks that have no predecessors by the time it their bytecodes are parsed
+        if (block == null || block.firstInstruction == null) {
+            Debug.log("Ignoring block %s", block);
+            return;
+        }
+        Debug.log("Parsing block %s  firstInstruction: %s  loopHeader: %b", block, block.firstInstruction, block.isLoopHeader);
+
+        lastInstr = block.firstInstruction;
+        frameState = block.entryState;
+        currentBlock = block;
+
+        frameState.cleanupDeletedPhis();
+        if (lastInstr instanceof MergeNode) {
+            int bci = block.startBci;
+            if (block instanceof ExceptionBlock) {
+                bci = ((ExceptionBlock) block).deoptBci;
+            }
+            ((MergeNode) lastInstr).setStateAfter(frameState.create(bci));
+        }
+
+        if (block == returnBlock) {
+            frameState.setRethrowException(false);
+            createReturn();
+        } else if (block == unwindBlock) {
+            frameState.setRethrowException(false);
+            createUnwind();
+        } else if (block instanceof ExceptionBlock) {
+            createExceptionDispatch((ExceptionBlock) block);
+        } else {
+            frameState.setRethrowException(false);
+            iterateBytecodesForBlock(block);
+        }
+    }
+
+    private void connectLoopEndToBegin() {
+        for (LoopBeginNode begin : currentGraph.getNodes(LoopBeginNode.class)) {
+            if (begin.loopEnds().isEmpty()) {
+                // Remove loop header without loop ends.
+                // This can happen with degenerated loops like this one:
+                // for (;;) {
+                //     try {
+                //         break;
+                //     } catch (UnresolvedException iioe) {
+                //     }
+                // }
+                assert begin.forwardEndCount() == 1;
+                currentGraph.reduceDegenerateLoopBegin(begin);
+            } else {
+                // Delete unnecessary loop phi functions, i.e., phi functions where all inputs are either the same or the phi itself.
+                for (PhiNode phi : begin.stateAfter().values().filter(PhiNode.class).snapshot()) {
+                    checkRedundantPhi(phi);
+                }
+            }
+        }
+    }
+
+    private static void checkRedundantPhi(PhiNode phiNode) {
+        if (phiNode.isDeleted() || phiNode.valueCount() == 1) {
+            return;
+        }
+
+        ValueNode singleValue = phiNode.singleValue();
+        if (singleValue != null) {
+            Collection<PhiNode> phiUsages = phiNode.usages().filter(PhiNode.class).snapshot();
+            ((StructuredGraph) phiNode.graph()).replaceFloating(phiNode, singleValue);
+            for (PhiNode phi : phiUsages) {
+                checkRedundantPhi(phi);
+            }
+        }
+    }
+
+    private void createUnwind() {
+        synchronizedEpilogue(FrameState.AFTER_EXCEPTION_BCI);
+        UnwindNode unwindNode = currentGraph.add(new UnwindNode(frameState.apop()));
+        append(unwindNode);
+    }
+
+    private void createReturn() {
+        if (method.isConstructor() && method.holder().superType() == null) {
+            callRegisterFinalizer();
+        }
+        CiKind returnKind = method.signature().returnKind(false).stackKind();
+        ValueNode x = returnKind == CiKind.Void ? null : frameState.pop(returnKind);
+        assert frameState.stackSize() == 0;
+
+        // TODO (gdub) remove this when FloatingRead can handle this case
+        if (Modifier.isSynchronized(method.accessFlags())) {
+            append(currentGraph.add(new ValueAnchorNode(x)));
+            assert !frameState.rethrowException();
+        }
+
+        synchronizedEpilogue(FrameState.AFTER_BCI);
+        ReturnNode returnNode = currentGraph.add(new ReturnNode(x));
+        append(returnNode);
+    }
+
+    private void synchronizedEpilogue(int bci) {
+        if (Modifier.isSynchronized(method.accessFlags())) {
+            MonitorExitNode monitorExit = genMonitorExit(methodSynchronizedObject);
+            monitorExit.setStateAfter(frameState.create(bci));
+            assert !frameState.rethrowException();
+        }
+    }
+
+    private void createExceptionDispatch(ExceptionBlock block) {
+        if (block.handler == null) {
+            assert frameState.stackSize() == 1 : "only exception object expected on stack, actual size: " + frameState.stackSize();
+            createUnwind();
+        } else {
+            assert frameState.stackSize() == 1 : frameState;
+
+            RiType catchType = block.handler.catchType();
+            if (config.eagerResolving()) {
+                catchType = lookupType(block.handler.catchTypeCPI(), INSTANCEOF);
+            }
+            boolean initialized = (catchType instanceof RiResolvedType);
+            if (initialized && config.getSkippedExceptionTypes() != null) {
+                RiResolvedType resolvedCatchType = (RiResolvedType) catchType;
+                for (RiResolvedType skippedType : config.getSkippedExceptionTypes()) {
+                    initialized &= !resolvedCatchType.isSubtypeOf(skippedType);
+                    if (!initialized) {
+                        break;
+                    }
+                }
+            }
+
+            ConstantNode typeInstruction = genTypeOrDeopt(RiType.Representation.ObjectHub, catchType, initialized);
+            if (typeInstruction != null) {
+                Block nextBlock = block.successors.size() == 1 ? unwindBlock(block.deoptBci) : block.successors.get(1);
+                FixedNode catchSuccessor = createTarget(block.successors.get(0), frameState);
+                FixedNode nextDispatch = createTarget(nextBlock, frameState);
+                ValueNode exception = frameState.stackAt(0);
+                IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new InstanceOfNode(typeInstruction, (RiResolvedType) catchType, exception, false)), catchSuccessor, nextDispatch, 0.5));
+                append(ifNode);
+            }
+        }
+    }
+
+    private void appendGoto(FixedNode target) {
+        if (lastInstr != null) {
+            lastInstr.setNext(target);
+        }
+    }
+
+    private static boolean isBlockEnd(Node n) {
+        return trueSuccessorCount(n) > 1 || n instanceof ReturnNode || n instanceof UnwindNode || n instanceof DeoptimizeNode;
+    }
+
+    private static int trueSuccessorCount(Node n) {
+        if (n == null) {
+            return 0;
+        }
+        int i = 0;
+        for (Node s : n.successors()) {
+            if (Util.isFixed(s)) {
+                i++;
+            }
+        }
+        return i;
+    }
+
+    private void iterateBytecodesForBlock(Block block) {
+        if (block.isLoopHeader) {
+            // Create the loop header block, which later will merge the backward branches of the loop.
+            EndNode preLoopEnd = currentGraph.add(new EndNode());
+            LoopBeginNode loopBegin = currentGraph.add(new LoopBeginNode());
+            lastInstr.setNext(preLoopEnd);
+            // Add the single non-loop predecessor of the loop header.
+            loopBegin.addForwardEnd(preLoopEnd);
+            lastInstr = loopBegin;
+
+            // Create phi functions for all local variables and operand stack slots.
+            frameState.insertLoopPhis(loopBegin);
+            loopBegin.setStateAfter(frameState.create(block.startBci));
+
+            // We have seen all forward branches. All subsequent backward branches will merge to the loop header.
+            // This ensures that the loop header has exactly one non-loop predecessor.
+            block.firstInstruction = loopBegin;
+            // We need to preserve the frame state builder of the loop header so that we can merge values for
+            // phi functions, so make a copy of it.
+            block.entryState = frameState.copy();
+
+            Debug.log("  created loop header %s", loopBegin);
+        }
+        assert lastInstr.next() == null : "instructions already appended at block " + block;
+        Debug.log("  frameState: %s", frameState);
+
+        int endBCI = stream.endBCI();
+
+        stream.setBCI(block.startBci);
+        int bci = block.startBci;
+        while (bci < endBCI) {
+            // read the opcode
+            int opcode = stream.currentBC();
+            traceState();
+            traceInstruction(bci, opcode, bci == block.startBci);
+            processBytecode(bci, opcode);
+
+            if (lastInstr == null || isBlockEnd(lastInstr) || lastInstr.next() != null) {
+                break;
+            }
+
+            stream.next();
+            bci = stream.currentBCI();
+            if (lastInstr instanceof StateSplit) {
+                StateSplit stateSplit = (StateSplit) lastInstr;
+                if (stateSplit.stateAfter() == null && stateSplit.needsStateAfter()) {
+                    stateSplit.setStateAfter(frameState.create(bci));
+                }
+            }
+            if (bci < endBCI) {
+                if (bci > block.endBci) {
+                    assert !block.successors.get(0).isExceptionEntry;
+                    assert block.normalSuccessors == 1;
+                    // we fell through to the next block, add a goto and break
+                    appendGoto(createTarget(block.successors.get(0), frameState));
+                    break;
+                }
+            }
+        }
+    }
+
+    private void traceState() {
+        if (GraalOptions.TraceBytecodeParserLevel >= TRACELEVEL_STATE && !TTY.isSuppressed()) {
+            log.println(String.format("|   state [nr locals = %d, stack depth = %d, method = %s]", frameState.localsSize(), frameState.stackSize(), method));
+            for (int i = 0; i < frameState.localsSize(); ++i) {
+                ValueNode value = frameState.localAt(i);
+                log.println(String.format("|   local[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().javaName, value));
+            }
+            for (int i = 0; i < frameState.stackSize(); ++i) {
+                ValueNode value = frameState.stackAt(i);
+                log.println(String.format("|   stack[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().javaName, value));
+            }
+        }
+    }
+
+    private void processBytecode(int bci, int opcode) {
+        int cpi;
+
+        // Checkstyle: stop
+        switch (opcode) {
+            case NOP            : /* nothing to do */ break;
+            case ACONST_NULL    : frameState.apush(appendConstant(CiConstant.NULL_OBJECT)); break;
+            case ICONST_M1      : frameState.ipush(appendConstant(CiConstant.INT_MINUS_1)); break;
+            case ICONST_0       : frameState.ipush(appendConstant(CiConstant.INT_0)); break;
+            case ICONST_1       : frameState.ipush(appendConstant(CiConstant.INT_1)); break;
+            case ICONST_2       : frameState.ipush(appendConstant(CiConstant.INT_2)); break;
+            case ICONST_3       : frameState.ipush(appendConstant(CiConstant.INT_3)); break;
+            case ICONST_4       : frameState.ipush(appendConstant(CiConstant.INT_4)); break;
+            case ICONST_5       : frameState.ipush(appendConstant(CiConstant.INT_5)); break;
+            case LCONST_0       : frameState.lpush(appendConstant(CiConstant.LONG_0)); break;
+            case LCONST_1       : frameState.lpush(appendConstant(CiConstant.LONG_1)); break;
+            case FCONST_0       : frameState.fpush(appendConstant(CiConstant.FLOAT_0)); break;
+            case FCONST_1       : frameState.fpush(appendConstant(CiConstant.FLOAT_1)); break;
+            case FCONST_2       : frameState.fpush(appendConstant(CiConstant.FLOAT_2)); break;
+            case DCONST_0       : frameState.dpush(appendConstant(CiConstant.DOUBLE_0)); break;
+            case DCONST_1       : frameState.dpush(appendConstant(CiConstant.DOUBLE_1)); break;
+            case BIPUSH         : frameState.ipush(appendConstant(CiConstant.forInt(stream.readByte()))); break;
+            case SIPUSH         : frameState.ipush(appendConstant(CiConstant.forInt(stream.readShort()))); break;
+            case LDC            : // fall through
+            case LDC_W          : // fall through
+            case LDC2_W         : genLoadConstant(stream.readCPI(), opcode); break;
+            case ILOAD          : loadLocal(stream.readLocalIndex(), CiKind.Int); break;
+            case LLOAD          : loadLocal(stream.readLocalIndex(), CiKind.Long); break;
+            case FLOAD          : loadLocal(stream.readLocalIndex(), CiKind.Float); break;
+            case DLOAD          : loadLocal(stream.readLocalIndex(), CiKind.Double); break;
+            case ALOAD          : loadLocal(stream.readLocalIndex(), CiKind.Object); break;
+            case ILOAD_0        : // fall through
+            case ILOAD_1        : // fall through
+            case ILOAD_2        : // fall through
+            case ILOAD_3        : loadLocal(opcode - ILOAD_0, CiKind.Int); break;
+            case LLOAD_0        : // fall through
+            case LLOAD_1        : // fall through
+            case LLOAD_2        : // fall through
+            case LLOAD_3        : loadLocal(opcode - LLOAD_0, CiKind.Long); break;
+            case FLOAD_0        : // fall through
+            case FLOAD_1        : // fall through
+            case FLOAD_2        : // fall through
+            case FLOAD_3        : loadLocal(opcode - FLOAD_0, CiKind.Float); break;
+            case DLOAD_0        : // fall through
+            case DLOAD_1        : // fall through
+            case DLOAD_2        : // fall through
+            case DLOAD_3        : loadLocal(opcode - DLOAD_0, CiKind.Double); break;
+            case ALOAD_0        : // fall through
+            case ALOAD_1        : // fall through
+            case ALOAD_2        : // fall through
+            case ALOAD_3        : loadLocal(opcode - ALOAD_0, CiKind.Object); break;
+            case IALOAD         : genLoadIndexed(CiKind.Int   ); break;
+            case LALOAD         : genLoadIndexed(CiKind.Long  ); break;
+            case FALOAD         : genLoadIndexed(CiKind.Float ); break;
+            case DALOAD         : genLoadIndexed(CiKind.Double); break;
+            case AALOAD         : genLoadIndexed(CiKind.Object); break;
+            case BALOAD         : genLoadIndexed(CiKind.Byte  ); break;
+            case CALOAD         : genLoadIndexed(CiKind.Char  ); break;
+            case SALOAD         : genLoadIndexed(CiKind.Short ); break;
+            case ISTORE         : storeLocal(CiKind.Int, stream.readLocalIndex()); break;
+            case LSTORE         : storeLocal(CiKind.Long, stream.readLocalIndex()); break;
+            case FSTORE         : storeLocal(CiKind.Float, stream.readLocalIndex()); break;
+            case DSTORE         : storeLocal(CiKind.Double, stream.readLocalIndex()); break;
+            case ASTORE         : storeLocal(CiKind.Object, stream.readLocalIndex()); break;
+            case ISTORE_0       : // fall through
+            case ISTORE_1       : // fall through
+            case ISTORE_2       : // fall through
+            case ISTORE_3       : storeLocal(CiKind.Int, opcode - ISTORE_0); break;
+            case LSTORE_0       : // fall through
+            case LSTORE_1       : // fall through
+            case LSTORE_2       : // fall through
+            case LSTORE_3       : storeLocal(CiKind.Long, opcode - LSTORE_0); break;
+            case FSTORE_0       : // fall through
+            case FSTORE_1       : // fall through
+            case FSTORE_2       : // fall through
+            case FSTORE_3       : storeLocal(CiKind.Float, opcode - FSTORE_0); break;
+            case DSTORE_0       : // fall through
+            case DSTORE_1       : // fall through
+            case DSTORE_2       : // fall through
+            case DSTORE_3       : storeLocal(CiKind.Double, opcode - DSTORE_0); break;
+            case ASTORE_0       : // fall through
+            case ASTORE_1       : // fall through
+            case ASTORE_2       : // fall through
+            case ASTORE_3       : storeLocal(CiKind.Object, opcode - ASTORE_0); break;
+            case IASTORE        : genStoreIndexed(CiKind.Int   ); break;
+            case LASTORE        : genStoreIndexed(CiKind.Long  ); break;
+            case FASTORE        : genStoreIndexed(CiKind.Float ); break;
+            case DASTORE        : genStoreIndexed(CiKind.Double); break;
+            case AASTORE        : genStoreIndexed(CiKind.Object); break;
+            case BASTORE        : genStoreIndexed(CiKind.Byte  ); break;
+            case CASTORE        : genStoreIndexed(CiKind.Char  ); break;
+            case SASTORE        : genStoreIndexed(CiKind.Short ); break;
+            case POP            : // fall through
+            case POP2           : // fall through
+            case DUP            : // fall through
+            case DUP_X1         : // fall through
+            case DUP_X2         : // fall through
+            case DUP2           : // fall through
+            case DUP2_X1        : // fall through
+            case DUP2_X2        : // fall through
+            case SWAP           : stackOp(opcode); break;
+            case IADD           : // fall through
+            case ISUB           : // fall through
+            case IMUL           : genArithmeticOp(CiKind.Int, opcode, false); break;
+            case IDIV           : // fall through
+            case IREM           : genArithmeticOp(CiKind.Int, opcode, true); break;
+            case LADD           : // fall through
+            case LSUB           : // fall through
+            case LMUL           : genArithmeticOp(CiKind.Long, opcode, false); break;
+            case LDIV           : // fall through
+            case LREM           : genArithmeticOp(CiKind.Long, opcode, true); break;
+            case FADD           : // fall through
+            case FSUB           : // fall through
+            case FMUL           : // fall through
+            case FDIV           : // fall through
+            case FREM           : genArithmeticOp(CiKind.Float, opcode, false); break;
+            case DADD           : // fall through
+            case DSUB           : // fall through
+            case DMUL           : // fall through
+            case DDIV           : // fall through
+            case DREM           : genArithmeticOp(CiKind.Double, opcode, false); break;
+            case INEG           : genNegateOp(CiKind.Int); break;
+            case LNEG           : genNegateOp(CiKind.Long); break;
+            case FNEG           : genNegateOp(CiKind.Float); break;
+            case DNEG           : genNegateOp(CiKind.Double); break;
+            case ISHL           : // fall through
+            case ISHR           : // fall through
+            case IUSHR          : genShiftOp(CiKind.Int, opcode); break;
+            case IAND           : // fall through
+            case IOR            : // fall through
+            case IXOR           : genLogicOp(CiKind.Int, opcode); break;
+            case LSHL           : // fall through
+            case LSHR           : // fall through
+            case LUSHR          : genShiftOp(CiKind.Long, opcode); break;
+            case LAND           : // fall through
+            case LOR            : // fall through
+            case LXOR           : genLogicOp(CiKind.Long, opcode); break;
+            case IINC           : genIncrement(); break;
+            case I2L            : genConvert(ConvertNode.Op.I2L); break;
+            case I2F            : genConvert(ConvertNode.Op.I2F); break;
+            case I2D            : genConvert(ConvertNode.Op.I2D); break;
+            case L2I            : genConvert(ConvertNode.Op.L2I); break;
+            case L2F            : genConvert(ConvertNode.Op.L2F); break;
+            case L2D            : genConvert(ConvertNode.Op.L2D); break;
+            case F2I            : genConvert(ConvertNode.Op.F2I); break;
+            case F2L            : genConvert(ConvertNode.Op.F2L); break;
+            case F2D            : genConvert(ConvertNode.Op.F2D); break;
+            case D2I            : genConvert(ConvertNode.Op.D2I); break;
+            case D2L            : genConvert(ConvertNode.Op.D2L); break;
+            case D2F            : genConvert(ConvertNode.Op.D2F); break;
+            case I2B            : genConvert(ConvertNode.Op.I2B); break;
+            case I2C            : genConvert(ConvertNode.Op.I2C); break;
+            case I2S            : genConvert(ConvertNode.Op.I2S); break;
+            case LCMP           : genCompareOp(CiKind.Long, false); break;
+            case FCMPL          : genCompareOp(CiKind.Float, true); break;
+            case FCMPG          : genCompareOp(CiKind.Float, false); break;
+            case DCMPL          : genCompareOp(CiKind.Double, true); break;
+            case DCMPG          : genCompareOp(CiKind.Double, false); break;
+            case IFEQ           : genIfZero(Condition.EQ); break;
+            case IFNE           : genIfZero(Condition.NE); break;
+            case IFLT           : genIfZero(Condition.LT); break;
+            case IFGE           : genIfZero(Condition.GE); break;
+            case IFGT           : genIfZero(Condition.GT); break;
+            case IFLE           : genIfZero(Condition.LE); break;
+            case IF_ICMPEQ      : genIfSame(CiKind.Int, Condition.EQ); break;
+            case IF_ICMPNE      : genIfSame(CiKind.Int, Condition.NE); break;
+            case IF_ICMPLT      : genIfSame(CiKind.Int, Condition.LT); break;
+            case IF_ICMPGE      : genIfSame(CiKind.Int, Condition.GE); break;
+            case IF_ICMPGT      : genIfSame(CiKind.Int, Condition.GT); break;
+            case IF_ICMPLE      : genIfSame(CiKind.Int, Condition.LE); break;
+            case IF_ACMPEQ      : genIfSame(CiKind.Object, Condition.EQ); break;
+            case IF_ACMPNE      : genIfSame(CiKind.Object, Condition.NE); break;
+            case GOTO           : genGoto(); break;
+            case JSR            : genJsr(stream.readBranchDest()); break;
+            case RET            : genRet(stream.readLocalIndex()); break;
+            case TABLESWITCH    : genTableswitch(); break;
+            case LOOKUPSWITCH   : genLookupswitch(); break;
+            case IRETURN        : genReturn(frameState.ipop()); break;
+            case LRETURN        : genReturn(frameState.lpop()); break;
+            case FRETURN        : genReturn(frameState.fpop()); break;
+            case DRETURN        : genReturn(frameState.dpop()); break;
+            case ARETURN        : genReturn(frameState.apop()); break;
+            case RETURN         : genReturn(null); break;
+            case GETSTATIC      : cpi = stream.readCPI(); genGetStatic(lookupField(cpi, opcode)); break;
+            case PUTSTATIC      : cpi = stream.readCPI(); genPutStatic(lookupField(cpi, opcode)); break;
+            case GETFIELD       : cpi = stream.readCPI(); genGetField(lookupField(cpi, opcode)); break;
+            case PUTFIELD       : cpi = stream.readCPI(); genPutField(lookupField(cpi, opcode)); break;
+            case INVOKEVIRTUAL  : cpi = stream.readCPI(); genInvokeVirtual(lookupMethod(cpi, opcode)); break;
+            case INVOKESPECIAL  : cpi = stream.readCPI(); genInvokeSpecial(lookupMethod(cpi, opcode)); break;
+            case INVOKESTATIC   : cpi = stream.readCPI(); genInvokeStatic(lookupMethod(cpi, opcode)); break;
+            case INVOKEINTERFACE: cpi = stream.readCPI(); genInvokeInterface(lookupMethod(cpi, opcode)); break;
+            case NEW            : genNewInstance(stream.readCPI()); break;
+            case NEWARRAY       : genNewTypeArray(stream.readLocalIndex()); break;
+            case ANEWARRAY      : genNewObjectArray(stream.readCPI()); break;
+            case ARRAYLENGTH    : genArrayLength(); break;
+            case ATHROW         : genThrow(stream.currentBCI()); break;
+            case CHECKCAST      : genCheckCast(); break;
+            case INSTANCEOF     : genInstanceOf(); break;
+            case MONITORENTER   : genMonitorEnter(frameState.apop()); break;
+            case MONITOREXIT    : genMonitorExit(frameState.apop()); break;
+            case MULTIANEWARRAY : genNewMultiArray(stream.readCPI()); break;
+            case IFNULL         : genIfNull(Condition.EQ); break;
+            case IFNONNULL      : genIfNull(Condition.NE); break;
+            case GOTO_W         : genGoto(); break;
+            case JSR_W          : genJsr(stream.readBranchDest()); break;
+            case BREAKPOINT:
+                throw new CiBailout("concurrent setting of breakpoint");
+            default:
+                throw new CiBailout("Unsupported opcode " + opcode + " (" + nameOf(opcode) + ") [bci=" + bci + "]");
+        }
+        // Checkstyle: resume
+    }
+
+    private void traceInstruction(int bci, int opcode, boolean blockStart) {
+        if (GraalOptions.TraceBytecodeParserLevel >= TRACELEVEL_INSTRUCTIONS && !TTY.isSuppressed()) {
+            StringBuilder sb = new StringBuilder(40);
+            sb.append(blockStart ? '+' : '|');
+            if (bci < 10) {
+                sb.append("  ");
+            } else if (bci < 100) {
+                sb.append(' ');
+            }
+            sb.append(bci).append(": ").append(Bytecodes.nameOf(opcode));
+            for (int i = bci + 1; i < stream.nextBCI(); ++i) {
+                sb.append(' ').append(stream.readUByte(i));
+            }
+            if (!currentBlock.jsrScope.isEmpty()) {
+                sb.append(' ').append(currentBlock.jsrScope);
+            }
+            log.println(sb.toString());
+        }
+    }
+
+    private void genArrayLength() {
+        frameState.ipush(append(currentGraph.add(new ArrayLengthNode(frameState.apop()))));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java;
+
+import com.oracle.max.cri.ci.*;
+
+
+public class JsrNotSupportedBailout extends CiBailout{
+    private static final long serialVersionUID = -7476925652727154272L;
+
+    public JsrNotSupportedBailout(String reason) {
+        super(reason);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrScope.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java;
+
+public class JsrScope {
+
+    public static final JsrScope EMPTY_SCOPE = new JsrScope();
+
+    private final long scope;
+
+    private JsrScope(long scope) {
+        this.scope = scope;
+    }
+
+    public JsrScope() {
+        this.scope = 0;
+    }
+
+    public int nextReturnAddress() {
+        return (int) (scope & 0xffff);
+    }
+
+    public JsrScope push(int jsrReturnBci) {
+        if ((scope & 0xffff000000000000L) != 0) {
+            throw new JsrNotSupportedBailout("only four jsr nesting levels are supported");
+        }
+        return new JsrScope((scope << 16) | jsrReturnBci);
+    }
+
+    public boolean isEmpty() {
+        return scope == 0;
+    }
+
+    public boolean isPrefixOf(JsrScope other) {
+        return (scope & other.scope) == scope;
+    }
+
+    public JsrScope pop() {
+        return new JsrScope(scope >>> 16);
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) (scope ^ (scope >>> 32));
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        return obj != null && getClass() == obj.getClass() && scope == ((JsrScope) obj).scope;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        long tmp = scope;
+        sb.append(" [");
+        while (tmp != 0) {
+            sb.append(", ").append(tmp & 0xffff);
+            tmp = tmp >>> 16;
+        }
+        sb.append(']');
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeLookupSwitch.java	Thu Mar 08 19:24:17 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.graal.java.bytecode;
+
+/**
+ * A utility for processing {@link Bytecodes#LOOKUPSWITCH} bytecodes.
+ */
+public class BytecodeLookupSwitch extends BytecodeSwitch {
+    private static final int OFFSET_TO_NUMBER_PAIRS = 4;
+    private static final int OFFSET_TO_FIRST_PAIR_MATCH = 8;
+    private static final int OFFSET_TO_FIRST_PAIR_OFFSET = 12;
+    private static final int PAIR_SIZE = 8;
+
+    /**
+     * Constructor for a {@link BytecodeStream}.
+     * @param stream the {@code BytecodeStream} containing the switch instruction
+     * @param bci the index in the stream of the switch instruction
+     */
+    public BytecodeLookupSwitch(BytecodeStream stream, int bci) {
+        super(stream, bci);
+    }
+
+    @Override
+    public int defaultOffset() {
+        return stream.readInt(alignedBci);
+    }
+
+    @Override
+    public int offsetAt(int i) {
+        return stream.readInt(alignedBci + OFFSET_TO_FIRST_PAIR_OFFSET + PAIR_SIZE * i);
+    }
+
+    @Override
+    public int keyAt(int i) {
+        return stream.readInt(alignedBci + OFFSET_TO_FIRST_PAIR_MATCH + PAIR_SIZE * i);
+    }
+
+    @Override
+    public int numberOfCases() {
+        return stream.readInt(alignedBci + OFFSET_TO_NUMBER_PAIRS);
+    }
+
+    @Override
+    public int size() {
+        return alignedBci + OFFSET_TO_FIRST_PAIR_MATCH + PAIR_SIZE * numberOfCases() - bci;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeStream.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java.bytecode;
+
+/**
+ * A utility class that makes iterating over bytecodes and reading operands
+ * simpler and less error prone. For example, it handles the {@link Bytecodes#WIDE} instruction
+ * and wide variants of instructions internally.
+ */
+public final class BytecodeStream {
+
+    private final byte[] code;
+    private int opcode;
+    private int curBCI;
+    private int nextBCI;
+
+    /**
+     * Creates a new {@code BytecodeStream} for the specified bytecode.
+     * @param code the array of bytes that contains the bytecode
+     */
+    public BytecodeStream(byte[] code) {
+        assert code != null;
+        this.code = code;
+        setBCI(0);
+    }
+
+    /**
+     * Advances to the next bytecode.
+     */
+    public void next() {
+        setBCI(nextBCI);
+    }
+
+    /**
+     * Gets the next bytecode index (no side-effects).
+     * @return the next bytecode index
+     */
+    public int nextBCI() {
+        return nextBCI;
+    }
+
+    /**
+     * Gets the current bytecode index.
+     * @return the current bytecode index
+     */
+    public int currentBCI() {
+        return curBCI;
+    }
+
+    /**
+     * Gets the bytecode index of the end of the code.
+     * @return the index of the end of the code
+     */
+    public int endBCI() {
+        return code.length;
+    }
+
+    /**
+     * Gets the current opcode. This method will never return the
+     * {@link Bytecodes#WIDE WIDE} opcode, but will instead
+     * return the opcode that is modified by the {@code WIDE} opcode.
+     * @return the current opcode; {@link Bytecodes#END} if at or beyond the end of the code
+     */
+    public int currentBC() {
+        if (opcode == Bytecodes.WIDE) {
+            return Bytes.beU1(code, curBCI + 1);
+        } else {
+            return opcode;
+        }
+    }
+
+    /**
+     * Reads the index of a local variable for one of the load or store instructions.
+     * The WIDE modifier is handled internally.
+     * @return the index of the local variable
+     */
+    public int readLocalIndex() {
+        // read local variable index for load/store
+        if (opcode == Bytecodes.WIDE) {
+            return Bytes.beU2(code, curBCI + 2);
+        }
+        return Bytes.beU1(code, curBCI + 1);
+    }
+
+    /**
+     * Read the delta for an {@link Bytecodes#IINC} bytecode.
+     * @return the delta for the {@code IINC}
+     */
+    public int readIncrement() {
+        // read the delta for the iinc bytecode
+        if (opcode == Bytecodes.WIDE) {
+            return Bytes.beS2(code, curBCI + 4);
+        }
+        return Bytes.beS1(code, curBCI + 2);
+    }
+
+    /**
+     * Read the destination of a {@link Bytecodes#GOTO} or {@code IF} instructions.
+     * @return the destination bytecode index
+     */
+    public int readBranchDest() {
+        // reads the destination for a branch bytecode
+        if (opcode == Bytecodes.GOTO_W || opcode == Bytecodes.JSR_W) {
+            return curBCI + Bytes.beS4(code, curBCI + 1);
+        } else {
+            return curBCI + Bytes.beS2(code, curBCI + 1);
+        }
+    }
+
+    /**
+     * Read a signed 4-byte integer from the bytecode stream at the specified bytecode index.
+     * @param bci the bytecode index
+     * @return the integer value
+     */
+    public int readInt(int bci) {
+        // reads a 4-byte signed value
+        return Bytes.beS4(code, bci);
+    }
+
+    /**
+     * Reads an unsigned, 1-byte value from the bytecode stream at the specified bytecode index.
+     * @param bci the bytecode index
+     * @return the byte
+     */
+    public int readUByte(int bci) {
+        return Bytes.beU1(code, bci);
+    }
+
+    /**
+     * Reads a constant pool index for the current instruction.
+     * @return the constant pool index
+     */
+    public char readCPI() {
+        if (opcode == Bytecodes.LDC) {
+            return (char) Bytes.beU1(code, curBCI + 1);
+        }
+        return (char) Bytes.beU2(code, curBCI + 1);
+    }
+
+    /**
+     * Reads a signed, 1-byte value for the current instruction (e.g. BIPUSH).
+     * @return the byte
+     */
+    public byte readByte() {
+        return code[curBCI + 1];
+    }
+
+    /**
+     * Reads a signed, 2-byte short for the current instruction (e.g. SIPUSH).
+     * @return the short value
+     */
+    public short readShort() {
+        return (short) Bytes.beS2(code, curBCI + 1);
+    }
+
+    /**
+     * Sets the bytecode index to the specified value.
+     * If {@code bci} is beyond the end of the array, {@link #currentBC} will return
+     * {@link Bytecodes#END} and other methods may throw {@link ArrayIndexOutOfBoundsException}.
+     * @param bci the new bytecode index
+     */
+    public void setBCI(int bci) {
+        curBCI = bci;
+        if (curBCI < code.length) {
+            opcode = Bytes.beU1(code, bci);
+            nextBCI = bci + lengthOf();
+        } else {
+            opcode = Bytecodes.END;
+            nextBCI = curBCI;
+        }
+    }
+
+    /**
+     * Gets the length of the current bytecode.
+     */
+    private int lengthOf() {
+        int length = Bytecodes.lengthOf(opcode);
+        if (length == 0) {
+            switch (opcode) {
+                case Bytecodes.TABLESWITCH: {
+                    return new BytecodeTableSwitch(this, curBCI).size();
+                }
+                case Bytecodes.LOOKUPSWITCH: {
+                    return new BytecodeLookupSwitch(this, curBCI).size();
+                }
+                case Bytecodes.WIDE: {
+                    int opc = Bytes.beU1(code, curBCI + 1);
+                    if (opc == Bytecodes.RET) {
+                        return 4;
+                    } else if (opc == Bytecodes.IINC) {
+                        return 6;
+                    } else {
+                        return 4; // a load or store bytecode
+                    }
+                }
+                default:
+                    throw new Error("unknown variable-length bytecode: " + opcode);
+            }
+        }
+        return length;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeSwitch.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java.bytecode;
+
+/**
+ * An abstract class that provides the state and methods common to {@link Bytecodes#LOOKUPSWITCH}
+ * and {@link Bytecodes#TABLESWITCH} instructions.
+ */
+public abstract class BytecodeSwitch {
+    /**
+     * The {@link BytecodeStream} containing the bytecode array.
+     */
+    protected final BytecodeStream stream;
+    /**
+     * Index of start of switch instruction.
+     */
+    protected final int bci;
+    /**
+     * Index of the start of the additional data for the switch instruction, aligned to a multiple of four from the method start.
+     */
+    protected final int alignedBci;
+
+    /**
+     * Constructor for a {@link BytecodeStream}.
+     * @param stream the {@code BytecodeStream} containing the switch instruction
+     * @param bci the index in the stream of the switch instruction
+     */
+    public BytecodeSwitch(BytecodeStream stream, int bci) {
+        this.stream = stream;
+        this.bci = bci;
+        this.alignedBci = (bci + 4) & 0xfffffffc;
+    }
+
+    /**
+     * Gets the current bytecode index.
+     * @return the current bytecode index
+     */
+    public int bci() {
+        return bci;
+    }
+
+    /**
+     * Gets the index of the instruction denoted by the {@code i}'th switch target.
+     * @param i index of the switch target
+     * @return the index of the instruction denoted by the {@code i}'th switch target
+     */
+    public int targetAt(int i) {
+        return bci + offsetAt(i);
+    }
+
+    /**
+     * Gets the index of the instruction for the default switch target.
+     * @return the index of the instruction for the default switch target
+     */
+    public int defaultTarget() {
+        return bci + defaultOffset();
+    }
+
+    /**
+     * Gets the offset from the start of the switch instruction to the default switch target.
+     * @return the offset to the default switch target
+     */
+    public abstract int defaultOffset();
+
+    /**
+     * Gets the key at {@code i}'th switch target index.
+     * @param i the switch target index
+     * @return the key at {@code i}'th switch target index
+     */
+    public abstract int keyAt(int i);
+
+    /**
+     * Gets the offset from the start of the switch instruction for the {@code i}'th switch target.
+     * @param i the switch target index
+     * @return the offset to the {@code i}'th switch target
+     */
+    public abstract int offsetAt(int i);
+
+    /**
+     * Gets the number of switch targets.
+     * @return the number of switch targets
+     */
+    public abstract int numberOfCases();
+
+    /**
+     * Gets the total size in bytes of the switch instruction.
+     * @return the total size in bytes of the switch instruction
+     */
+    public abstract int size();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/BytecodeTableSwitch.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java.bytecode;
+
+/**
+ * A utility for processing {@link Bytecodes#TABLESWITCH} bytecodes.
+ */
+public class BytecodeTableSwitch extends BytecodeSwitch {
+    private static final int OFFSET_TO_LOW_KEY = 4;
+    private static final int OFFSET_TO_HIGH_KEY = 8;
+    private static final int OFFSET_TO_FIRST_JUMP_OFFSET = 12;
+    private static final int JUMP_OFFSET_SIZE = 4;
+
+    /**
+     * Constructor for a {@link BytecodeStream}.
+     * @param stream the {@code BytecodeStream} containing the switch instruction
+     * @param bci the index in the stream of the switch instruction
+     */
+    public BytecodeTableSwitch(BytecodeStream stream, int bci) {
+        super(stream, bci);
+    }
+
+    /**
+     * Gets the low key of the table switch.
+     * @return the low key
+     */
+    public int lowKey() {
+        return stream.readInt(alignedBci + OFFSET_TO_LOW_KEY);
+    }
+
+    /**
+     * Gets the high key of the table switch.
+     * @return the high key
+     */
+    public int highKey() {
+        return stream.readInt(alignedBci + OFFSET_TO_HIGH_KEY);
+    }
+
+    @Override
+    public int keyAt(int i) {
+        return lowKey() + i;
+    }
+
+    @Override
+    public int defaultOffset() {
+        return stream.readInt(alignedBci);
+    }
+
+    @Override
+    public int offsetAt(int i) {
+        return stream.readInt(alignedBci + OFFSET_TO_FIRST_JUMP_OFFSET + JUMP_OFFSET_SIZE * i);
+    }
+
+    @Override
+    public int numberOfCases() {
+        return highKey() - lowKey() + 1;
+    }
+
+    @Override
+    public int size() {
+        return alignedBci + OFFSET_TO_FIRST_JUMP_OFFSET + JUMP_OFFSET_SIZE * numberOfCases() - bci;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/Bytecodes.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,940 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.java.bytecode;
+
+import static com.oracle.graal.java.bytecode.Bytecodes.Flags.*;
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.regex.*;
+
+/**
+ * The definitions of the bytecodes that are valid input to the compiler and
+ * related utility methods. This comprises two groups: the standard Java
+ * bytecodes defined by <a href=
+ * "http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html">
+ * Java Virtual Machine Specification</a>, and a set of <i>extended</i>
+ * bytecodes that support low-level programming, for example, memory barriers.
+ *
+ * The extended bytecodes are one or three bytes in size. The one-byte bytecodes
+ * follow the values in the standard set, with no gap. The three-byte extended
+ * bytecodes share a common first byte and carry additional instruction-specific
+ * information in the second and third bytes.
+ */
+public class Bytecodes {
+    public static final int NOP                  =   0; // 0x00
+    public static final int ACONST_NULL          =   1; // 0x01
+    public static final int ICONST_M1            =   2; // 0x02
+    public static final int ICONST_0             =   3; // 0x03
+    public static final int ICONST_1             =   4; // 0x04
+    public static final int ICONST_2             =   5; // 0x05
+    public static final int ICONST_3             =   6; // 0x06
+    public static final int ICONST_4             =   7; // 0x07
+    public static final int ICONST_5             =   8; // 0x08
+    public static final int LCONST_0             =   9; // 0x09
+    public static final int LCONST_1             =  10; // 0x0A
+    public static final int FCONST_0             =  11; // 0x0B
+    public static final int FCONST_1             =  12; // 0x0C
+    public static final int FCONST_2             =  13; // 0x0D
+    public static final int DCONST_0             =  14; // 0x0E
+    public static final int DCONST_1             =  15; // 0x0F
+    public static final int BIPUSH               =  16; // 0x10
+    public static final int SIPUSH               =  17; // 0x11
+    public static final int LDC                  =  18; // 0x12
+    public static final int LDC_W                =  19; // 0x13
+    public static final int LDC2_W               =  20; // 0x14
+    public static final int ILOAD                =  21; // 0x15
+    public static final int LLOAD                =  22; // 0x16
+    public static final int FLOAD                =  23; // 0x17
+    public static final int DLOAD                =  24; // 0x18
+    public static final int ALOAD                =  25; // 0x19
+    public static final int ILOAD_0              =  26; // 0x1A
+    public static final int ILOAD_1              =  27; // 0x1B
+    public static final int ILOAD_2              =  28; // 0x1C
+    public static final int ILOAD_3              =  29; // 0x1D
+    public static final int LLOAD_0              =  30; // 0x1E
+    public static final int LLOAD_1              =  31; // 0x1F
+    public static final int LLOAD_2              =  32; // 0x20
+    public static final int LLOAD_3              =  33; // 0x21
+    public static final int FLOAD_0              =  34; // 0x22
+    public static final int FLOAD_1              =  35; // 0x23
+    public static final int FLOAD_2              =  36; // 0x24
+    public static final int FLOAD_3              =  37; // 0x25
+    public static final int DLOAD_0              =  38; // 0x26
+    public static final int DLOAD_1              =  39; // 0x27
+    public static final int DLOAD_2              =  40; // 0x28
+    public static final int DLOAD_3              =  41; // 0x29
+    public static final int ALOAD_0              =  42; // 0x2A
+    public static final int ALOAD_1              =  43; // 0x2B
+    public static final int ALOAD_2              =  44; // 0x2C
+    public static final int ALOAD_3              =  45; // 0x2D
+    public static final int IALOAD               =  46; // 0x2E
+    public static final int LALOAD               =  47; // 0x2F
+    public static final int FALOAD               =  48; // 0x30
+    public static final int DALOAD               =  49; // 0x31
+    public static final int AALOAD               =  50; // 0x32
+    public static final int BALOAD               =  51; // 0x33
+    public static final int CALOAD               =  52; // 0x34
+    public static final int SALOAD               =  53; // 0x35
+    public static final int ISTORE               =  54; // 0x36
+    public static final int LSTORE               =  55; // 0x37
+    public static final int FSTORE               =  56; // 0x38
+    public static final int DSTORE               =  57; // 0x39
+    public static final int ASTORE               =  58; // 0x3A
+    public static final int ISTORE_0             =  59; // 0x3B
+    public static final int ISTORE_1             =  60; // 0x3C
+    public static final int ISTORE_2             =  61; // 0x3D
+    public static final int ISTORE_3             =  62; // 0x3E
+    public static final int LSTORE_0             =  63; // 0x3F
+    public static final int LSTORE_1             =  64; // 0x40
+    public static final int LSTORE_2             =  65; // 0x41
+    public static final int LSTORE_3             =  66; // 0x42
+    public static final int FSTORE_0             =  67; // 0x43
+    public static final int FSTORE_1             =  68; // 0x44
+    public static final int FSTORE_2             =  69; // 0x45
+    public static final int FSTORE_3             =  70; // 0x46
+    public static final int DSTORE_0             =  71; // 0x47
+    public static final int DSTORE_1             =  72; // 0x48
+    public static final int DSTORE_2             =  73; // 0x49
+    public static final int DSTORE_3             =  74; // 0x4A
+    public static final int ASTORE_0             =  75; // 0x4B
+    public static final int ASTORE_1             =  76; // 0x4C
+    public static final int ASTORE_2             =  77; // 0x4D
+    public static final int ASTORE_3             =  78; // 0x4E
+    public static final int IASTORE              =  79; // 0x4F
+    public static final int LASTORE              =  80; // 0x50
+    public static final int FASTORE              =  81; // 0x51
+    public static final int DASTORE              =  82; // 0x52
+    public static final int AASTORE              =  83; // 0x53
+    public static final int BASTORE              =  84; // 0x54
+    public static final int CASTORE              =  85; // 0x55
+    public static final int SASTORE              =  86; // 0x56
+    public static final int POP                  =  87; // 0x57
+    public static final int POP2                 =  88; // 0x58
+    public static final int DUP                  =  89; // 0x59
+    public static final int DUP_X1               =  90; // 0x5A
+    public static final int DUP_X2               =  91; // 0x5B
+    public static final int DUP2                 =  92; // 0x5C
+    public static final int DUP2_X1              =  93; // 0x5D
+    public static final int DUP2_X2              =  94; // 0x5E
+    public static final int SWAP                 =  95; // 0x5F
+    public static final int IADD                 =  96; // 0x60
+    public static final int LADD                 =  97; // 0x61
+    public static final int FADD                 =  98; // 0x62
+    public static final int DADD                 =  99; // 0x63
+    public static final int ISUB                 = 100; // 0x64
+    public static final int LSUB                 = 101; // 0x65
+    public static final int FSUB                 = 102; // 0x66
+    public static final int DSUB                 = 103; // 0x67
+    public static final int IMUL                 = 104; // 0x68
+    public static final int LMUL                 = 105; // 0x69
+    public static final int FMUL                 = 106; // 0x6A
+    public static final int DMUL                 = 107; // 0x6B
+    public static final int IDIV                 = 108; // 0x6C
+    public static final int LDIV                 = 109; // 0x6D
+    public static final int FDIV                 = 110; // 0x6E
+    public static final int DDIV                 = 111; // 0x6F
+    public static final int IREM                 = 112; // 0x70
+    public static final int LREM                 = 113; // 0x71
+    public static final int FREM                 = 114; // 0x72
+    public static final int DREM                 = 115; // 0x73
+    public static final int INEG                 = 116; // 0x74
+    public static final int LNEG                 = 117; // 0x75
+    public static final int FNEG                 = 118; // 0x76
+    public static final int DNEG                 = 119; // 0x77
+    public static final int ISHL                 = 120; // 0x78
+    public static final int LSHL                 = 121; // 0x79
+    public static final int ISHR                 = 122; // 0x7A
+    public static final int LSHR                 = 123; // 0x7B
+    public static final int IUSHR                = 124; // 0x7C
+    public static final int LUSHR                = 125; // 0x7D
+    public static final int IAND                 = 126; // 0x7E
+    public static final int LAND                 = 127; // 0x7F
+    public static final int IOR                  = 128; // 0x80
+    public static final int LOR                  = 129; // 0x81
+    public static final int IXOR                 = 130; // 0x82
+    public static final int LXOR                 = 131; // 0x83
+    public static final int IINC                 = 132; // 0x84
+    public static final int I2L                  = 133; // 0x85
+    public static final int I2F                  = 134; // 0x86
+    public static final int I2D                  = 135; // 0x87
+    public static final int L2I                  = 136; // 0x88
+    public static final int L2F                  = 137; // 0x89
+    public static final int L2D                  = 138; // 0x8A
+    public static final int F2I                  = 139; // 0x8B
+    public static final int F2L                  = 140; // 0x8C
+    public static final int F2D                  = 141; // 0x8D
+    public static final int D2I                  = 142; // 0x8E
+    public static final int D2L                  = 143; // 0x8F
+    public static final int D2F                  = 144; // 0x90
+    public static final int I2B                  = 145; // 0x91
+    public static final int I2C                  = 146; // 0x92
+    public static final int I2S                  = 147; // 0x93
+    public static final int LCMP                 = 148; // 0x94
+    public static final int FCMPL                = 149; // 0x95
+    public static final int FCMPG                = 150; // 0x96
+    public static final int DCMPL                = 151; // 0x97
+    public static final int DCMPG                = 152; // 0x98
+    public static final int IFEQ                 = 153; // 0x99
+    public static final int IFNE                 = 154; // 0x9A
+    public static final int IFLT                 = 155; // 0x9B
+    public static final int IFGE                 = 156; // 0x9C
+    public static final int IFGT                 = 157; // 0x9D
+    public static final int IFLE                 = 158; // 0x9E
+    public static final int IF_ICMPEQ            = 159; // 0x9F
+    public static final int IF_ICMPNE            = 160; // 0xA0
+    public static final int IF_ICMPLT            = 161; // 0xA1
+    public static final int IF_ICMPGE            = 162; // 0xA2
+    public static final int IF_ICMPGT            = 163; // 0xA3
+    public static final int IF_ICMPLE            = 164; // 0xA4
+    public static final int IF_ACMPEQ            = 165; // 0xA5
+    public static final int IF_ACMPNE            = 166; // 0xA6
+    public static final int GOTO                 = 167; // 0xA7
+    public static final int JSR                  = 168; // 0xA8
+    public static final int RET                  = 169; // 0xA9
+    public static final int TABLESWITCH          = 170; // 0xAA
+    public static final int LOOKUPSWITCH         = 171; // 0xAB
+    public static final int IRETURN              = 172; // 0xAC
+    public static final int LRETURN              = 173; // 0xAD
+    public static final int FRETURN              = 174; // 0xAE
+    public static final int DRETURN              = 175; // 0xAF
+    public static final int ARETURN              = 176; // 0xB0
+    public static final int RETURN               = 177; // 0xB1
+    public static final int GETSTATIC            = 178; // 0xB2
+    public static final int PUTSTATIC            = 179; // 0xB3
+    public static final int GETFIELD             = 180; // 0xB4
+    public static final int PUTFIELD             = 181; // 0xB5
+    public static final int INVOKEVIRTUAL        = 182; // 0xB6
+    public static final int INVOKESPECIAL        = 183; // 0xB7
+    public static final int INVOKESTATIC         = 184; // 0xB8
+    public static final int INVOKEINTERFACE      = 185; // 0xB9
+    public static final int XXXUNUSEDXXX         = 186; // 0xBA
+    public static final int NEW                  = 187; // 0xBB
+    public static final int NEWARRAY             = 188; // 0xBC
+    public static final int ANEWARRAY            = 189; // 0xBD
+    public static final int ARRAYLENGTH          = 190; // 0xBE
+    public static final int ATHROW               = 191; // 0xBF
+    public static final int CHECKCAST            = 192; // 0xC0
+    public static final int INSTANCEOF           = 193; // 0xC1
+    public static final int MONITORENTER         = 194; // 0xC2
+    public static final int MONITOREXIT          = 195; // 0xC3
+    public static final int WIDE                 = 196; // 0xC4
+    public static final int MULTIANEWARRAY       = 197; // 0xC5
+    public static final int IFNULL               = 198; // 0xC6
+    public static final int IFNONNULL            = 199; // 0xC7
+    public static final int GOTO_W               = 200; // 0xC8
+    public static final int JSR_W                = 201; // 0xC9
+    public static final int BREAKPOINT           = 202; // 0xCA
+
+    public static final int ILLEGAL = 255;
+    public static final int END = 256;
+
+    /**
+     * The last opcode defined by the JVM specification. To iterate over all JVM bytecodes:
+     * <pre>
+     *     for (int opcode = 0; opcode <= Bytecodes.LAST_JVM_OPCODE; ++opcode) {
+     *         //
+     *     }
+     * </pre>
+     */
+    public static final int LAST_JVM_OPCODE = JSR_W;
+
+    /**
+     * A collection of flags describing various bytecode attributes.
+     */
+    static class Flags {
+
+        /**
+         * Denotes an instruction that ends a basic block and does not let control flow fall through to its lexical successor.
+         */
+        static final int STOP = 0x00000001;
+
+        /**
+         * Denotes an instruction that ends a basic block and may let control flow fall through to its lexical successor.
+         * In practice this means it is a conditional branch.
+         */
+        static final int FALL_THROUGH = 0x00000002;
+
+        /**
+         * Denotes an instruction that has a 2 or 4 byte operand that is an offset to another instruction in the same method.
+         * This does not include the {@link Bytecodes#TABLESWITCH} or {@link Bytecodes#LOOKUPSWITCH} instructions.
+         */
+        static final int BRANCH = 0x00000004;
+
+        /**
+         * Denotes an instruction that reads the value of a static or instance field.
+         */
+        static final int FIELD_READ = 0x00000008;
+
+        /**
+         * Denotes an instruction that writes the value of a static or instance field.
+         */
+        static final int FIELD_WRITE = 0x00000010;
+
+        /**
+         * Denotes an instruction that is not defined in the JVM specification.
+         */
+        static final int EXTENSION = 0x00000020;
+
+        /**
+         * Denotes an instruction that can cause a trap.
+         */
+        static final int TRAP        = 0x00000080;
+        /**
+         * Denotes an instruction that is commutative.
+         */
+        static final int COMMUTATIVE = 0x00000100;
+        /**
+         * Denotes an instruction that is associative.
+         */
+        static final int ASSOCIATIVE = 0x00000200;
+        /**
+         * Denotes an instruction that loads an operand.
+         */
+        static final int LOAD        = 0x00000400;
+        /**
+         * Denotes an instruction that stores an operand.
+         */
+        static final int STORE       = 0x00000800;
+        /**
+         * Denotes the 4 INVOKE* instructions.
+         */
+        static final int INVOKE       = 0x00001000;
+    }
+
+    // Performs a sanity check that none of the flags overlap.
+    static {
+        int allFlags = 0;
+        try {
+            for (Field field : Flags.class.getDeclaredFields()) {
+                int flagsFilter = Modifier.FINAL | Modifier.STATIC;
+                if ((field.getModifiers() & flagsFilter) == flagsFilter && !field.isSynthetic()) {
+                    assert field.getType() == int.class : "Field is not int : " + field;
+                    final int flag = field.getInt(null);
+                    assert flag != 0;
+                    assert (flag & allFlags) == 0 : field.getName() + " has a value conflicting with another flag";
+                    allFlags |= flag;
+                }
+            }
+        } catch (Exception e) {
+            throw new InternalError(e.toString());
+        }
+    }
+
+    /**
+     * An array that maps from a bytecode value to a {@link String} for the corresponding instruction mnemonic.
+     * This will include the root instruction for the three-byte extended instructions.
+     */
+    private static final String[] nameArray = new String[256];
+
+    /**
+     * An array that maps from a bytecode value to the set of {@link Flags} for the corresponding instruction.
+     */
+    private static final int[] flagsArray = new int[256];
+
+    /**
+     * An array that maps from a bytecode value to the length in bytes for the corresponding instruction.
+     */
+    private static final int[] lengthArray = new int[256];
+
+    /**
+     * An array that maps from a bytecode value to the estimated complexity of the bytecode in terms of generated machine code.
+     */
+    private static final int[] compilationComplexityArray = new int[256];
+
+    // Checkstyle: stop
+    static {
+        def(NOP                 , "nop"             , "b"    , 0);
+        def(ACONST_NULL         , "aconst_null"     , "b"    , 0);
+        def(ICONST_M1           , "iconst_m1"       , "b"    , 0);
+        def(ICONST_0            , "iconst_0"        , "b"    , 0);
+        def(ICONST_1            , "iconst_1"        , "b"    , 0);
+        def(ICONST_2            , "iconst_2"        , "b"    , 0);
+        def(ICONST_3            , "iconst_3"        , "b"    , 0);
+        def(ICONST_4            , "iconst_4"        , "b"    , 0);
+        def(ICONST_5            , "iconst_5"        , "b"    , 0);
+        def(LCONST_0            , "lconst_0"        , "b"    , 0);
+        def(LCONST_1            , "lconst_1"        , "b"    , 0);
+        def(FCONST_0            , "fconst_0"        , "b"    , 0);
+        def(FCONST_1            , "fconst_1"        , "b"    , 0);
+        def(FCONST_2            , "fconst_2"        , "b"    , 0);
+        def(DCONST_0            , "dconst_0"        , "b"    , 0);
+        def(DCONST_1            , "dconst_1"        , "b"    , 0);
+        def(BIPUSH              , "bipush"          , "bc"   , 0);
+        def(SIPUSH              , "sipush"          , "bcc"  , 0);
+        def(LDC                 , "ldc"             , "bi"   , 0, TRAP);
+        def(LDC_W               , "ldc_w"           , "bii"  , 0, TRAP);
+        def(LDC2_W              , "ldc2_w"          , "bii"  , 0, TRAP);
+        def(ILOAD               , "iload"           , "bi"   , 0, LOAD);
+        def(LLOAD               , "lload"           , "bi"   , 0, LOAD);
+        def(FLOAD               , "fload"           , "bi"   , 0, LOAD);
+        def(DLOAD               , "dload"           , "bi"   , 0, LOAD);
+        def(ALOAD               , "aload"           , "bi"   , 0, LOAD);
+        def(ILOAD_0             , "iload_0"         , "b"    , 0, LOAD);
+        def(ILOAD_1             , "iload_1"         , "b"    , 0, LOAD);
+        def(ILOAD_2             , "iload_2"         , "b"    , 0, LOAD);
+        def(ILOAD_3             , "iload_3"         , "b"    , 0, LOAD);
+        def(LLOAD_0             , "lload_0"         , "b"    , 0, LOAD);
+        def(LLOAD_1             , "lload_1"         , "b"    , 0, LOAD);
+        def(LLOAD_2             , "lload_2"         , "b"    , 0, LOAD);
+        def(LLOAD_3             , "lload_3"         , "b"    , 0, LOAD);
+        def(FLOAD_0             , "fload_0"         , "b"    , 0, LOAD);
+        def(FLOAD_1             , "fload_1"         , "b"    , 0, LOAD);
+        def(FLOAD_2             , "fload_2"         , "b"    , 0, LOAD);
+        def(FLOAD_3             , "fload_3"         , "b"    , 0, LOAD);
+        def(DLOAD_0             , "dload_0"         , "b"    , 0, LOAD);
+        def(DLOAD_1             , "dload_1"         , "b"    , 0, LOAD);
+        def(DLOAD_2             , "dload_2"         , "b"    , 0, LOAD);
+        def(DLOAD_3             , "dload_3"         , "b"    , 0, LOAD);
+        def(ALOAD_0             , "aload_0"         , "b"    , 0, LOAD);
+        def(ALOAD_1             , "aload_1"         , "b"    , 0, LOAD);
+        def(ALOAD_2             , "aload_2"         , "b"    , 0, LOAD);
+        def(ALOAD_3             , "aload_3"         , "b"    , 0, LOAD);
+        def(IALOAD              , "iaload"          , "b"    , 0, TRAP);
+        def(LALOAD              , "laload"          , "b"    , 0, TRAP);
+        def(FALOAD              , "faload"          , "b"    , 0, TRAP);
+        def(DALOAD              , "daload"          , "b"    , 0, TRAP);
+        def(AALOAD              , "aaload"          , "b"    , 0, TRAP);
+        def(BALOAD              , "baload"          , "b"    , 0, TRAP);
+        def(CALOAD              , "caload"          , "b"    , 0, TRAP);
+        def(SALOAD              , "saload"          , "b"    , 0, TRAP);
+        def(ISTORE              , "istore"          , "bi"   , 0, STORE);
+        def(LSTORE              , "lstore"          , "bi"   , 0, STORE);
+        def(FSTORE              , "fstore"          , "bi"   , 0, STORE);
+        def(DSTORE              , "dstore"          , "bi"   , 0, STORE);
+        def(ASTORE              , "astore"          , "bi"   , 0, STORE);
+        def(ISTORE_0            , "istore_0"        , "b"    , 0, STORE);
+        def(ISTORE_1            , "istore_1"        , "b"    , 0, STORE);
+        def(ISTORE_2            , "istore_2"        , "b"    , 0, STORE);
+        def(ISTORE_3            , "istore_3"        , "b"    , 0, STORE);
+        def(LSTORE_0            , "lstore_0"        , "b"    , 0, STORE);
+        def(LSTORE_1            , "lstore_1"        , "b"    , 0, STORE);
+        def(LSTORE_2            , "lstore_2"        , "b"    , 0, STORE);
+        def(LSTORE_3            , "lstore_3"        , "b"    , 0, STORE);
+        def(FSTORE_0            , "fstore_0"        , "b"    , 0, STORE);
+        def(FSTORE_1            , "fstore_1"        , "b"    , 0, STORE);
+        def(FSTORE_2            , "fstore_2"        , "b"    , 0, STORE);
+        def(FSTORE_3            , "fstore_3"        , "b"    , 0, STORE);
+        def(DSTORE_0            , "dstore_0"        , "b"    , 0, STORE);
+        def(DSTORE_1            , "dstore_1"        , "b"    , 0, STORE);
+        def(DSTORE_2            , "dstore_2"        , "b"    , 0, STORE);
+        def(DSTORE_3            , "dstore_3"        , "b"    , 0, STORE);
+        def(ASTORE_0            , "astore_0"        , "b"    , 0, STORE);
+        def(ASTORE_1            , "astore_1"        , "b"    , 0, STORE);
+        def(ASTORE_2            , "astore_2"        , "b"    , 0, STORE);
+        def(ASTORE_3            , "astore_3"        , "b"    , 0, STORE);
+        def(IASTORE             , "iastore"         , "b"    , 3, TRAP);
+        def(LASTORE             , "lastore"         , "b"    , 3, TRAP);
+        def(FASTORE             , "fastore"         , "b"    , 3, TRAP);
+        def(DASTORE             , "dastore"         , "b"    , 3, TRAP);
+        def(AASTORE             , "aastore"         , "b"    , 4, TRAP);
+        def(BASTORE             , "bastore"         , "b"    , 3, TRAP);
+        def(CASTORE             , "castore"         , "b"    , 3, TRAP);
+        def(SASTORE             , "sastore"         , "b"    , 3, TRAP);
+        def(POP                 , "pop"             , "b"    , 0);
+        def(POP2                , "pop2"            , "b"    , 0);
+        def(DUP                 , "dup"             , "b"    , 0);
+        def(DUP_X1              , "dup_x1"          , "b"    , 0);
+        def(DUP_X2              , "dup_x2"          , "b"    , 0);
+        def(DUP2                , "dup2"            , "b"    , 0);
+        def(DUP2_X1             , "dup2_x1"         , "b"    , 0);
+        def(DUP2_X2             , "dup2_x2"         , "b"    , 0);
+        def(SWAP                , "swap"            , "b"    , 0);
+        def(IADD                , "iadd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(LADD                , "ladd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(FADD                , "fadd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(DADD                , "dadd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(ISUB                , "isub"            , "b"    , 1);
+        def(LSUB                , "lsub"            , "b"    , 1);
+        def(FSUB                , "fsub"            , "b"    , 1);
+        def(DSUB                , "dsub"            , "b"    , 1);
+        def(IMUL                , "imul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(LMUL                , "lmul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(FMUL                , "fmul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(DMUL                , "dmul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(IDIV                , "idiv"            , "b"    , 1, TRAP);
+        def(LDIV                , "ldiv"            , "b"    , 1, TRAP);
+        def(FDIV                , "fdiv"            , "b"    , 1);
+        def(DDIV                , "ddiv"            , "b"    , 1);
+        def(IREM                , "irem"            , "b"    , 1, TRAP);
+        def(LREM                , "lrem"            , "b"    , 1, TRAP);
+        def(FREM                , "frem"            , "b"    , 1);
+        def(DREM                , "drem"            , "b"    , 1);
+        def(INEG                , "ineg"            , "b"    , 1);
+        def(LNEG                , "lneg"            , "b"    , 1);
+        def(FNEG                , "fneg"            , "b"    , 1);
+        def(DNEG                , "dneg"            , "b"    , 1);
+        def(ISHL                , "ishl"            , "b"    , 1);
+        def(LSHL                , "lshl"            , "b"    , 1);
+        def(ISHR                , "ishr"            , "b"    , 1);
+        def(LSHR                , "lshr"            , "b"    , 1);
+        def(IUSHR               , "iushr"           , "b"    , 1);
+        def(LUSHR               , "lushr"           , "b"    , 1);
+        def(IAND                , "iand"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(LAND                , "land"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(IOR                 , "ior"             , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(LOR                 , "lor"             , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(IXOR                , "ixor"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(LXOR                , "lxor"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
+        def(IINC                , "iinc"            , "bic"  , 1, LOAD | STORE);
+        def(I2L                 , "i2l"             , "b"    , 1);
+        def(I2F                 , "i2f"             , "b"    , 1);
+        def(I2D                 , "i2d"             , "b"    , 1);
+        def(L2I                 , "l2i"             , "b"    , 1);
+        def(L2F                 , "l2f"             , "b"    , 1);
+        def(L2D                 , "l2d"             , "b"    , 1);
+        def(F2I                 , "f2i"             , "b"    , 1);
+        def(F2L                 , "f2l"             , "b"    , 1);
+        def(F2D                 , "f2d"             , "b"    , 1);
+        def(D2I                 , "d2i"             , "b"    , 1);
+        def(D2L                 , "d2l"             , "b"    , 1);
+        def(D2F                 , "d2f"             , "b"    , 1);
+        def(I2B                 , "i2b"             , "b"    , 1);
+        def(I2C                 , "i2c"             , "b"    , 1);
+        def(I2S                 , "i2s"             , "b"    , 1);
+        def(LCMP                , "lcmp"            , "b"    , 1);
+        def(FCMPL               , "fcmpl"           , "b"    , 1);
+        def(FCMPG               , "fcmpg"           , "b"    , 1);
+        def(DCMPL               , "dcmpl"           , "b"    , 1);
+        def(DCMPG               , "dcmpg"           , "b"    , 1);
+        def(IFEQ                , "ifeq"            , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IFNE                , "ifne"            , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IFLT                , "iflt"            , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IFGE                , "ifge"            , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IFGT                , "ifgt"            , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IFLE                , "ifle"            , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IF_ICMPEQ           , "if_icmpeq"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
+        def(IF_ICMPNE           , "if_icmpne"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
+        def(IF_ICMPLT           , "if_icmplt"       , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IF_ICMPGE           , "if_icmpge"       , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IF_ICMPGT           , "if_icmpgt"       , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IF_ICMPLE           , "if_icmple"       , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IF_ACMPEQ           , "if_acmpeq"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
+        def(IF_ACMPNE           , "if_acmpne"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
+        def(GOTO                , "goto"            , "boo"  , 1, STOP | BRANCH);
+        def(JSR                 , "jsr"             , "boo"  , 0, STOP | BRANCH);
+        def(RET                 , "ret"             , "bi"   , 0, STOP);
+        def(TABLESWITCH         , "tableswitch"     , ""     , 4, STOP);
+        def(LOOKUPSWITCH        , "lookupswitch"    , ""     , 4, STOP);
+        def(IRETURN             , "ireturn"         , "b"    , 1, TRAP | STOP);
+        def(LRETURN             , "lreturn"         , "b"    , 1, TRAP | STOP);
+        def(FRETURN             , "freturn"         , "b"    , 1, TRAP | STOP);
+        def(DRETURN             , "dreturn"         , "b"    , 1, TRAP | STOP);
+        def(ARETURN             , "areturn"         , "b"    , 1, TRAP | STOP);
+        def(RETURN              , "return"          , "b"    , 1, TRAP | STOP);
+        def(GETSTATIC           , "getstatic"       , "bjj"  , 2, TRAP | FIELD_READ);
+        def(PUTSTATIC           , "putstatic"       , "bjj"  , 2, TRAP | FIELD_WRITE);
+        def(GETFIELD            , "getfield"        , "bjj"  , 2, TRAP | FIELD_READ);
+        def(PUTFIELD            , "putfield"        , "bjj"  , 2, TRAP | FIELD_WRITE);
+        def(INVOKEVIRTUAL       , "invokevirtual"   , "bjj"  , 7, TRAP | INVOKE);
+        def(INVOKESPECIAL       , "invokespecial"   , "bjj"  , 5, TRAP | INVOKE);
+        def(INVOKESTATIC        , "invokestatic"    , "bjj"  , 5, TRAP | INVOKE);
+        def(INVOKEINTERFACE     , "invokeinterface" , "bjja_", 7, TRAP | INVOKE);
+        def(XXXUNUSEDXXX        , "xxxunusedxxx"    , ""     , 0);
+        def(NEW                 , "new"             , "bii"  , 6, TRAP);
+        def(NEWARRAY            , "newarray"        , "bc"   , 6, TRAP);
+        def(ANEWARRAY           , "anewarray"       , "bii"  , 6, TRAP);
+        def(ARRAYLENGTH         , "arraylength"     , "b"    , 2, TRAP);
+        def(ATHROW              , "athrow"          , "b"    , 5, TRAP | STOP);
+        def(CHECKCAST           , "checkcast"       , "bii"  , 3, TRAP);
+        def(INSTANCEOF          , "instanceof"      , "bii"  , 4, TRAP);
+        def(MONITORENTER        , "monitorenter"    , "b"    , 5, TRAP);
+        def(MONITOREXIT         , "monitorexit"     , "b"    , 5, TRAP);
+        def(WIDE                , "wide"            , ""     , 0);
+        def(MULTIANEWARRAY      , "multianewarray"  , "biic" , 6, TRAP);
+        def(IFNULL              , "ifnull"          , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(IFNONNULL           , "ifnonnull"       , "boo"  , 2, FALL_THROUGH | BRANCH);
+        def(GOTO_W              , "goto_w"          , "boooo", 1, STOP | BRANCH);
+        def(JSR_W               , "jsr_w"           , "boooo", 0, STOP | BRANCH);
+        def(BREAKPOINT          , "breakpoint"      , "b"    , 0, TRAP);
+    }
+    // Checkstyle: resume
+
+    /**
+     * Determines if an opcode is commutative.
+     * @param opcode the opcode to check
+     * @return {@code true} iff commutative
+     */
+    public static boolean isCommutative(int opcode) {
+        return (flagsArray[opcode & 0xff] & COMMUTATIVE) != 0;
+    }
+
+    /**
+     * Gets the length of an instruction denoted by a given opcode.
+     *
+     * @param opcode an instruction opcode
+     * @return the length of the instruction denoted by {@code opcode}. If {@code opcode} is an illegal instruction or denotes a
+     *         variable length instruction (e.g. {@link #TABLESWITCH}), then 0 is returned.
+     */
+    public static int lengthOf(int opcode) {
+        return lengthArray[opcode & 0xff];
+    }
+
+    /**
+     * Gets the compilation complexity for a given opcode.
+     * @param opcode an opcode
+     * @return a value >= 0
+     */
+    public static int compilationComplexity(int opcode) {
+        return compilationComplexityArray[opcode & 0xff];
+    }
+
+    /**
+     * Gets the lower-case mnemonic for a given opcode.
+     *
+     * @param opcode an opcode
+     * @return the mnemonic for {@code opcode} or {@code "<illegal opcode: " + opcode + ">"} if {@code opcode} is not a legal opcode
+     */
+    public static String nameOf(int opcode) throws IllegalArgumentException {
+        String name = nameArray[opcode & 0xff];
+        if (name == null) {
+            return "<illegal opcode: " + opcode + ">";
+        }
+        return name;
+    }
+
+    /**
+     * Allocation-free version of {@linkplain #nameOf(int)}.
+     * @param opcode an opcode.
+     * @return the mnemonic for {@code opcode} or {@code "<illegal opcode>"} if {@code opcode} is not a legal opcode.
+     */
+    public static String baseNameOf(int opcode) {
+        String name = nameArray[opcode & 0xff];
+        if (name == null) {
+            return "<illegal opcode>";
+        }
+        return name;
+    }
+
+    /**
+     * Gets the opcode corresponding to a given mnemonic.
+     *
+     * @param name an opcode mnemonic
+     * @return the opcode corresponding to {@code mnemonic}
+     * @throws IllegalArgumentException if {@code name} does not denote a valid opcode
+     */
+    public static int valueOf(String name) {
+        for (int opcode = 0; opcode < nameArray.length; ++opcode) {
+            if (name.equalsIgnoreCase(nameArray[opcode])) {
+                return opcode;
+            }
+        }
+        throw new IllegalArgumentException("No opcode for " + name);
+    }
+
+    /**
+     * Determines if a given opcode denotes an instruction that can cause an implicit exception.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} can cause an implicit exception, {@code false} otherwise
+     */
+    public static boolean canTrap(int opcode) {
+        return (flagsArray[opcode & 0xff] & TRAP) != 0;
+    }
+
+    /**
+     * Determines if a given opcode denotes an instruction that loads a local variable to the operand stack.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} loads a local variable to the operand stack, {@code false} otherwise
+     */
+    public static boolean isLoad(int opcode) {
+        return (flagsArray[opcode & 0xff] & LOAD) != 0;
+    }
+
+    /**
+     * Determines if a given opcode denotes an instruction that ends a basic block and does not let control flow fall
+     * through to its lexical successor.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} properly ends a basic block
+     */
+    public static boolean isStop(int opcode) {
+        return (flagsArray[opcode & 0xff] & STOP) != 0;
+    }
+
+    /**
+     * Determines if a given opcode denotes an instruction that stores a value to a local variable
+     * after popping it from the operand stack.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} stores a value to a local variable, {@code false} otherwise
+     */
+    public static boolean isInvoke(int opcode) {
+        return (flagsArray[opcode & 0xff] & INVOKE) != 0;
+    }
+
+    /**
+     * Determines if a given opcode denotes an instruction that stores a value to a local variable
+     * after popping it from the operand stack.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} stores a value to a local variable, {@code false} otherwise
+     */
+    public static boolean isStore(int opcode) {
+        return (flagsArray[opcode & 0xff] & STORE) != 0;
+    }
+
+    /**
+     * Determines if a given opcode is an instruction that delimits a basic block.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} delimits a basic block
+     */
+    public static boolean isBlockEnd(int opcode) {
+        return (flagsArray[opcode & 0xff] & (STOP | FALL_THROUGH)) != 0;
+    }
+
+    /**
+     * Determines if a given opcode is an instruction that has a 2 or 4 byte operand that is an offset to another
+     * instruction in the same method. This does not include the {@linkplain #TABLESWITCH switch} instructions.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} is a branch instruction with a single operand
+     */
+    public static boolean isBranch(int opcode) {
+        return (flagsArray[opcode & 0xff] & BRANCH) != 0;
+    }
+
+    /**
+     * Determines if a given opcode denotes a conditional branch.
+     * @param opcode
+     * @return {@code true} iff {@code opcode} is a conditional branch
+     */
+    public static boolean isConditionalBranch(int opcode) {
+        return (flagsArray[opcode & 0xff] & FALL_THROUGH) != 0;
+    }
+
+    /**
+     * Determines if a given opcode denotes a standard bytecode. A standard bytecode is
+     * defined in the JVM specification.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} iff {@code opcode} is a standard bytecode
+     */
+    public static boolean isStandard(int opcode) {
+        return (flagsArray[opcode & 0xff] & EXTENSION) == 0;
+    }
+
+    /**
+     * Determines if a given opcode denotes an extended bytecode.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} if {@code opcode} is an extended bytecode
+     */
+    public static boolean isExtended(int opcode) {
+        return (flagsArray[opcode & 0xff] & EXTENSION) != 0;
+    }
+
+    /**
+     * Determines if a given opcode is a three-byte extended bytecode.
+     *
+     * @param opcode an opcode to test
+     * @return {@code true} if {@code (opcode & ~0xff) != 0}
+     */
+    public static boolean isThreeByteExtended(int opcode) {
+        return (opcode & ~0xff) != 0;
+    }
+
+    /**
+     * Gets the arithmetic operator name for a given opcode. If {@code opcode} does not denote an
+     * arithmetic instruction, then the {@linkplain #nameOf(int) name} of the opcode is returned
+     * instead.
+     *
+     * @param op an opcode
+     * @return the arithmetic operator name
+     */
+    public static String operator(int op) {
+        // Checkstyle: stop
+        switch (op) {
+            // arithmetic ops
+            case IADD : // fall through
+            case LADD : // fall through
+            case FADD : // fall through
+            case DADD : return "+";
+            case ISUB : // fall through
+            case LSUB : // fall through
+            case FSUB : // fall through
+            case DSUB : return "-";
+            case IMUL : // fall through
+            case LMUL : // fall through
+            case FMUL : // fall through
+            case DMUL : return "*";
+            case IDIV : // fall through
+            case LDIV : // fall through
+            case FDIV : // fall through
+            case DDIV : return "/";
+            case IREM : // fall through
+            case LREM : // fall through
+            case FREM : // fall through
+            case DREM : return "%";
+            // shift ops
+            case ISHL : // fall through
+            case LSHL : return "<<";
+            case ISHR : // fall through
+            case LSHR : return ">>";
+            case IUSHR: // fall through
+            case LUSHR: return ">>>";
+            // logic ops
+            case IAND : // fall through
+            case LAND : return "&";
+            case IOR  : // fall through
+            case LOR  : return "|";
+            case IXOR : // fall through
+            case LXOR : return "^";
+        }
+        // Checkstyle: resume
+        return nameOf(op);
+    }
+
+    /**
+     * Defines a bytecode by entering it into the arrays that record its name, length and flags.
+     *
+     * @param name instruction name (should be lower case)
+     * @param format encodes the length of the instruction
+     * @param flagsArray the set of {@link Flags} associated with the instruction
+     */
+    private static void def(int opcode, String name, String format, int compilationComplexity) {
+        def(opcode, name, format, compilationComplexity, 0);
+    }
+
+    /**
+     * Defines a bytecode by entering it into the arrays that record its name, length and flags.
+     *
+     * @param name instruction name (lower case)
+     * @param format encodes the length of the instruction
+     * @param flags the set of {@link Flags} associated with the instruction
+     */
+    private static void def(int opcode, String name, String format, int compilationComplexity, int flags) {
+        assert nameArray[opcode] == null : "opcode " + opcode + " is already bound to name " + nameArray[opcode];
+        nameArray[opcode] = name;
+        int instructionLength = format.length();
+        lengthArray[opcode] = instructionLength;
+        compilationComplexityArray[opcode] = compilationComplexity;
+        Bytecodes.flagsArray[opcode] = flags;
+
+        assert !isConditionalBranch(opcode) || isBranch(opcode) : "a conditional branch must also be a branch";
+    }
+
+    /**
+     * Utility for ensuring that the extended opcodes are contiguous and follow on directly
+     * from the standard JVM opcodes. If these conditions do not hold for the input source
+     * file, then it is modified 'in situ' to fix the problem.
+     *
+     * @param args {@code args[0]} is the path to this source file
+     */
+    public static void main(String[] args) throws Exception {
+        Method findWorkspaceDirectory = Class.forName("com.sun.max.ide.JavaProject").getDeclaredMethod("findWorkspaceDirectory");
+        File base = new File((File) findWorkspaceDirectory.invoke(null), "com.oracle.max.cri/src");
+        File file = new File(base, Bytecodes.class.getName().replace('.', File.separatorChar) + ".java").getAbsoluteFile();
+
+        Pattern opcodeDecl = Pattern.compile("(\\s*public static final int )(\\w+)(\\s*=\\s*)(\\d+)(;.*)");
+
+        BufferedReader br = new BufferedReader(new FileReader(file));
+        CharArrayWriter buffer = new CharArrayWriter((int) file.length());
+        PrintWriter out = new PrintWriter(buffer);
+        String line;
+        int lastExtendedOpcode = BREAKPOINT;
+        boolean modified = false;
+        int section = 0;
+        while ((line = br.readLine()) != null) {
+            if (section == 0) {
+                if (line.equals("    // Start extended bytecodes")) {
+                    section = 1;
+                }
+            } else if (section == 1) {
+                if (line.equals("    // End extended bytecodes")) {
+                    section = 2;
+                } else {
+                    Matcher matcher = opcodeDecl.matcher(line);
+                    if (matcher.matches()) {
+                        String name = matcher.group(2);
+                        String value = matcher.group(4);
+                        int opcode = Integer.parseInt(value);
+                        if (nameArray[opcode] == null || !nameArray[opcode].equalsIgnoreCase(name)) {
+                            throw new RuntimeException("Missing definition of name and flags for " + opcode + ":" + name + " -- " + nameArray[opcode]);
+                        }
+                        if (opcode != lastExtendedOpcode + 1) {
+                            System.err.println("Fixed declaration of opcode " + name + " to be " + (lastExtendedOpcode + 1) + " (was " + value + ")");
+                            opcode = lastExtendedOpcode + 1;
+                            line = line.substring(0, matcher.start(4)) + opcode + line.substring(matcher.end(4));
+                            modified = true;
+                        }
+
+                        if (opcode >= 256) {
+                            throw new RuntimeException("Exceeded maximum opcode value with " + name);
+                        }
+
+                        lastExtendedOpcode = opcode;
+                    }
+                }
+            }
+
+            out.println(line);
+        }
+        if (section == 0) {
+            throw new RuntimeException("Did not find line starting extended bytecode declarations:\n\n    // Start extended bytecodes");
+        } else if (section == 1) {
+            throw new RuntimeException("Did not find line ending extended bytecode declarations:\n\n    // End extended bytecodes");
+        }
+
+        if (modified) {
+            out.flush();
+            FileWriter fileWriter = new FileWriter(file);
+            fileWriter.write(buffer.toCharArray());
+            fileWriter.close();
+
+            System.out.println("Modified: " + file);
+        }
+
+
+        // Uncomment to print out visitor method declarations:
+//        for (int opcode = 0; opcode < flags.length; ++opcode) {
+//            if (isExtension(opcode)) {
+//                String visitorParams = length(opcode) == 1 ? "" : "int index";
+//                System.out.println("@Override");
+//                System.out.println("protected void " + name(opcode) + "(" + visitorParams + ") {");
+//                System.out.println("}");
+//                System.out.println();
+//            }
+//        }
+
+        // Uncomment to print out visitor method declarations:
+//        for (int opcode = 0; opcode < flags.length; ++opcode) {
+//            if (isExtension(opcode)) {
+//                System.out.println("case " + name(opcode).toUpperCase() + ": {");
+//                String arg = "";
+//                int length = length(opcode);
+//                if (length == 2) {
+//                    arg = "readUnsigned1()";
+//                } else if (length == 3) {
+//                    arg = "readUnsigned2()";
+//                }
+//                System.out.println("    bytecodeVisitor." + name(opcode) + "(" + arg + ");");
+//                System.out.println("    break;");
+//                System.out.println("}");
+//            }
+//        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/bytecode/Bytes.java	Thu Mar 08 19:24:17 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.graal.java.bytecode;
+
+/**
+ * A collection of utility methods for dealing with bytes, particularly in byte arrays.
+ */
+public class Bytes {
+    /**
+     * Gets a signed 1-byte value.
+     * @param data the array containing the data
+     * @param bci the start index of the value to retrieve
+     * @return the signed 1-byte value at index {@code bci} in array {@code data}
+     */
+    public static int beS1(byte[] data, int bci) {
+        return data[bci];
+    }
+
+    /**
+     * Gets a signed 2-byte big-endian value.
+     * @param data the array containing the data
+     * @param bci the start index of the value to retrieve
+     * @return the signed 2-byte, big-endian, value at index {@code bci} in array {@code data}
+     */
+    public static int beS2(byte[] data, int bci) {
+        return (data[bci] << 8) | (data[bci + 1] & 0xff);
+    }
+
+    /**
+     * Gets an unsigned 1-byte value.
+     * @param data the array containing the data
+     * @param bci the start index of the value to retrieve
+     * @return the unsigned 1-byte value at index {@code bci} in array {@code data}
+     */
+    public static int beU1(byte[] data, int bci) {
+        return data[bci] & 0xff;
+    }
+
+    /**
+     * Gets an unsigned 2-byte big-endian value.
+     * @param data the array containing the data
+     * @param bci the start index of the value to retrieve
+     * @return the unsigned 2-byte, big-endian, value at index {@code bci} in array {@code data}
+     */
+    public static int beU2(byte[] data, int bci) {
+        return ((data[bci] & 0xff) << 8) | (data[bci + 1] & 0xff);
+    }
+
+    /**
+     * Gets a signed 4-byte big-endian value.
+     * @param data the array containing the data
+     * @param bci the start index of the value to retrieve
+     * @return the signed 4-byte, big-endian, value at index {@code bci} in array {@code data}
+     */
+    public static int beS4(byte[] data, int bci) {
+        return (data[bci] << 24) | ((data[bci + 1] & 0xff) << 16) | ((data[bci + 2] & 0xff) << 8) | (data[bci + 3] & 0xff);
+    }
+
+    /**
+     * Gets either a signed 2-byte or a signed 4-byte big-endian value.
+     * @param data the array containing the data
+     * @param bci the start index of the value to retrieve
+     * @param fourByte if true, this method will return a 4-byte value
+     * @return the signed 2 or 4-byte, big-endian, value at index {@code bci} in array {@code data}
+     */
+    public static int beSVar(byte[] data, int bci, boolean fourByte) {
+        if (fourByte) {
+            return beS4(data, bci);
+        } else {
+            return beS2(data, bci);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/ConvertJTT.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt;
+
+import java.io.*;
+import java.nio.charset.*;
+import java.nio.file.*;
+import java.util.*;
+
+/**
+ * Simple Utility to convert java tester tests from the proprietary test format into JUnit - tests.
+ */
+public class ConvertJTT {
+
+    public static void main(String[] args) throws IOException {
+        String targetPath = "graalvm/graal/com.oracle.graal.tests/src/com/oracle/max/graal/jtt";
+        String sourcePath = "maxine/com.oracle.max.vm/test/jtt";
+
+        File target = new File(targetPath);
+        for (File dir : new File(sourcePath).listFiles()) {
+            if (dir.isDirectory()) {
+                String packageName = dir.getName();
+                if (packageName.equals("exbytecode") || packageName.equals("max")) {
+                    continue;
+                }
+                File targetDir = new File(target, packageName);
+                for (File file : dir.listFiles()) {
+                    if (file.getName().endsWith(".java")) {
+                        targetDir.mkdirs();
+                        try {
+                            processFile(file.toPath(), new File(targetDir, file.getName()).toPath(), packageName);
+                        } catch (RuntimeException e) {
+                            e.printStackTrace();
+                            System.out.println("in file " + file.getAbsolutePath());
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    public static class Run {
+
+        public String input;
+        public String output;
+
+        public Run(String input, String output) {
+            this.input = input;
+            this.output = output;
+        }
+
+        @Override
+        public String toString() {
+            return String.format("%16s = %s", input, output);
+        }
+    }
+
+    private static void processFile(Path file, Path target, String packageName) throws IOException {
+        List<String> lines = Files.readAllLines(file, Charset.forName("UTF-8"));
+        Iterator<String> iter = lines.iterator();
+
+        ArrayList<String> output = new ArrayList<>();
+        ArrayList<Run> runs = new ArrayList<>();
+
+        String line;
+        boolean javaHarness = false;
+        while (iter.hasNext()) {
+            line = iter.next();
+            if (line.startsWith(" * Copyright (c) ")) {
+                output.add(" * Copyright (c) " + line.substring(17, 21) + ", 2012, Oracle and/or its affiliates. All rights reserved.");
+            } else if (line.contains("@Runs:")) {
+                line = line.substring(line.indexOf("@Runs:") + 6).trim();
+                if (line.endsWith(";")) {
+                    line = line.substring(0, line.length() - 1);
+                }
+                String[] runStrings;
+                if (charCount(line, ';') == charCount(line, '=') - 1) {
+                    runStrings = line.split(";");
+                } else if (charCount(line, ',') == charCount(line, '=') - 1) {
+                    runStrings = line.split(",");
+                } else if (charCount(line, ',', ';') == charCount(line, '=') - 1) {
+                    runStrings = line.split("[,;]");
+                } else {
+                    throw new RuntimeException("invalid run line: " + line);
+                }
+                for (String runString : runStrings) {
+                    String[] split = runString.split("=");
+                    if (split.length != 2) {
+                        throw new RuntimeException("invalid run string: " + runString);
+                    }
+                    Run run = new Run(split[0].trim(), split[1].trim());
+                    runs.add(run);
+                }
+            } else if (line.contains("@Harness:")) {
+                if (line.contains("@Harness: java")) {
+                    javaHarness = true;
+                }
+            } else if (line.startsWith("package jtt.")) {
+                output.add("package com.oracle.graal.jtt." + packageName + ";");
+                output.add("");
+                output.add("import org.junit.*;");
+            } else if (line.contains("@NEVER_INLINE")) {
+                output.add("// " + line);
+            } else if (line.startsWith("import com.sun.max.annotate.")) {
+                // do nothing
+            } else if (line.equals("}")) {
+                if (runs != null) {
+                    int n = 0;
+                    for (Run run : runs) {
+                        processRun(output, run, n++);
+                    }
+                    runs = null;
+                }
+                output.add(line);
+            } else {
+// line = line.replace(oldClassName, newClassName);
+                line = line.replace(" jtt.", " com.oracle.graal.jtt.");
+                output.add(line);
+            }
+        }
+        if (!javaHarness) {
+            throw new RuntimeException("no java harness");
+        }
+        if (runs != null) {
+            throw new RuntimeException("no ending brace found");
+        }
+
+        Files.write(target, output, Charset.forName("UTF-8"));
+    }
+
+    private static void processRun(ArrayList<String> output, Run run, int n) {
+        if (run.output.startsWith("!")) {
+            output.add("    @Test(expected = " + run.output.substring(1).replace("jtt.", "com.oracle.graal.jtt.").replace('$', '.') + ".class)");
+            output.add("    public void run" + n + "() throws Throwable {");
+            output.add("        test(" + parameters(run.input) + ");");
+            output.add("    }");
+            output.add("");
+        } else {
+            output.add("    @Test");
+            output.add("    public void run" + n + "() throws Throwable {");
+            String result = parameters(run.output);
+            if (result.endsWith("f") || result.endsWith("d") || result.endsWith("F") || result.endsWith("D")) {
+                output.add("        Assert.assertEquals(" + result + ", test(" + parameters(run.input) + "), 0);");
+            } else {
+                output.add("        Assert.assertEquals(" + result + ", test(" + parameters(run.input) + "));");
+            }
+            output.add("    }");
+            output.add("");
+        }
+    }
+
+    private static String parameters(String params) {
+        if (params.startsWith("(")) {
+            StringBuilder str = new StringBuilder();
+            String[] split = params.substring(1, params.length() - 1).split(",");
+            for (int i = 0; i < split.length; i++) {
+                str.append(i == 0 ? "" : ", ").append(parameters(split[i].trim()));
+            }
+            return str.toString();
+        } else if (params.startsWith("`")) {
+            return params.substring(1);
+        } else {
+            if (params.length() <= 1) {
+                return params;
+            } else {
+                if (params.endsWith("s")) {
+                    return "((short) " + params.substring(0, params.length() - 1) + ")";
+                } else if (params.endsWith("c")) {
+                    return "((char) " + params.substring(0, params.length() - 1) + ")";
+                } else if (params.endsWith("b")) {
+                    return "((byte) " + params.substring(0, params.length() - 1) + ")";
+                }
+            }
+            return params.replace("jtt.", "com.oracle.graal.jtt.");
+        }
+    }
+
+    private static int charCount(String str, char ch1) {
+        int count = 0;
+        for (int i = 0; i < str.length(); i++) {
+            if (str.charAt(i) == ch1) {
+                count++;
+            }
+        }
+        return count;
+    }
+
+    private static int charCount(String str, char ch1, char ch2) {
+        int count = 0;
+        for (int i = 0; i < str.length(); i++) {
+            if (str.charAt(i) == ch1 || str.charAt(i) == ch2) {
+                count++;
+            }
+        }
+        return count;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aaload {
+
+    static Object[] array = {null, null, ""};
+
+    public static Object test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(null, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("", test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aaload_1 {
+
+    static Object[][] array = {{null}, {null}, {""}};
+
+    public static Object test(int arg) {
+        return array[arg][0];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(null, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("", test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aastore {
+
+    static Object[] param = {new Object(), null, "h"};
+    static Object[] array1 = {null, null, null};
+    static String[] array2 = {null, null, null};
+
+    public static int test(boolean a, int indx) {
+        Object[] array = a ? array1 : array2;
+        Object val;
+        val = param[indx];
+        array[indx] = val;
+        return indx;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(true, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(true, 1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(true, 2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1, test(false, 1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(2, test(false, 2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_0.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aload_0 {
+
+    public static Object test(Object arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("x", test("x"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aload_1 {
+
+    @SuppressWarnings("unused")
+    public static Object test(int i, Object arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(1, null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("x", test(1, "x"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aload_2 {
+
+    @SuppressWarnings("unused")
+    public static Object test(int i, int j, Object arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(1, 1, null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("x", test(1, 1, "x"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aload_3 {
+
+    @SuppressWarnings("unused")
+    public static Object test(int i, int j, int k, Object arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("x", test(1, 1, 1, "x"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(null, test(1, 1, 1, null));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_anewarray.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_anewarray {
+
+    @SuppressWarnings("unused")
+    public static int test(int a) {
+        final BC_anewarray[] v = new BC_anewarray[3];
+        if (v != null) {
+            return a;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_areturn.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_areturn {
+
+    public static Object test(Object a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("", test(""));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("this", test("this"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_arraylength.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_arraylength {
+
+    static int[] array1 = {1, 2, 3};
+    static char[] array2 = {'a', 'b', 'c', 'd'};
+    static Object[] array3 = new Object[5];
+    static Object[][] array4 = new Object[5][5];
+
+    public static int test(int arg) {
+        if (arg == 1) {
+            return array1.length;
+        }
+        if (arg == 2) {
+            return array2.length;
+        }
+        if (arg == 3) {
+            return array3.length;
+        }
+        if (arg == 4) {
+            return array4[0].length;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(4, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(5, test(3));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(5, test(4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(42, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_athrow.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_athrow {
+
+    static Throwable throwable = new Throwable();
+
+    public static int test(int arg) throws Throwable {
+        if (arg == 2) {
+            throw throwable;
+        }
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test(expected = java.lang.Throwable.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_baload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_baload {
+
+    static boolean[] array = {true, false, true, false};
+
+    public static boolean test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_bastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_bastore {
+
+    static boolean[] array = {false, false, false, false};
+
+    public static boolean test(int arg, boolean val) {
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0, true));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1, false));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2, true));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3, false));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_caload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_caload {
+
+    static char[] array = {'\000', 'a', ' ', 10000};
+
+    public static char test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 0), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 97), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 32), test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((char) 10000), test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_castore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_castore {
+
+    static char[] array = {0, 0, 0, 0};
+
+    public static char test(int arg, char val) {
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 97), test(0, ((char) 97)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 65), test(1, ((char) 65)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 42), test(2, ((char) 42)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((char) 120), test(3, ((char) 120)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast01 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new BC_checkcast01();
+
+    public static int test(int arg) {
+        Object obj;
+        if (arg == 2) {
+            obj = object2;
+        } else if (arg == 3) {
+            obj = object3;
+        } else if (arg == 4) {
+            obj = object4;
+        } else {
+            obj = null;
+        }
+        final BC_checkcast01 bc = (BC_checkcast01) obj;
+        if (bc != null) {
+            return arg;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast02 {
+
+    static Object[] o1 = {new Object()};
+    static String[] o2 = {""};
+    static BC_checkcast02[] o3 = {new BC_checkcast02()};
+
+    public static int test(int arg) {
+        Object obj = null;
+        if (arg == 0) {
+            obj = o1;
+        }
+        if (arg == 1) {
+            obj = o2;
+        }
+        if (arg == 2) {
+            obj = o3;
+        }
+        Object[] r = (Object[]) obj;
+        return r == null ? -1 : -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2f.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_d2f {
+
+    public static float test(double d) {
+        return (float) d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0.0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0f, test(1.0d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1.06f, test(-1.06d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i01.java	Thu Mar 08 19:24:17 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.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_d2i01 {
+
+    public static int test(double d) {
+        return (int) d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-1.06d));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-156, test(-156.82743d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_d2i02 {
+
+    private static double[] inputs = {-1.3e44d, Double.NEGATIVE_INFINITY, Double.NaN, Double.POSITIVE_INFINITY, 1.3e44d};
+
+    public static int test(int i) {
+        return (int) inputs[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2147483648, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2147483648, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2147483647, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(2147483647, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l01.java	Thu Mar 08 19:24:17 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.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_d2l01 {
+
+    public static long test(double d) {
+        return (long) d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1L, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1L, test(-1.06d));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-156L, test(-156.82743d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_d2l02 {
+
+    private static double[] inputs = {-1.3e44d, Double.NEGATIVE_INFINITY, Double.NaN, Double.POSITIVE_INFINITY, 1.3e44d};
+
+    public static long test(int i) {
+        return (long) inputs[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-9223372036854775808L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-9223372036854775808L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(9223372036854775807L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(9223372036854775807L, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dadd.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dadd {
+
+    public static double test(double a, double b) {
+        return a + b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0d, 0.0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2.0d, test(1.0d, 1.0d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(307.54d, test(253.11d, 54.43d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_daload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_daload {
+
+    static double[] array = {0.0, -1.1, 4.32, 6.06};
+
+    public static double test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1.1d, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(4.32d, test(2), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(6.06d, test(3), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dastore {
+
+    static double[] array = {0, 0, 0, 0};
+
+    public static double test(int arg, double val) {
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.01d, test(0, 0.01d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1.4d, test(1, -1.4d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.01d, test(2, 0.01d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1.4d, test(3, -1.4d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp01 {
+
+    public static boolean test(double a, double b) {
+        return a < b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0d, -0.1d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(78.00d, 78.001d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp02 {
+
+    public static boolean test(double a) {
+        return (a / a) < 0.0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(-0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp03 {
+
+    public static boolean test(double a) {
+        return (a / a) > 0.0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(-0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp04 {
+
+    public static boolean test(double a) {
+        return (a / a) <= 0.0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(-0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp05 {
+
+    public static boolean test(double a) {
+        return (a / a) >= 0.0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp06 {
+
+    public static boolean test(double a) {
+        return 0.0 < (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp07.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp07 {
+
+    public static boolean test(double a) {
+        return 0.0 > (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp08.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp08 {
+
+    public static boolean test(double a) {
+        return 0.0 <= (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp09.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp09 {
+
+    public static boolean test(double a) {
+        return 0.0 >= (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0d));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0d));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0d));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp10.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dcmp10 {
+
+    public static boolean test(int x) {
+        double a = 0;
+        double b = 0;
+        switch (x) {
+            case 0:
+                a = Double.POSITIVE_INFINITY;
+                b = 1;
+                break;
+            case 1:
+                a = 1;
+                b = Double.POSITIVE_INFINITY;
+                break;
+            case 2:
+                a = Double.NEGATIVE_INFINITY;
+                b = 1;
+                break;
+            case 3:
+                a = 1;
+                b = Double.NEGATIVE_INFINITY;
+                break;
+            case 4:
+                a = Double.NEGATIVE_INFINITY;
+                b = Double.NEGATIVE_INFINITY;
+                break;
+            case 5:
+                a = Double.NEGATIVE_INFINITY;
+                b = Double.POSITIVE_INFINITY;
+                break;
+            case 6:
+                a = Double.NaN;
+                b = Double.POSITIVE_INFINITY;
+                break;
+            case 7:
+                a = 1;
+                b = Double.NaN;
+                break;
+            case 8:
+                a = 1;
+                b = -0.0d / 0.0d;
+                break;
+        }
+        return a <= b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ddiv.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ddiv {
+
+    public static double test(double a, double b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(31.1D, test(311.0D, 10D), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dmul.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dmul {
+
+    public static double test(double a, double b) {
+        return a * b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3110.0D, test(311.0D, 10D), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(22.4D, test(11.2D, 2.0D), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dneg {
+
+    public static double test(double a, double b, int which) {
+        double result1 = -a;
+        double result2 = -b;
+        double result = 0.0;
+        if (which == 0) {
+            result = result1;
+        } else {
+            result = result2;
+        }
+        return result;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-0.0d, test(0.0d, 1.0d, 0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.01d, test(-1.01d, -2.01d, 0), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-7263.8734d, test(7263.8734d, 8263.8734d, 0), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1.0d, test(0.0d, 1.0d, 1), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(2.01d, test(-1.01d, -2.01d, 1), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-8263.8734d, test(7263.8734d, 8263.8734d, 1), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dneg2 {
+
+// @NEVER_INLINE
+    public static double test(double a) {
+        return 1 / (-a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(-0.0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0.0d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_drem.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+public class BC_drem {
+
+    public static double test(double a, double b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1.0D, test(311.0D, 10D), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.2D, test(11.2D, 2.0D), 0.000000000000001);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dreturn.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dreturn {
+
+    public static double test(double a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.1d, test(1.1d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1.4d, test(-1.4d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(256.33d, test(256.33d), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(1000.001d, test(1000.001d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dsub {
+
+    public static double test(double a, double b) {
+        return a - b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0d, 0.0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0.0d, test(1.0d, 1.0d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(198.68d, test(253.11d, 54.43d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_dsub2 {
+
+    public static double test(double a) {
+        return 1.0 / (0.0 - a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(0.0d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2d.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_f2d {
+
+    public static double test(float d) {
+        return d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0d, test(1.0f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-2.00d, test(-2.00f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i01.java	Thu Mar 08 19:24:17 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.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_f2i01 {
+
+    public static int test(float d) {
+        return (int) d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-1.06f));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-156, test(-156.82743f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_f2i02 {
+
+    private static float[] inputs = {-1.3e22f, Float.NEGATIVE_INFINITY, Float.NaN, Float.POSITIVE_INFINITY, 1.3e22f};
+
+    public static int test(int i) {
+        return (int) inputs[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2147483648, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2147483648, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2147483647, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(2147483647, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l01.java	Thu Mar 08 19:24:17 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.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_f2l01 {
+
+    public static long test(float d) {
+        return (long) d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1L, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1L, test(-1.06f));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-156L, test(-156.82743f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_f2l02 {
+
+    private static float[] inputs = {-1.3e22f, Float.NEGATIVE_INFINITY, Float.NaN, Float.POSITIVE_INFINITY, 1.3e22f};
+
+    public static long test(int i) {
+        return (long) inputs[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-9223372036854775808L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-9223372036854775808L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(9223372036854775807L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(9223372036854775807L, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fadd.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fadd {
+
+    public static float test(float a, float b) {
+        return a + b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0.0f, 0.0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2.0f, test(1.0f, 1.0f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(307.54f, test(253.11f, 54.43f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_faload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_faload {
+
+    static float[] array = {0.0f, -1.1f, 4.32f, 6.06f};
+
+    public static float test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1.1f, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(4.32f, test(2), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(6.06f, test(3), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fastore {
+
+    static float[] array = {0, 0, 0, 0};
+
+    public static float test(int arg, float val) {
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.01f, test(0, 0.01f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1.4f, test(1, -1.4f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.01f, test(2, 0.01f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1.4f, test(3, -1.4f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp01 {
+
+    public static boolean test(float a, float b) {
+        return a < b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0f, -0.1f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(78.00f, 78.001f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp02 {
+
+    public static boolean test(float a) {
+        return (a / a) < 0.0f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp03 {
+
+    public static boolean test(float a) {
+        return (a / a) > 0.0f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp04 {
+
+    public static boolean test(float a) {
+        return (a / a) <= 0.0f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp05 {
+
+    public static boolean test(float a) {
+        return (a / a) >= 0.0f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp06 {
+
+    public static boolean test(float a) {
+        return 0.0f < (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp07.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp07 {
+
+    public static boolean test(float a) {
+        return 0.0f > (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp08.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp08 {
+
+    public static boolean test(float a) {
+        return 0.0f <= (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp09.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp09 {
+
+    public static boolean test(float a) {
+        return 0.0f >= (a / a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.0f));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp10.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fcmp10 {
+
+    public static boolean test(int x) {
+        float a = 0;
+        float b = 0;
+        switch (x) {
+            case 0:
+                a = Float.POSITIVE_INFINITY;
+                b = 1;
+                break;
+            case 1:
+                a = 1;
+                b = Float.POSITIVE_INFINITY;
+                break;
+            case 2:
+                a = Float.NEGATIVE_INFINITY;
+                b = 1;
+                break;
+            case 3:
+                a = 1;
+                b = Float.NEGATIVE_INFINITY;
+                break;
+            case 4:
+                a = Float.NEGATIVE_INFINITY;
+                b = Float.NEGATIVE_INFINITY;
+                break;
+            case 5:
+                a = Float.NEGATIVE_INFINITY;
+                b = Float.POSITIVE_INFINITY;
+                break;
+            case 6:
+                a = Float.NaN;
+                b = Float.POSITIVE_INFINITY;
+                break;
+            case 7:
+                a = 1;
+                b = Float.NaN;
+                break;
+            case 8:
+                a = 1;
+                b = -0.0f / 0.0f;
+                break;
+        }
+        return a <= b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fdiv.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fdiv {
+
+    public static float test(float a, float b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(31.1f, test(311.0f, 10f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fload {
+
+    public static float test(float arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1f, test(-1f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1.01f, test(-1.01f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fload_2 {
+
+    @SuppressWarnings("unused")
+    public static float test(float i, float arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1f, test(0f, -1f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1.01f, test(0f, -1.01f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fmul.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fmul {
+
+    public static float test(float a, float b) {
+        return a * b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3110.0f, test(311.0f, 10f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(22.4f, test(11.2f, 2.0f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fneg.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fneg {
+
+    public static float test(float a) {
+        return -a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-0.0f, test(0.0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.01f, test(-1.01f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-7263.8734f, test(7263.8734f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_frem.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+public class BC_frem {
+
+    public static float test(float a, float b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1.0f, test(311.0f, 10f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0.5f, test(12.5f, 6.0f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_freturn.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_freturn {
+
+    public static float test(float a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0.0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.1f, test(1.1f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1.4f, test(-1.4f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(256.33f, test(256.33f), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(1000.001f, test(1000.001f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fsub.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_fsub {
+
+    public static float test(float a, float b) {
+        return a - b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0.0f, 0.0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0.0f, test(1.0f, 1.0f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(198.68f, test(253.11f, 54.43f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getfield {
+
+    private static BC_getfield object = new BC_getfield();
+
+    private int field = 13;
+
+    public static int test() {
+        return object.field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(13, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_b.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_b {
+
+    private static byte field = 11;
+
+    public static byte test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 11), test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_c.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_c {
+
+    private static char field = 11;
+
+    public static char test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 11), test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_d.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_d {
+
+    private static double field = 11;
+
+    public static double test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11d, test(), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_f.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_f {
+
+    private static float field = 11;
+
+    public static float test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11f, test(), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_i.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_i {
+
+    private static int field = 11;
+
+    public static int test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_l.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_l {
+
+    private static long field = 11;
+
+    public static long test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11L, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_s.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_s {
+
+    private static short field = 11;
+
+    public static short test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 11), test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_z.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_getstatic_z {
+
+    private static boolean field = true;
+
+    public static boolean test() {
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2b.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_i2b {
+
+    public static byte test(int a) {
+        return (byte) a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) -1), test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 2), test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) -1), test(255));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((byte) -128), test(128));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2c.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_i2c {
+
+    public static char test(int a) {
+        return (char) a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 65535), test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 645), test(645));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 65535), test(65535));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2d.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_i2d {
+
+    public static double test(int a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0d, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-34.0d, test(-34), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2f.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_i2f {
+
+    public static float test(int a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0f, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-34.0f, test(-34), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2l.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_i2l {
+
+    public static long test(int a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2L, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3L, test(3));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1L, test(-1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647L, test(-2147483647));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-2147483648L, test(-2147483648));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(2147483647L, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2s.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_i2s {
+
+    public static short test(int a) {
+        return (short) a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) -1), test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) 34), test(34));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) -1), test(65535));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((short) -32768), test(32768));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iadd {
+
+    public static int test(int a, int b) {
+        return a + b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(0, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(100, test(33, 67));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(1, -1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647, test(-2147483648, 1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-2147483648, test(2147483647, 1));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(2147483647, test(-2147483647, -2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iadd2 {
+
+    public static int test(byte a, byte b) {
+        return a + b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(((byte) 1), ((byte) 2)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(((byte) 0), ((byte) -1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(100, test(((byte) 33), ((byte) 67)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(((byte) 1), ((byte) -1)));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-127, test(((byte) -128), ((byte) 1)));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(128, test(((byte) 127), ((byte) 1)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iadd3 {
+
+    public static int test(short a, short b) {
+        return a + b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(((short) 1), ((short) 2)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(((short) 0), ((short) -1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(100, test(((short) 33), ((short) 67)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(((short) 1), ((short) -1)));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-127, test(((short) -128), ((short) 1)));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(128, test(((short) 127), ((short) 1)));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-32767, test(((short) -32768), ((short) 1)));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(32768, test(((short) 32767), ((short) 1)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iaload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iaload {
+
+    static int[] array = {0, -1, 4, 1000000000};
+
+    public static int test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(4, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000000000, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iand.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iand {
+
+    public static int test(int a, int b) {
+        return a & b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(0, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(31, test(31, 63));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4, test(6, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(-2147483648, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iastore {
+
+    static int[] array = {0, 0, 0, 0};
+
+    public static int test(int arg, int val) {
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(11, test(2, 11));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-14, test(3, -14));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iconst.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iconst {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return 0;
+        }
+        if (arg == 1) {
+            return 1;
+        }
+        if (arg == 2) {
+            return 2;
+        }
+        if (arg == 3) {
+            return 3;
+        }
+        if (arg == 4) {
+            return 4;
+        }
+        if (arg == 5) {
+            return 5;
+        }
+        return 375;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(5, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(375, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_idiv {
+
+    public static int test(int a, int b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2, test(2, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(64, test(256, 4));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(19, test(135, 7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_idiv2 {
+
+    public static int test(int a, int b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2147483648, test(-2147483648, -1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2147483648, test(-2147483648, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifeq {
+
+    public static int test(int a) {
+        int n = 0;
+        if (a == 0) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a != 0) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifeq_2 {
+
+    public static boolean test(int a) {
+        return a == 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifeq_3 {
+
+    public static boolean test(int a) {
+        return a != 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifge {
+
+    public static int test(int a) {
+        int n = 0;
+        if (a >= 0) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a < 0) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-2, test(-1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifge_2 {
+
+    public static boolean test(int a, int b) {
+        return a >= b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0, 1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1, 0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(1, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0, -100));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(-1, 0));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(-12, -12));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifge_3 {
+
+    public static boolean test(int a, int b) {
+        return a < b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0, 1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1, 0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(1, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0, -100));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(-1, 0));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(-12, -12));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifgt.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifgt {
+
+    public static int test(int a) {
+        int n = 0;
+        if (a > 0) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a <= 0) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-2, test(-1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ificmplt1 {
+
+    public static int test(int a) {
+        return a < 1 ? 12 : 13;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(12, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(13, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(13, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ificmplt2 {
+
+    public static int test(int a) {
+        return a > 1 ? 13 : 12;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(12, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(12, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(13, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ificmpne1 {
+
+    public static int test(int a) {
+        return a == 1 ? 12 : 13;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(13, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(12, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(13, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ificmpne2 {
+
+    public static int test(int a) {
+        return a != 1 ? 13 : 12;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(13, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(12, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(13, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifle.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifle {
+
+    public static int test(int a) {
+        int n = 0;
+        if (a <= 0) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a > 0) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(-1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iflt.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iflt {
+
+    public static int test(int a) {
+        int n = 0;
+        if (a < 0) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a >= 0) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(-1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifne.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifne {
+
+    public static int test(int a) {
+        int n = 0;
+        if (a != 0) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a == 0) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifnonnull {
+
+    public static int test(Object a) {
+        int n = 0;
+        if (a == null) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a != null) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2, test(""));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifnonnull_2 {
+
+    public static boolean test(Object a) {
+        return a != null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(""));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifnonnull_3 {
+
+    public static int test(Object a) {
+        if (a != null) {
+            return 1;
+        }
+        return 2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(""));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifnull {
+
+    public static int test(Object a) {
+        int n = 0;
+        if (a != null) {
+            n += 1;
+        } else {
+            n -= 1;
+        }
+        if (a == null) {
+            n -= 1;
+        } else {
+            n += 1;
+        }
+        return n;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(""));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifnull_2 {
+
+    public static boolean test(Object a) {
+        return a == null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(""));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ifnull_3 {
+
+    public static int test(Object a) {
+        if (a == null) {
+            return 1;
+        }
+        return 2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(""));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iinc_1 {
+
+    public static int test(int a) {
+        int arg = a;
+        arg += 1;
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(3, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(5, test(4));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(-1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iinc_2 {
+
+    public static int test(int a) {
+        int arg = a;
+        arg += 2;
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(4, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(6, test(4));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iinc_3 {
+
+    public static int test(int a) {
+        int arg = a;
+        arg += 51;
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(52, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(53, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(55, test(4));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(50, test(-1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_4.java	Thu Mar 08 19:24:17 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iinc_4 {
+
+    public static int test(int a) {
+        int arg = a;
+        arg += 512;
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(513, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(514, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(516, test(4));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(511, test(-1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iload_0 {
+
+    public static int test(int arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(-1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000345, test(1000345));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iload_0_1 {
+
+    public static int test(int arg) {
+        return arg + 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(-1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000346, test(1000345));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iload_0_2 {
+
+    public static int test(int arg) {
+        int i = arg;
+        return i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(-1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000345, test(1000345));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iload_1 {
+
+    @SuppressWarnings("unused")
+    public static int test(int i, int arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(1, 2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000345, test(1, 1000345));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iload_1_1 {
+
+    public static int test(int i) {
+        int arg = 0;
+        return i + arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(-1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000345, test(1000345));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iload_2 {
+
+    @SuppressWarnings("unused")
+    public static int test(int i, int j, int arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 1, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1, 1, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(1, 1, 2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000345, test(1, 1, 1000345));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iload_3 {
+
+    @SuppressWarnings("unused")
+    public static int test(int i, int j, int k, int arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 1, 1, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1, 1, 1, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(1, 1, 1, 2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000345, test(1, 1, 1, 1000345));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_imul.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_imul {
+
+    public static int test(int a, int b) {
+        return a * b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(0, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2211, test(33, 67));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1, test(1, -1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483648, test(-2147483648, 1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-2147483647, test(2147483647, -1));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-2147483648, test(-2147483648, -1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ineg.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ineg {
+
+    public static int test(int a) {
+        return -a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(-1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-7263, test(7263));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-2147483648, test(-2147483648));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_instanceof.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_instanceof {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new BC_instanceof();
+
+    public static boolean test(int arg) {
+        Object obj;
+        if (arg == 2) {
+            obj = object2;
+        } else if (arg == 3) {
+            obj = object3;
+        } else if (arg == 4) {
+            obj = object4;
+        } else {
+            obj = null;
+        }
+        return obj instanceof BC_instanceof;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokeinterface.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_invokeinterface {
+
+    public interface ITest {
+
+        int id(int a);
+    }
+
+    static class IClass implements ITest {
+
+        public int id(int a) {
+            return a;
+        }
+    }
+
+    static ITest object = new IClass();
+
+    public static int test(int a) {
+        return object.id(a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_invokespecial {
+
+    static BC_invokespecial object = new BC_invokespecial();
+
+    public static int test(int a) {
+        return object.id(a);
+    }
+
+    @SuppressWarnings("static-method")
+    private int id(int i) {
+        return i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_invokespecial2 {
+
+    static BC_invokespecial2 object = new BC_invokespecial2();
+
+    public static int test(int a) {
+        return 3 + object.id(a);
+    }
+
+    @SuppressWarnings("static-method")
+    private int id(int i) {
+        return 4 + i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(7, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(8, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(9, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(10, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(3, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokestatic.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_invokestatic {
+
+    public static int test(int a) {
+        return id(a);
+    }
+
+    public static int id(int i) {
+        return i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokevirtual.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_invokevirtual {
+
+    static BC_invokevirtual object = new BC_invokevirtual();
+
+    public static int test(int a) {
+        return object.id(a);
+    }
+
+    public int id(int i) {
+        return i;
+    }
+
+    public static void main(String[] args) {
+        test(0);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ior.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ior {
+
+    public static int test(int a, int b) {
+        return a | b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(0, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(63, test(31, 63));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(6, test(6, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647, test(-2147483648, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_irem {
+
+    public static int test(int a, int b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(2, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(256, 4));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2, test(135, 7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_irem2 {
+
+    public static int test(int a, int b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(-2147483648, -1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(-2147483648, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem3.java	Thu Mar 08 19:24:17 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.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_irem3 {
+
+    public static int test(int a) {
+        return a % 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(1000));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(-2147483648));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ireturn.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ireturn {
+
+    public static int test(int a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(256, test(256));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ishl {
+
+    public static int test(int a, int b) {
+        return a << b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(0, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(62, test(31, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(96, test(6, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(-2147483648, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishr.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ishr {
+
+    public static int test(int a, int b) {
+        return a >> b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(16, test(67, 2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(15, test(31, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(6, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-32768, test(-2147483648, 16));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_isub.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_isub {
+
+    public static int test(int a, int b) {
+        return a - b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(1, -2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(0, 1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(100, test(33, -67));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(1, 1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647, test(-2147483648, -1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-2147483648, test(2147483647, -1));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(2147483647, test(-2147483647, 2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iushr.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_iushr {
+
+    public static int test(int a, int b) {
+        return a >>> b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(16, test(67, 2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(15, test(31, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(6, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(32768, test(-2147483648, 16));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ixor.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ixor {
+
+    public static int test(int a, int b) {
+        return a ^ b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(0, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(32, test(31, 63));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2, test(6, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647, test(-2147483648, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2d.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_l2d {
+
+    public static double test(long a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0D, test(0L), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0D, test(1L), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-74652389.00D, test(-74652389L), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2f.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_l2f {
+
+    public static float test(long a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0L), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0f, test(1L), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-74652389.00f, test(-74652389L), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ * TODO: test roundoff behavior
+ */
+public class BC_l2i {
+
+    public static int test(long a) {
+        return (int) a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(1L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3, test(3L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1, test(-1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647, test(-2147483647L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-2147483648, test(-2147483648L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(2147483647, test(2147483647L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_l2i_2 {
+
+    static Object[] array = {null};
+
+    public static Object test(long a) {
+        long arg = a;
+        arg = arg << 32;
+        return array[(int) arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(1L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(null, test(123456789L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ladd {
+
+    public static long test(long a, long b) {
+        return a + b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1L, test(0L, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(100L, test(33L, 67L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0L, test(1L, -1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647L, test(-2147483648L, 1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(2147483648L, test(2147483647L, 1L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-2147483649L, test(-2147483647L, -2L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ladd2 {
+
+    public static long test(int a, int b) {
+        return a + (long) b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3L, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1L, test(0, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(100L, test(33, 67));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0L, test(1, -1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647L, test(-2147483648, 1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(2147483648L, test(2147483647, 1));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-2147483649L, test(-2147483647, -2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_laload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_laload {
+
+    static long[] array = {0L, -1L, 4L, 1000000000000L};
+
+    public static long test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(4L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1000000000000L, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_land.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_land {
+
+    public static long test(long a, long b) {
+        return a & b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(0L, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(31L, test(31L, 63L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4L, test(6L, 4L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0L, test(-2147483648L, 1L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lastore {
+
+    static long[] array = {0, 0, 0, 0};
+
+    public static long test(int arg, long val) {
+        final long[] array2 = arg == -2 ? null : BC_lastore.array;
+        array2[arg] = val;
+        return array2[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0, 0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1L, test(1, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(11L, test(2, 11L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-14L, test(3, -14L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lcmp.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lcmp {
+
+    public static boolean test(long a, long b) {
+        return a < b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0L, -1L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(77L, 78L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1L, 0L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldc_01 {
+
+    public static int test() {
+        return -123;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-123, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldc_02 {
+
+    public static float test() {
+        return -2.4f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2.4f, test(), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldc_03 {
+
+    public static long test() {
+        return -123L;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-123L, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldc_04 {
+
+    public static String test() {
+        return "xyz";
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("xyz", test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldc_05 {
+
+    public static double test() {
+        return -2.33d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2.33d, test(), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldc_06 {
+
+    public static String test() {
+        return test2().getName();
+    }
+
+    static Class<BC_ldc_06> test2() {
+        return BC_ldc_06.class;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.bytecode.BC_ldc_06", test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldiv {
+
+    public static long test(long a, long b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-2L, test(2L, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(64L, test(256L, 4L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(19L, test(135L, 7L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldiv2 {
+
+    public static long test(long a, long b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-9223372036854775808L, test(-9223372036854775808L, -1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-9223372036854775808L, test(-9223372036854775808L, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_0.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lload_0 {
+
+    public static long test(long arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(1L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-3L, test(-3L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(10000L, test(10000L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("unused")
+public class BC_lload_01 {
+
+    public static long test(int i) {
+        return test1(null);
+    }
+
+    public static int test1(Object o0) {
+        long x = 1;
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(-3));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0L, test(100));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lload_1 {
+
+    @SuppressWarnings("unused")
+    public static long test(int i, long arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(1, 1L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-3L, test(1, -3L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(10000L, test(1, 10000L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lload_2 {
+
+    @SuppressWarnings("unused")
+    public static long test(int i, int j, long arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(1, 1, 1L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-3L, test(1, 1, -3L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(10000L, test(1, 1, 10000L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lload_3 {
+
+    @SuppressWarnings("unused")
+    public static long test(int i, int j, int k, long arg) {
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(1, 1, 1, 1L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-3L, test(1, 1, 1, -3L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(10000L, test(1, 1, 1, 10000L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lmul.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lmul {
+
+    public static long test(long a, long b) {
+        return a * b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(0L, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2211L, test(33L, 67L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1L, test(1L, -1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483648L, test(-2147483648L, 1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-2147483647L, test(2147483647L, -1L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(2147483648L, test(-2147483648L, -1L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(1000000000000L, test(1000000L, 1000000L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lneg.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lneg {
+
+    public static long test(long a) {
+        return -a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1L, test(-1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-7263L, test(7263L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2147483648L, test(-2147483648L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lookupswitch01 {
+
+    public static int test(int a) {
+        switch (a) {
+            case 67:
+                return 0;
+            case 97:
+                return 1;
+            case 107:
+                return 2;
+            case 133:
+                return 3;
+            case 212:
+                return 4;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(42, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(42, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(66));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(67));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(42, test(68));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(42, test(96));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(1, test(97));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(42, test(98));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(42, test(106));
+    }
+
+    @Test
+    public void run9() throws Throwable {
+        Assert.assertEquals(2, test(107));
+    }
+
+    @Test
+    public void run10() throws Throwable {
+        Assert.assertEquals(42, test(108));
+    }
+
+    @Test
+    public void run11() throws Throwable {
+        Assert.assertEquals(42, test(132));
+    }
+
+    @Test
+    public void run12() throws Throwable {
+        Assert.assertEquals(3, test(133));
+    }
+
+    @Test
+    public void run13() throws Throwable {
+        Assert.assertEquals(42, test(134));
+    }
+
+    @Test
+    public void run14() throws Throwable {
+        Assert.assertEquals(42, test(211));
+    }
+
+    @Test
+    public void run15() throws Throwable {
+        Assert.assertEquals(4, test(212));
+    }
+
+    @Test
+    public void run16() throws Throwable {
+        Assert.assertEquals(42, test(213));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lookupswitch02 {
+
+    public static int test(int a) {
+        final int b = a;
+        switch (b) {
+            case 67:
+                return 0;
+            case 97:
+                return 1;
+            case 107:
+                return 2;
+            case 133:
+                return 3;
+            case 212:
+                return 4;
+            case -122:
+                return 5;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(42, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(42, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(66));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(67));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(42, test(68));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(42, test(96));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(1, test(97));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(42, test(98));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(42, test(106));
+    }
+
+    @Test
+    public void run9() throws Throwable {
+        Assert.assertEquals(2, test(107));
+    }
+
+    @Test
+    public void run10() throws Throwable {
+        Assert.assertEquals(42, test(108));
+    }
+
+    @Test
+    public void run11() throws Throwable {
+        Assert.assertEquals(42, test(132));
+    }
+
+    @Test
+    public void run12() throws Throwable {
+        Assert.assertEquals(3, test(133));
+    }
+
+    @Test
+    public void run13() throws Throwable {
+        Assert.assertEquals(42, test(134));
+    }
+
+    @Test
+    public void run14() throws Throwable {
+        Assert.assertEquals(42, test(211));
+    }
+
+    @Test
+    public void run15() throws Throwable {
+        Assert.assertEquals(4, test(212));
+    }
+
+    @Test
+    public void run16() throws Throwable {
+        Assert.assertEquals(42, test(213));
+    }
+
+    @Test
+    public void run17() throws Throwable {
+        Assert.assertEquals(42, test(-121));
+    }
+
+    @Test
+    public void run18() throws Throwable {
+        Assert.assertEquals(5, test(-122));
+    }
+
+    @Test
+    public void run19() throws Throwable {
+        Assert.assertEquals(42, test(-123));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lookupswitch03 {
+
+    public static int test(int a) {
+        final int b = a + 10;
+        switch (b) {
+            case 77:
+                return 0;
+            case 107:
+                return 1;
+            case 117:
+                return 2;
+            case 143:
+                return 3;
+            case 222:
+                return 4;
+            case -112:
+                return 5;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(42, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(42, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(66));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(67));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(42, test(68));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(42, test(96));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(1, test(97));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(42, test(98));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(42, test(106));
+    }
+
+    @Test
+    public void run9() throws Throwable {
+        Assert.assertEquals(2, test(107));
+    }
+
+    @Test
+    public void run10() throws Throwable {
+        Assert.assertEquals(42, test(108));
+    }
+
+    @Test
+    public void run11() throws Throwable {
+        Assert.assertEquals(42, test(132));
+    }
+
+    @Test
+    public void run12() throws Throwable {
+        Assert.assertEquals(3, test(133));
+    }
+
+    @Test
+    public void run13() throws Throwable {
+        Assert.assertEquals(42, test(134));
+    }
+
+    @Test
+    public void run14() throws Throwable {
+        Assert.assertEquals(42, test(211));
+    }
+
+    @Test
+    public void run15() throws Throwable {
+        Assert.assertEquals(4, test(212));
+    }
+
+    @Test
+    public void run16() throws Throwable {
+        Assert.assertEquals(42, test(213));
+    }
+
+    @Test
+    public void run17() throws Throwable {
+        Assert.assertEquals(42, test(-121));
+    }
+
+    @Test
+    public void run18() throws Throwable {
+        Assert.assertEquals(5, test(-122));
+    }
+
+    @Test
+    public void run19() throws Throwable {
+        Assert.assertEquals(42, test(-123));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lookupswitch04 {
+
+    public static int test(int a) {
+        final int b = a + 8;
+        final int c = b + 2;
+        switch (c) {
+            case 77:
+                return 0;
+            case 107:
+                return 1;
+            case 117:
+                return 2;
+            case 143:
+                return 3;
+            case 222:
+                return 4;
+            case -112:
+                return 5;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(42, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(42, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(66));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(67));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(42, test(68));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(42, test(96));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(1, test(97));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(42, test(98));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(42, test(106));
+    }
+
+    @Test
+    public void run9() throws Throwable {
+        Assert.assertEquals(2, test(107));
+    }
+
+    @Test
+    public void run10() throws Throwable {
+        Assert.assertEquals(42, test(108));
+    }
+
+    @Test
+    public void run11() throws Throwable {
+        Assert.assertEquals(42, test(132));
+    }
+
+    @Test
+    public void run12() throws Throwable {
+        Assert.assertEquals(3, test(133));
+    }
+
+    @Test
+    public void run13() throws Throwable {
+        Assert.assertEquals(42, test(134));
+    }
+
+    @Test
+    public void run14() throws Throwable {
+        Assert.assertEquals(42, test(211));
+    }
+
+    @Test
+    public void run15() throws Throwable {
+        Assert.assertEquals(4, test(212));
+    }
+
+    @Test
+    public void run16() throws Throwable {
+        Assert.assertEquals(42, test(213));
+    }
+
+    @Test
+    public void run17() throws Throwable {
+        Assert.assertEquals(42, test(-121));
+    }
+
+    @Test
+    public void run18() throws Throwable {
+        Assert.assertEquals(5, test(-122));
+    }
+
+    @Test
+    public void run19() throws Throwable {
+        Assert.assertEquals(42, test(-123));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lookupswitch05 {
+
+    public static Object test(int a) {
+        switch (a) {
+            default:
+                return new String();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("", test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lor.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lor {
+
+    public static long test(long a, long b) {
+        return a | b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1L, test(0L, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(63L, test(31L, 63L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(6L, test(6L, 4L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647L, test(-2147483648L, 1L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lrem {
+
+    public static long test(long a, long b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(2L, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0L, test(256L, 4L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2L, test(135L, 7L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lrem2 {
+
+    public static long test(long a, long b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(-9223372036854775808L, -1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(-9223372036854775808L, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lreturn.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lreturn {
+
+    public static long test(long a) {
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1L, test(1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1L, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(256L, test(256L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(1000000000000L, test(1000000000000L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshl.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lshl {
+
+    public static long test(long a, int b) {
+        return a << b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4L, test(1L, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(0L, -1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(62L, test(31L, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(96L, test(6L, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-4294967296L, test(-2147483648L, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshr.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lshr {
+
+    public static long test(long a, int b) {
+        return a >> b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(1L, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(16L, test(67L, 2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(15L, test(31L, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0L, test(6L, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-32768L, test(-2147483648L, 16));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lsub.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lsub {
+
+    public static long test(long a, long b) {
+        return a - b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3L, test(1L, -2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1L, test(0L, 1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(100L, test(33L, -67L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0L, test(1L, 1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647L, test(-2147483648L, -1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(2147483648L, test(2147483647L, -1L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-2147483649L, test(-2147483647L, 2L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lushr.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lushr {
+
+    public static long test(long a, int b) {
+        return a >>> b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(1L, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(16L, test(67L, 2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(15L, test(31L, 1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0L, test(6L, 4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(281474976677888L, test(-2147483648L, 16));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lxor.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lxor {
+
+    public static long test(long a, long b) {
+        return a ^ b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1L, test(0L, -1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(32L, test(31L, 63L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2L, test(6L, 4L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-2147483647L, test(-2147483648L, 1L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_monitorenter {
+
+    static BC_monitorenter object = new BC_monitorenter();
+
+    public static int test(int arg) {
+        synchronized (object) {
+            return arg;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-2, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_monitorenter02 {
+
+    static BC_monitorenter02 object = new BC_monitorenter02();
+
+    public static int test(int arg, int arg2) {
+        int result = arg;
+        synchronized (object) {
+            result = arg / arg2;
+        }
+        synchronized (object) {
+            result = arg / arg2;
+        }
+        return result;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0, 1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1, 1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-2, test(-2, 1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_multianewarray01 {
+
+    public static int test(int a) {
+        final BC_multianewarray01[][] v = new BC_multianewarray01[3][3];
+        return v != null ? a : -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_multianewarray02 {
+
+    public static int test(int a) {
+        final BC_multianewarray02[][][][] v = new BC_multianewarray02[3][3][3][3];
+        return v != null ? a : -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_multianewarray03 {
+
+    public static int test(int a) {
+        final BC_multianewarray03[][][][] v = new BC_multianewarray03[a][a][a][a];
+        return v.length + v[0].length + v[0][0].length + v[0][0][0].length;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(8, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_multianewarray04 {
+
+    public static int test(int a) {
+        int i = 1;
+
+        i += test_byte(a);
+        i += test_boolean(a);
+        i += test_char(a);
+        i += test_short(a);
+        i += test_int(a);
+        i += test_float(a);
+        i += test_long(a);
+        i += test_double(a);
+
+        return i;
+    }
+
+    private static int test_double(int a) {
+        double[][] b2 = new double[a][a];
+        double[][][] b3 = new double[a][a][a];
+        double[][][][] b4 = new double[a][a][a][a];
+        double[][][][][] b5 = new double[a][a][a][a][a];
+        double[][][][][][] b6 = new double[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    private static int test_long(int a) {
+        long[][] b2 = new long[a][a];
+        long[][][] b3 = new long[a][a][a];
+        long[][][][] b4 = new long[a][a][a][a];
+        long[][][][][] b5 = new long[a][a][a][a][a];
+        long[][][][][][] b6 = new long[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    private static int test_float(int a) {
+        float[][] b2 = new float[a][a];
+        float[][][] b3 = new float[a][a][a];
+        float[][][][] b4 = new float[a][a][a][a];
+        float[][][][][] b5 = new float[a][a][a][a][a];
+        float[][][][][][] b6 = new float[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    private static int test_int(int a) {
+        int[][] b2 = new int[a][a];
+        int[][][] b3 = new int[a][a][a];
+        int[][][][] b4 = new int[a][a][a][a];
+        int[][][][][] b5 = new int[a][a][a][a][a];
+        int[][][][][][] b6 = new int[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    private static int test_short(int a) {
+        short[][] b2 = new short[a][a];
+        short[][][] b3 = new short[a][a][a];
+        short[][][][] b4 = new short[a][a][a][a];
+        short[][][][][] b5 = new short[a][a][a][a][a];
+        short[][][][][][] b6 = new short[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    private static int test_char(int a) {
+        char[][] b2 = new char[a][a];
+        char[][][] b3 = new char[a][a][a];
+        char[][][][] b4 = new char[a][a][a][a];
+        char[][][][][] b5 = new char[a][a][a][a][a];
+        char[][][][][][] b6 = new char[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    private static int test_boolean(int a) {
+        boolean[][] b2 = new boolean[a][a];
+        boolean[][][] b3 = new boolean[a][a][a];
+        boolean[][][][] b4 = new boolean[a][a][a][a];
+        boolean[][][][][] b5 = new boolean[a][a][a][a][a];
+        boolean[][][][][][] b6 = new boolean[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    private static int test_byte(int a) {
+        byte[][] b2 = new byte[a][a];
+        byte[][][] b3 = new byte[a][a][a];
+        byte[][][][] b4 = new byte[a][a][a][a];
+        byte[][][][][] b5 = new byte[a][a][a][a][a];
+        byte[][][][][][] b6 = new byte[a][a][a][a][a][a];
+        return b2.length + b3.length + b4.length + b5.length + b6.length;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(41, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(81, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_new.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_new {
+
+    @SuppressWarnings("unused")
+    public static int test(int a) {
+        new BC_new();
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_newarray.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_newarray {
+
+    public static int test(int a) {
+        if (new boolean[3] == null) {
+            return -1;
+        }
+        if (new char[3] == null) {
+            return -1;
+        }
+        if (new float[3] == null) {
+            return -1;
+        }
+        if (new double[3] == null) {
+            return -1;
+        }
+        if (new byte[3] == null) {
+            return -1;
+        }
+        if (new short[3] == null) {
+            return -1;
+        }
+        if (new int[3] == null) {
+            return -1;
+        }
+        if (new long[3] == null) {
+            return -1;
+        }
+
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putfield.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_putfield {
+
+    private static BC_putfield object = new BC_putfield();
+
+    private int field;
+
+    public static int test(int arg) {
+        object.field = arg;
+        return object.field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putstatic.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_putstatic {
+
+    private static int field;
+
+    public static int test(int a) {
+        field = a;
+        return field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_saload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_saload {
+
+    static short[] array = {0, -1, 4, 10000};
+
+    public static short test(int arg) {
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 0), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) -1), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) 4), test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((short) 10000), test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_sastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_sastore {
+
+    static short[] array = {0, 0, 0, 0};
+
+    public static short test(int arg, short val) {
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 0), test(0, ((short) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) -1), test(1, ((short) -1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) 11), test(2, ((short) 11)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((short) -14), test(3, ((short) -14)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_tableswitch {
+
+    public static int test(int a) {
+        switch (a) {
+            case 0:
+                return 10;
+            case 1:
+                return 20;
+            case 2:
+                return 30;
+            case 4:
+                return 40;
+            case 5:
+                return 50;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(42, test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(20, test(1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(30, test(2));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(42, test(3));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(40, test(4));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(50, test(5));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(42, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_tableswitch2 {
+
+    public static int test(int a) {
+        switch (a) {
+            case 5:
+                return 55;
+            case 6:
+                return 66;
+            case 7:
+                return 77;
+        }
+        return 11;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(55, test(5));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(66, test(6));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(77, test(7));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(11, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_tableswitch3 {
+
+    public static int test(int a) {
+        switch (a) {
+            case -2:
+                return 22;
+            case -1:
+                return 11;
+            case 0:
+                return 33;
+            case 1:
+                return 77;
+        }
+        return 99;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(22, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(99, test(-3));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(99, test(-4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(77, test(1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(99, test(2));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(99, test(10));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch4.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_tableswitch4 {
+
+    public static int test(int a) {
+        switch (a) {
+            case -5:
+                return 55;
+            case -4:
+                return 44;
+            case -3:
+                return 33;
+        }
+        return 11;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(55, test(-5));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(44, test(-4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(33, test(-3));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(11, test(-8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_wide01 {
+
+    @SuppressWarnings("unused")
+    public static int test(int arg) {
+
+        // Checkstyle: stop
+        long i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15;
+        long j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
+        long k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15;
+        long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15;
+        long m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15;
+        long n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15;
+        long o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15;
+        long p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15;
+        long q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15;
+        long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
+        // Checkstyle: resume
+
+        int i255 = 10;
+        return arg + i255 + 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(12, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.bytecode;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_wide02 {
+
+    @SuppressWarnings("unused")
+    public static int test(int arg) {
+
+        // Checkstyle: stop
+        long i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15;
+        long j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
+        long k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15;
+        long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15;
+        long m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15;
+        long n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15;
+        long o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15;
+        long p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15;
+        long q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15;
+        long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
+        // Checkstyle: resume
+
+        int i255 = 9;
+        i255++;
+        return arg + i255 + 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(12, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload0.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_aaload0 {
+
+    static Object[] array = {null, null, ""};
+
+    public static Object test(int arg) {
+        final Object[] obj = arg == -2 ? null : array;
+        return obj[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(null, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aaload1 {
+
+    static Object[] array = {null, null, ""};
+
+    public static Object test(int arg) {
+        final Object[] obj = arg == -2 ? null : array;
+        try {
+            return obj[arg];
+        } catch (NullPointerException e) {
+            return null;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(-2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(null, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore0.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_aastore0 {
+
+    static Object[] param = {new Object(), null, "h"};
+    static Object[] arr = {null, null, null};
+    static String[] arr2 = {null, null, null};
+
+    public static int test(boolean a, int indx) {
+        Object[] array = a ? arr : arr2;
+        Object val;
+        if (indx == -2) {
+            array = null;
+            val = null;
+        } else {
+            val = param[indx];
+        }
+        array[indx] = val;
+        return indx;
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(true, -2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(true, -1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(true, 0));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1, test(true, 1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(2, test(true, 2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run5() throws Throwable {
+        test(true, 3);
+    }
+
+    @Test(expected = java.lang.ArrayStoreException.class)
+    public void run6() throws Throwable {
+        test(false, 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(1, test(false, 1));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(2, test(false, 2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run9() throws Throwable {
+        test(false, 3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_aastore1 {
+
+    static Object[] param = {new Object(), null, "h"};
+    static Object[] arr = {null, null, null};
+    static String[] arr2 = {null, null, null};
+
+    public static int test(boolean a, int indx) {
+        try {
+            Object[] array = a ? arr : arr2;
+            Object val;
+            if (indx == -2) {
+                array = null;
+                val = null;
+            } else {
+                val = param[indx];
+            }
+            array[indx] = val;
+            return indx;
+        } catch (NullPointerException e) {
+            return 5;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5, test(true, -2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(true, -1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(true, 0));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1, test(true, 1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(2, test(true, 2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run5() throws Throwable {
+        test(true, 3);
+    }
+
+    @Test(expected = java.lang.ArrayStoreException.class)
+    public void run6() throws Throwable {
+        test(false, 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(1, test(false, 1));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(2, test(false, 2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run9() throws Throwable {
+        test(false, 3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_anewarray.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_anewarray {
+
+    @SuppressWarnings("unused")
+    public static int test(int a) {
+        final BC_anewarray[] v = new BC_anewarray[a];
+        if (v != null) {
+            return a;
+        }
+        return -1;
+    }
+
+    @Test(expected = java.lang.NegativeArraySizeException.class)
+    public void run0() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_arraylength.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_arraylength {
+
+    static int[] arr = {1, 2, 3};
+    static char[] arr2 = {'a', 'b', 'c', 'd'};
+    static Object[] arr3 = new Object[5];
+
+    @SuppressWarnings("all")
+    public static int test(int arg) {
+        if (arg == 0) {
+            int[] array = null;
+            return array.length;
+        }
+        if (arg == 1) {
+            return arr.length;
+        }
+        if (arg == 2) {
+            return arr2.length;
+        }
+        if (arg == 3) {
+            return arr3.length;
+        }
+        return 42;
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(3, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(4, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(5, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(42, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow0.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_athrow0 {
+
+    static Throwable throwable = new Throwable();
+
+    public static int test(int arg) throws Throwable {
+        if (arg == 2) {
+            throw throwable;
+        }
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.Throwable.class)
+    public void run1() throws Throwable {
+        test(2);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_athrow1 {
+
+    static Throwable throwable = new Throwable();
+
+    public static int test(int arg) throws Throwable {
+        if (arg == 2) {
+            throw throwable;
+        }
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test(expected = java.lang.Throwable.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_athrow2 {
+
+    static Throwable throwable = new Throwable();
+
+    public static int test(int arg) throws Throwable {
+        if (arg == 2) {
+            throw throwable;
+        } else if (arg == 3) {
+            throw null;
+        }
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.Throwable.class)
+    public void run1() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_athrow3 {
+
+    static Throwable throwable = new Throwable();
+
+    public static int test(int arg) throws Throwable {
+        if (arg == 2) {
+            throw2();
+        } else if (arg == 3) {
+            throw1();
+        }
+        return arg;
+    }
+
+    private static void throw2() throws Throwable {
+        throw throwable;
+    }
+
+    private static void throw1() throws Throwable {
+        throw null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.Throwable.class)
+    public void run1() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_baload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_baload {
+
+    static boolean[] arr = {true, false, true, false};
+
+    public static boolean test(int arg) {
+        final boolean[] array = arg == -2 ? null : arr;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_bastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_bastore {
+
+    static boolean[] arr = {false, false, false, false};
+
+    public static boolean test(int arg, boolean val) {
+        final boolean[] array = arg == -2 ? null : arr;
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2, true);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1, false);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(0, true));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4, true);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_caload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_caload {
+
+    static char[] arr = {'\000', 'a', ' ', 10000};
+
+    public static char test(int arg) {
+        final char[] array = arg == -2 ? null : arr;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 0), test(0));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_castore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_castore {
+
+    static char[] arr = {0, 0, 0, 0};
+
+    public static char test(int arg, char val) {
+        final char[] array = arg == -2 ? null : arr;
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2, ((char) 97));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1, ((char) 99));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 97), test(0, ((char) 97)));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4, ((char) 97));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new BC_checkcast();
+
+    public static int test(int arg) {
+        Object obj = null;
+        if (arg == 2) {
+            obj = object2;
+        }
+        if (arg == 3) {
+            obj = object3;
+        }
+        if (arg == 4) {
+            obj = object4;
+        }
+        final BC_checkcast bc = (BC_checkcast) obj;
+        if (bc == null) {
+            return arg;
+        }
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run1() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run2() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast1 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new BC_checkcast1();
+
+    public static int test(int arg) {
+        Object obj = null;
+        if (arg == 2) {
+            obj = object2;
+        }
+        if (arg == 3) {
+            obj = object3;
+        }
+        if (arg == 4) {
+            obj = object4;
+        }
+        final BC_checkcast1 bc = (BC_checkcast1) obj;
+        if (bc == null) {
+            return arg;
+        }
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run1() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run2() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast2 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new com.oracle.graal.jtt.except.BC_checkcast2();
+
+    public static int test(int arg) {
+        Object obj;
+        if (arg == 2) {
+            obj = object2;
+        } else if (arg == 3) {
+            obj = object3;
+        } else if (arg == 4) {
+            obj = object4;
+        } else {
+            obj = null;
+        }
+        final BC_checkcast2 bc = (BC_checkcast2) obj;
+        if (bc != null) {
+            return arg;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast3.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast3 {
+
+    static Object[] o1 = {new Object()};
+    static String[] o2 = {""};
+    static BC_checkcast3[] o3 = {new BC_checkcast3()};
+
+    public static int test(int arg) {
+        Object obj = null;
+        if (arg == 0) {
+            obj = o1;
+        }
+        if (arg == 1) {
+            obj = o2;
+        }
+        if (arg == 2) {
+            obj = o3;
+        }
+        Object[] r = (BC_checkcast3[]) obj;
+        return r == null ? -1 : -1;
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast4.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class BC_checkcast4 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new BC_checkcast4();
+
+    public static int test(int arg) {
+        Object obj;
+        if (arg == 2) {
+            obj = object2;
+        } else if (arg == 3) {
+            obj = object3;
+        } else if (arg == 4) {
+            obj = object4;
+        } else {
+            obj = null;
+        }
+        final BC_checkcast4 bc = (BC_checkcast4) obj;
+        if (bc != null) {
+            return arg;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast5.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast5 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new BC_checkcast5();
+
+    public static int test(int arg) {
+        Object obj;
+        if (arg == 2) {
+            obj = object2;
+        } else if (arg == 3) {
+            obj = object3;
+        } else if (arg == 4) {
+            obj = object4;
+        } else {
+            obj = null;
+        }
+        try {
+            final BC_checkcast5 bc = (BC_checkcast5) obj;
+            if (bc != null) {
+                return arg;
+            }
+        } catch (ClassCastException e) {
+            return -5;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-5, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-5, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast6.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class BC_checkcast6 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new BC_checkcast6();
+
+    public static int test(int arg) {
+        Object obj;
+        if (arg == 2) {
+            obj = object2;
+        } else if (arg == 3) {
+            obj = object3;
+        } else if (arg == 4) {
+            obj = object4;
+        } else {
+            obj = null;
+        }
+        try {
+            final BC_checkcast6 bc = (BC_checkcast6) obj;
+            if (bc != null) {
+                return arg;
+            }
+        } catch (ClassCastException e) {
+            return -5;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-5, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-5, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_daload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_daload {
+
+    static double[] arr = {0.0, -1.1, 4.32, 6.06};
+
+    public static double test(int arg) {
+        final double[] array = arg == -2 ? null : arr;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.0d, test(0), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_dastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_dastore {
+
+    static double[] arr = {0, 0, 0, 0};
+
+    public static double test(int arg, double val) {
+        final double[] array = arg == -2 ? null : arr;
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2, 0.01d);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1, -1.4d);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.01d, test(0, 0.01d), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4, 0.01d);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_faload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_faload {
+
+    static float[] arr = {0.0f, -1.1f, 4.32f, 6.06f};
+
+    public static float test(int arg) {
+        final float[] array = arg == -2 ? null : arr;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.0f, test(0), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_fastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_fastore {
+
+    static float[] arr = {0, 0, 0, 0};
+
+    public static float test(int arg, float val) {
+        final float[] array = arg == -2 ? null : arr;
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2, 0.01f);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1, -1.4f);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.01f, test(0, 0.01f), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4, 0.01f);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_getfield.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_getfield {
+
+    private static BC_getfield object = new BC_getfield();
+
+    private int field = 13;
+
+    public static int test(int arg) {
+        final BC_getfield obj = (arg == 3) ? null : object;
+        return obj.field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(13, test(0));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run1() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_iaload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_iaload {
+
+    static int[] arr = {0, -1, 4, 1000000000};
+
+    public static int test(int arg) {
+        final int[] array = arg == -2 ? null : arr;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_iastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_iastore {
+
+    static int[] arr = {0, 0, 0, 0};
+
+    public static int test(int arg, int val) {
+        final int[] array = arg == -2 ? null : arr;
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2, 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1, 3);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(0, 0));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4, 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_idiv {
+
+    public static int test(int a, int b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 2));
+    }
+
+    @Test(expected = java.lang.ArithmeticException.class)
+    public void run1() throws Throwable {
+        test(11, 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_idiv2 {
+
+    public static int test(int a, int b) {
+        try {
+            return a / b;
+        } catch (Exception e) {
+            return -11;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-11, test(11, 0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokespecial01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public class BC_invokespecial01 {
+
+    private static final BC_invokespecial01 obj = new BC_invokespecial01();
+
+    public static boolean test(int arg) {
+        BC_invokespecial01 object = null;
+        if (arg == 0) {
+            object = obj;
+        }
+        return object.method();
+    }
+
+    private boolean method() {
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_invokevirtual01 {
+
+    private static final BC_invokevirtual01 obj = new BC_invokevirtual01();
+
+    public static boolean test(int arg) {
+        BC_invokevirtual01 object = null;
+        if (arg == 0) {
+            object = obj;
+        }
+        return object.method();
+    }
+
+    public boolean method() {
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public class BC_invokevirtual02 {
+
+    private static final BC_invokevirtual02 obj = new BC_invokevirtual02();
+
+    public static boolean test(int arg) {
+        BC_invokevirtual02 object = null;
+        if (arg == 0) {
+            object = obj;
+        }
+        return object.method();
+    }
+
+    public final boolean method() {
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_irem.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_irem {
+
+    public static int test(int a, int b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(1, 2));
+    }
+
+    @Test(expected = java.lang.ArithmeticException.class)
+    public void run1() throws Throwable {
+        test(11, 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_laload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_laload {
+
+    static long[] arr = {0L, -1L, 4L, 1000000000000L};
+
+    public static long test(int arg) {
+        final long[] array = arg == -2 ? null : arr;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0L, test(0));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_lastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_lastore {
+
+    static long[] arr = {0, 0, 0, 0};
+
+    public static long test(int arg, long val) {
+        final long[] array = arg == -2 ? null : arr;
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2, 0L);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1, 3L);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0L, test(0, 0L));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4, 0L);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_ldiv {
+
+    public static long test(long a, long b) {
+        return a / b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(1L, 2L));
+    }
+
+    @Test(expected = java.lang.ArithmeticException.class)
+    public void run1() throws Throwable {
+        test(11L, 0L);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_ldiv2 {
+
+    public static long test(long a, long b) {
+        try {
+            return a / b;
+        } catch (Exception e) {
+            return -11;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(1L, 2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-11L, test(11L, 0L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_lrem.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_lrem {
+
+    public static long test(long a, long b) {
+        return a % b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(1L, 2L));
+    }
+
+    @Test(expected = java.lang.ArithmeticException.class)
+    public void run1() throws Throwable {
+        test(11L, 0L);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_monitorenter.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_monitorenter {
+
+    static com.oracle.graal.jtt.bytecode.BC_monitorenter object = new com.oracle.graal.jtt.bytecode.BC_monitorenter();
+
+    public static boolean test(boolean arg) {
+        final Object o = arg ? object : null;
+        synchronized (o) {
+            return arg;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(true));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run1() throws Throwable {
+        test(false);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_multianewarray.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_multianewarray {
+
+    @SuppressWarnings("unused")
+    public static int test(int a, int b) {
+        final BC_multianewarray[][] v = new BC_multianewarray[a][b];
+        if (v != null) {
+            return a;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1, 1));
+    }
+
+    @Test(expected = java.lang.NegativeArraySizeException.class)
+    public void run2() throws Throwable {
+        test(-1, 0);
+    }
+
+    @Test(expected = java.lang.NegativeArraySizeException.class)
+    public void run3() throws Throwable {
+        test(0, -1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_newarray.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_newarray {
+
+    public static int test(int a) {
+        if (new boolean[a] == null) {
+            return -1;
+        }
+        if (new char[a] == null) {
+            return -1;
+        }
+        if (new float[a] == null) {
+            return -1;
+        }
+        if (new double[a] == null) {
+            return -1;
+        }
+        if (new byte[a] == null) {
+            return -1;
+        }
+        if (new short[a] == null) {
+            return -1;
+        }
+        if (new int[a] == null) {
+            return -1;
+        }
+        if (new long[a] == null) {
+            return -1;
+        }
+
+        return a;
+    }
+
+    @Test(expected = java.lang.NegativeArraySizeException.class)
+    public void run0() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_putfield.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_putfield {
+
+    private static BC_putfield object = new BC_putfield();
+
+    private int field;
+
+    public static int test(int arg) {
+        final BC_putfield obj = arg == 3 ? null : object;
+        obj.field = arg;
+        return obj.field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run1() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_saload.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_saload {
+
+    static short[] arr = {0, -1, 4, 10000};
+
+    public static short test(int arg) {
+        final short[] array = arg == -2 ? null : arr;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) 0), test(0));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_sastore.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class BC_sastore {
+
+    static short[] arr = {0, 0, 0, 0};
+
+    public static short test(int arg, short val) {
+        final short[] array = arg == -2 ? null : arr;
+        array[arg] = val;
+        return array[arg];
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(-2, ((short) 0));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(-1, ((short) 3));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) 0), test(0, ((short) 0)));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(4, ((short) 0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Loop01 {
+
+    public static int test(int arg) {
+        int accum = 0;
+        for (int i = 0; i < arg; i++) {
+            try {
+                accum += div(20, i);
+            } catch (ArithmeticException e) {
+                accum -= 100;
+            }
+        }
+        return accum;
+    }
+
+    static int div(int a, int b) {
+        return a / (b % 3);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-170, test(4));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-150, test(5));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-140, test(6));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-240, test(7));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-700, test(30));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Loop02 {
+
+    public static int test(int arg) {
+        int accum = 0;
+        for (int i = 0; i < arg; i++) {
+            try {
+                accum += div(20, i);
+            } catch (IllegalArgumentException e) {
+                accum -= 100;
+            }
+        }
+        return accum;
+    }
+
+    static int div(int a, int b) {
+        if (b % 3 == 0) {
+            throw new IllegalArgumentException();
+        }
+        return a / (b % 3);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-170, test(4));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-150, test(5));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-140, test(6));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-240, test(7));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-700, test(30));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Loop03 {
+
+    public static int test(int arg) {
+        int accum = 0;
+        for (int i = 0; i < arg; i++) {
+            try {
+                accum += div(20, i);
+            } catch (Catch_Loop03_Exception1 e) {
+                accum -= 100;
+            }
+        }
+        return accum;
+    }
+
+    static int div(int a, int b) {
+        if (b % 3 == 0) {
+            throw new Catch_Loop03_Exception1();
+        }
+        return a / (b % 3);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-170, test(4));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-150, test(5));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-140, test(6));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-240, test(7));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-700, test(30));
+    }
+
+}
+
+@SuppressWarnings("serial")
+class Catch_Loop03_Exception1 extends RuntimeException {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_1.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NASE_1 {
+
+    @SuppressWarnings("unused")
+    public static int test(int a) {
+        try {
+            int[] v = new int[a];
+            if (v != null) {
+                return v.length;
+            }
+            return -1;
+        } catch (NegativeArraySizeException e) {
+            return 100;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(100, test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(100, test(-34));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(20, test(20));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NASE_2 {
+
+    @SuppressWarnings("unused")
+    public static int test(int a) {
+        try {
+            Catch_NASE_2[] v = new Catch_NASE_2[a];
+            if (v != null) {
+                return v.length;
+            }
+            return -1;
+        } catch (NegativeArraySizeException e) {
+            return 100;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(100, test(-1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(100, test(-34));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(20, test(20));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_00.java	Thu Mar 08 19:24:17 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.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_00 {
+
+    public static int test(int a) {
+        int[] array = a > 0 ? new int[3] : null;
+        try {
+            return array.length;
+        } catch (NullPointerException npe) {
+            return -1;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(-3));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3, test(1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_01 {
+
+    public static int test(int a) {
+        try {
+            if (a >= 0) {
+                throw new NullPointerException();
+            }
+        } catch (NullPointerException npe) {
+            return a;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_02 {
+
+    public static int test(int a) {
+        try {
+            throwNPE(a);
+        } catch (NullPointerException npe) {
+            return a;
+        }
+        return -1;
+    }
+
+    private static void throwNPE(int a) {
+        if (a >= 0) {
+            throw new NullPointerException();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_03 {
+
+    @SuppressWarnings("all")
+    public static int test(int a) {
+        try {
+            if (a >= 0) {
+                final Object o = null;
+                return o.hashCode();
+            }
+        } catch (NullPointerException npe) {
+            return a;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_04 {
+
+    private int field = 45;
+
+    @SuppressWarnings("all")
+    public static int test(int a) {
+        try {
+            if (a >= 0) {
+                final Catch_NPE_04 obj = null;
+                return obj.field;
+            }
+        } catch (NullPointerException npe) {
+            return a;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_05 {
+
+    private int field = 45;
+
+    public static int test(int a) {
+        try {
+            return throwNPE(a);
+        } catch (NullPointerException npe) {
+            return a;
+        }
+    }
+
+    @SuppressWarnings("all")
+    private static int throwNPE(int a) {
+        if (a >= 0) {
+            final Catch_NPE_05 obj = null;
+            return obj.field;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_06 {
+
+    public static int test(String string) {
+        try {
+            return string.hashCode();
+        } catch (NullPointerException npe) {
+            return -1;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(""));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(null));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_07.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+
+public class Catch_NPE_07 {
+
+    @SuppressWarnings("serial")
+    public static class MyThrowable extends Throwable {
+    }
+
+    @SuppressWarnings("unused")
+    public static int foo(Throwable t) {
+        try {
+            throw t;
+        } catch (Throwable t1) {
+            if (t1 == null) {
+                return -1;
+            }
+            if (t1 instanceof NullPointerException) {
+                return 0;
+            }
+            if (t1 instanceof MyThrowable) {
+                return 1;
+            }
+            return -2;
+        }
+    }
+
+    public static int test(int i) {
+        Throwable t = (i == 0) ? null : new MyThrowable();
+        try {
+            return foo(t);
+        } catch (Throwable t1) {
+            return -3;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_08.java	Thu Mar 08 19:24:17 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.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_08 {
+
+    public static int test(int a) {
+        try {
+            throwNPE(a);
+        } catch (NullPointerException npe) {
+            return a;
+        }
+        return -1;
+    }
+
+    @SuppressWarnings("unused")
+    private static void throwNPE(int a) {
+        throw null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-2, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_09.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_09 {
+
+    public static int test(int a) {
+        int r = 0;
+        try {
+            r = 0;
+            throwNPE(a);
+            r = 1;
+            throwNPE(a - 1);
+        } catch (NullPointerException e) {
+            return r + 10;
+        }
+        return r;
+    }
+
+    private static void throwNPE(int a) {
+        if (a == 0) {
+            throw null;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_10.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_10 {
+
+    public static int test(int a) {
+        int r = 0;
+        try {
+            r = 0;
+            if (a == 0) {
+                throw null;
+            }
+            r = 1;
+            if (a - 1 == 0) {
+                throw null;
+            }
+        } catch (NullPointerException e) {
+            return r + 10;
+        }
+        return r;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_11.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_NPE_11 {
+
+    public static int test(int a) {
+        int r = 0;
+        try {
+            r = 0;
+            throwE(a);
+            r = 1;
+            throwE(a - 1);
+        } catch (ArithmeticException e) {
+            return r + 10;
+        }
+        return r;
+    }
+
+    private static int throwE(int a) {
+        return 1 / a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_StackOverflowError_01 {
+
+    private static void recurse() {
+        recurse();
+    }
+
+    public static int test() throws StackOverflowError {
+        recurse();
+        return -1;
+    }
+
+    @Test(expected = java.lang.StackOverflowError.class)
+    public void run0() throws Throwable {
+        test();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_StackOverflowError_02 {
+
+    private static void recurse() {
+        recurse();
+    }
+
+    public static int test() {
+        try {
+            recurse();
+        } catch (StackOverflowError stackOverflowError) {
+            // tests that the guard page was reset and a second SOE can be handled
+            recurse();
+        }
+        return -1;
+    }
+
+    @Test(expected = java.lang.StackOverflowError.class)
+    public void run0() throws Throwable {
+        test();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/**
+ * Some basic checking of the stack trace produced after a StackOverflowError.
+ */
+public class Catch_StackOverflowError_03 {
+
+    private static final int PASS = 0;
+    private static final int FAIL = 1;
+
+    private static void recurseA() {
+        recurseB();
+    }
+
+    private static void recurseB() {
+        recurseA();
+    }
+
+    public static int test() {
+        try {
+            recurseA();
+        } catch (StackOverflowError stackOverflowError) {
+            // Check that a method does not appear to be calling itself in the stack trace
+            // and check that recurse* is only called by either recurse* or test
+            StackTraceElement[] elements = null;
+            elements = stackOverflowError.getStackTrace();
+            if (elements.length == 0) {
+                // Not much we can do about this perfectly legal situation
+                return PASS;
+            }
+            String lastMethodName = elements[0].getMethodName();
+            for (int i = 1; i < elements.length; ++i) {
+                String methodName = elements[i].getMethodName();
+
+                // Skip top-of-stack until we find a method with name "recurse*".
+                if (!methodName.startsWith("recurse")) {
+                    continue;
+                }
+
+                // We reached the test method => done.
+                if (methodName.equals("test")) {
+                    break;
+                }
+
+                // Stack elements must alternate between recurseA and recurseB
+                if (lastMethodName.equals(methodName) || (!methodName.equals("recurseA") && !methodName.equals("recurseB"))) {
+                    return FAIL;
+                }
+
+                lastMethodName = methodName;
+            }
+
+            return PASS;
+        }
+
+        return FAIL;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Two01 {
+
+    public static String test(int arg) {
+        try {
+            throwSomething(arg);
+        } catch (NullPointerException e) {
+            return e.getClass().getName();
+        } catch (ArithmeticException e) {
+            return e.getClass().getName();
+        }
+        return "none";
+    }
+
+    private static void throwSomething(int arg) {
+        if (arg == 0) {
+            throw new NullPointerException();
+        }
+        if (arg == 1) {
+            throw new ArithmeticException();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("java.lang.NullPointerException", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("java.lang.ArithmeticException", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("none", test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Two02 {
+
+    public static String test(int arg) {
+        try {
+            throwSomething(arg + 10);
+        } catch (NullPointerException e) {
+            return e.getClass().getName();
+        } catch (ArithmeticException e) {
+            return e.getClass().getName();
+        }
+        return "none" + (arg + 10);
+    }
+
+    private static void throwSomething(int arg) {
+        if (arg == 10) {
+            throw new NullPointerException();
+        }
+        if (arg == 11) {
+            throw new ArithmeticException();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("java.lang.NullPointerException", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("java.lang.ArithmeticException", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("none13", test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Two03 {
+
+    public static String test(int arg) {
+        int r = 0;
+        try {
+            r = 1;
+            throwSomething(r + arg);
+            r = 2;
+            throwSomething(r + arg);
+            r = 3;
+            throwSomething(r + arg);
+            r = 4;
+        } catch (NullPointerException e) {
+            return e.getClass().getName() + r;
+        } catch (ArithmeticException e) {
+            return e.getClass().getName() + r;
+        }
+        return "none" + r;
+    }
+
+    private static void throwSomething(int arg) {
+        if (arg == 5) {
+            throw new NullPointerException();
+        }
+        if (arg == 6) {
+            throw new ArithmeticException();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("none4", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("none4", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("java.lang.NullPointerException3", test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Unresolved {
+
+    public static boolean executed;
+
+    public static int test(int arg) {
+        executed = false;
+        try {
+            helper1(arg);
+            helper2(arg);
+        } catch (Catch_Unresolved_Exception1 e) {
+            return 1;
+        } catch (Catch_Unresolved_Exception2 e) {
+            return 2;
+        }
+        return 0;
+    }
+
+    private static void helper1(int arg) {
+        if (executed) {
+            throw new IllegalStateException("helper1 may only be called once");
+        }
+        executed = true;
+        if (arg == 1) {
+            throw new Catch_Unresolved_Exception1();
+        } else if (arg == 2) {
+            throw new Catch_Unresolved_Exception2();
+        }
+    }
+
+    private static void helper2(int arg) {
+        if (arg != 0) {
+            throw new IllegalStateException("helper2 can only be called if arg==0");
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+}
+
+@SuppressWarnings("serial")
+class Catch_Unresolved_Exception1 extends RuntimeException {
+}
+
+@SuppressWarnings("serial")
+class Catch_Unresolved_Exception2 extends RuntimeException {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Unresolved01 {
+
+    public static boolean executed;
+
+    public static int test(int arg) {
+        executed = false;
+        try {
+            helper1(arg);
+        } catch (Catch_Unresolved_Exception3 e) {
+            return 1;
+        } catch (Catch_Unresolved_Exception4 e) {
+            return 2;
+        }
+        return 0;
+    }
+
+    private static void helper1(int arg) {
+        if (executed) {
+            throw new IllegalStateException("helper1 may only be called once");
+        }
+        executed = true;
+        if (arg == 1) {
+            throw new Catch_Unresolved_Exception3();
+        } else if (arg == 2) {
+            throw new Catch_Unresolved_Exception4();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+}
+
+@SuppressWarnings("serial")
+class Catch_Unresolved_Exception3 extends RuntimeException {
+}
+
+@SuppressWarnings("serial")
+class Catch_Unresolved_Exception4 extends RuntimeException {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Unresolved02 {
+
+    public static boolean executed;
+    public static int value;
+
+    public static int test(int arg) {
+        executed = false;
+        int result = 0;
+        try {
+            result = value + helper1(arg) + helper2(arg);
+        } catch (Catch_Unresolved02_Exception1 e) {
+            return 1 + result;
+        } catch (Catch_Unresolved02_Exception2 e) {
+            return 2 + result;
+        }
+        return result;
+    }
+
+    private static int helper1(int arg) {
+        if (executed) {
+            throw new IllegalStateException("helper1 may only be called once");
+        }
+        executed = true;
+        if (arg == 1) {
+            throw new Catch_Unresolved02_Exception1();
+        } else if (arg == 2) {
+            throw new Catch_Unresolved02_Exception2();
+        }
+        return 0;
+    }
+
+    private static int helper2(int arg) {
+        if (arg != 0) {
+            throw new IllegalStateException("helper2 can only be called if arg==0");
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+}
+
+@SuppressWarnings("serial")
+class Catch_Unresolved02_Exception1 extends RuntimeException {
+}
+
+@SuppressWarnings("serial")
+class Catch_Unresolved02_Exception2 extends RuntimeException {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Catch_Unresolved03 {
+
+    public static boolean executed;
+    public static int value;
+
+    public static int test(int arg) {
+        executed = false;
+        int result = 0;
+        try {
+            result = value + helper1(arg) + helper2(arg);
+        } catch (Catch_Unresolved03_Exception1 e) {
+            if (arg == 1) {
+                return 1;
+            }
+            return new Catch_Unresolved03_UnresolvedClass().value();
+        }
+        return result;
+    }
+
+    private static int helper1(int arg) {
+        if (executed) {
+            throw new IllegalStateException("helper1 may only be called once");
+        }
+        executed = true;
+        if (arg == 1 || arg == 2) {
+            throw new Catch_Unresolved03_Exception1();
+        }
+        return 0;
+    }
+
+    private static int helper2(int arg) {
+        if (arg != 0) {
+            throw new IllegalStateException("helper2 can only be called if arg==0");
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+}
+
+@SuppressWarnings("serial")
+class Catch_Unresolved03_Exception1 extends RuntimeException {
+}
+
+class Catch_Unresolved03_UnresolvedClass {
+
+    public int value() {
+        return 2;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Locals.java	Thu Mar 08 19:24:17 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.graal.jtt.except;
+
+import org.junit.*;
+
+public class Except_Locals {
+
+    public static int test(String a, String b) {
+        int x = 0;
+        try {
+            x = 1;
+            a.toString();
+            x = 2;
+            b.toString();
+        } catch (NullPointerException e) {
+            // System.out.println(x);
+            return x;
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(null, null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test("", null));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test("", ""));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Except_Synchronized01 {
+
+    static final Except_Synchronized01 object = new Except_Synchronized01();
+
+    final int x = 1;
+
+    public static int test(int i) throws Exception {
+        if (i == 0) {
+            return 0;
+        }
+        return object.test2(i);
+    }
+
+    @SuppressWarnings("all")
+    public synchronized int test2(int i) throws Exception {
+        try {
+            Except_Synchronized01 object = null;
+            return object.x;
+        } catch (NullPointerException e) {
+            return 2;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Except_Synchronized02 {
+
+    static final Except_Synchronized02 object = new Except_Synchronized02();
+
+    final int x = 1;
+
+    public static int test(int i) throws Exception {
+        if (i == 0) {
+            return 0;
+        }
+        return object.test2(i);
+    }
+
+    @SuppressWarnings("all")
+    public synchronized int test2(int i) throws Exception {
+        while (true) {
+            try {
+                Except_Synchronized02 object = null;
+                return object.x;
+            } catch (NullPointerException e) {
+                return 2;
+            }
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Except_Synchronized03 {
+
+    static final Except_Synchronized03 object = new Except_Synchronized03();
+
+    int x = 1;
+
+    public static int test(int i) throws Exception {
+        if (i == 0) {
+            return 0;
+        }
+        return object.test2(i);
+    }
+
+    @SuppressWarnings("all")
+    public synchronized int test2(int i) throws Exception {
+        while (true) {
+            try {
+                synchronized (this) {
+                    Except_Synchronized03 object = null;
+                    return object.x;
+                }
+            } catch (NullPointerException e) {
+                return 2;
+            }
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Except_Synchronized04 {
+
+    static final Except_Synchronized04 object = new Except_Synchronized04();
+
+    final int x = 1;
+
+    public static int test(int i) throws Exception {
+        if (i == 0) {
+            return 0;
+        }
+        return object.test2(i);
+    }
+
+    @SuppressWarnings("all")
+    public int test2(int i) throws Exception {
+        try {
+            synchronized (Except_Synchronized04.class) {
+                Except_Synchronized04 object = null;
+                return object.x;
+            }
+        } catch (NullPointerException e) {
+            return 2;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public class Except_Synchronized05 {
+
+    Object field;
+
+    public static int test(int arg) {
+        Except_Synchronized05 obj = new Except_Synchronized05();
+        int a = obj.bar(arg) != null ? 1 : 0;
+        int b = obj.baz(arg) != null ? 1 : 0;
+        return a + b;
+    }
+
+    public synchronized Object bar(int arg) {
+        try {
+            String f = foo1(arg);
+            if (f == null) {
+                field = new Object();
+            }
+        } catch (NullPointerException e) {
+            // do nothing
+        }
+        return field;
+    }
+
+    public Object baz(int arg) {
+        synchronized (this) {
+            try {
+                String f = foo1(arg);
+                if (f == null) {
+                    field = new Object();
+                }
+            } catch (NullPointerException e) {
+                // do nothing
+            }
+            return field;
+        }
+    }
+
+    private String foo1(int arg) {
+        if (arg == 0) {
+            throw null;
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Finally01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Finally01 {
+
+    @SuppressWarnings("all")
+    public static int test(int arg) {
+        try {
+            return 0;
+        } finally {
+            return -1;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Finally02.java	Thu Mar 08 19:24:17 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.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class Finally02 {
+
+    public static int test() {
+        try {
+            a();
+        } finally {
+            b();
+        }
+
+        return c();
+    }
+
+// @NEVER_INLINE
+    static int a() {
+        return 0;
+    }
+
+// @NEVER_INLINE
+    static int b() {
+        return -3;
+    }
+
+    static int c() {
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_AIOOBE_00.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class StackTrace_AIOOBE_00 {
+
+    private static int[] array = new int[3];
+
+    public static int test(int a) {
+        try {
+            return array[a];
+        } catch (ArrayIndexOutOfBoundsException npe) {
+            for (StackTraceElement e : npe.getStackTrace()) {
+                if (e.getClassName().equals(StackTrace_AIOOBE_00.class.getName()) && e.getMethodName().equals("test")) {
+                    return -1;
+                }
+            }
+        }
+        return -2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_CCE_00.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class StackTrace_CCE_00 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new StackTrace_CCE_00();
+
+    public static int test(int arg) {
+        Object obj = null;
+        if (arg == 2) {
+            obj = object2;
+        }
+        if (arg == 3) {
+            obj = object3;
+        }
+        if (arg == 4) {
+            obj = object4;
+        }
+        try {
+            final StackTrace_CCE_00 bc = (StackTrace_CCE_00) obj;
+            if (bc == null) {
+                return arg;
+            }
+            return arg;
+        } catch (ClassCastException npe) {
+            for (StackTraceElement e : npe.getStackTrace()) {
+                if (e.getClassName().equals(StackTrace_CCE_00.class.getName()) && e.getMethodName().equals("test")) {
+                    return -100;
+                }
+            }
+            return -200;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-100, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-100, test(3));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_00.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class StackTrace_NPE_00 {
+
+    public static int test(int a) {
+        int[] array = a > 0 ? new int[3] : null;
+        try {
+            return array.length;
+        } catch (NullPointerException npe) {
+            for (StackTraceElement e : npe.getStackTrace()) {
+                if (e.getClassName().equals(StackTrace_NPE_00.class.getName())) {
+                    return -1;
+                }
+            }
+            return -2;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(-3));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3, test(1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class StackTrace_NPE_01 {
+
+    @SuppressWarnings("all")
+    public static int test(int a) {
+        try {
+            if (a >= 0) {
+                final Object o = null;
+                return o.hashCode();
+            }
+        } catch (NullPointerException npe) {
+            for (StackTraceElement e : npe.getStackTrace()) {
+                if (e.getClassName().equals(StackTrace_NPE_01.class.getName()) && e.getMethodName().equals("test")) {
+                    return a;
+                }
+            }
+        }
+        return -1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class StackTrace_NPE_02 {
+
+    private static String[] trace = {"test1", "test"};
+
+    public static int test(int a) {
+        try {
+            if (a >= 0) {
+                return test1();
+            }
+        } catch (NullPointerException npe) {
+            String thisClass = StackTrace_NPE_02.class.getName();
+            StackTraceElement[] stackTrace = npe.getStackTrace();
+            for (int i = 0; i < stackTrace.length; i++) {
+                StackTraceElement e = stackTrace[i];
+                if (e.getClassName().equals(thisClass)) {
+                    for (int j = 0; j < trace.length; j++) {
+                        StackTraceElement f = stackTrace[i + j];
+                        if (!f.getClassName().equals(thisClass)) {
+                            return -2;
+                        }
+                        if (!f.getMethodName().equals(trace[j])) {
+                            return -3;
+                        }
+                    }
+                    return 0;
+                }
+            }
+        }
+        return -1;
+    }
+
+    @SuppressWarnings("all")
+    private static int test1() {
+        final Object o = null;
+        return o.hashCode();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class StackTrace_NPE_03 {
+
+    private static String[] trace = {"test2", "test1", "test"};
+
+    public static int test(int a) {
+        try {
+            if (a >= 0) {
+                return test1();
+            }
+        } catch (NullPointerException npe) {
+            String thisClass = StackTrace_NPE_03.class.getName();
+            StackTraceElement[] stackTrace = npe.getStackTrace();
+            for (int i = 0; i < stackTrace.length; i++) {
+                StackTraceElement e = stackTrace[i];
+                if (e.getClassName().equals(thisClass)) {
+                    for (int j = 0; j < trace.length; j++) {
+                        StackTraceElement f = stackTrace[i + j];
+                        if (!f.getClassName().equals(thisClass)) {
+                            return -2;
+                        }
+                        if (!f.getMethodName().equals(trace[j])) {
+                            return -3;
+                        }
+                    }
+                    return 0;
+                }
+            }
+        }
+        return -1;
+    }
+
+    private static int test1() {
+        return test2();
+    }
+
+    private static int test2() {
+        throw new NullPointerException();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(-2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_InCatch01 {
+
+    public static boolean test(int i) throws Exception {
+        if (i == 0) {
+            return true;
+        }
+        try {
+            throw new Exception();
+        } catch (Exception e) {
+            throw e;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_InCatch02 {
+
+    public static boolean test(int i) throws Exception {
+        if (i == 0) {
+            return true;
+        }
+        try {
+            throwE();
+        } catch (Exception e) {
+            throwE(e);
+        }
+        return false;
+    }
+
+    private static void throwE(Exception e) throws Exception {
+        throw e;
+    }
+
+    private static void throwE() throws Exception {
+        throw new Exception();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_InCatch03 {
+
+    public static boolean test(int i) throws Exception {
+        if (i == 0) {
+            return true;
+        }
+        try {
+            throwE();
+        } catch (Exception e) {
+            throw e;
+        }
+        return false;
+    }
+
+    private static void throwE() throws Exception {
+        throw new Exception();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InNested.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_InNested {
+
+    public static int test(int i) throws Exception {
+        return 42 + test2(i);
+    }
+
+    public static int test2(int i) throws Exception {
+        try {
+            return test3(i);
+        } catch (Exception e) {
+            return 5;
+        }
+    }
+
+    private static int test3(int i) {
+        if (i == 0) {
+            throw new RuntimeException();
+        }
+        return i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(47, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(43, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_NPE_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_NPE_01 {
+
+    public static int test(int i) throws Exception {
+        int a = test2(i);
+        a = a + 1;
+        return a;
+    }
+
+    public static int test2(int i) {
+        if (i < 0) {
+            throw null;
+        }
+        return i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(-1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_Synchronized01 {
+
+    public static synchronized boolean test(int i) throws Exception {
+        return i == 0 || test2(i);
+    }
+
+    @SuppressWarnings("unused")
+    public static boolean test2(int i) throws Exception {
+        throw new Exception();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_Synchronized02 {
+
+    public static synchronized boolean test(int i) throws Exception {
+        if (i == 0) {
+            return true;
+        }
+        throw new Exception();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_Synchronized03 {
+
+    public static synchronized boolean test(int i) throws Exception {
+        if (i == 0) {
+            return true;
+        }
+        return test2(i);
+    }
+
+    @SuppressWarnings("unused")
+    public static synchronized boolean test2(int i) throws Exception {
+        throw new Exception();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_Synchronized04 {
+
+    static final Throw_Synchronized04 object = new Throw_Synchronized04();
+
+    public static boolean test(int i) throws Exception {
+        if (i == 0) {
+            return true;
+        }
+        return object.test2(i);
+    }
+
+    @SuppressWarnings("unused")
+    public synchronized boolean test2(int i) throws Exception {
+        throw new Exception();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized05.java	Thu Mar 08 19:24:17 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.graal.jtt.except;
+
+import org.junit.*;
+
+public class Throw_Synchronized05 {
+
+    static final Throw_Synchronized05 object = new Throw_Synchronized05();
+
+    public static boolean test(int i) throws Exception {
+        if (i == 0) {
+            return true;
+        }
+        return object.test2(i);
+    }
+
+    @SuppressWarnings("unused")
+    public synchronized boolean test2(int i) throws Exception {
+        try {
+            throw new Exception();
+        } catch (Exception e) {
+            // do nothing and then rethrow
+            throw e;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_allocate01 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            sum += i;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(3160, test(80));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_allocate02 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            final Integer j = new Integer(i);
+            sum += j;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4950, test(100));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_allocate03 {
+
+    public static int test(int count) {
+        @SuppressWarnings("unused")
+        final int sum = 0;
+        String text = "";
+        for (int i = 0; i < count; i++) {
+            text += '.';
+        }
+        return text.length();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(100, test(100));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate04.java	Thu Mar 08 19:24:17 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.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_allocate04 {
+
+    public static int test(int count) {
+        int[] a = new int[count];
+
+        for (int i = 0; i < a.length; i++) {
+            a[i] = i;
+        }
+
+        int i = 0;
+        int iwrap = count - 1;
+        int sum = 0;
+
+        while (i < count) {
+            sum += (a[i] + a[iwrap]) / 2;
+            iwrap = i;
+            i++;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3120, test(80));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_array01 {
+
+    public static int[] array = new int[40];
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            array[i] = i;
+            sum += array[i];
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(780, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_array02 {
+
+    public static byte[] b = new byte[40];
+    public static char[] c = new char[40];
+    public static short[] s = new short[40];
+    public static int[] iArray = new int[40];
+    public static long[] l = new long[40];
+    public static float[] f = new float[40];
+    public static double[] d = new double[40];
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int x = 0; x < count; x++) {
+            b[x] = (byte) x;
+            c[x] = (char) x;
+            s[x] = (short) x;
+            iArray[x] = x;
+            l[x] = x;
+            f[x] = x;
+            d[x] = x;
+            sum += b[x] + c[x] + s[x] + iArray[x] + l[x] + f[x] + d[x];
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5460, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_array03 {
+
+    public static byte[] b = new byte[40];
+    public static char[] c = new char[40];
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            sum += b.length + c.length;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3200, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_array04 {
+
+    public static byte[] b = new byte[40];
+    public static char[] c = new char[40];
+
+    public static int test(int count) {
+        int sum = 0;
+
+        for (int i = 0; i < b.length; i++) {
+            b[i] = (byte) i;
+            c[i] = (char) i;
+        }
+
+        for (int j = 0; j < 10; j++) {
+            try {
+                for (int i = 0; i < count; i++) {
+                    sum += b[i] + c[i];
+                }
+            } catch (IndexOutOfBoundsException e) {
+                sum += j;
+            }
+        }
+
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(15645, test(80));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_control01 {
+
+    public static int test(int count) {
+        int i1 = 1;
+        int i2 = 2;
+        int i3 = 3;
+        int i4 = 4;
+
+        for (int i = 0; i < count; i++) {
+            i1 = i2;
+            i2 = i3;
+            i3 = i4;
+            i4 = i1;
+
+            i1 = i2;
+            i2 = i3;
+            i3 = i4;
+            i4 = i1;
+
+            i1 = i2;
+            i2 = i3;
+            i3 = i4;
+            i4 = i1;
+
+            i1 = i2;
+            i2 = i3;
+            i3 = i4;
+            i4 = i1;
+        }
+
+        return i1 + i2 * 10 + i3 * 100 + i4 * 1000;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2432, test(40));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(3243, test(80));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_control02 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            switch (i) {
+                case 30:
+                    sum += 30;
+                    break;
+                case 31:
+                    sum += 31;
+                    break;
+                case 32:
+                    sum += 32;
+                    break;
+                case 33:
+                    sum += 33;
+                    break;
+                case 34:
+                    sum += 34;
+                    break;
+                case 35:
+                    sum += 35;
+                    break;
+                case 36:
+                    sum += 36;
+                    break;
+                case 37:
+                    sum += 37;
+                    break;
+                case 38:
+                    sum += 38;
+                    break;
+                case 39:
+                    sum += 39;
+                    break;
+                case 40:
+                    sum += 40;
+                    break;
+                case 41:
+                    sum += 41;
+                    break;
+                case 42:
+                    sum += 42;
+                    break;
+                default:
+                    sum += 1;
+                    break;
+            }
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(515, test(60));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(555, test(100));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_convert01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_convert01 {
+
+    public static int test(int count) {
+        double sum = 0;
+        for (int i = 0; i < count; i++) {
+            sum = (int) sum + i;
+        }
+        return (int) sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4950, test(100));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_count.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ * Runs: 10 = 55; 20 = 210; 30 = 465; 40 = 820;
+ */
+@SuppressWarnings("unused")
+public class HP_count {
+
+    public static int test(int count) {
+        float unusedFloat = 0;
+        double dub = 0;
+        int sum = 0;
+        double unusedDouble = 0;
+        for (int i = 0; i <= count; i++) {
+            if (i > 20) {
+                sum += i;
+            } else {
+                sum += i;
+            }
+            dub += sum;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(820, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_dead01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_dead01 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i <= count; i++) {
+            int a = i + i;
+            int b = i / 2 * i - 10;
+            @SuppressWarnings("unused")
+            int c = a + b;
+            int d = a;
+            sum += d;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(110, test(10));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(420, test(20));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(930, test(30));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1640, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_demo01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_demo01 {
+
+    public static int test(int count) {
+        int sum = 0;
+
+        for (int i = 0; i < count; i++) {
+            int[] ia = new int[count];
+            long[] la = new long[count];
+            float[] fa = new float[count];
+            double[] da = new double[count];
+            sum += ia[i] = (int) (la[i] = (long) (fa[i] = (float) (da[i] = i)));
+        }
+
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3160, test(80));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_field01 {
+
+    public static int a;
+    public static int b;
+    public static int c;
+
+    public static int test(int count) {
+        for (int i = 0; i <= count; i++) {
+            if (i > 5) {
+                a += i;
+            } else if (i > 7) {
+                b += i;
+            } else {
+                c += i;
+            }
+        }
+        return a + b + c;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(820, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ * Runs: 10 = 55; 20 = 210; 30 = 465; 40 = 820;
+ */
+public class HP_field02 {
+
+    public int a;
+    public int b;
+    public int c;
+
+    public static int test(int count) {
+        return new HP_field02().run(count);
+    }
+
+    public int run(int count) {
+        for (int i = 0; i <= count; i++) {
+            if (i > 5) {
+                a += i;
+            } else if (i > 7) {
+                b += i;
+            } else {
+                c += i;
+            }
+        }
+        return a + b + c;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(820, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_field03 {
+
+    public static byte b;
+    public static char c;
+    public static short s;
+    public static int i;
+    public static long l;
+    public static float f;
+    public static double d;
+
+    public static int test(int count) {
+        for (int x = 0; x <= count; x++) {
+            b += x;
+            c += x;
+            s += x;
+            i += x;
+            l += x;
+            f += x;
+            d += x;
+        }
+        return (int) (b + c + s + i + l + f + d);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2019980, test(1000));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_field04 {
+
+    public byte b;
+    public char c;
+    public short s;
+    public int i;
+    public long l;
+    public float f;
+    public double d;
+
+    public static int test(int count) {
+        return new HP_field04().run(count);
+    }
+
+    public int run(int count) {
+        for (int x = 0; x <= count; x++) {
+            b += x;
+            c += x;
+            s += x;
+            i += x;
+            l += x;
+            f += x;
+            d += x;
+        }
+        return (int) (b + c + s + i + l + f + d);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4972, test(40));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2019980, test(1000));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_idea.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,456 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+
+package com.oracle.graal.jtt.hotpath;
+
+import java.util.*;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public class HP_idea {
+
+    public boolean test() {
+        buildTestData();
+        Do();
+        return verify();
+    }
+
+    // Declare class data. Byte buffer plain1 holds the original
+    // data for encryption, crypt1 holds the encrypted data, and
+    // plain2 holds the decrypted data, which should match plain1
+    // byte for byte.
+
+    int array_rows;
+
+    byte[] plain1; // Buffer for plaintext data.
+    byte[] crypt1; // Buffer for encrypted data.
+    byte[] plain2; // Buffer for decrypted data.
+
+    short[] userkey; // Key for encryption/decryption.
+    int[] Z; // Encryption subkey (userkey derived).
+    int[] DK; // Decryption subkey (userkey derived).
+
+    void Do() {
+        cipher_idea(plain1, crypt1, Z); // Encrypt plain1.
+        cipher_idea(crypt1, plain2, DK); // Decrypt.
+    }
+
+    /*
+     * buildTestData
+     * 
+     * Builds the data used for the test -- each time the test is run.
+     */
+
+    void buildTestData() {
+        // Create three byte arrays that will be used (and reused) for
+        // encryption/decryption operations.
+
+        plain1 = new byte[array_rows];
+        crypt1 = new byte[array_rows];
+        plain2 = new byte[array_rows];
+
+        Random rndnum = new Random(136506717L); // Create random number generator.
+
+        // Allocate three arrays to hold keys: userkey is the 128-bit key.
+        // Z is the set of 16-bit encryption subkeys derived from userkey,
+        // while DK is the set of 16-bit decryption subkeys also derived
+        // from userkey. NOTE: The 16-bit values are stored here in
+        // 32-bit int arrays so that the values may be used in calculations
+        // as if they are unsigned. Each 64-bit block of plaintext goes
+        // through eight processing rounds involving six of the subkeys
+        // then a final output transform with four of the keys; (8 * 6)
+        // + 4 = 52 subkeys.
+
+        userkey = new short[8]; // User key has 8 16-bit shorts.
+        Z = new int[52]; // Encryption subkey (user key derived).
+        DK = new int[52]; // Decryption subkey (user key derived).
+
+        // Generate user key randomly; eight 16-bit values in an array.
+
+        for (int i = 0; i < 8; i++) {
+            // Again, the random number function returns int. Converting
+            // to a short type preserves the bit pattern in the lower 16
+            // bits of the int and discards the rest.
+
+            userkey[i] = (short) rndnum.nextInt();
+        }
+
+        // Compute encryption and decryption subkeys.
+
+        calcEncryptKey();
+        calcDecryptKey();
+
+        // Fill plain1 with "text."
+        for (int i = 0; i < array_rows; i++) {
+            plain1[i] = (byte) i;
+
+            // Converting to a byte
+            // type preserves the bit pattern in the lower 8 bits of the
+            // int and discards the rest.
+        }
+    }
+
+    /*
+     * calcEncryptKey
+     * 
+     * Builds the 52 16-bit encryption subkeys Z[] from the user key and stores in 32-bit int array. The routing
+     * corrects an error in the source code in the Schnier book. Basically, the sense of the 7- and 9-bit shifts are
+     * reversed. It still works reversed, but would encrypted code would not decrypt with someone else's IDEA code.
+     */
+
+    private void calcEncryptKey() {
+        int j; // Utility variable.
+
+        for (int i = 0; i < 52; i++) {
+            // Zero out the 52-int Z array.
+            Z[i] = 0;
+        }
+
+        for (int i = 0; i < 8; i++) // First 8 subkeys are userkey itself.
+        {
+            Z[i] = userkey[i] & 0xffff; // Convert "unsigned"
+            // short to int.
+        }
+
+        // Each set of 8 subkeys thereafter is derived from left rotating
+        // the whole 128-bit key 25 bits to left (once between each set of
+        // eight keys and then before the last four). Instead of actually
+        // rotating the whole key, this routine just grabs the 16 bits
+        // that are 25 bits to the right of the corresponding subkey
+        // eight positions below the current subkey. That 16-bit extent
+        // straddles two array members, so bits are shifted left in one
+        // member and right (with zero fill) in the other. For the last
+        // two subkeys in any group of eight, those 16 bits start to
+        // wrap around to the first two members of the previous eight.
+
+        for (int i = 8; i < 52; i++) {
+            j = i % 8;
+            if (j < 6) {
+                Z[i] = ((Z[i - 7] >>> 9) | (Z[i - 6] << 7)) // Shift and combine.
+                & 0xFFFF; // Just 16 bits.
+                continue; // Next iteration.
+            }
+
+            if (j == 6) // Wrap to beginning for second chunk.
+            {
+                Z[i] = ((Z[i - 7] >>> 9) | (Z[i - 14] << 7)) & 0xFFFF;
+                continue;
+            }
+
+            // j == 7 so wrap to beginning for both chunks.
+
+            Z[i] = ((Z[i - 15] >>> 9) | (Z[i - 14] << 7)) & 0xFFFF;
+        }
+    }
+
+    /*
+     * calcDecryptKey
+     * 
+     * Builds the 52 16-bit encryption subkeys DK[] from the encryption- subkeys Z[]. DK[] is a 32-bit int array holding
+     * 16-bit values as unsigned.
+     */
+
+    private void calcDecryptKey() {
+        int j, k; // Index counters.
+        int t1, t2, t3; // Temps to hold decrypt subkeys.
+
+        t1 = inv(Z[0]); // Multiplicative inverse (mod x10001).
+        t2 = -Z[1] & 0xffff; // Additive inverse, 2nd encrypt subkey.
+        t3 = -Z[2] & 0xffff; // Additive inverse, 3rd encrypt subkey.
+
+        DK[51] = inv(Z[3]); // Multiplicative inverse (mod x10001).
+        DK[50] = t3;
+        DK[49] = t2;
+        DK[48] = t1;
+
+        j = 47; // Indices into temp and encrypt arrays.
+        k = 4;
+        for (int i = 0; i < 7; i++) {
+            t1 = Z[k++];
+            DK[j--] = Z[k++];
+            DK[j--] = t1;
+            t1 = inv(Z[k++]);
+            t2 = -Z[k++] & 0xffff;
+            t3 = -Z[k++] & 0xffff;
+            DK[j--] = inv(Z[k++]);
+            DK[j--] = t2;
+            DK[j--] = t3;
+            DK[j--] = t1;
+        }
+
+        t1 = Z[k++];
+        DK[j--] = Z[k++];
+        DK[j--] = t1;
+        t1 = inv(Z[k++]);
+        t2 = -Z[k++] & 0xffff;
+        t3 = -Z[k++] & 0xffff;
+        DK[j--] = inv(Z[k++]);
+        DK[j--] = t3;
+        DK[j--] = t2;
+        DK[j--] = t1;
+    }
+
+    /*
+     * cipher_idea
+     * 
+     * IDEA encryption/decryption algorithm. It processes plaintext in 64-bit blocks, one at a time, breaking the block
+     * into four 16-bit unsigned subblocks. It goes through eight rounds of processing using 6 new subkeys each time,
+     * plus four for last step. The source text is in array text1, the destination text goes into array text2 The
+     * routine represents 16-bit subblocks and subkeys as type int so that they can be treated more easily as unsigned.
+     * Multiplication modulo 0x10001 interprets a zero sub-block as 0x10000; it must to fit in 16 bits.
+     */
+
+    private void cipher_idea(byte[] text1, byte[] text2, int[] key) {
+
+        int i1 = 0; // Index into first text array.
+        int i2 = 0; // Index into second text array.
+        int ik; // Index into key array.
+        int x1, x2, x3, x4, t1, t2; // Four "16-bit" blocks, two temps.
+        int r; // Eight rounds of processing.
+
+        for (int i = 0; i < text1.length; i += 8) {
+
+            ik = 0; // Restart key index.
+            r = 8; // Eight rounds of processing.
+
+            // Load eight plain1 bytes as four 16-bit "unsigned" integers.
+            // Masking with 0xff prevents sign extension with cast to int.
+
+            x1 = text1[i1++] & 0xff; // Build 16-bit x1 from 2 bytes,
+            x1 |= (text1[i1++] & 0xff) << 8; // assuming low-order byte first.
+            x2 = text1[i1++] & 0xff;
+            x2 |= (text1[i1++] & 0xff) << 8;
+            x3 = text1[i1++] & 0xff;
+            x3 |= (text1[i1++] & 0xff) << 8;
+            x4 = text1[i1++] & 0xff;
+            x4 |= (text1[i1++] & 0xff) << 8;
+
+            do {
+                // 1) Multiply (modulo 0x10001), 1st text sub-block
+                // with 1st key sub-block.
+
+                x1 = (int) ((long) x1 * key[ik++] % 0x10001L & 0xffff);
+
+                // 2) Add (modulo 0x10000), 2nd text sub-block
+                // with 2nd key sub-block.
+
+                x2 = x2 + key[ik++] & 0xffff;
+
+                // 3) Add (modulo 0x10000), 3rd text sub-block
+                // with 3rd key sub-block.
+
+                x3 = x3 + key[ik++] & 0xffff;
+
+                // 4) Multiply (modulo 0x10001), 4th text sub-block
+                // with 4th key sub-block.
+
+                x4 = (int) ((long) x4 * key[ik++] % 0x10001L & 0xffff);
+
+                // 5) XOR results from steps 1 and 3.
+
+                t2 = x1 ^ x3;
+
+                // 6) XOR results from steps 2 and 4.
+                // Included in step 8.
+
+                // 7) Multiply (modulo 0x10001), result of step 5
+                // with 5th key sub-block.
+
+                t2 = (int) ((long) t2 * key[ik++] % 0x10001L & 0xffff);
+
+                // 8) Add (modulo 0x10000), results of steps 6 and 7.
+
+                t1 = t2 + (x2 ^ x4) & 0xffff;
+
+                // 9) Multiply (modulo 0x10001), result of step 8
+                // with 6th key sub-block.
+
+                t1 = (int) ((long) t1 * key[ik++] % 0x10001L & 0xffff);
+
+                // 10) Add (modulo 0x10000), results of steps 7 and 9.
+
+                t2 = t1 + t2 & 0xffff;
+
+                // 11) XOR results from steps 1 and 9.
+
+                x1 ^= t1;
+
+                // 14) XOR results from steps 4 and 10. (Out of order).
+
+                x4 ^= t2;
+
+                // 13) XOR results from steps 2 and 10. (Out of order).
+
+                t2 ^= x2;
+
+                // 12) XOR results from steps 3 and 9. (Out of order).
+
+                x2 = x3 ^ t1;
+
+                x3 = t2; // Results of x2 and x3 now swapped.
+
+            } while (--r != 0); // Repeats seven more rounds.
+
+            // Final output transform (4 steps).
+
+            // 1) Multiply (modulo 0x10001), 1st text-block
+            // with 1st key sub-block.
+
+            x1 = (int) ((long) x1 * key[ik++] % 0x10001L & 0xffff);
+
+            // 2) Add (modulo 0x10000), 2nd text sub-block
+            // with 2nd key sub-block. It says x3, but that is to undo swap
+            // of subblocks 2 and 3 in 8th processing round.
+
+            x3 = x3 + key[ik++] & 0xffff;
+
+            // 3) Add (modulo 0x10000), 3rd text sub-block
+            // with 3rd key sub-block. It says x2, but that is to undo swap
+            // of subblocks 2 and 3 in 8th processing round.
+
+            x2 = x2 + key[ik++] & 0xffff;
+
+            // 4) Multiply (modulo 0x10001), 4th text-block
+            // with 4th key sub-block.
+
+            x4 = (int) ((long) x4 * key[ik++] % 0x10001L & 0xffff);
+
+            // Repackage from 16-bit sub-blocks to 8-bit byte array text2.
+
+            text2[i2++] = (byte) x1;
+            text2[i2++] = (byte) (x1 >>> 8);
+            text2[i2++] = (byte) x3; // x3 and x2 are switched
+            text2[i2++] = (byte) (x3 >>> 8); // only in name.
+            text2[i2++] = (byte) x2;
+            text2[i2++] = (byte) (x2 >>> 8);
+            text2[i2++] = (byte) x4;
+            text2[i2++] = (byte) (x4 >>> 8);
+
+        } // End for loop.
+
+    } // End routine.
+
+    /*
+     * mul
+     * 
+     * Performs multiplication, modulo (2**16)+1. This code is structured on the assumption that untaken branches are
+     * cheaper than taken branches, and that the compiler doesn't schedule branches. Java: Must work with 32-bit int and
+     * one 64-bit long to keep 16-bit values and their products "unsigned." The routine assumes that both a and b could
+     * fit in 16 bits even though they come in as 32-bit ints. Lots of "& 0xFFFF" masks here to keep things 16-bit.
+     * Also, because the routine stores mod (2**16)+1 results in a 2**16 space, the result is truncated to zero whenever
+     * the result would zero, be 2**16. And if one of the multiplicands is 0, the result is not zero, but (2**16) + 1
+     * minus the other multiplicand (sort of an additive inverse mod 0x10001).
+     * 
+     * NOTE: The java conversion of this routine works correctly, but is half the speed of using Java's modulus division
+     * function (%) on the multiplication with a 16-bit masking of the result--running in the Symantec Caje IDE. So it's
+     * not called for now; the test uses Java % instead.
+     */
+
+    /*
+     * private int mul(int a, int b) throws ArithmeticException { long p; // Large enough to catch 16-bit multiply //
+     * without hitting sign bit. if (a != 0) { if(b != 0) { p = (long) a * b; b = (int) p & 0xFFFF; // Lower 16 bits. a
+     * = (int) p >>> 16; // Upper 16 bits.
+     * 
+     * return (b - a + (b < a ? 1 : 0) & 0xFFFF); } else return ((1 - a) & 0xFFFF); // If b = 0, then same as // 0x10001
+     * - a. } else // If a = 0, then return return((1 - b) & 0xFFFF); // same as 0x10001 - b. }
+     */
+
+    /*
+     * inv
+     * 
+     * Compute multiplicative inverse of x, modulo (2**16)+1 using extended Euclid's GCD (greatest common divisor)
+     * algorithm. It is unrolled twice to avoid swapping the meaning of the registers. And some subtracts are changed to
+     * adds. Java: Though it uses signed 32-bit ints, the interpretation of the bits within is strictly unsigned 16-bit.
+     */
+
+    private int inv(int x) {
+        int x2 = x;
+        int t0, t1;
+        int q, y;
+
+        if (x2 <= 1) {
+            return (x2); // 0 and 1 are self-inverse.
+        }
+
+        t1 = 0x10001 / x2; // (2**16+1)/x; x is >= 2, so fits 16 bits.
+        y = 0x10001 % x2;
+        if (y == 1) {
+            return ((1 - t1) & 0xFFFF);
+        }
+
+        t0 = 1;
+        do {
+            q = x2 / y;
+            x2 = x2 % y;
+            t0 += q * t1;
+            if (x2 == 1) {
+                return (t0);
+            }
+            q = y / x2;
+            y = y % x2;
+            t1 += q * t0;
+        } while (y != 1);
+
+        return ((1 - t1) & 0xFFFF);
+    }
+
+    boolean verify() {
+        boolean error;
+        for (int i = 0; i < array_rows; i++) {
+            error = (plain1[i] != plain2[i]);
+            if (error) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /*
+     * freeTestData
+     * 
+     * Nulls arrays and forces garbage collection to free up memory.
+     */
+
+    void freeTestData() {
+        plain1 = null;
+        crypt1 = null;
+        plain2 = null;
+        userkey = null;
+        Z = null;
+        DK = null;
+    }
+
+    public HP_idea() {
+        array_rows = 3000;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_inline01 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            sum += foo(i);
+        }
+        return sum;
+    }
+
+    public static int foo(int x) {
+        if (x < 15) {
+            return bar(x);
+        }
+        return bar(x + 1);
+    }
+
+    public static int bar(int x) {
+        return x + 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(215, test(20));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_inline02 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            sum += foo(i, sum);
+        }
+        return sum;
+    }
+
+    public static int foo(int x, int y) {
+        if (x < 18) {
+            return bar(x, x - y);
+        }
+        return bar(x, x + y);
+    }
+
+    public static int bar(int x, int y) {
+        if (x < 15) {
+            return car(x, x + y);
+        }
+        return x - 1;
+    }
+
+    @SuppressWarnings("unused")
+    public static int car(int x, int y) {
+        if (x < 13) {
+            return x + 1;
+        }
+        return x - 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(196, test(20));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_invoke01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_invoke01 {
+
+    private static int sum;
+
+    public static int test(int count) {
+        sum = 0;
+        final Instruction[] instructions = new Instruction[]{new Instruction.Add(), new Instruction.Sub(), new Instruction.Mul(), new Instruction.Div()};
+        final Visitor v = new Visitor();
+        for (int i = 0; i < count; i++) {
+            instructions[i % 4].accept(v);
+        }
+        return sum;
+    }
+
+    public static abstract class Instruction {
+
+        public abstract void accept(Visitor v);
+
+        public static abstract class Binary extends Instruction {
+
+        }
+
+        public static class Add extends Binary {
+
+            @Override
+            public void accept(Visitor v) {
+                v.visit(this);
+            }
+        }
+
+        public static class Sub extends Binary {
+
+            @Override
+            public void accept(Visitor v) {
+                v.visit(this);
+            }
+        }
+
+        public static class Mul extends Binary {
+
+            @Override
+            public void accept(Visitor v) {
+                v.visit(this);
+            }
+        }
+
+        public static class Div extends Binary {
+
+            @Override
+            public void accept(Visitor v) {
+                v.visit(this);
+            }
+        }
+    }
+
+    @SuppressWarnings("unused")
+    public static class Visitor {
+
+        public void visit(Instruction.Add i) {
+            sum += 7;
+        }
+
+        public void visit(Instruction.Sub i) {
+            sum += 194127;
+        }
+
+        public void visit(Instruction.Mul i) {
+            sum += 18991;
+        }
+
+        public void visit(Instruction.Div i) {
+            sum += 91823;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3049480, test(40));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(6098960, test(80));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_life.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import java.util.*;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_life {
+
+    public static int test(int generations) {
+        reset();
+        for (int i = 0; i < generations; ++i) {
+            step();
+        }
+        int sum = 0;
+        for (int row = 0; row < rows; ++row) {
+            for (int col = 0; col < cols; ++col) {
+                boolean value = cell(row, col);
+                // System.out.print(value ? "1" : "0");
+                sum += (row * 15223242 + col * 21623234) ^ ((value ? 1 : 0) * 15323142);
+            }
+        }
+        return sum;
+    }
+
+    private static final int rows = 20;
+    private static final int cols = 20;
+    private static boolean cells[] = new boolean[rows * cols];
+
+    private static boolean cell(int row, int col) {
+        return ((row >= 0) && (row < rows) && (col >= 0) && (col < cols) && cells[row * cols + col]);
+    }
+
+    private static boolean step() {
+        boolean next[] = new boolean[rows * cols];
+        boolean changed = false;
+        for (int row = rows - 1; row >= 0; --row) {
+            int row_offset = row * cols;
+            for (int col = cols - 1; col >= 0; --col) {
+                int count = 0;
+                if (cell(row - 1, col - 1)) {
+                    count++;
+                }
+                if (cell(row - 1, col)) {
+                    count++;
+                }
+                if (cell(row - 1, col + 1)) {
+                    count++;
+                }
+                if (cell(row, col - 1)) {
+                    count++;
+                }
+                if (cell(row, col + 1)) {
+                    count++;
+                }
+                if (cell(row + 1, col - 1)) {
+                    count++;
+                }
+                if (cell(row + 1, col)) {
+                    count++;
+                }
+                if (cell(row + 1, col + 1)) {
+                    count++;
+                }
+                boolean old_state = cells[row_offset + col];
+                boolean new_state = (!old_state && count == 3) || (old_state && (count == 2 || count == 3));
+                if (!changed && new_state != old_state) {
+                    changed = true;
+                }
+                next[row_offset + col] = new_state;
+            }
+        }
+        cells = next;
+        return changed;
+    }
+
+    private static void reset() {
+        Random random = new Random(0);
+        boolean cells2[] = HP_life.cells;
+        for (int offset = 0; offset < cells2.length; ++offset) {
+            cells2[offset] = random.nextDouble() > 0.5;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1756613086, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_nest01 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            sum += i;
+            for (int j = 0; j < count; j++) {
+                sum += j;
+            }
+            for (int j = 0; j < count; j++) {
+                sum += j;
+            }
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3255, test(15));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_nest02 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            sum += i;
+            sum = foo(count, sum);
+            sum = foo(count, sum);
+        }
+        return sum;
+    }
+
+    private static int foo(int count, int s) {
+        int sum = s;
+        for (int j = 0; j < count; j++) {
+            sum += j;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3255, test(15));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_scope01 {
+
+    public static int test(int count) {
+        int sum = 0;
+
+        for (int k = 0; k < count; k++) {
+            {
+                int i = 1;
+                sum += i;
+            }
+            {
+                float f = 3;
+                sum += f;
+            }
+            {
+                long l = 7;
+                sum += l;
+            }
+            {
+                double d = 11;
+                sum += d;
+            }
+        }
+
+        for (int k = 0; k < count; k++) {
+            if (k < 20) {
+                int i = 1;
+                sum += i;
+            } else {
+                float f = 3;
+                sum += f;
+            }
+        }
+
+        for (int k = 0; k < count; k++) {
+            int i = 3;
+            for (int j = 0; j < count; j++) {
+                float f = 7;
+                sum += i + f;
+            }
+        }
+
+        for (int k = 0; k < count; k++) {
+            for (int j = 0; j < count; j++) {
+                float f = 7;
+                sum += j + f;
+            }
+            int i = 3;
+            sum += i;
+        }
+
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(59480, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_scope02 {
+
+    public static int test(int count) {
+        int sum = 0;
+        // Although sum is not explicitly read in the tree below it is implicitly read
+        // by the guard bail-out.
+        for (int i = 0; i < count; i++) {
+            if (i > 20) {
+                break; // We need to write back either the original value of sum, or the previous iteration's value.
+            }
+            sum = i;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(20, test(40));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(20, test(22));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_series.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_series {
+
+    public static double test(int count) {
+        final int arrayRows = count;
+        final double[][] testArray = new double[2][arrayRows];
+        double omega; // Fundamental frequency.
+        testArray[0][0] = TrapezoidIntegrate(0.0, // Lower bound.
+                        2.0, // Upper bound.
+                        1000, // # of steps.
+                        0.0, // No omega*n needed.
+                        0) / 2.0; // 0 = term A[0].
+        omega = 3.1415926535897932;
+        for (int i = 1; i < arrayRows; i++) {
+            testArray[0][i] = TrapezoidIntegrate(0.0, 2.0, 1000, omega * i, 1); // 1 = cosine
+            // term.
+            testArray[1][i] = TrapezoidIntegrate(0.0, 2.0, 1000, omega * i, 2); // 2 = sine
+            // term.
+        }
+        final double ref[][] = {{2.8729524964837996, 0.0}, {1.1161046676147888, -1.8819691893398025}, {0.34429060398168704, -1.1645642623320958}, {0.15238898702519288, -0.8143461113044298}};
+        double error = 0.0;
+        double sum = 0.0;
+        for (int i = 0; i < 4; i++) {
+            for (int j = 0; j < 2; j++) {
+                error += Math.abs(testArray[j][i] - ref[i][j]);
+                sum += testArray[j][i];
+            }
+        }
+        return sum + error;
+    }
+
+    private static double TrapezoidIntegrate(double x0, // Lower bound.
+                    double x1, // Upper bound.
+                    int ns, // # of steps.
+                    double omegan, // omega * n.
+                    int select) // Term type.
+    {
+        int nsteps = ns;
+        double x; // Independent variable.
+        double dx; // Step size.
+        double rvalue; // Return value.
+
+        x = x0;
+        dx = (x1 - x0) / nsteps;
+        rvalue = thefunction(x0, omegan, select) / 2.0;
+        if (nsteps != 1) {
+            --nsteps; // Already done 1 step.
+            while (--nsteps > 0) {
+                x += dx;
+                rvalue += thefunction(x, omegan, select);
+            }
+        }
+        rvalue = (rvalue + thefunction(x1, omegan, select) / 2.0) * dx;
+        return (rvalue);
+    }
+
+    private static double thefunction(double x, // Independent variable.
+                    double omegan, // Omega * term.
+                    int select) // Choose type.
+    {
+        switch (select) {
+            case 0:
+                return (Math.pow(x + 1.0, x));
+            case 1:
+                return (Math.pow(x + 1.0, x) * Math.cos(omegan * x));
+            case 2:
+                return (Math.pow(x + 1.0, x) * Math.sin(omegan * x));
+        }
+        return (0.0);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.6248571921291398d, test(100), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_trees01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+// Checkstyle: stop
+package com.oracle.graal.jtt.hotpath;
+
+import org.junit.*;
+
+/*
+ */
+public class HP_trees01 {
+
+    public static int test(int count) {
+        int sum = 0;
+        for (int i = 0; i < count; i++) {
+            if (i < 100) {
+                sum += 1;
+            } else if (i < 200) {
+                sum += 3;
+            } else if (i < 300) {
+                sum += 5;
+            } else if (i < 400) {
+                sum += 7;
+            } else if (i < 500) {
+                sum += 11;
+            }
+
+            if (i % 5 == 0) {
+                sum += 1;
+            } else if (i % 5 == 1) {
+                sum += 3;
+            } else if (i % 5 == 2) {
+                sum += 5;
+            } else if (i % 5 == 3) {
+                sum += 7;
+            } else if (i % 5 == 4) {
+                sum += 11;
+            }
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(8100, test(1000));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6186134.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotspot;
+
+import java.util.*;
+
+import org.junit.*;
+
+public class Test6186134 {
+
+    public static class TestClass {
+
+        int num = 0;
+
+        public TestClass(int n) {
+            num = n;
+        }
+
+        public boolean more() {
+            return num-- > 0;
+        }
+
+        public ArrayList test1() {
+            ArrayList<Object> res = new ArrayList<>();
+            int maxResults = Integer.MAX_VALUE;
+            int n = 0;
+            boolean more = more();
+            while ((n++ < maxResults) && more) {
+                res.add(new Object());
+                more = more();
+            }
+            return res;
+        }
+
+    }
+
+    public static int test(int n) {
+        for (int i = 0; i < n; i++) {
+            TestClass t = new TestClass(10);
+            int size = t.test1().size();
+            if (size != 10) {
+                return 97;
+            }
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(100));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6196102.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotspot;
+
+import org.junit.*;
+
+/**
+ * @test
+ * @bug 6196102
+ * @summary Integer seems to be greater than Integer.MAX_VALUE
+ * 
+ * @run main Test6196102
+ */
+
+public class Test6196102 {
+
+    public static String test() {
+        int i1 = 0;
+        int i2 = Integer.MAX_VALUE;
+
+        while (i1 >= 0) {
+            i1++;
+            if (i1 > i2) {
+                return "E R R O R: " + i1;
+            }
+        }
+        return "ok";
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("ok", test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6753639.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotspot;
+
+import org.junit.*;
+
+/**
+ * @test
+ * @bug 6753639
+ * @summary Strange optimisation in for loop with cyclic integer condition
+ * 
+ * @run main/othervm -Xbatch Test6753639
+ */
+
+public class Test6753639 {
+
+    public static int test() {
+        int end = Integer.MAX_VALUE;
+        int count = 0;
+        for (int i = Integer.MAX_VALUE - 5; i <= end; i++) {
+            count++;
+            if (count > 100000) {
+                return 95;
+            }
+        }
+        return 97;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(95, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6850611.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotspot;
+
+import org.junit.*;
+
+/**
+ * @test
+ * @bug 6850611
+ * @summary int / long arithmetic seems to be broken in 1.6.0_14 HotSpot Server VM (Win XP)
+ * 
+ * @run main Test6850611
+ */
+
+public class Test6850611 {
+
+    public static int test() {
+        // for (int j = 0; j < 5; ++j) {
+        long x = 0;
+        for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; ++i) {
+            x += i;
+        }
+        if (x != -4294967295L) {
+            return 97;
+        }
+        // }
+        return 95;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(95, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6959129.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotspot;
+
+import org.junit.*;
+
+/**
+ * @test
+ * @bug 6959129
+ * @summary COMPARISON WITH INTEGER.MAX_INT DOES NOT WORK CORRECTLY IN THE CLIENT VM.
+ * 
+ *          This test will not run properly without assertions
+ * 
+ * @run main/othervm -ea Test6959129
+ */
+
+public class Test6959129 {
+
+    public static int test() {
+        int min = Integer.MAX_VALUE - 30000;
+        int max = Integer.MAX_VALUE;
+        try {
+            maxMoves(min, max);
+        } catch (AssertionError e) {
+            return 95;
+        }
+        return 97;
+    }
+
+    /**
+     * Imperative implementation that returns the length hailstone moves for a given number.
+     */
+    public static long hailstoneLengthImp(long n2) {
+        long n = n2;
+        long moves = 0;
+        while (n != 1) {
+            assert n > 1;
+            if (isEven(n)) {
+                n = n / 2;
+            } else {
+                n = 3 * n + 1;
+            }
+            ++moves;
+        }
+        return moves;
+    }
+
+    private static boolean isEven(long n) {
+        return n % 2 == 0;
+    }
+
+    /**
+     * Returns the maximum length of the hailstone sequence for numbers between min to max.
+     * 
+     * For rec1 - Assume that min is bigger than max.
+     */
+    public static long maxMoves(int min, int max) {
+        long maxmoves = 0;
+        for (int n = min; n <= max; n++) {
+            long moves = hailstoneLengthImp(n);
+            if (moves > maxmoves) {
+                maxmoves = moves;
+            }
+        }
+        return maxmoves;
+    }
+
+    // @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(95, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test7005594.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.hotspot;
+
+/**
+ * @test
+ * @bug 7005594
+ * @summary Array overflow not handled correctly with loop optimzations
+ * 
+ * @run shell Test7005594.sh
+ * @##Disabled huge heap##Runs: 0 = 95
+ */
+
+public class Test7005594 {
+
+    private static int test0(byte[] a) {
+        int result = 0;
+        for (int i = 0; i < a.length; i += ((0x7fffffff >> 1) + 1)) {
+            result += a[i];
+        }
+        return result;
+    }
+
+    public static int test() {
+        byte[] a = new byte[(0x7fffffff >> 1) + 2];
+        try {
+            test0(a);
+        } catch (ArrayIndexOutOfBoundsException e) {
+            return 95;
+        }
+        return 97;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/Class_getName.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import org.junit.*;
+
+/*
+ */
+public class Class_getName {
+
+    public static String test(int a) {
+        if (a == 0) {
+            return String.class.getName();
+        }
+        return "";
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("java.lang.String", test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import java.util.*;
+
+import org.junit.*;
+
+/*
+ */
+public class EnumMap01 {
+
+    private static final EnumMap<Enum, String> map = new EnumMap<>(Enum.class);
+
+    static {
+        map.put(Enum.A, "A");
+        map.put(Enum.B, "B");
+        map.put(Enum.C, "C");
+    }
+
+    public static String test(int i) {
+        return map.get(Enum.values()[i]);
+    }
+
+    private enum Enum {
+        A, B, C
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("A", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("B", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("C", test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import java.util.*;
+
+import org.junit.*;
+
+/*
+ */
+public class EnumMap02 {
+
+    public static String test(int i) {
+        EnumMap<Enum, String> map = new EnumMap<>(Enum.class);
+        map.put(Enum.A, "A");
+        map.put(Enum.B, "B");
+        map.put(Enum.C, "C");
+        return map.get(Enum.values()[i]);
+    }
+
+    private enum Enum {
+        A, B, C
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("A", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("B", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("C", test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import org.junit.*;
+
+/*
+ */
+public class System_currentTimeMillis01 {
+
+    public static int test() {
+        long start = System.currentTimeMillis();
+        for (int i = 0; i < 10000000; i++) {
+            if (System.currentTimeMillis() - start > 0) {
+                return 1;
+            }
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import org.junit.*;
+
+/*
+ */
+public class System_currentTimeMillis02 {
+
+    public static boolean test() {
+        long start = System.currentTimeMillis();
+        long delta = 0;
+        for (int i = 0; delta == 0 && i < 5000000; i++) {
+            delta = System.currentTimeMillis() - start;
+            // do nothing.
+        }
+        // better get at least 40 millisecond resolution.
+        return delta >= 1 && delta < 40;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import org.junit.*;
+
+/*
+ */
+public class System_nanoTime01 {
+
+    public static int test() {
+        long start = System.nanoTime();
+        for (int i = 0; i < 10000000; i++) {
+            if (System.nanoTime() - start > 0) {
+                return 1;
+            }
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import org.junit.*;
+
+/*
+ */
+public class System_nanoTime02 {
+
+    public static boolean test() {
+        long minDelta = Long.MAX_VALUE;
+
+        // the first call to System.nanoTime might take a long time due to call resolution
+        for (int c = 0; c < 10; c++) {
+            long start = System.nanoTime();
+            long delta = 0;
+            int i;
+            for (i = 0; delta == 0 && i < 50000; i++) {
+                delta = System.nanoTime() - start;
+                // do nothing.
+            }
+            if (delta < minDelta) {
+                minDelta = delta;
+            }
+        }
+
+        // better get at least 30 microsecond resolution.
+        return minDelta > 1 && minDelta < 30000;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_setOut.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import java.io.*;
+
+import org.junit.*;
+
+/*
+ */
+public class System_setOut {
+
+    public static int test(int n) throws Exception {
+        PrintStream oldOut = System.out;
+        int sum = 0;
+        for (int i = 0; i < 10; i++) {
+            ByteArrayOutputStream ba = new ByteArrayOutputStream(n * 10);
+            PrintStream newOut = new PrintStream(ba);
+            System.setOut(newOut);
+            doPrint(n);
+            sum += ba.size();
+        }
+
+        System.setOut(oldOut);
+        return sum;
+    }
+
+// @NEVER_INLINE
+    private static void doPrint(int n) {
+        for (int i = 0; i < n; i++) {
+            System.out.print('x');
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        System.out.println(test(10000));
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(100000, test(10000));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/Thread_setName.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import org.junit.*;
+
+/*
+ */
+public class Thread_setName {
+
+    public static String test(String name) {
+        String oldName = Thread.currentThread().getName();
+        Thread.currentThread().setName(name);
+        String name2 = Thread.currentThread().getName();
+        Thread.currentThread().setName(oldName);
+        return name2;
+    }
+
+    public static void main(String[] args) throws Exception {
+        System.out.println(test("abc"));
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("abc", test("abc"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/UnsafeAccess01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+import sun.misc.*;
+
+/*
+ */
+public class UnsafeAccess01 {
+
+    @SuppressWarnings("unused")
+    private int field = 42;
+
+    public static int test() throws SecurityException, NoSuchFieldException, IllegalAccessException {
+        final Unsafe unsafe = getUnsafe();
+
+        final UnsafeAccess01 object = new UnsafeAccess01();
+        final Field field = UnsafeAccess01.class.getDeclaredField("field");
+        final long offset = unsafe.objectFieldOffset(field);
+        final int value = unsafe.getInt(object, offset);
+        return value;
+    }
+
+    private static Unsafe getUnsafe() throws NoSuchFieldException, IllegalAccessException {
+        final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
+        unsafeField.setAccessible(true);
+        return (Unsafe) unsafeField.get(null);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(42, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Boxed_TYPE_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Boxed_TYPE_01 {
+
+    public static String test(int i) {
+        if (i == 0) {
+            return Boolean.TYPE.getName();
+        }
+        if (i == 1) {
+            return Byte.TYPE.getName();
+        }
+        if (i == 2) {
+            return Character.TYPE.getName();
+        }
+        if (i == 3) {
+            return Double.TYPE.getName();
+        }
+        if (i == 4) {
+            return Float.TYPE.getName();
+        }
+        if (i == 5) {
+            return Integer.TYPE.getName();
+        }
+        if (i == 6) {
+            return Long.TYPE.getName();
+        }
+        if (i == 7) {
+            return Short.TYPE.getName();
+        }
+        if (i == 8) {
+            return Void.TYPE.getName();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("boolean", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("byte", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("char", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("double", test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals("float", test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals("int", test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals("long", test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals("short", test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals("void", test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Bridge_method01.java	Thu Mar 08 19:24:17 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.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Bridge_method01 {
+
+    private abstract static class Wrap<T> {
+
+        abstract T get();
+    }
+
+    private static class IWrap extends Wrap<Integer> {
+
+        @Override
+        Integer get() {
+            return 1;
+        }
+    }
+
+    private static Wrap<Integer> wrapped = new IWrap();
+
+    public static int test() {
+        return wrapped.get();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/ClassLoader_loadClass01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import java.net.*;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class ClassLoader_loadClass01 {
+
+    public static String test(int i) throws ClassNotFoundException {
+        final URLClassLoader classLoader = new URLClassLoader(new URL[0], String.class.getClassLoader());
+        if (i == 0) {
+            return classLoader.loadClass("java.lang.String").toString();
+        } else if (i == 1) {
+            return classLoader.loadClass("[Ljava.lang.String;").toString();
+        } else if (i == 2) {
+            return classLoader.loadClass("java.lang.String[]").toString();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("class java.lang.String", test(0));
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(null, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_Literal01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_Literal01 {
+
+    public static String test(int i) {
+        if (i == 0) {
+            return Object.class.toString();
+        }
+        if (i == 1) {
+            return String.class.toString();
+        }
+        if (i == 2) {
+            return Class.class.toString();
+        }
+        if (i == 3) {
+            return Class_Literal01.class.toString();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("class java.lang.Object", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("class java.lang.String", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("class java.lang.Class", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("class com.oracle.graal.jtt.lang.Class_Literal01", test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(null, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_asSubclass01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_asSubclass01 {
+
+    public static int test(int i) {
+        if (i == 0) {
+            if (Object.class.asSubclass(String.class) == null) {
+                return -1;
+            }
+        }
+        if (i == 1) {
+            if (String.class.asSubclass(Object.class) == null) {
+                return -1;
+            }
+        }
+        if (i == 2) {
+            if (Object.class.asSubclass(Class_asSubclass01.class) == null) {
+                return -1;
+            }
+        }
+        if (i == 3) {
+            if (Class_asSubclass01.class.asSubclass(Object.class) == null) {
+                return -1;
+            }
+        }
+        return i;
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_cast01 {
+
+    static final String string = "";
+    static final Object object = new Object();
+    static final Class_cast01 thisObject = new Class_cast01();
+
+    public static int test(int i) {
+        if (i == 0) {
+            if (Object.class.cast(string) == null) {
+                return -1;
+            }
+        }
+        if (i == 1) {
+            if (String.class.cast(object) == null) {
+                return -1;
+            }
+        }
+        if (i == 2) {
+            if (Object.class.cast(thisObject) == null) {
+                return -1;
+            }
+        }
+        if (i == 3) {
+            if (Class_cast01.class.cast(object) == null) {
+                return -1;
+            }
+        }
+        return i;
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run0() throws Throwable {
+        test(1);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test(expected = java.lang.ClassCastException.class)
+    public void run2() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_cast02 {
+
+    static final String string = "";
+    static final Object object = new Object();
+    static final Class_cast02 thisObject = new Class_cast02();
+
+    public static int test(int i) {
+        if (i == 0) {
+            if (Object.class.cast(null) == null) {
+                return -1;
+            }
+        }
+        if (i == 1) {
+            if (String.class.cast(null) == null) {
+                return -1;
+            }
+        }
+        if (i == 2) {
+            if (Object.class.cast(null) == null) {
+                return -1;
+            }
+        }
+        if (i == 3) {
+            if (Class_cast02.class.cast(null) == null) {
+                return -1;
+            }
+        }
+        return i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-1, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_forName01 {
+
+    public static String test(int i) throws ClassNotFoundException {
+        if (i == 0) {
+            return Class.forName("java.lang.Object").toString();
+        }
+        if (i == 1) {
+            return Class.forName("java.lang.String").toString();
+        }
+        if (i == 2) {
+            return Class.forName("com.oracle.graal.jtt.lang.Class_forName01").toString();
+        }
+        if (i == 3) {
+            return Class.forName("xyxzz.xyzyzyz.XXYYY").toString();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("class java.lang.Object", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("class java.lang.String", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("class com.oracle.graal.jtt.lang.Class_forName01", test(2));
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(null, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_forName02 {
+
+    public static String test(int i) throws ClassNotFoundException {
+        String clname = null;
+        Class cl = null;
+        if (i == 0) {
+            clname = "java.lang.Object";
+            cl = Object.class;
+        } else if (i == 1) {
+            clname = "java.lang.String";
+            cl = String.class;
+        } else if (i == 2) {
+            clname = "com.oracle.graal.jtt.lang.Class_forName02";
+            cl = Class_forName02.class;
+        } else if (i == 3) {
+            clname = "xyzz.zyxy.XYXY";
+            cl = Class_forName02.class;
+        }
+        if (clname != null) {
+            return Class.forName(clname, false, cl.getClassLoader()).toString();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("class java.lang.Object", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("class java.lang.String", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("class com.oracle.graal.jtt.lang.Class_forName02", test(2));
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(null, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import java.net.*;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class Class_forName03 {
+
+    public static String test(int i) throws ClassNotFoundException {
+        String clname = null;
+        Class cl = null;
+        if (i == 0) {
+            clname = "java.lang.Object[]";
+            cl = Object.class;
+        } else if (i == 1) {
+            clname = "[Ljava.lang.String;";
+            cl = String.class;
+        } else if (i == 2) {
+            clname = "[Ljava/lang/String;";
+            cl = String.class;
+        } else if (i == 3) {
+            clname = "[I";
+            cl = Class_forName03.class;
+        } else if (i == 4) {
+            clname = "[java.lang.Object;";
+            cl = Class_forName03.class;
+        }
+        if (clname != null) {
+            return Class.forName(clname, false, new URLClassLoader(new URL[0], cl.getClassLoader())).toString();
+        }
+        return null;
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("class [Ljava.lang.String;", test(1));
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("class [I", test(3));
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(null, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class Class_forName04 {
+
+    public static String test(int i) throws ClassNotFoundException {
+        String clname = null;
+        if (i == 0) {
+            clname = "java.lang.Object[]";
+        } else if (i == 1) {
+            clname = "[Ljava.lang.String;";
+        } else if (i == 2) {
+            clname = "[Ljava/lang/String;";
+        } else if (i == 3) {
+            clname = "[I";
+        } else if (i == 4) {
+            clname = "[java.lang.Object;";
+        }
+        if (clname != null) {
+            return Class.forName(clname).toString();
+        }
+        return null;
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("class [Ljava.lang.String;", test(1));
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("class [I", test(3));
+    }
+
+    @Test(expected = java.lang.ClassNotFoundException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(null, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import java.net.*;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class Class_forName05 {
+
+    public static String test(int i) throws ClassNotFoundException {
+        final URLClassLoader classLoader = new URLClassLoader(new URL[0], String.class.getClassLoader());
+        if (i == 0) {
+            return Class.forName("java.lang.String", false, classLoader).toString();
+        } else if (i == 1) {
+            return Class.forName("[Ljava.lang.String;", false, classLoader).toString();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("class java.lang.String", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("class [Ljava.lang.String;", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(null, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getComponentType01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_getComponentType01 {
+
+    public static String test(int i) {
+        Class cl = Object.class;
+        if (i == 0) {
+            cl = int.class;
+        } else if (i == 1) {
+            cl = int[].class;
+        } else if (i == 2) {
+            cl = Object.class;
+        } else if (i == 3) {
+            cl = Object[].class;
+        } else if (i == 4) {
+            cl = Class_getComponentType01.class;
+        } else if (i == 5) {
+            cl = Cloneable.class;
+        } else if (i == 6) {
+            cl = Object[][].class;
+        } else if (i == 7) {
+            cl = void.class;
+        }
+        cl = cl.getComponentType();
+        if (cl == null) {
+            return null;
+        }
+        return cl.getName();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("int", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(null, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("java.lang.Object", test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(null, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(null, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals("[Ljava.lang.Object;", test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(null, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(null, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getInterfaces01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+
+@SuppressWarnings("static-method")
+public final class Class_getInterfaces01 {
+
+    public static String test(int i) {
+        switch (i) {
+            case 0:
+                return toString(I1.class);
+            case 1:
+                return toString(I2.class);
+            case 2:
+                return toString(C1.class);
+            case 3:
+                return toString(C2.class);
+            case 4:
+                return toString(C12.class);
+            default:
+                return null;
+        }
+    }
+
+    private static String toString(Class< ? > klass) {
+        final Class< ? >[] classes = klass.getInterfaces();
+        final StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        for (Class< ? > c : classes) {
+            if (!first) {
+                sb.append(' ');
+            } else {
+                first = false;
+            }
+            sb.append(c.getName());
+        }
+        return sb.toString();
+    }
+
+    interface I1 {
+
+    }
+
+    interface I2 extends I1 {
+
+    }
+
+    static class C1 implements I1 {
+
+    }
+
+    static class C2 implements I2 {
+
+    }
+
+    static class C12 implements I1, I2 {
+
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I1", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I1", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I2", test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I1 com.oracle.graal.jtt.lang.Class_getInterfaces01$I2", test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_getName01 {
+
+    public static String test(int i) {
+        if (i == 0) {
+            return Object.class.getName();
+        } else if (i == 1) {
+            return Class.class.getName();
+        } else if (i == 2) {
+            return Class_getName01.class.getName();
+        } else if (i == 3) {
+            return "a string".getClass() == String.class ? "true" : "false";
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("java.lang.Object", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("java.lang.Class", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getName01", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("true", test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(null, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_getName02 {
+
+    public static String test(int i) {
+        if (i == 0) {
+            return int.class.getName();
+        }
+        if (i == 1) {
+            return int[].class.getName();
+        }
+        if (i == 2) {
+            return Object[][].class.getName();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("int", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("[I", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("[[Ljava.lang.Object;", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(null, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_getSimpleName01 {
+
+    public static String test(int i) {
+        if (i == 0) {
+            return Object.class.getSimpleName();
+        }
+        if (i == 1) {
+            return Class.class.getSimpleName();
+        }
+        if (i == 2) {
+            return Class_getSimpleName01.class.getSimpleName();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("Object", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("Class", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("Class_getSimpleName01", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(null, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_getSimpleName02 {
+
+    public static String test(int i) {
+        if (i == 0) {
+            return int.class.getSimpleName();
+        }
+        if (i == 1) {
+            return int[].class.getSimpleName();
+        }
+        if (i == 2) {
+            return Object[][].class.getSimpleName();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("int", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("int[]", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("Object[][]", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(null, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSuperClass01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_getSuperClass01 {
+
+    public static String test(int i) {
+        Class cl = Object.class;
+        if (i == 0) {
+            cl = int.class;
+        } else if (i == 1) {
+            cl = Object.class;
+        } else if (i == 2) {
+            cl = int[].class;
+        } else if (i == 3) {
+            cl = Cloneable.class;
+        } else if (i == 4) {
+            cl = Integer.class;
+        } else if (i == 5) {
+            cl = Class.class;
+        } else if (i == 6) {
+            cl = Class_getSuperClass01.class;
+        }
+        cl = cl.getSuperclass();
+        if (cl == null) {
+            return null;
+        }
+        return cl.getName();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(null, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("java.lang.Object", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(null, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals("java.lang.Number", test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals("java.lang.Object", test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals("java.lang.Object", test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(null, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isArray01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isArray01 {
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return int.class.isArray();
+        }
+        if (i == 1) {
+            return int[].class.isArray();
+        }
+        if (i == 2) {
+            return Object.class.isArray();
+        }
+        if (i == 3) {
+            return Object[].class.isArray();
+        }
+        if (i == 4) {
+            return Class_isArray01.class.isArray();
+        }
+        if (i == 5) {
+            return Cloneable.class.isArray();
+        }
+        if (i == 6) {
+            return Runnable.class.isArray();
+        }
+        if (i == 7) {
+            return void.class.isArray();
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isAssignableFrom01 {
+
+    public static boolean test(int i) {
+        Class source = Object.class;
+        if (i == 0) {
+            source = int.class;
+        }
+        if (i == 1) {
+            source = int[].class;
+        }
+        if (i == 2) {
+            source = float.class;
+        }
+        if (i == 3) {
+            source = byte.class;
+        }
+        if (i == 4) {
+            source = Runnable.class;
+        }
+        if (i == 5) {
+            source = Class_isAssignableFrom01.class;
+        }
+        if (i == 6) {
+            source = Object[].class;
+        }
+        return int.class.isAssignableFrom(source);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isAssignableFrom02 {
+
+    public static boolean test(int i) {
+        Class source = Object.class;
+        if (i == 0) {
+            source = int.class;
+        }
+        if (i == 1) {
+            source = int[].class;
+        }
+        if (i == 2) {
+            source = float.class;
+        }
+        if (i == 3) {
+            source = byte.class;
+        }
+        if (i == 4) {
+            source = Runnable.class;
+        }
+        if (i == 5) {
+            source = Class_isAssignableFrom02.class;
+        }
+        if (i == 6) {
+            source = Object[].class;
+        }
+        return Object.class.isAssignableFrom(source);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isAssignableFrom03 implements Cloneable {
+
+    public static boolean test(int i) {
+        Class source = Object.class;
+        if (i == 0) {
+            source = int.class;
+        }
+        if (i == 1) {
+            source = int[].class;
+        }
+        if (i == 2) {
+            source = float.class;
+        }
+        if (i == 3) {
+            source = Cloneable.class;
+        }
+        if (i == 4) {
+            source = Runnable.class;
+        }
+        if (i == 5) {
+            source = Class_isAssignableFrom03.class;
+        }
+        if (i == 6) {
+            source = Object[].class;
+        }
+        return Cloneable.class.isAssignableFrom(source);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isInstance01 {
+
+    static final String string = "";
+    static final Object obj = new Object();
+    static final Class_isInstance01 thisObject = new Class_isInstance01();
+
+    public static boolean test(int i) {
+        Object object = null;
+        if (i == 0) {
+            object = obj;
+        }
+        if (i == 1) {
+            object = string;
+        }
+        if (i == 2) {
+            object = thisObject;
+        }
+        return Object.class.isInstance(object);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isInstance02 {
+
+    static final String string = "";
+    static final Object obj = new Object();
+    static final Class_isInstance02 thisObject = new Class_isInstance02();
+
+    public static boolean test(int i) {
+        Object object = null;
+        if (i == 0) {
+            object = obj;
+        }
+        if (i == 1) {
+            object = string;
+        }
+        if (i == 2) {
+            object = thisObject;
+        }
+        return String.class.isInstance(object);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isInstance03 {
+
+    static final String string = "";
+    static final Object obj = new Object();
+    static final Class_isInstance03 thisObject = new Class_isInstance03();
+
+    public static boolean test(int i) {
+        Object object = null;
+        if (i == 0) {
+            object = obj;
+        }
+        if (i == 1) {
+            object = string;
+        }
+        if (i == 2) {
+            object = thisObject;
+        }
+        return Class_isInstance03.class.isInstance(object);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isInstance04 {
+
+    static final String string = "";
+    static final Object[] oarray = {};
+    static final String[] sarray = {};
+
+    public static boolean test(int i) {
+        Object object = null;
+        if (i == 0) {
+            object = oarray;
+        }
+        if (i == 1) {
+            object = string;
+        }
+        if (i == 2) {
+            object = sarray;
+        }
+        return String[].class.isInstance(object);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isInstance05 {
+
+    static final String string = "";
+    static final Object obj = new Object();
+    static final int[] array = {};
+
+    public static boolean test(int i) {
+        Object object = null;
+        if (i == 0) {
+            object = obj;
+        }
+        if (i == 1) {
+            object = string;
+        }
+        if (i == 2) {
+            object = array;
+        }
+        return int[].class.isInstance(object);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isInstance06 implements Cloneable {
+
+    static final String string = "";
+    static final Object obj = new Object();
+    static final String[] sarray = {};
+    static final Object thisObject = new Class_isInstance06();
+
+    public static boolean test(int i) {
+        Object object = null;
+        if (i == 0) {
+            object = obj;
+        }
+        if (i == 1) {
+            object = string;
+        }
+        if (i == 2) {
+            object = sarray;
+        }
+        if (i == 3) {
+            object = thisObject;
+        }
+        return Cloneable.class.isInstance(object);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInterface01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isInterface01 {
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return int.class.isInterface();
+        }
+        if (i == 1) {
+            return int[].class.isInterface();
+        }
+        if (i == 2) {
+            return Object.class.isInterface();
+        }
+        if (i == 3) {
+            return Object[].class.isInterface();
+        }
+        if (i == 4) {
+            return Class_isInterface01.class.isInterface();
+        }
+        if (i == 5) {
+            return Cloneable.class.isInterface();
+        }
+        if (i == 6) {
+            return Runnable.class.isInterface();
+        }
+        if (i == 7) {
+            return void.class.isInterface();
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isPrimitive01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_isPrimitive01 {
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return int.class.isPrimitive();
+        }
+        if (i == 1) {
+            return int[].class.isPrimitive();
+        }
+        if (i == 2) {
+            return Object.class.isPrimitive();
+        }
+        if (i == 3) {
+            return Object[].class.isPrimitive();
+        }
+        if (i == 4) {
+            return Class_isPrimitive01.class.isPrimitive();
+        }
+        if (i == 5) {
+            return Cloneable.class.isPrimitive();
+        }
+        if (i == 6) {
+            return Runnable.class.isPrimitive();
+        }
+        if (i == 7) {
+            return void.class.isPrimitive();
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Double_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Double_01 {
+
+    public static boolean test() {
+        return Double.doubleToLongBits(Double.longBitsToDouble(0x7ff8000000000088L)) == 0x7ff8000000000000L;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Double_toString.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class Double_toString {
+
+    public static String test() {
+        double z1 = 0.4363485526704198;
+        double z2 = -0.43536514763046896;
+        double z3 = z1 + z2;
+        return Double.toString(z3);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("9.834050399508132E-4", test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Float_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+public class Float_01 {
+
+    public static boolean test(float f) {
+        return /* Float.isNaN(f); */f != f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(2.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(0.5f));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(java.lang.Float.NaN));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Float_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Float_02 {
+
+    public static boolean test(float f) {
+        return f != 1.0f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(1.0f));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(2.0f));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(0.5f));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(java.lang.Float.NaN));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Float_03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Float_03 {
+
+    public static boolean test() {
+        return Float.floatToIntBits(Float.intBitsToFloat(0x7fc00088)) == 0x7fc00000;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_greater01 {
+
+    public static boolean test(int i) {
+        if (i > 0) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_greater02 {
+
+    public static boolean test(int i) {
+        if (i > 5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_greater03 {
+
+    public static boolean test(int i) {
+        if (i > -5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-6));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-5));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(-4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(-1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_greaterEqual01 {
+
+    public static boolean test(int i) {
+        if (i >= 0) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_greaterEqual02 {
+
+    public static boolean test(int i) {
+        if (i >= 5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_greaterEqual03 {
+
+    public static boolean test(int i) {
+        if (i >= -5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-6));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-5));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(-4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(-1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_less01 {
+
+    public static boolean test(int i) {
+        if (i < 0) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_less02 {
+
+    public static boolean test(int i) {
+        if (i < 5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_less03 {
+
+    public static boolean test(int i) {
+        if (i < -5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-6));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-5));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(-4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(-1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_lessEqual01 {
+
+    public static boolean test(int i) {
+        if (i <= 0) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_lessEqual02 {
+
+    public static boolean test(int i) {
+        if (i <= 5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Int_lessEqual03 {
+
+    public static boolean test(int i) {
+        if (i <= -5) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-2147483648));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-6));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-5));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(-4));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(-1));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class JDK_ClassLoaders01 {
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return Object.class.getClassLoader() == null;
+        }
+        if (i == 1) {
+            return Class.class.getClassLoader() == null;
+        }
+        if (i == 2) {
+            return String.class.getClassLoader() == null;
+        }
+        if (i == 3) {
+            return Thread.class.getClassLoader() == null;
+        }
+        if (i == 4) {
+            return System.class.getClassLoader() == null;
+        }
+        if (i == 5) {
+            return ClassLoader.class.getClassLoader() == null;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
+ * that is described in this document. In particular, and without limitation, these intellectual property
+ * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
+ * more additional patents or pending patent applications in the U.S. and in other countries.
+ *
+ * U.S. Government Rights - Commercial software. Government users are subject to the Sun
+ * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
+ * supplements.
+ *
+ * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
+ * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
+ * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
+ * U.S. and other countries.
+ *
+ * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
+ * Company, Ltd.
+ */
+package com.oracle.graal.jtt.lang;
+
+import java.net.*;
+
+import org.junit.*;
+
+/*
+ */
+public class JDK_ClassLoaders02 {
+
+    public static boolean test() {
+        ClassLoader classLoader = JDK_ClassLoaders02.class.getClassLoader();
+        return classLoader == null || classLoader instanceof URLClassLoader;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class Long_greater01 {
+
+    public static boolean test(long i) {
+        if (i > 0L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(2L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_greater02 {
+
+    public static boolean test(long i) {
+        if (i > 5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(4L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(5L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(6L));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_greater03 {
+
+    public static boolean test(long i) {
+        if (i > -5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-6L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-5L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(-4L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(-1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(0L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(1L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(2L));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_greaterEqual01 {
+
+    public static boolean test(long i) {
+        if (i >= 0L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(2L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_greaterEqual02 {
+
+    public static boolean test(long i) {
+        if (i >= 5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(4L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(5L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(6L));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_greaterEqual03 {
+
+    public static boolean test(long i) {
+        if (i >= -5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(-6L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-5L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(-4L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(-1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(0L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(1L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(2L));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(true, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_less01 {
+
+    public static boolean test(long i) {
+        if (i < 0L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(0L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(2L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_less02 {
+
+    public static boolean test(long i) {
+        if (i < 5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_less03 {
+
+    public static boolean test(long i) {
+        if (i < -5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-6L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(-5L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(-4L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(-1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(0L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(1L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(2L));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_lessEqual01 {
+
+    public static boolean test(long i) {
+        if (i <= 0L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-2L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-2L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(-1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(0L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(1L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(2L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_lessEqual02 {
+
+    public static boolean test(long i) {
+        if (i <= 5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-2L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-1L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(0L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(6L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Long_lessEqual03 {
+
+    public static boolean test(long i) {
+        if (i <= -5L) {
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-9223372036854775808L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(-6L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(-5L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(-4L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(-1L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(0L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(false, test(1L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(2L));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(9223372036854775807L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Long_reverseBytes01 {
+
+    public static long test(long val) {
+        return Long.reverseBytes(val);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0x877665544332211L, test(0x1122334455667708L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Long_reverseBytes02 {
+
+    public static long test(long val) {
+        return (((val >> 56) & 0xff) << 0) | (((val >> 48) & 0xff) << 8) | (((val >> 40) & 0xff) << 16) | (((val >> 32) & 0xff) << 24) | (((val >> 24) & 0xff) << 32) | (((val >> 16) & 0xff) << 40) |
+                        (((val >> 8) & 0xff) << 48) | (((val >> 0) & 0xff) << 56);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0x877665544332211L, test(0x1122334455667708L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_abs.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_abs {
+
+    @SuppressWarnings("serial")
+    public static class NaN extends Throwable {
+    }
+
+    public static double test(double arg) throws NaN {
+        double v = Math.abs(arg);
+        if (Double.isNaN(v)) {
+            // NaN can't be tested against itself
+            throw new NaN();
+        }
+        return v;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5.0d, test(5.0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(5.0d, test(-5.0d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0.0d, test(-0.0d), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.NEGATIVE_INFINITY), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_abs.NaN.class)
+    public void run6() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_cos.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_cos {
+
+    @SuppressWarnings("serial")
+    public static class NaN extends Throwable {
+    }
+
+    public static double test(double arg) throws NaN {
+        double v = Math.cos(arg);
+        if (Double.isNaN(v)) {
+            // NaN can't be tested against itself
+            throw new NaN();
+        }
+        return v;
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_cos.NaN.class)
+    public void run0() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_cos.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_cos.NaN.class)
+    public void run2() throws Throwable {
+        test(java.lang.Double.POSITIVE_INFINITY);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_log {
+
+    @SuppressWarnings("serial")
+    public static class NaN extends Throwable {
+    }
+
+    public static double test(double arg) throws NaN {
+        double v = Math.log(arg);
+        if (Double.isNaN(v)) {
+            // NaN can't be tested against itself
+            throw new NaN();
+        }
+        return v;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1.0d, test(java.lang.Math.E), 0);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_log.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_log.NaN.class)
+    public void run2() throws Throwable {
+        test(-1.0d);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_log.NaN.class)
+    public void run3() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0.0d), 0);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(-0.0d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log10.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_log10 {
+
+    @SuppressWarnings("serial")
+    public static class NaN extends Throwable {
+    }
+
+    public static double test(double arg) throws NaN {
+        double v = Math.log10(arg);
+        if (Double.isNaN(v)) {
+            // NaN can't be tested against itself
+            throw new NaN();
+        }
+        return v;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(1.0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0d, test(10.0d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2.0d, test(100.0d), 0);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_log10.NaN.class)
+    public void run3() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_log10.NaN.class)
+    public void run4() throws Throwable {
+        test(-1.0d);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_log10.NaN.class)
+    public void run5() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0.0d), 0);
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(-0.0d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_pow.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_pow {
+
+    public static double test(double pow) {
+        return Math.pow(2.0d, pow);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4.0d, test(2d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(8.574187700290345d, test(3.1d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sin.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_sin {
+
+    @SuppressWarnings("serial")
+    public static class NaN extends Throwable {
+    }
+
+    public static double test(double arg) throws NaN {
+        double v = Math.sin(arg);
+        if (Double.isNaN(v)) {
+            // NaN can't be tested against itself
+            throw new NaN();
+        }
+        return v;
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_sin.NaN.class)
+    public void run0() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_sin.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_sin.NaN.class)
+    public void run2() throws Throwable {
+        test(java.lang.Double.POSITIVE_INFINITY);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-0.0d, test(-0.0d), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sqrt.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_sqrt {
+
+    @SuppressWarnings("serial")
+    public static class NaN extends Throwable {
+    }
+
+    public static double test(double arg) throws NaN {
+        double v = Math.sqrt(arg);
+        if (Double.isNaN(v)) {
+            // NaN can't be tested against itself
+            throw new NaN();
+        }
+        return v;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2.0d, test(4.0d), 0);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_sqrt.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_sqrt.NaN.class)
+    public void run2() throws Throwable {
+        test(-1.0d);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_sqrt.NaN.class)
+    public void run3() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0d), 0);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-0.0d, test(-0.0d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Math_tan.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class Math_tan {
+
+    @SuppressWarnings("serial")
+    public static class NaN extends Throwable {
+    }
+
+    public static double test(double arg) throws NaN {
+        double v = Math.tan(arg);
+        if (Double.isNaN(v)) {
+            // NaN can't be tested against itself
+            throw new NaN();
+        }
+        return v;
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_tan.NaN.class)
+    public void run0() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_tan.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test(expected = com.oracle.graal.jtt.lang.Math_tan.NaN.class)
+    public void run2() throws Throwable {
+        test(java.lang.Double.POSITIVE_INFINITY);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-0.0d, test(-0.0d), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0.0d, test(0.0d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+public class Object_clone01 {
+
+    static final Object_clone01 field = new Object_clone01();
+
+    public static boolean test(int i) throws CloneNotSupportedException {
+        return field.tryClone(i);
+    }
+
+    @SuppressWarnings("unused")
+    private boolean tryClone(int i) throws CloneNotSupportedException {
+        return this == this.clone();
+    }
+
+    @Test(expected = java.lang.CloneNotSupportedException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+public class Object_clone02 implements Cloneable {
+
+    static final Object_clone02 field = new Object_clone02();
+
+    public static boolean test(int i) throws CloneNotSupportedException {
+        return field.tryClone(i);
+    }
+
+    @SuppressWarnings("unused")
+    private boolean tryClone(int i) throws CloneNotSupportedException {
+        return this == this.clone();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_equals01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_equals01 {
+
+    public static Object_equals01 field = new Object_equals01();
+
+    public static boolean test(int i) {
+        final Object obj1 = new Object();
+        final Object obj2 = new Object();
+        switch (i) {
+            case 0:
+                return obj1.equals(field);
+            case 1:
+                return obj1.equals(obj2);
+            case 2:
+                return obj1.equals(null);
+            case 3:
+                return obj1.equals(obj1);
+            case 4:
+                return field.equals(field);
+            case 5:
+                return obj2.equals(field);
+            case 6:
+                return obj2.equals(obj2);
+            case 7:
+                return obj2.equals(null);
+            case 8:
+                return obj2.equals(obj1);
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(false, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_getClass01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_getClass01 {
+
+    static final Object object = new Object();
+    static final Object string = new String();
+    static final Object_getClass01 thisObject = new Object_getClass01();
+
+    public static String test(int i) {
+        if (i == 0) {
+            return object.getClass().toString();
+        }
+        if (i == 1) {
+            return string.getClass().toString();
+        }
+        if (i == 2) {
+            return thisObject.getClass().toString();
+        }
+        if (i == 3) {
+            return thisObject.getClass().getClass().toString();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("class java.lang.Object", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("class java.lang.String", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("class com.oracle.graal.jtt.lang.Object_getClass01", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("class java.lang.Class", test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(null, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_hashCode01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_hashCode01 {
+
+    public static boolean test() {
+        final Object o1 = new Object();
+        final Object o2 = new Object();
+        return o1.hashCode() != 0 || o2.hashCode() != 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_notify01 {
+
+    static final Object object = new Object();
+
+    public static boolean test() {
+        object.notify();
+        return true;
+    }
+
+    @Test(expected = java.lang.IllegalMonitorStateException.class)
+    public void run0() throws Throwable {
+        test();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_notify02 {
+
+    static final Object object = new Object();
+
+    public static boolean test() {
+        synchronized (object) {
+            object.notify();
+        }
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_notifyAll01 {
+
+    static final Object obj = new Object();
+
+    public static boolean test() {
+        obj.notifyAll();
+        return true;
+    }
+
+    @Test(expected = java.lang.IllegalMonitorStateException.class)
+    public void run0() throws Throwable {
+        test();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_notifyAll02 {
+
+    static final Object object = new Object();
+
+    public static boolean test() {
+        synchronized (object) {
+            object.notifyAll();
+        }
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+public class Object_toString01 {
+
+    static final String string = "Object_toString01";
+    static final Object object = new Object();
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return object.toString() != null;
+        }
+        if (i == 1) {
+            return new Object_toString01().toString() == string;
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return string;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+public class Object_toString02 {
+
+    static final Object obj = new Object_toString02();
+
+    public static String test(int i) {
+        Object object = null;
+        if (i == 0) {
+            object = obj;
+        } else if (i == 1) {
+            object = "string";
+        } else if (i == 2) {
+            object = "string".getClass();
+        }
+        return object.toString();
+    }
+
+    @Override
+    public String toString() {
+        return "XYZ";
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("XYZ", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("string", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("class java.lang.String", test(2));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_wait01 {
+
+    static final Object object = new Object();
+
+    public static boolean test() throws InterruptedException {
+        object.wait();
+        return true;
+    }
+
+    @Test(expected = java.lang.IllegalMonitorStateException.class)
+    public void run0() throws Throwable {
+        test();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_wait02 {
+
+    static final Object object = new Object();
+
+    public static boolean test() throws InterruptedException {
+        synchronized (object) {
+            object.wait(1);
+        }
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Object_wait03 {
+
+    static final Object object = new Object();
+
+    public static boolean test() throws InterruptedException {
+        synchronized (object) {
+            object.wait(1, 1);
+        }
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/ProcessEnvironment_init.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import java.util.*;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class ProcessEnvironment_init {
+
+    private static HashMap<Object, Object> theEnvironment;
+    public static Map<Object, Object> theUnmodifiableEnvironment;
+
+    public static int test(int v) {
+
+        byte[][] environ = environ();
+        theEnvironment = new HashMap<>(environ.length / 2 + 3);
+
+        for (int i = environ.length - 1; i > 0; i -= 2) {
+            theEnvironment.put(Variable.valueOf(environ[i - 1]), Value.valueOf(environ[i]));
+        }
+
+        theUnmodifiableEnvironment = Collections.unmodifiableMap(new StringEnvironment(theEnvironment));
+
+        return v;
+    }
+
+    @SuppressWarnings("serial")
+    private static final class StringEnvironment extends HashMap<Object, Object> {
+
+        @SuppressWarnings("unused")
+        public StringEnvironment(HashMap<Object, Object> theenvironment) {
+        }
+    }
+
+    private static final class Variable {
+
+        @SuppressWarnings("unused")
+        public static Object valueOf(byte[] bs) {
+            return new Object();
+        }
+    }
+
+    private static final class Value {
+
+        @SuppressWarnings("unused")
+        public static Object valueOf(byte[] bs) {
+            return new Object();
+        }
+    }
+
+    private static byte[][] environ() {
+        return new byte[3][3];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(7, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/StringCoding_Scale.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+public class StringCoding_Scale {
+
+    public static float maxCharPerByte = 1.0f;
+
+    public static int test(int i) {
+        return scale(i, maxCharPerByte);
+    }
+
+    // Copy of java.lang.StringCode.scale
+    private static int scale(int len, float expansionFactor) {
+        // We need to perform double, not float, arithmetic; otherwise
+        // we lose low order bits when len is larger than 2**24.
+        return (int) (len * (double) expansionFactor);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class String_intern01 {
+
+    public static boolean test() {
+        // Checkstyle: stop
+        return "id".intern() == "id";
+        // Checkstyle: resume
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class String_intern02 {
+
+    public static boolean test(int i) {
+        return ("id" + i).intern() == ("id" + i).intern();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class String_intern03 {
+
+    public static boolean test(int i) {
+        return ("id" + i).intern().equals("id" + i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/String_valueOf01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class String_valueOf01 {
+
+    public static String test(int i) {
+        Object result = null;
+        if (i == 1) {
+            result = "string";
+        }
+        return String.valueOf(result);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("null", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("string", test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/System_identityHashCode01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.lang;
+
+import org.junit.*;
+
+/*
+ */
+public class System_identityHashCode01 {
+
+    private static final Object object0 = new Object();
+    private static final Object object1 = new Object();
+    private static final Object object2 = new Object();
+
+    private static final int hash0 = System.identityHashCode(object0);
+    private static final int hash1 = System.identityHashCode(object1);
+    private static final int hash2 = System.identityHashCode(object2);
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return hash0 == System.identityHashCode(object0);
+        }
+        if (i == 1) {
+            return hash1 == System.identityHashCode(object1);
+        }
+        if (i == 2) {
+            return hash2 == System.identityHashCode(object2);
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/DegeneratedLoop.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class DegeneratedLoop {
+
+    public static String test(int a) {
+        int arg = a;
+        for (;;) {
+            try {
+                arg++;
+                break;
+            } catch (Unresolved iioe) {
+            }
+        }
+        return "ok-" + arg;
+    }
+
+    @SuppressWarnings("serial")
+    public static class Unresolved extends RuntimeException {
+
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("ok-1", test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop01 {
+
+    public static boolean test() {
+        int x = 1;
+
+        for (int i = 0; i < 10; i++) {
+            int y = m();
+            if (x == 1) {
+                return true;
+            }
+            x = y;
+        }
+        return false;
+    }
+
+    private static int m() {
+        return 2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop02 {
+
+    public static boolean test(int arg) {
+        int x = arg;
+
+        for (int i = 0; i < 10; i++) {
+            int y = m();
+            if (x == 1) {
+                return true;
+            }
+            x = y;
+        }
+        return false;
+    }
+
+    private static int m() {
+        return 2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop03 {
+
+    public static int test(int count) {
+        int i1 = 1;
+        int i2 = 2;
+        int i4 = 4;
+
+        for (int i = 0; i < count; i++) {
+            i1 = i2;
+            i2 = 7;
+            i4 = i1;
+        }
+        return i1 + i2 * 10 + i4 * 1000;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(7077, test(10));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop04 {
+
+    public static int test(int count) {
+        int i1 = 1;
+        int i2 = 2;
+        int i3 = 3;
+        int i4 = 4;
+
+        for (int i = 0; i < count; i++) {
+            i1 = i2;
+            i2 = i3;
+            i3 = i4;
+            i4 = i1;
+        }
+        return i1 + i2 * 10 + i3 * 100 + i4 * 1000;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4321, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2432, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2432, test(10));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop05 {
+
+    @SuppressWarnings("unused")
+    public static String test(int a) {
+        int arg = a;
+        int count = 0;
+        while (--arg > 0) {
+            count++;
+            new Object();
+        }
+        return "ok" + count;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("ok0", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("ok9", test(10));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("ok24", test(25));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop06 {
+
+    public static String test(int a) {
+        int arg = a;
+        int count = 0;
+        while (--arg > 0) {
+            count++;
+            foo();
+        }
+        return "ok" + count;
+    }
+
+    static void foo() {
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("ok0", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("ok9", test(10));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("ok24", test(25));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop07.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop07 {
+
+    public static String test(int arg) {
+        int count = arg;
+        for (int i = 0; i < arg; i++) {
+            count++;
+        }
+        return "ok" + count;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("ok0", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("ok20", test(10));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("ok50", test(25));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop08.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop08 {
+
+    public static int test(int arg) {
+        int a = 0;
+        for (int i = 0; i < arg; i++) {
+            a += i;
+        }
+        return a;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(45, test(10));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(300, test(25));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop09.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop09 {
+
+    private static int cnt;
+
+    public static String test(int arg) {
+        cnt = 0;
+        int count = arg;
+        for (int i = 0; i < arg; i++) {
+            count++;
+            foo();
+        }
+        return "ok" + count + "-" + cnt;
+    }
+
+    static void foo() {
+        cnt++;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("ok0-0", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("ok20-10", test(10));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("ok50-25", test(25));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop11.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop11 {
+
+    public static int test(int a) {
+        int arg = a;
+        int v = 0;
+        while (arg-- > 0) {
+            v = 1;
+        }
+        return v;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop12.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop12 {
+
+    private static int[] source = new int[]{10, 15, 20, 25, 30};
+
+    public static int test(int arg) {
+        int i = 0;
+        if (source[i] != arg) {
+            while (++i <= 5 && source[i] != arg) {
+                // nothing
+            }
+        }
+        return i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(10));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(15));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(4, test(30));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop13.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop13 {
+
+    public static class Loop {
+
+        private int index;
+        private Object[] nodes = new Object[]{null, null, new Object(), null, null, new Object(), null};
+        private int size = nodes.length;
+
+        public Loop(int start) {
+            index = start;
+        }
+
+        public void test0() {
+            if (index < size) {
+                do {
+                    index++;
+                } while (index < size && nodes[index] == null);
+            }
+        }
+
+        public int getIndex() {
+            return index;
+        }
+
+    }
+
+    public static int test(int arg) {
+        Loop loop = new Loop(arg);
+        loop.test0();
+        return loop.getIndex();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(5, test(3));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(7, test(6));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(7, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/Loop14.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class Loop14 {
+
+    private static int value;
+
+    public static int test(int arg) {
+        return calc(arg);
+    }
+
+    public static int calc(int arg) {
+        int result = 0;
+        for (int k = 0; k < arg; ++k) {
+            value = 5;
+            for (int i = 0; i < arg; ++i) {
+                for (int j = 0; j < arg; ++j) {
+                }
+                result += value;
+            }
+        }
+        return result;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(5, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopInline.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ * This test is meaningful only if you run it with 'forced' inlinning because running it in the harness with -Xcomp will not trigger any normal inlining
+ */
+public class LoopInline {
+
+    public static int test(int arg) {
+        int count = 0;
+        for (int i = 0; i < arg; i++) {
+            count += foo(i);
+            if (count > 15) {
+                count -= foo(3);
+                break;
+            }
+        }
+        return count;
+    }
+
+    public static int foo(int t) {
+        int sum = 0;
+        for (int i = 0; i < t; i++) {
+            sum += i;
+            if (i == 4) {
+                sum += foo2(sum);
+                break;
+            }
+        }
+        return sum;
+    }
+
+    public static int foo2(int i) {
+        int j = i;
+        int sum = 0;
+        while (j > 0) {
+            sum += j * j;
+            j--;
+        }
+        return sum;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(402, test(10));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopNewInstance.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class LoopNewInstance {
+
+    public static Blop initBlop = new Blop();
+
+    @SuppressWarnings("unused")
+    public static int test(int arg) {
+        for (int i = 0; i < arg; i++) {
+            new Blop();
+        }
+        return count;
+    }
+
+    private static int count = 0;
+
+    private static class Blop {
+
+        private boolean exists;
+
+        public Blop() {
+            if (!exists) {
+                count++;
+            }
+            exists = true;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        count = 0;
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        count = 0;
+        Assert.assertEquals(5, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopPhi.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+
+public class LoopPhi {
+
+    public static int test(int arg) {
+        for (int i = 0; i < arg; i++) {
+            test(1, 1, 1, 1, 1, 1);
+        }
+        return test(1, 1, 1, 1, 1, 1);
+    }
+
+    public static int test(int j1, int j2, int j3, int j4, int j5, int j6) {
+        int i1 = j1;
+        int i2 = j2;
+        int i3 = j3;
+        int i4 = j4;
+        int i5 = j5;
+        int i6 = j6;
+
+        if (i1 == 0) {
+            i1 = 2;
+        } else {
+            i2 = 2;
+        }
+        for (int i = 0; i < 10; i++) {
+            if (i == 0) {
+                i3 = 2;
+            } else {
+                i4 = 2;
+            }
+
+            for (int j = 0; j < 10; j++) {
+                if (j == 0) {
+                    i5 = 2;
+                } else {
+                    i6 = 2;
+                }
+            }
+        }
+
+        return i1 + i2 + i3 + i4 + i5 + i6;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(50000));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopSwitch01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.loop;
+
+import org.junit.*;
+
+/*
+ */
+public class LoopSwitch01 {
+
+    static int count = 0;
+
+    @SuppressWarnings("unused")
+    public static String test() {
+        String line;
+        while ((line = string()) != null) {
+            switch (line.charAt(0)) {
+                case 'a':
+                    new Object();
+                    break;
+                case 'b':
+                    new Object();
+                    break;
+                default:
+                    new Object();
+                    break;
+            }
+        }
+        return "ok" + count;
+    }
+
+    private static String string() {
+        if (count == 0) {
+            return null;
+        }
+        count--;
+        return "" + ('a' + count);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("ok0", test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class ArrayCompare01 {
+
+    static final long[] a1 = {1, 2, 3, -5};
+    static final long[] a2 = {1, 2, 3, -5};
+    static final long[] a3 = {1, 2, 4, -5};
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return compare(a1, a2);
+        }
+        if (arg == 1) {
+            return compare(a1, a3);
+        }
+        return false;
+    }
+
+    static boolean compare(long[] a, long[] b) {
+        if (a.length == b.length) {
+            for (int i = 0; i < a.length; i++) {
+                if (a[i] != b[i]) {
+                    return false;
+                }
+            }
+            return true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class ArrayCompare02 {
+
+    static final long[] a1 = {1, 1, 1, 1, 1, 1};
+    static final long[] a2 = {1, 1, 1, 2, 1, 1};
+    static final long[] a3 = {1, 1, 2, 2, 3, 3};
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return compare(a1);
+        }
+        if (arg == 1) {
+            return compare(a2);
+        }
+        if (arg == 2) {
+            return compare(a3);
+        }
+        return false;
+    }
+
+    static boolean compare(long[] a) {
+        return a[0] == a[1] & a[2] == a[3] & a[4] == a[5];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BC_invokevirtual2.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_invokevirtual2 {
+
+    static Unresolved object;
+
+    public static class Unresolved {
+
+        public int id(int i) {
+            return i;
+        }
+    }
+
+    private static Unresolved object() {
+        if (object == null) {
+            object = new Unresolved();
+        }
+        return object;
+    }
+
+    public static int test(int a) {
+        return object().id(a);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(3, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-4, test(-4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigByteParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigByteParams01 {
+
+    public static int test(int num) {
+        int sum = 0;
+        if (num == 0) {
+            sum += testA((byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 1, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 2, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 3, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 4, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 5, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 6, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 7, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testA((byte) 8, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+        } else if (num == 1) {
+            sum += testB(0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(1, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(2, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(3, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(4, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(5, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(6, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(7, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            sum += testB(8, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+        } else if (num == 2) {
+            for (int i = 0; i < 9; i++) {
+                sum += testA(i, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            }
+        } else if (num == 3) {
+            for (int i = 0; i < 9; i++) {
+                sum += testB(i, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
+            }
+        }
+        return sum;
+    }
+
+    private static int testA(int choice, byte p0, byte p1, byte p2, byte p3, byte p4, byte p5, byte p6, byte p7, byte p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    private static long testB(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(45, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(45, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(45, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(45, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigDoubleParams02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigDoubleParams02 {
+
+    public static double test(int choice, double p0, double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1d, test(0, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2d, test(1, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3d, test(2, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4d, test(3, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5d, test(4, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(6d, test(5, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7d, test(6, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(8d, test(7, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(9d, test(8, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigFloatParams01 {
+
+    public static double test(int num) {
+        double sum = 0;
+        if (num == 0) {
+            sum += testA(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        } else if (num == 1) {
+            sum += testB(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        } else if (num == 2) {
+            for (int i = 0; i < 9; i++) {
+                sum += testA(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            }
+        } else if (num == 3) {
+            for (int i = 0; i < 9; i++) {
+                sum += testB(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            }
+        }
+        return sum;
+    }
+
+    private static float testA(int choice, float p0, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    private static double testB(int choice, double p0, double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(45D, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(45D, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(45D, test(2), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(45D, test(3), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0D, test(4), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigFloatParams02 {
+
+    public static float test(int choice, float p0, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1f, test(0, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2f, test(1, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3f, test(2, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4f, test(3, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5f, test(4, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(6f, test(5, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7f, test(6, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(8f, test(7, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(9f, test(8, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigIntParams01 {
+
+    public static int test(int num) {
+        int sum = 0;
+        if (num == 0) {
+            sum += testA(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        } else if (num == 1) {
+            sum += testB(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testB(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        } else if (num == 2) {
+            for (int i = 0; i < 9; i++) {
+                sum += testA(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            }
+        } else if (num == 3) {
+            for (int i = 0; i < 9; i++) {
+                sum += testB(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            }
+        }
+        return sum;
+    }
+
+    private static int testA(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    private static long testB(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(45, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(45, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(45, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(45, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigIntParams02 {
+
+    public static int test(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(0, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3, test(2, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4, test(3, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5, test(4, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(6, test(5, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7, test(6, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(-8, test(7, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(-9, test(8, 1, 2, 3, 4, 5, 6, 7, -8, -9));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigInterfaceParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigInterfaceParams01 {
+
+    public static String test(boolean b, String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+        I i = b ? new A() : new B();
+        return i.test(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+    }
+
+    interface I {
+
+        String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9);
+    }
+
+    static class A implements I {
+
+        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+            return "A" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
+        }
+    }
+
+    static class B implements I {
+
+        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+            return "B" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("A0123456789", test(true, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("B0123456789", test(false, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigLongParams02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigLongParams02 {
+
+    public static long test(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1L, test(0, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2L, test(1, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3L, test(2, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4L, test(3, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5L, test(4, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(6L, test(5, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7L, test(6, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(-8L, test(7, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(-9L, test(8, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigMixedParams01 {
+
+    public static double test(int num) {
+        double sum = 0;
+        if (num == 0) {
+            sum += testA(0, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(1, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(2, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(3, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(4, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(5, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(6, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(7, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            sum += testA(8, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+        } else if (num == 1) {
+            sum += testB(0, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(2, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(3, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(4, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(5, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(6, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(7, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            sum += testB(8, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+        } else if (num == 2) {
+            for (int i = 0; i < 9; i++) {
+                sum += testA(i, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
+            }
+        } else if (num == 3) {
+            for (int i = 0; i < 9; i++) {
+                sum += testB(i, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
+            }
+        }
+        return sum;
+    }
+
+    @SuppressWarnings("unused")
+    private static float testA(int choice, int i0, int i1, int i2, int i3, float p0, float p1, float p2, float p3, int i4, int i5, float p4, float p5, float p6, float p7, float p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @SuppressWarnings("unused")
+    private static double testB(int choice, int i0, int i1, int i2, double p0, double p1, double p2, double p3, int i3, int i4, double p4, double p5, double p6, double p7, double p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(45D, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(45D, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(45D, test(2), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(45D, test(3), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0D, test(4), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigMixedParams02 {
+
+    @SuppressWarnings("unused")
+    public static float test(int choice, int i0, int i1, int i2, int i3, float p0, float p1, float p2, float p3, int i4, int i5, float p4, float p5, float p6, float p7, float p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1f, test(0, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2f, test(1, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3f, test(2, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4f, test(3, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5f, test(4, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(6f, test(5, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7f, test(6, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(8f, test(7, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(9f, test(8, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigMixedParams03 {
+
+    @SuppressWarnings("unused")
+    public static double test(int choice, int i0, int i1, int i2, int i3, double p0, double p1, double p2, double p3, int i4, int i5, double p4, double p5, double p6, double p7, double p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1d, test(0, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2d, test(1, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(3d, test(2, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4d, test(3, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5d, test(4, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(6d, test(5, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7d, test(6, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(8d, test(7, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(9d, test(8, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigObjectParams01 {
+
+    @SuppressWarnings("unused")
+    public static String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+        return p0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("0", test("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("a", test("a", null, null, null, null, null, null, null, null, null));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigObjectParams02 {
+
+    public static String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+        return p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("0123456789", test("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigParamsAlignment.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+/*
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+public class BigParamsAlignment {
+
+    public static int test(int num) {
+        int sum = 0;
+        if (num == 0) {
+            sum += testA(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            sum += testA(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        } else if (num == 1) {
+            sum += testB(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            sum += testB(9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+        } else if (num == 2) {
+            for (int i = 0; i < 9; i++) {
+                sum += testA(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+            }
+        } else if (num == 3) {
+            for (int i = 0; i < 10; i++) {
+                sum += testB(i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+            }
+        } else if (num == 4) {
+            for (int i = 0; i < 11; i++) {
+                sum += testC(i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+            }
+        } else if (num == 5) {
+            for (int i = 0; i < 12; i++) {
+                sum += testD(i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+            }
+        }
+        return sum;
+    }
+
+    private static int testA(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    private static int testB(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+            case 9:
+                return p9;
+        }
+        return 42;
+    }
+
+    private static int testC(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+            case 9:
+                return p9;
+            case 10:
+                return p10;
+        }
+        return 42;
+    }
+
+    private static int testD(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10, int p11) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+            case 9:
+                return p9;
+            case 10:
+                return p10;
+            case 11:
+                return p11;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(45, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(55, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(45, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(55, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(66, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(78, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(0, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigShortParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigShortParams01 {
+
+    public static int test(int num) {
+        int sum = 0;
+        if (num == 0) {
+            sum += testA((short) 0, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 1, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 2, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 3, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 4, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 5, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 6, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 7, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testA((short) 8, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+        } else if (num == 1) {
+            sum += testB(0, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(1, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(2, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(3, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(4, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(5, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(6, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(7, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            sum += testB(8, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+        } else if (num == 2) {
+            for (int i = 0; i < 9; i++) {
+                sum += testA(i, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            }
+        } else if (num == 3) {
+            for (int i = 0; i < 9; i++) {
+                sum += testB(i, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
+            }
+        }
+        return sum;
+    }
+
+    private static int testA(int choice, short p0, short p1, short p2, short p3, short p4, short p5, short p6, short p7, short p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    private static long testB(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
+        switch (choice) {
+            case 0:
+                return p0;
+            case 1:
+                return p1;
+            case 2:
+                return p2;
+            case 3:
+                return p3;
+            case 4:
+                return p4;
+            case 5:
+                return p5;
+            case 6:
+                return p6;
+            case 7:
+                return p7;
+            case 8:
+                return p8;
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(45, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(45, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(45, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(45, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/BigVirtualParams01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class BigVirtualParams01 {
+
+    public static String test(boolean b, String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+        I i = b ? new A() : new B();
+        return i.test(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+    }
+
+    abstract static class I {
+
+        abstract String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9);
+    }
+
+    static class A extends I {
+
+        @Override
+        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+            return "A" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
+        }
+    }
+
+    static class B extends I {
+
+        @Override
+        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
+            return "B" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("A0123456789", test(true, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("B0123456789", test(false, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/Bubblesort.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+public class Bubblesort {
+
+    public static int test(int num) {
+        final int[] array = {23, 8, -9, 5, 882, 0, 0, 1};
+
+        for (int i = 0; i < array.length; i++) {
+            for (int j = i + 1; j < array.length; j++) {
+                if (array[j] < array[i]) {
+                    final int tmp = array[i];
+                    array[i] = array[j];
+                    array[j] = tmp;
+                }
+            }
+        }
+        return array[num];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-9, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(8, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(23, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(882, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/Fibonacci.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class Fibonacci {
+
+    public static int test(int num) {
+        if (num <= 0) {
+            return 0;
+        }
+        int n1 = 0;
+        int n2 = 1;
+        for (int i = 1; i < num; i++) {
+            final int next = n2 + n1;
+            n1 = n2;
+            n2 = next;
+        }
+        return n2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(2, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(3, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(5, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(8, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(13, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+public class InvokeVirtual_01 {
+
+    static class A {
+
+        int plus(int a) {
+            return a;
+        }
+    }
+
+    static class B extends A {
+
+        @Override
+        int plus(int a) {
+            return a + 10;
+        }
+    }
+
+    static class C extends A {
+
+        @Override
+        int plus(int a) {
+            return a + 20;
+        }
+    }
+
+    static A aObject = new A();
+    static A bObject = new B();
+    static A cObject = new C();
+
+    public static int test(int a) {
+        if (a == 0) {
+            return aObject.plus(a);
+        }
+        if (a == 1) {
+            return bObject.plus(a);
+        }
+        if (a == 2) {
+            return cObject.plus(a);
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(22, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(42, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+public class InvokeVirtual_02 {
+
+    static class A {
+
+        long plus(long a) {
+            return a;
+        }
+    }
+
+    static class B extends A {
+
+        @Override
+        long plus(long a) {
+            return a + 10;
+        }
+    }
+
+    static class C extends A {
+
+        @Override
+        long plus(long a) {
+            return a + 20;
+        }
+    }
+
+    static A objectA = new A();
+    static A objectB = new B();
+    static A objectC = new C();
+
+    public static long test(long a) {
+        if (a == 0) {
+            return objectA.plus(a);
+        }
+        if (a == 1) {
+            return objectB.plus(a);
+        }
+        if (a == 2) {
+            return objectC.plus(a);
+        }
+        return 42;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11L, test(1L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(22L, test(2L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(42L, test(3L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/Matrix01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class Matrix01 {
+
+    public static class Matrix {
+
+        final int id;
+
+        Matrix(int id) {
+            this.id = id;
+        }
+    }
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return matrix1(3) + matrix1(5);
+        }
+        if (arg == 1) {
+            return matrix2(3) + matrix2(5);
+        }
+        if (arg == 2) {
+            return matrix3(3) + matrix3(5);
+        }
+        if (arg == 3) {
+            return matrix4(3) + matrix4(5);
+        }
+        if (arg == 4) {
+            return matrix5(3) + matrix5(5);
+        }
+        return 42;
+    }
+
+    static int matrix1(int size) {
+        Matrix[] matrix = new Matrix[size];
+        fillMatrix(matrix, size);
+        int count = 0;
+        for (Matrix m : matrix) {
+            if (m != null) {
+                count++;
+            }
+        }
+        return count;
+    }
+
+    static int matrix2(int size) {
+        Matrix[][] matrix = new Matrix[size][size];
+        fillMatrix(matrix, size * size);
+        int count = 0;
+        for (Matrix[] n : matrix) {
+            for (Matrix m : n) {
+                if (m != null) {
+                    count++;
+                }
+            }
+        }
+        return count;
+    }
+
+    static int matrix3(int size) {
+        Matrix[][][] matrix = new Matrix[size][5][size];
+        fillMatrix(matrix, size * size * size);
+        int count = 0;
+        for (Matrix[][] o : matrix) {
+            for (Matrix[] n : o) {
+                for (Matrix m : n) {
+                    if (m != null) {
+                        count++;
+                    }
+                }
+            }
+        }
+        return count;
+    }
+
+    static int matrix4(int size) {
+        Matrix[][][][] matrix = new Matrix[size][2][size][3];
+        fillMatrix(matrix, size * size * size * size);
+        int count = 0;
+        for (Matrix[][][] p : matrix) {
+            for (Matrix[][] o : p) {
+                for (Matrix[] n : o) {
+                    for (Matrix m : n) {
+                        if (m != null) {
+                            count++;
+                        }
+                    }
+                }
+            }
+        }
+        return count;
+    }
+
+    static int matrix5(int size) {
+        Matrix[][][][][] matrix = new Matrix[size][size][3][4][size];
+        fillMatrix(matrix, size * size * size * size * size);
+        int count = 0;
+        for (Matrix[][][][] q : matrix) {
+            for (Matrix[][][] p : q) {
+                for (Matrix[][] o : p) {
+                    for (Matrix[] n : o) {
+                        for (Matrix m : n) {
+                            if (m != null) {
+                                count++;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return count;
+    }
+
+    static void fillMatrix(Object[] matrix, int total) {
+        for (int i = 0; i < 10000; i += 7) {
+            int number = i % total;
+            set(matrix, number);
+        }
+    }
+
+    static void set(Object[] matrix, int number) {
+        int val = number;
+        Object[] array = matrix;
+        while (!(array instanceof Matrix[])) {
+            int index = val % array.length;
+            val = val / array.length;
+            array = (Object[]) array[index];
+        }
+        ((Matrix[]) array)[val % array.length] = new Matrix(number);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(8, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(34, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(152, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(204, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(1547, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(42, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/ReferenceMap01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class ReferenceMap01 {
+
+    public static Integer val1 = new Integer(3);
+    public static Integer val2 = new Integer(4);
+
+    @SuppressWarnings("unused")
+    private static String foo(String[] a) {
+        String[] args = new String[]{"78"};
+        Integer i1 = new Integer(1);
+        Integer i2 = new Integer(2);
+        Integer i3 = val1;
+        Integer i4 = val2;
+        Integer i5 = new Integer(5);
+        Integer i6 = new Integer(6);
+        Integer i7 = new Integer(7);
+        Integer i8 = new Integer(8);
+        Integer i9 = new Integer(9);
+        Integer i10 = new Integer(10);
+        Integer i11 = new Integer(11);
+        Integer i12 = new Integer(12);
+
+        System.gc();
+        int sum = i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12;
+        return args[0] + sum;
+    }
+
+    public static int test() {
+        return Integer.valueOf(foo(new String[]{"asdf"}));
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(7878, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/StrangeFrames.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("unused")
+public class StrangeFrames {
+
+    public static boolean test(int arg) {
+        empty();
+        oneOperandStackSlot();
+        twoOperandStackSlots();
+        oneLocalSlot();
+        return true;
+    }
+
+    static void empty() {
+        // do nothing.
+    }
+
+    static void oneOperandStackSlot() {
+        new StrangeFrames();
+    }
+
+    static void twoOperandStackSlots() {
+        two(new StrangeFrames(), new StrangeFrames());
+    }
+
+    static void oneLocalSlot() {
+        int a;
+    }
+
+    static void two(Object a, Object b) {
+        Object c = b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/String_format01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class String_format01 {
+
+    public static String test(String s) {
+        return String.format("Hello %s", s);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("Hello World", test("World"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("Hello New World Order", test("New World Order"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/String_format02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class String_format02 {
+
+    public static String test(int val) {
+        return String.format("Hello %d", val);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("Hello 0", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("Hello -11", test(-11));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("Hello -2147483648", test(-2147483648));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("Hello 2147483647", test(2147483647));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_String01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_String01 {
+
+    public static String test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, "a", null, "test");
+    }
+
+    private static String get(int index, String... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("a", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(null, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("test", test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_boolean01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_boolean01 {
+
+    public static boolean test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, true, false, true);
+    }
+
+    private static boolean get(int index, boolean... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_byte01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_byte01 {
+
+    public static byte test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, (byte) 1, (byte) 2, (byte) 3);
+    }
+
+    private static byte get(int index, byte... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 1), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 2), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) 3), test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_char01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_char01 {
+
+    public static char test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, 'a', 'b', 'c');
+    }
+
+    private static char get(int index, char... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 97), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 98), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 99), test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_double01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_double01 {
+
+    public static double test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, 0.0d, 1.0d, 2.0d);
+    }
+
+    private static double get(int index, double... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0d, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0d, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2.0d, test(2), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_float01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_float01 {
+
+    public static float test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, 0.0f, 1.0f, 2.0f);
+    }
+
+    private static float get(int index, float... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0.0f, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1.0f, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2.0f, test(2), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_int01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_int01 {
+
+    public static int test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, 0, 1, 2);
+    }
+
+    private static int get(int index, int... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_long01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_long01 {
+
+    public static long test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, 0L, 1L, 2L);
+    }
+
+    private static long get(int index, long... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2L, test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_short01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+/*
+ */
+public class VarArgs_short01 {
+
+    public static short test(int arg) {
+        if (arg == 4) {
+            return get(0);
+        }
+        return get(arg, (short) 0, (short) 1, (short) 2);
+    }
+
+    private static short get(int index, short... args) {
+        return args[index];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 0), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) 1), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) 2), test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class ABCE_01 {
+
+    public static int[] array = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+
+    public static int test(int a) {
+        int arg = a;
+        for (int i = 0; i < array.length; i++) {
+            arg += array[i];
+        }
+        return arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(55, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(65, test(10));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class ABCE_02 {
+
+    public static int[] array = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+
+    public static int test(int arg) {
+        int r = 0;
+        for (int i = 0; i < arg; i++) {
+            r += array[i];
+        }
+        return r;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(55, test(10));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run2() throws Throwable {
+        test(20);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class ABCE_03 {
+
+    private static final int[] ARRAY1 = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+    private static final int[] ARRAY2 = new int[]{1};
+
+    public static int test(int arg) {
+        int[] array = arg == 0 ? ARRAY2 : ARRAY1;
+        int r = 0;
+        for (int i = 0; i < arg; i++) {
+            r += array[i];
+        }
+        return r;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(55, test(10));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run2() throws Throwable {
+        test(20);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayCopy01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests calls to the array copy method.
+ */
+public class ArrayCopy01 {
+
+    public static Object[] src = new Object[]{null, null};
+    public static Object[] dest = new Object[]{null, null};
+
+    public static int test(int srcPos, int destPos, int length) {
+        System.arraycopy(src, srcPos, dest, destPos, length);
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0, 0, 0));
+    }
+
+    @Test(expected = java.lang.IndexOutOfBoundsException.class)
+    public void run1() throws Throwable {
+        test(0, 0, -1);
+    }
+
+    @Test(expected = java.lang.IndexOutOfBoundsException.class)
+    public void run2() throws Throwable {
+        test(-1, 0, 0);
+    }
+
+    @Test(expected = java.lang.IndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(0, -1, 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(0, 0, 2));
+    }
+
+    @Test(expected = java.lang.IndexOutOfBoundsException.class)
+    public void run5() throws Throwable {
+        test(0, 1, 2);
+    }
+
+    @Test(expected = java.lang.IndexOutOfBoundsException.class)
+    public void run6() throws Throwable {
+        test(1, 0, 2);
+    }
+
+    @Test(expected = java.lang.IndexOutOfBoundsException.class)
+    public void run7() throws Throwable {
+        test(1, 1, -1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayLength01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of array length operations.
+ */
+public class ArrayLength01 {
+
+    public static final int SIZE = 8;
+    public static final byte[] arr = new byte[5];
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return arr.length;
+        }
+        if (arg == 1) {
+            return new byte[6].length;
+        }
+        if (arg == 2) {
+            return new Object[7].length;
+        }
+        if (arg == 3) {
+            return new Class[SIZE][].length;
+        }
+        if (arg == 4) {
+            return new int[arg].length;
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(6, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(7, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(8, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(4, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_16.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_idiv_16 {
+
+    public static int test(int i, int arg) {
+        if (i == 0) {
+            final int constant = 16;
+            return arg / constant;
+        }
+        return arg / 16;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(0, 16));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(0, 17));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(0, -1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-1, test(0, -16));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-1, test(0, -17));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-64, test(0, -1024));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0, test(1, 0));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(1, test(1, 16));
+    }
+
+    @Test
+    public void run9() throws Throwable {
+        Assert.assertEquals(1, test(1, 17));
+    }
+
+    @Test
+    public void run10() throws Throwable {
+        Assert.assertEquals(0, test(1, -1));
+    }
+
+    @Test
+    public void run11() throws Throwable {
+        Assert.assertEquals(-1, test(1, -16));
+    }
+
+    @Test
+    public void run12() throws Throwable {
+        Assert.assertEquals(-1, test(1, -17));
+    }
+
+    @Test
+    public void run13() throws Throwable {
+        Assert.assertEquals(-64, test(1, -1024));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_4.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_idiv_4 {
+
+    public static int test(int arg) {
+        return arg / 4;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(4));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(5));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0, test(-1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-1, test(-4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-1, test(-5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-64, test(-256));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_16.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_imul_16 {
+
+    public static int test(int i, int arg) {
+        if (i == 0) {
+            final int mult = 16;
+            return arg * mult;
+        }
+        return arg * 16;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(256, test(0, 16));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(272, test(0, 17));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-16, test(0, -1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-256, test(0, -16));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-272, test(0, -17));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-16, test(0, 2147483647));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0, test(0, -2147483648));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(0, test(1, 0));
+    }
+
+    @Test
+    public void run9() throws Throwable {
+        Assert.assertEquals(256, test(1, 16));
+    }
+
+    @Test
+    public void run10() throws Throwable {
+        Assert.assertEquals(272, test(1, 17));
+    }
+
+    @Test
+    public void run11() throws Throwable {
+        Assert.assertEquals(-16, test(1, -1));
+    }
+
+    @Test
+    public void run12() throws Throwable {
+        Assert.assertEquals(-256, test(1, -16));
+    }
+
+    @Test
+    public void run13() throws Throwable {
+        Assert.assertEquals(-272, test(1, -17));
+    }
+
+    @Test
+    public void run14() throws Throwable {
+        Assert.assertEquals(-16, test(1, 2147483647));
+    }
+
+    @Test
+    public void run15() throws Throwable {
+        Assert.assertEquals(0, test(1, -2147483648));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_4.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_imul_4 {
+
+    public static int test(int arg) {
+        return arg * 4;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(16, test(4));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(20, test(5));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-4, test(-1));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-16, test(-4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-20, test(-5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-1024, test(-256));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_16.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldiv_16 {
+
+    public static long test(long arg) {
+        return arg / 16;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1L, test(16L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1L, test(17L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0L, test(-1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-1L, test(-16L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-1L, test(-17L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-64L, test(-1024L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_4.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_ldiv_4 {
+
+    public static long test(long arg) {
+        return arg / 4;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1L, test(4L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1L, test(5L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0L, test(-1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-1L, test(-4L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-1L, test(-5L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-64L, test(-256L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_16.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lmul_16 {
+
+    public static long test(long arg) {
+        return arg * 16;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(256L, test(16L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(272L, test(17L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-16L, test(-1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-256L, test(-16L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-272L, test(-17L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-16384L, test(-1024L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_4.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lmul_4 {
+
+    public static long test(long arg) {
+        return arg * 4;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0L, test(0L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(16L, test(4L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(20L, test(5L));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-4L, test(-1L));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(-16L, test(-4L));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(-20L, test(-5L));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(-1024L, test(-256L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C16.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lshr_C16 {
+
+    public static long test(long a) {
+        return a >> 16;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1330945L, test(87224824140L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C24.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lshr_C24 {
+
+    public static long test(long a) {
+        return a >> 24;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5199L, test(87224824140L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C32.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_lshr_C32 {
+
+    public static long test(long a) {
+        return a >> 32;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(20L, test(87224824140L));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/BlockSkip01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class BlockSkip01 {
+
+    public static boolean test(int arg) {
+        int x = 1;
+
+        if (arg > 2) {
+            x = 2;
+        } else {
+            x = 1;
+        }
+        return m(x) == 2;
+    }
+
+    private static int m(int x) {
+        return x + 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Cmov01 {
+
+    public static boolean test(int a, int b) {
+        boolean result = a < b || a == b;
+        return result;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(-1, -1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1, 10));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(1, 0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Cmov02 {
+
+    public static int test(double a, double b, int v1, int v2) {
+        return a < b ? v1 : v2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(1.0, 1.1, 1, 2));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1.0, -1.1, 1, 2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(1.0, java.lang.Double.NaN, 1, 2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Conditional01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import java.util.*;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("unused")
+public class Conditional01 {
+
+    private static final int RAM_SIZE = 0x100;
+
+    public static int test(int arg) {
+        Conditional01 c = new Conditional01();
+        Random rnd = new Random();
+        for (int i = 0; i < arg; i++) {
+            CPC i2 = new CPC();
+            i2.r1 = new Register();
+            i2.r1.val = i;
+            i2.r1.num = i + RAM_SIZE - 20;
+            i2.r2 = new Register();
+            i2.r2.val = rnd.nextInt();
+            i2.r2.num = rnd.nextInt(RAM_SIZE);
+            try {
+                c.visit(i2);
+            } catch (RuntimeException re) {
+
+            }
+        }
+        return c.cyclesConsumed;
+    }
+
+    private static class Register {
+
+        int val;
+        int num;
+    }
+
+    private static class CPC {
+
+        public Register r1;
+        public Register r2;
+
+    }
+
+    private int nextPC;
+    private int pc;
+    private boolean aC;
+    private boolean aH;
+    private boolean aN;
+    private boolean aZ;
+    private boolean aV;
+    private boolean aS;
+    private int cyclesConsumed;
+    private int[] sram = new int[RAM_SIZE];
+
+    public void visit(CPC i) {
+        nextPC = pc + 2;
+        int tmp0 = getRegisterByte(i.r1);
+        int tmp1 = getRegisterByte(i.r2);
+        int tmp2 = bit(aC);
+        int tmp3 = tmp0 - tmp1 - tmp2;
+        boolean tmp4 = ((tmp0 & 128) != 0);
+        boolean tmp5 = ((tmp1 & 128) != 0);
+        boolean tmp6 = ((tmp3 & 128) != 0);
+        boolean tmp7 = ((tmp0 & 8) != 0);
+        boolean tmp8 = ((tmp1 & 8) != 0);
+        boolean tmp9 = ((tmp3 & 8) != 0);
+        aH = !tmp7 && tmp8 || tmp8 && tmp9 || tmp9 && !tmp7;
+        aC = !tmp4 && tmp5 || tmp5 && tmp6 || tmp6 && !tmp4;
+        aN = tmp6;
+        aZ = low(tmp3) == 0 && aZ;
+        aV = tmp4 && !tmp5 && !tmp6 || !tmp4 && tmp5 && tmp6;
+        aS = (aN != aV);
+        cyclesConsumed++;
+    }
+
+    public int getRegisterByte(Register r1) {
+        if ((r1.val % 10) == 0) {
+            return sram[r1.num];
+        }
+        return r1.val;
+    }
+
+    public int low(int tmp3) {
+        return tmp3 & 0x01;
+    }
+
+    public int bit(boolean c2) {
+        return c2 ? 1 : 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(10, test(10));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(20, test(20));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(38, test(40));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class DeadCode01 {
+
+    public static int test(int a) {
+        int arg = a;
+        int p = arg;
+        if (p > 2) {
+            p += 1;
+            arg += 10;
+        } else {
+            p += 2;
+            arg += 20;
+            if (p > 3) {
+                p += 1;
+                arg += 10;
+                if (p > 4) {
+                    p += 1;
+                    arg += 10;
+                } else {
+                    p += 2;
+                    arg += 20;
+                }
+            } else {
+                p += 2;
+                arg += 20;
+            }
+        }
+        return p;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(5, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(6, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(7, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class DeadCode02 {
+
+    public static int test() {
+        int i = 0;
+        while (true) {
+            i++;
+            if (test2()) {
+                break;
+            }
+        }
+        return i;
+    }
+
+    public static boolean test2() {
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Cast01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Fold_Cast01 {
+
+    static final Object object = new Fold_Cast01();
+
+    int field = 9;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return ((Fold_Cast01) object).field;
+        }
+        if (arg == 1) {
+            Object obj = new Fold_Cast01();
+            return ((Fold_Cast01) obj).field;
+        }
+        if (arg == 2) {
+            return ((Fold_Cast01) null).field;
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(9, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(9, test(1));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Fold_Convert01 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return i2b();
+        }
+        if (arg == 1) {
+            return i2s();
+        }
+        if (arg == 2) {
+            return i2c();
+        }
+        return 0;
+    }
+
+    public static int i2b() {
+        int x = 0x00000080;
+        return (byte) x;
+    }
+
+    public static int i2s() {
+        int x = 0x00008000;
+        return (short) x;
+    }
+
+    public static int i2c() {
+        int x = 0xffffffff;
+        return (char) x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-128, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-32768, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(65535, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Fold_Convert02 {
+    public static long test(long arg) {
+        if (arg == 0) {
+            return i2l();
+        }
+        if (arg == 1) {
+            return f2l();
+        }
+        if (arg == 2) {
+            return d2l();
+        }
+        return  0;
+    }
+    public static long i2l() {
+        int x = 0x80000000;
+        return x;
+    }
+    public static long f2l() {
+        float x = -33.1f;
+        return (long) x;
+    }
+    public static long d2l() {
+        double x = -78.1d;
+        return (long) x;
+    }
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(-2147483648L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-33L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-78L, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of float conversions
+ */
+public class Fold_Convert03 {
+
+    public static float test(float arg) {
+        if (arg == 0) {
+            return i2f();
+        }
+        if (arg == 1) {
+            return l2f();
+        }
+        if (arg == 2) {
+            return d2f();
+        }
+        return 0;
+    }
+
+    public static float i2f() {
+        int x = 1024;
+        return x;
+    }
+
+    public static float l2f() {
+        long x = -33;
+        return x;
+    }
+
+    public static float d2f() {
+        double x = -78.1d;
+        return (float) x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1024f, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-33f, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(-78.1f, test(2), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of float conversions
+ */
+public class Fold_Convert04 {
+
+    public static double test(double arg) {
+        if (arg == 0) {
+            return l2d();
+        }
+        if (arg == 1) {
+            return f2d();
+        }
+        return 0;
+    }
+
+    public static double l2d() {
+        long x = 1024;
+        return x;
+    }
+
+    public static double f2d() {
+        float x = -1.25f;
+        return x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1024d, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(-1.25d, test(1), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of float operations.
+ */
+public class Fold_Double01 {
+
+    public static double test(double arg) {
+        if (arg == 0) {
+            return add();
+        }
+        if (arg == 1) {
+            return sub();
+        }
+        if (arg == 2) {
+            return mul();
+        }
+        if (arg == 3) {
+            return div();
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        return 0;
+    }
+
+    public static double add() {
+        double x = 3;
+        return x + 7;
+    }
+
+    public static double sub() {
+        double x = 15;
+        return x - 4;
+    }
+
+    public static double mul() {
+        double x = 6;
+        return x * 2;
+    }
+
+    public static double div() {
+        double x = 26;
+        return x / 2;
+    }
+
+    public static double mod() {
+        double x = 29;
+        return x % 15;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10d, test(0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11d, test(1d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12d, test(2d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13d, test(3d), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14d, test(4d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer comparisons.
+ */
+public class Fold_Double02 {
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return equ();
+        }
+        if (arg == 1) {
+            return neq();
+        }
+        if (arg == 2) {
+            return geq();
+        }
+        if (arg == 3) {
+            return ge();
+        }
+        if (arg == 4) {
+            return ltq();
+        }
+        if (arg == 5) {
+            return lt();
+        }
+        return false;
+    }
+
+    static boolean equ() {
+        double x = 34;
+        return x == 34;
+    }
+
+    static boolean neq() {
+        double x = 34;
+        return x != 33;
+    }
+
+    static boolean geq() {
+        double x = 34;
+        return x >= 33;
+    }
+
+    static boolean ge() {
+        double x = 34;
+        return x > 35;
+    }
+
+    static boolean ltq() {
+        double x = 34;
+        return x <= 32;
+    }
+
+    static boolean lt() {
+        double x = 34;
+        return x < 31;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Fold_Double03 {
+
+    private static final double MINUS_ZERO = 1 / Double.NEGATIVE_INFINITY;
+
+    public static double test(int t, double a) {
+        double v;
+        if (t == 0) {
+            v = a * 0.0;
+        } else {
+            v = a * MINUS_ZERO;
+        }
+        return 1 / v;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(0, 5.0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(1, 5.0), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0, -5.0), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(1, -5.0), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of float operations.
+ */
+public class Fold_Float01 {
+
+    public static float test(float arg) {
+        if (arg == 0) {
+            return add();
+        }
+        if (arg == 1) {
+            return sub();
+        }
+        if (arg == 2) {
+            return mul();
+        }
+        if (arg == 3) {
+            return div();
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        return 0;
+    }
+
+    public static float add() {
+        float x = 3;
+        return x + 7;
+    }
+
+    public static float sub() {
+        float x = 15;
+        return x - 4;
+    }
+
+    public static float mul() {
+        float x = 6;
+        return x * 2;
+    }
+
+    public static float div() {
+        float x = 26;
+        return x / 2;
+    }
+
+    public static float mod() {
+        float x = 29;
+        return x % 15;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10f, test(0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11f, test(1f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12f, test(2f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13f, test(3f), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14f, test(4f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer comparisons.
+ */
+public class Fold_Float02 {
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return equ();
+        }
+        if (arg == 1) {
+            return neq();
+        }
+        if (arg == 2) {
+            return geq();
+        }
+        if (arg == 3) {
+            return ge();
+        }
+        if (arg == 4) {
+            return ltq();
+        }
+        if (arg == 5) {
+            return lt();
+        }
+        return false;
+    }
+
+    static boolean equ() {
+        float x = 34;
+        return x == 34;
+    }
+
+    static boolean neq() {
+        float x = 34;
+        return x != 33;
+    }
+
+    static boolean geq() {
+        float x = 34;
+        return x >= 33;
+    }
+
+    static boolean ge() {
+        float x = 34;
+        return x > 35;
+    }
+
+    static boolean ltq() {
+        float x = 34;
+        return x <= 32;
+    }
+
+    static boolean lt() {
+        float x = 34;
+        return x < 31;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_InstanceOf01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Fold_InstanceOf01 {
+
+    static final Object object = new Fold_InstanceOf01();
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return object instanceof Fold_InstanceOf01;
+        }
+        if (arg == 1) {
+            Object obj = new Fold_InstanceOf01();
+            return obj instanceof Fold_InstanceOf01;
+        }
+        if (arg == 2) {
+            return null instanceof Fold_InstanceOf01;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Fold_Int01 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return add();
+        }
+        if (arg == 1) {
+            return sub();
+        }
+        if (arg == 2) {
+            return mul();
+        }
+        if (arg == 3) {
+            return div();
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        if (arg == 5) {
+            return and();
+        }
+        if (arg == 6) {
+            return or();
+        }
+        if (arg == 7) {
+            return xor();
+        }
+        return 0;
+    }
+
+    public static int add() {
+        int x = 3;
+        return x + 7;
+    }
+
+    public static int sub() {
+        int x = 15;
+        return x - 4;
+    }
+
+    public static int mul() {
+        int x = 6;
+        return x * 2;
+    }
+
+    public static int div() {
+        int x = 26;
+        return x / 2;
+    }
+
+    public static int mod() {
+        int x = 29;
+        return x % 15;
+    }
+
+    public static int and() {
+        int x = 31;
+        return x & 15;
+    }
+
+    public static int or() {
+        int x = 16;
+        return x | 16;
+    }
+
+    public static int xor() {
+        int x = 0;
+        return x ^ 17;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(17, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer comparisons.
+ */
+public class Fold_Int02 {
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return equ();
+        }
+        if (arg == 1) {
+            return neq();
+        }
+        if (arg == 2) {
+            return geq();
+        }
+        if (arg == 3) {
+            return ge();
+        }
+        if (arg == 4) {
+            return ltq();
+        }
+        if (arg == 5) {
+            return lt();
+        }
+        return false;
+    }
+
+    static boolean equ() {
+        int x = 34;
+        return x == 34;
+    }
+
+    static boolean neq() {
+        int x = 34;
+        return x != 33;
+    }
+
+    static boolean geq() {
+        int x = 34;
+        return x >= 33;
+    }
+
+    static boolean ge() {
+        int x = 34;
+        return x > 35;
+    }
+
+    static boolean ltq() {
+        int x = 34;
+        return x <= 32;
+    }
+
+    static boolean lt() {
+        int x = 34;
+        return x < 31;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Fold_Long01 {
+
+    public static long test(long arg) {
+        if (arg == 0) {
+            return add();
+        }
+        if (arg == 1) {
+            return sub();
+        }
+        if (arg == 2) {
+            return mul();
+        }
+        if (arg == 3) {
+            return div();
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        if (arg == 5) {
+            return and();
+        }
+        if (arg == 6) {
+            return or();
+        }
+        if (arg == 7) {
+            return xor();
+        }
+        return 0;
+    }
+
+    public static long add() {
+        long x = 3;
+        return x + 7;
+    }
+
+    public static long sub() {
+        long x = 15;
+        return x - 4;
+    }
+
+    public static long mul() {
+        long x = 6;
+        return x * 2;
+    }
+
+    public static long div() {
+        long x = 26;
+        return x / 2;
+    }
+
+    public static long mod() {
+        long x = 29;
+        return x % 15;
+    }
+
+    public static long and() {
+        long x = 31;
+        return x & 15;
+    }
+
+    public static long or() {
+        long x = 16;
+        return x | 16;
+    }
+
+    public static long xor() {
+        long x = 0;
+        return x ^ 17;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14L, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15L, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16L, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(17L, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer comparisons.
+ */
+public class Fold_Long02 {
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return equ();
+        }
+        if (arg == 1) {
+            return neq();
+        }
+        if (arg == 2) {
+            return geq();
+        }
+        if (arg == 3) {
+            return ge();
+        }
+        if (arg == 4) {
+            return ltq();
+        }
+        if (arg == 5) {
+            return lt();
+        }
+        return false;
+    }
+
+    static boolean equ() {
+        long x = 34;
+        return x == 34;
+    }
+
+    static boolean neq() {
+        long x = 34;
+        return x != 33;
+    }
+
+    static boolean geq() {
+        long x = 34;
+        return x >= 33;
+    }
+
+    static boolean ge() {
+        long x = 34;
+        return x > 35;
+    }
+
+    static boolean ltq() {
+        long x = 34;
+        return x <= 32;
+    }
+
+    static boolean lt() {
+        long x = 34;
+        return x < 31;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(false, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Math01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Fold_Math01 {
+
+    public static double test(int arg) {
+        switch (arg) {
+            case 0:
+                return abs();
+            case 1:
+                return sin();
+            case 2:
+                return cos();
+            case 3:
+                return tan();
+            case 4:
+                return atan2();
+            case 5:
+                return sqrt();
+            case 6:
+                return log();
+            case 7:
+                return log10();
+            case 8:
+                return pow();
+            case 9:
+                return exp();
+            case 10:
+                return min();
+            case 11:
+                return max();
+        }
+        return 42;
+    }
+
+    private static double abs() {
+        return Math.abs(-10.0d);
+    }
+
+    private static double sin() {
+        return Math.sin(0.15d);
+    }
+
+    private static double cos() {
+        return Math.cos(0.15d);
+    }
+
+    private static double tan() {
+        return Math.tan(0.15d);
+    }
+
+    private static double atan2() {
+        return Math.atan2(0.15d, 3.1d);
+    }
+
+    private static double sqrt() {
+        return Math.sqrt(144d);
+    }
+
+    private static double log() {
+        return Math.log(3.15d);
+    }
+
+    private static double log10() {
+        return Math.log10(0.15d);
+    }
+
+    private static double pow() {
+        return Math.pow(2.15d, 6.1d);
+    }
+
+    private static double exp() {
+        return Math.log(3.15d);
+    }
+
+    private static int min() {
+        return Math.min(2, -1);
+    }
+
+    private static int max() {
+        return Math.max(2, -1);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10d, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0.14943813247359922d, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(0.9887710779360422d, test(2), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(0.15113521805829508d, test(3), 0);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0.04834938665190287d, test(4), 0);
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(12.0d, test(5), 0);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(1.1474024528375417d, test(6), 0);
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(-0.8239087409443188d, test(7), 0);
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(106.62882057436371d, test(8), 0);
+    }
+
+    @Test
+    public void run9() throws Throwable {
+        Assert.assertEquals(1.1474024528375417d, test(9), 0);
+    }
+
+    @Test
+    public void run10() throws Throwable {
+        Assert.assertEquals(-1.0d, test(10), 0);
+    }
+
+    @Test
+    public void run11() throws Throwable {
+        Assert.assertEquals(2.0d, test(11), 0);
+    }
+
+    @Test
+    public void run12() throws Throwable {
+        Assert.assertEquals(42d, test(12), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Inline01 {
+
+    public static int test(int arg) {
+        return arg + nobranch(true) + nobranch(false) + nobranch(true) + nobranch(false);
+    }
+
+    static int nobranch(boolean f) {
+        if (f) {
+            return 0;
+        }
+        return 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(3, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Inline02 {
+
+    public static int test(int arg) {
+        return arg + nobranch(true, arg) + nobranch(false, arg) + nobranch(true, arg) + nobranch(false, arg);
+    }
+
+    static int nobranch(boolean f, int v) {
+        if (f) {
+            return v;
+        }
+        return 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(2, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(5, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(8, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/LLE_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Test case for local load elimination. It makes sure that the second field store is not eliminated, because
+ * it is recognized that the first store changes the field "field1", so it is no longer guaranteed that it
+ * has its default value 0.
+ */
+public class LLE_01 {
+
+    int field1;
+
+    public static int test() {
+        LLE_01 o = new LLE_01();
+        o.field1 = 1;
+        o.field1 = 0;
+        return o.field1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/List_reorder_bug.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("unused")
+public class List_reorder_bug {
+
+    static class List {
+
+        List(int id) {
+            this.id = id;
+        }
+
+        List next;
+        int id;
+        boolean bool = true;
+    }
+
+    private static List list;
+
+    public static boolean test(int i) {
+        list = new List(5);
+        list.next = new List(6);
+        new List_reorder_bug().match(new Object(), 27, 6, 0);
+        return list.next == null;
+    }
+
+    private void match(Object a, int src, int id, int seq) {
+        print("match: " + src + ", " + id);
+        List item = list;
+        List itemPrev = null;
+        while (item != null) {
+            if (item.id == id) {
+                if (item.bool) {
+                    outcall(item.id);
+                }
+                if (itemPrev != null) {
+                    itemPrev.next = item.next;
+                } else {
+                    list = item.next;
+                }
+
+                item.next = null;
+                return;
+            }
+
+            itemPrev = item;
+            item = item.next;
+        }
+    }
+
+    static int globalId;
+
+    private static void outcall(int id) {
+        globalId = id;
+    }
+
+    String s;
+
+    private void print(String s2) {
+        this.s = s2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Test case for null check elimination.
+ */
+public class NCE_01 {
+
+    public static NCE_01 object = new NCE_01();
+
+    int field1 = 22;
+    int field2 = 23;
+
+    public static int test() {
+        NCE_01 o = object;
+        int i = o.field1;
+        // expected null check elimination here
+        return o.field2 + i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(45, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Test case for null check elimination.
+ */
+public class NCE_02 {
+
+    public static NCE_02 object = new NCE_02();
+
+    int field1;
+    int field2 = 23;
+
+    public static int test() {
+        NCE_02 o = object;
+        o.field1 = 11;
+        // expect non-null
+        o.field1 = 22;
+        // expect non-null
+        return o.field2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(23, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Test case for null check elimination.
+ */
+public class NCE_03 {
+
+    private static boolean cond = true;
+    public static NCE_03 object = new NCE_03();
+
+    int field1;
+    int field2 = 23;
+
+    public static int test() {
+        NCE_03 o = object;
+        o.field1 = 11;
+        if (cond) {
+            // expect non-null
+            o.field1 = 22;
+        }
+        // expect non-null
+        return o.field2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(23, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Test case for null check elimination.
+ */
+public class NCE_04 {
+
+    private static boolean cond = true;
+    public static NCE_04 object = new NCE_04();
+
+    int field1;
+    int field2 = 23;
+
+    public static int test() {
+        NCE_04 o = object;
+        if (cond) {
+            o.field1 = 22;
+        } else {
+            o.field1 = 11;
+        }
+        // expect non-null
+        return o.field2;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(23, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class NCE_FlowSensitive01 {
+
+    public static String test(String arg) {
+        if (arg != null) {
+            return arg.toString();
+        }
+        return null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("x", test("x"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("yay", test("yay"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class NCE_FlowSensitive02 {
+
+    @SuppressWarnings("all")
+    public static String test(String arg) {
+        if (arg != null) {
+            return arg.toString();
+        }
+        return arg.toString();
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run0() throws Throwable {
+        test(null);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("x", test("x"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("yay", test("yay"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive03.java	Thu Mar 08 19:24:17 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.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class NCE_FlowSensitive03 {
+
+    public static String test(String arg) {
+        if ("x".equals(arg)) {
+            if (arg == null) {
+                return "null";
+            }
+        } else {
+            if (arg == null) {
+                return "null";
+            }
+        }
+        // arg cannot be null here
+        return arg.toString();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("null", test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("x", test("x"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("yay", test("yay"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive04.java	Thu Mar 08 19:24:17 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.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class NCE_FlowSensitive04 {
+
+    public static String test(String arg2) {
+        String arg = arg2;
+        if (arg == null) {
+            arg = "null";
+        }
+        // arg cannot be null here
+        return arg.toString();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("null", test(null));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("x", test("x"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("yay", test("yay"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class NCE_FlowSensitive05 {
+
+    public static String test(Object arg) {
+
+        // An artificial loop to trigger iterative NCE.
+        while (arg != null) {
+            System.out.println(arg);
+        }
+
+        // The upcast must still include the null check.
+        return (String) arg;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(null, test(null));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_byte01 {
+
+    public static byte val;
+
+    public static byte test(byte b) {
+        val = b;
+        return val;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 0), test(((byte) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 1), test(((byte) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) -1), test(((byte) -1)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((byte) 110), test(((byte) 110)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_byte02 {
+
+    static class Byte {
+
+        byte foo;
+    }
+
+    static Byte val = new Byte();
+
+    public static byte test(byte b) {
+        val.foo = b;
+        return val.foo;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 0), test(((byte) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 1), test(((byte) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) -1), test(((byte) -1)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((byte) 110), test(((byte) 110)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_byte03 {
+
+    static byte[] val = new byte[4];
+
+    public static byte test(byte b) {
+        val[0] = b;
+        return val[0];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 0), test(((byte) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 1), test(((byte) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) -1), test(((byte) -1)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((byte) 110), test(((byte) 110)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_char01 {
+
+    public static char val;
+
+    public static char test(char b) {
+        val = b;
+        return val;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 0), test(((char) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 1), test(((char) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 255), test(((char) 255)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((char) 65000), test(((char) 65000)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_char02 {
+
+    static class Char {
+
+        char foo;
+    }
+
+    static Char val = new Char();
+
+    public static char test(char b) {
+        val.foo = b;
+        return val.foo;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 0), test(((char) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 1), test(((char) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 255), test(((char) 255)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((char) 65000), test(((char) 65000)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_char03 {
+
+    static char[] val = new char[4];
+
+    public static char test(char b) {
+        val[0] = b;
+        return val[0];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 0), test(((char) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 1), test(((char) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 255), test(((char) 255)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((char) 65000), test(((char) 65000)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_short01 {
+
+    public static short val;
+
+    public static short test(short b) {
+        val = b;
+        return val;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 0), test(((short) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) 1), test(((short) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) -1), test(((short) -1)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((short) 23110), test(((short) 23110)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_short02 {
+
+    static class Short {
+
+        short foo;
+    }
+
+    static Short val = new Short();
+
+    public static short test(short b) {
+        val.foo = b;
+        return val.foo;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 0), test(((short) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) 1), test(((short) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) -1), test(((short) -1)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((short) 23110), test(((short) 23110)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Narrow_short03 {
+
+    static short[] val = new short[4];
+
+    public static short test(short b) {
+        val[0] = b;
+        return val[0];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 0), test(((short) 0)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) 1), test(((short) 1)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) -1), test(((short) -1)));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(((short) 23110), test(((short) 23110)));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Phi01 {
+
+    public static class Phi {
+
+        int f;
+
+        Phi(int f) {
+            this.f = f;
+        }
+    }
+
+    public static int test(int arg) {
+        return test2(new Phi(arg), arg);
+    }
+
+// @NEVER_INLINE
+    private static int test2(Phi p, int a) {
+        int arg = a;
+        if (arg > 2) {
+            p.f += 1;
+            arg += 1;
+        } else {
+            p.f += 2;
+            arg += 2;
+            if (arg > 3) {
+                p.f += 1;
+                arg += 1;
+                if (arg > 4) {
+                    p.f += 1;
+                    arg += 1;
+                } else {
+                    p.f += 2;
+                    arg += 2;
+                }
+            } else {
+                p.f += 2;
+                arg += 2;
+            }
+        }
+        return arg + p.f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(8, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(10, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(8, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(10, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(14, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Phi02 {
+
+    public static class Phi {
+
+        int f;
+
+        Phi(int f) {
+            this.f = f;
+        }
+    }
+
+    public static int test(int arg) {
+        return test2(new Phi(arg), arg);
+    }
+
+// @NEVER_INLINE
+    private static int test2(Phi p, int a) {
+        int arg = a;
+        if (arg > 2) {
+            inc(p, 1);
+            arg += 1;
+        } else {
+            inc(p, 2);
+            arg += 2;
+            if (arg > 3) {
+                inc(p, 1);
+                arg += 1;
+                if (arg > 4) {
+                    inc(p, 1);
+                    arg += 1;
+                } else {
+                    inc(p, 2);
+                    arg += 2;
+                }
+            } else {
+                inc(p, 2);
+                arg += 2;
+            }
+        }
+        return arg + p.f;
+    }
+
+// @NEVER_INLINE
+    private static void inc(Phi p, int inc) {
+        p.f += inc;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(8, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(10, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(8, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(10, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(14, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class Phi03 {
+
+    public static class Phi {
+
+        int f;
+
+        Phi(int f) {
+            this.f = f;
+        }
+    }
+
+    public static int test(int arg) {
+        return test2(new Phi(arg), arg);
+    }
+
+// @NEVER_INLINE
+    private static int test2(Phi p, int a) {
+        int arg = a;
+        if (arg > 2) {
+            inc(p, 1);
+            arg += 1;
+        } else {
+            inc(p, 2);
+            arg += 2;
+            if (arg > 3) {
+                inc(p, 1);
+                arg += 1;
+                if (arg > 4) {
+                    inc(p, 1);
+                    arg += 1;
+                } else {
+                    inc(p, 2);
+                    arg += 2;
+                }
+            } else {
+                inc(p, 2);
+                arg += 2;
+            }
+        }
+        return p.f;
+    }
+
+// @NEVER_INLINE
+    private static void inc(Phi p, int inc) {
+        p.f += inc;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(4, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(5, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(6, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(4, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(5, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(7, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Convert01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization integer conversions.
+ */
+public class Reduce_Convert01 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return i2b(arg + 10);
+        }
+        if (arg == 1) {
+            return i2s(arg + 10);
+        }
+        if (arg == 2) {
+            return i2c(arg + 10);
+        }
+        return 0;
+    }
+
+    public static int i2b(int arg) {
+        int x = (byte) arg;
+        return (byte) x;
+    }
+
+    public static int i2s(int arg) {
+        int x = (short) arg;
+        return (short) x;
+    }
+
+    public static int i2c(int arg) {
+        int x = (char) arg;
+        return (char) x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Double01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of double operations.
+ */
+public class Reduce_Double01 {
+
+    public static double test(double arg) {
+        if (arg == 0) {
+            return add(10);
+        }
+        if (arg == 1) {
+            return sub(11);
+        }
+        if (arg == 2) {
+            return mul(12);
+        }
+        if (arg == 3) {
+            return div(13);
+        }
+        return 0;
+    }
+
+    public static double add(double x) {
+        return x + 0;
+    }
+
+    public static double sub(double x) {
+        return x - 0;
+    }
+
+    public static double mul(double x) {
+        return x * 1;
+    }
+
+    public static double div(double x) {
+        return x / 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10d, test(0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11d, test(1d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12d, test(2d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13d, test(3d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Float01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of float operations.
+ */
+public class Reduce_Float01 {
+
+    public static float test(float arg) {
+        if (arg == 0) {
+            return add(10);
+        }
+        if (arg == 1) {
+            return sub(11);
+        }
+        if (arg == 2) {
+            return mul(12);
+        }
+        if (arg == 3) {
+            return div(13);
+        }
+        return 0;
+    }
+
+    public static float add(float x) {
+        return x + 0;
+    }
+
+    public static float sub(float x) {
+        return x - 0;
+    }
+
+    public static float mul(float x) {
+        return x * 1;
+    }
+
+    public static float div(float x) {
+        return x / 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10f, test(0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11f, test(1f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12f, test(2f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13f, test(3f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Int01 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return add(10);
+        }
+        if (arg == 1) {
+            return sub(11);
+        }
+        if (arg == 2) {
+            return mul(12);
+        }
+        if (arg == 3) {
+            return div(13);
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        if (arg == 5) {
+            return and(15);
+        }
+        if (arg == 6) {
+            return or(16);
+        }
+        if (arg == 7) {
+            return xor(17);
+        }
+        return 0;
+    }
+
+    public static int add(int x) {
+        return x + 0;
+    }
+
+    public static int sub(int x) {
+        return x - 0;
+    }
+
+    public static int mul(int x) {
+        return x * 1;
+    }
+
+    public static int div(int x) {
+        return x / 1;
+    }
+
+    public static int mod() {
+        return 14;
+    }
+
+    public static int and(int x) {
+        return x & -1;
+    }
+
+    public static int or(int x) {
+        return x | 0;
+    }
+
+    public static int xor(int x) {
+        return x ^ 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(17, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Int02 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return add(10);
+        }
+        if (arg == 1) {
+            return sub();
+        }
+        if (arg == 2) {
+            return mul(12);
+        }
+        if (arg == 3) {
+            return div();
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        if (arg == 5) {
+            return and(15);
+        }
+        if (arg == 6) {
+            return or(16);
+        }
+        if (arg == 7) {
+            return xor(17);
+        }
+        return 0;
+    }
+
+    public static int add(int x) {
+        return 0 + x;
+    }
+
+    public static int sub() {
+        return 11;
+    }
+
+    public static int mul(int x) {
+        return 1 * x;
+    }
+
+    public static int div() {
+        return 13;
+    }
+
+    public static int mod() {
+        return 14;
+    }
+
+    public static int and(int x) {
+        return -1 & x;
+    }
+
+    public static int or(int x) {
+        return 0 | x;
+    }
+
+    public static int xor(int x) {
+        return 0 ^ x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(17, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Int03 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return add(5);
+        }
+        if (arg == 1) {
+            return sub(10);
+        }
+        if (arg == 2) {
+            return mul(5);
+        }
+        if (arg == 3) {
+            return div(5);
+        }
+        if (arg == 4) {
+            return mod(5);
+        }
+        if (arg == 5) {
+            return and(15);
+        }
+        if (arg == 6) {
+            return or(16);
+        }
+        if (arg == 7) {
+            return xor(17);
+        }
+        return 0;
+    }
+
+    public static int add(int x) {
+        return x + x;
+    }
+
+    public static int sub(int x) {
+        return x - x;
+    }
+
+    public static int mul(int x) {
+        return x * x;
+    }
+
+    public static int div(int x) {
+        return x / x;
+    }
+
+    public static int mod(int x) {
+        return x % x;
+    }
+
+    public static int and(int x) {
+        return x & x;
+    }
+
+    public static int or(int x) {
+        return x | x;
+    }
+
+    public static int xor(int x) {
+        return x ^ x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(25, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int04.java	Thu Mar 08 19:24:17 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.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Int04 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return mul0(arg + 10);
+        }
+        if (arg == 1) {
+            return mul1(arg + 9);
+        }
+        return 0;
+    }
+
+    public static int mul0(int x) {
+        return x * 4;
+    }
+
+    public static int mul1(int x) {
+        return x * 65536;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(40, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(655360, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of integer operations.
+ */
+public class Reduce_IntShift01 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return shift0(arg + 10);
+        }
+        if (arg == 1) {
+            return shift1(arg + 10);
+        }
+        if (arg == 2) {
+            return shift2(arg + 10);
+        }
+        if (arg == 3) {
+            return shift3(arg + 10);
+        }
+        if (arg == 4) {
+            return shift4(arg + 10);
+        }
+        if (arg == 5) {
+            return shift5(arg + 10);
+        }
+        return 0;
+    }
+
+    public static int shift0(int x) {
+        return x >> 0;
+    }
+
+    public static int shift1(int x) {
+        return x >>> 0;
+    }
+
+    public static int shift2(int x) {
+        return x << 0;
+    }
+
+    public static int shift3(int x) {
+        return x >> 64;
+    }
+
+    public static int shift4(int x) {
+        return x >>> 64;
+    }
+
+    public static int shift5(int x) {
+        return x << 64;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of integer operations.
+ */
+public class Reduce_IntShift02 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return shift0(arg + 80);
+        }
+        if (arg == 1) {
+            return shift1(arg + 0x8000000a);
+        }
+        if (arg == 2) {
+            return shift2(arg + 192);
+        }
+        if (arg == 3) {
+            return shift3(arg + 208);
+        }
+        if (arg == 4) {
+            return shift4(arg);
+        }
+        if (arg == 5) {
+            return shift5(arg);
+        }
+        return 0;
+    }
+
+    public static int shift0(int x) {
+        return x >>> 3 << 3;
+    }
+
+    public static int shift1(int x) {
+        return x << 3 >>> 3;
+    }
+
+    public static int shift2(int x) {
+        return x >> 3 >> 1;
+    }
+
+    public static int shift3(int x) {
+        return x >>> 3 >>> 1;
+    }
+
+    public static int shift4(int x) {
+        return x << 3 << 1;
+    }
+
+    public static int shift5(int x) {
+        return x << 16 << 17;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(80, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(64, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(0, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Long01 {
+
+    public static long test(long arg) {
+        if (arg == 0) {
+            return add(10);
+        }
+        if (arg == 1) {
+            return sub(11);
+        }
+        if (arg == 2) {
+            return mul(12);
+        }
+        if (arg == 3) {
+            return div(13);
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        if (arg == 5) {
+            return and(15);
+        }
+        if (arg == 6) {
+            return or(16);
+        }
+        if (arg == 7) {
+            return xor(17);
+        }
+        return 0;
+    }
+
+    public static long add(long x) {
+        return x + 0;
+    }
+
+    public static long sub(long x) {
+        return x - 0;
+    }
+
+    public static long mul(long x) {
+        return x * 1;
+    }
+
+    public static long div(long x) {
+        return x / 1;
+    }
+
+    public static long mod() {
+        return 14;
+    }
+
+    public static long and(long x) {
+        return x & -1;
+    }
+
+    public static long or(long x) {
+        return x | 0;
+    }
+
+    public static long xor(long x) {
+        return x ^ 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14L, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15L, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16L, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(17L, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Long02 {
+
+    public static long test(long arg) {
+        if (arg == 0) {
+            return add(10);
+        }
+        if (arg == 1) {
+            return sub();
+        }
+        if (arg == 2) {
+            return mul(12);
+        }
+        if (arg == 3) {
+            return div();
+        }
+        if (arg == 4) {
+            return mod();
+        }
+        if (arg == 5) {
+            return and(15);
+        }
+        if (arg == 6) {
+            return or(16);
+        }
+        if (arg == 7) {
+            return xor(17);
+        }
+        return 0;
+    }
+
+    public static long add(long x) {
+        return 0 + x;
+    }
+
+    public static long sub() {
+        return 11;
+    }
+
+    public static long mul(long x) {
+        return 1 * x;
+    }
+
+    public static long div() {
+        return 13;
+    }
+
+    public static long mod() {
+        return 14;
+    }
+
+    public static long and(long x) {
+        return -1 & x;
+    }
+
+    public static long or(long x) {
+        return 0 | x;
+    }
+
+    public static long xor(long x) {
+        return 0 ^ x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14L, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15L, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16L, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(17L, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Long03 {
+
+    public static long test(long arg) {
+        if (arg == 0) {
+            return add(5);
+        }
+        if (arg == 1) {
+            return sub(10);
+        }
+        if (arg == 2) {
+            return mul(5);
+        }
+        if (arg == 3) {
+            return div(5);
+        }
+        if (arg == 4) {
+            return mod(5);
+        }
+        if (arg == 5) {
+            return and(15);
+        }
+        if (arg == 6) {
+            return or(16);
+        }
+        if (arg == 7) {
+            return xor(17);
+        }
+        return 0;
+    }
+
+    public static long add(long x) {
+        return x + x;
+    }
+
+    public static long sub(long x) {
+        return x - x;
+    }
+
+    public static long mul(long x) {
+        return x * x;
+    }
+
+    public static long div(long x) {
+        return x / x;
+    }
+
+    public static long mod(long x) {
+        return x % x;
+    }
+
+    public static long and(long x) {
+        return x & x;
+    }
+
+    public static long or(long x) {
+        return x | x;
+    }
+
+    public static long xor(long x) {
+        return x ^ x;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(25L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0L, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15L, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(16L, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0L, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long04.java	Thu Mar 08 19:24:17 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.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class Reduce_Long04 {
+
+    public static long test(long arg) {
+        if (arg == 0) {
+            return mul0(arg + 10);
+        }
+        if (arg == 1) {
+            return mul1(arg + 9);
+        }
+        return 0;
+    }
+
+    public static long mul0(long x) {
+        return x * 4;
+    }
+
+    public static long mul1(long x) {
+        return x * 8589934592L;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(40L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(85899345920L, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of integer operations.
+ */
+public class Reduce_LongShift01 {
+
+    public static long test(long arg) {
+        if (arg == 0) {
+            return shift0(arg + 10);
+        }
+        if (arg == 1) {
+            return shift1(arg + 10);
+        }
+        if (arg == 2) {
+            return shift2(arg + 10);
+        }
+        if (arg == 3) {
+            return shift3(arg + 10);
+        }
+        if (arg == 4) {
+            return shift4(arg + 10);
+        }
+        if (arg == 5) {
+            return shift5(arg + 10);
+        }
+        return 0;
+    }
+
+    public static long shift0(long x) {
+        return x >> 0;
+    }
+
+    public static long shift1(long x) {
+        return x >>> 0;
+    }
+
+    public static long shift2(long x) {
+        return x << 0;
+    }
+
+    public static long shift3(long x) {
+        return x >> 64;
+    }
+
+    public static long shift4(long x) {
+        return x >>> 64;
+    }
+
+    public static long shift5(long x) {
+        return x << 64;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(14L, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(15L, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of integer operations.
+ */
+public class Reduce_LongShift02 {
+
+    public static long test(long arg) {
+        if (arg == 0) {
+            return shift0(arg + 80);
+        }
+        if (arg == 1) {
+            return shift1(arg + 0x800000000000000aL);
+        }
+        if (arg == 2) {
+            return shift2(arg + 192);
+        }
+        if (arg == 3) {
+            return shift3(arg + 208);
+        }
+        if (arg == 4) {
+            return shift4(arg);
+        }
+        return 0;
+    }
+
+    public static long shift0(long x) {
+        return x >>> 3 << 3;
+    }
+
+    public static long shift1(long x) {
+        return x << 3 >>> 3;
+    }
+
+    public static long shift2(long x) {
+        return x >> 3 >> 1;
+    }
+
+    public static long shift3(long x) {
+        return x >>> 3 >>> 1;
+    }
+
+    public static long shift4(long x) {
+        return x << 3 << 1;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(80L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(11L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(12L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(13L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(64L, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of switches.
+ */
+public class Switch01 {
+
+    public static int test(int arg) {
+        switch (arg) {
+            default:
+                return 1;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of switches.
+ */
+public class Switch02 {
+
+    public static int test(int arg) {
+        switch (arg) {
+            case 1:
+                return 2;
+            default:
+                return 1;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(1, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(2, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/TypeCastElem.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ */
+public class TypeCastElem {
+
+    interface Int1 {
+
+        int do1();
+    }
+
+    interface Int2 {
+
+        int do2();
+    }
+
+    interface Int3 extends Int1 {
+
+        int do3();
+    }
+
+    public static class ClassA implements Int1 {
+
+        private int a;
+
+        public ClassA(int a) {
+            this.a = a;
+        }
+
+        public int do1() {
+            return a;
+        }
+    }
+
+    public static class ClassB extends ClassA implements Int2 {
+
+        int b;
+
+        public ClassB(int a, int b) {
+            super(a);
+            this.b = b;
+        }
+
+        public int do2() {
+            return b;
+        }
+    }
+
+    public static class ClassC implements Int3 {
+
+        private int a;
+        private int b;
+
+        public ClassC(int a, int b) {
+            this.a = a;
+            this.b = b;
+        }
+
+        public int do3() {
+            return b;
+        }
+
+        public int do1() {
+            return a;
+        }
+
+    }
+
+    public static int test1(Object o) {
+        if (o instanceof ClassB) {
+            ClassB b = (ClassB) o;
+            if (o instanceof Int1) {
+                return b.b - b.b + 1;
+            }
+            return 7;
+        }
+        return 3;
+    }
+
+    public static int test2(Object o) {
+        Object b = o;
+        if (o instanceof ClassB) {
+            ClassA a = (ClassA) o;
+            if (b instanceof Int1) {
+                return ((Int1) a).do1();
+            }
+            return 7;
+        }
+        return 3;
+    }
+
+    public static int test3(Object o) {
+        Object b = o;
+        boolean t = o instanceof Int3;
+        if (t) {
+            Int1 a = (Int1) b;
+            return a.do1();
+        }
+        return 3;
+    }
+
+    public static int test(int a, int b, int c) {
+        ClassA ca = new ClassA(a);
+        ClassB cb = new ClassB(a, b);
+        ClassC cc = new ClassC(c, c);
+        int sum1 = test1(ca) + test1(cb) * 10 + test1(cc) * 100;
+        int sum2 = test2(ca) + test2(cb) * 10 + test2(cc) * 100;
+        int sum3 = test3(ca) + test3(cb) * 10 + test3(cc) * 100;
+        int result = sum1 * 5 + sum2 * 7 + sum3 * 9;
+        return result;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(test(10, 13, 25));
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(27183, test(10, 13, 25));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class VN_Cast01 {
+
+    static final Object object = new VN_Cast01();
+
+    int field = 9;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return test1();
+        }
+        if (arg == 1) {
+            return test2();
+        }
+        if (arg == 2) {
+            return test3();
+        }
+        return 0;
+    }
+
+    private static int test1() {
+        Object o = object;
+        VN_Cast01 a = (VN_Cast01) o;
+        VN_Cast01 b = (VN_Cast01) o;
+        return a.field + b.field;
+    }
+
+    private static int test2() {
+        Object obj = new VN_Cast01();
+        VN_Cast01 a = (VN_Cast01) obj;
+        VN_Cast01 b = (VN_Cast01) obj;
+        return a.field + b.field;
+    }
+
+    @SuppressWarnings("all")
+    private static int test3() {
+        Object o = null;
+        VN_Cast01 a = (VN_Cast01) o;
+        VN_Cast01 b = (VN_Cast01) o;
+        return a.field + b.field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(18, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(18, test(1));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class VN_Cast02 {
+
+    private static boolean cond = true;
+    static final Object object = new VN_Cast02();
+
+    int field = 9;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return test1();
+        }
+        if (arg == 1) {
+            return test2();
+        }
+        if (arg == 2) {
+            return test3();
+        }
+        return 0;
+    }
+
+    private static int test1() {
+        Object o = object;
+        VN_Cast02 a = (VN_Cast02) o;
+        if (cond) {
+            VN_Cast02 b = (VN_Cast02) o;
+            return a.field + b.field;
+        }
+        return 0;
+    }
+
+    private static int test2() {
+        Object obj = new VN_Cast02();
+        VN_Cast02 a = (VN_Cast02) obj;
+        if (cond) {
+            VN_Cast02 b = (VN_Cast02) obj;
+            return a.field + b.field;
+        }
+        return 0;
+    }
+
+    @SuppressWarnings("all")
+    private static int test3() {
+        Object o = null;
+        VN_Cast02 a = (VN_Cast02) o;
+        if (cond) {
+            VN_Cast02 b = (VN_Cast02) o;
+            return a.field + b.field;
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(18, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(18, test(1));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization integer conversions.
+ */
+public class VN_Convert01 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return i2b(arg + 10);
+        }
+        if (arg == 1) {
+            return i2s(arg + 10);
+        }
+        if (arg == 2) {
+            return i2c(arg + 10);
+        }
+        return 0;
+    }
+
+    public static int i2b(int arg) {
+        int x = (byte) arg;
+        int y = (byte) arg;
+        return x + y;
+    }
+
+    public static int i2s(int arg) {
+        int x = (short) arg;
+        int y = (short) arg;
+        return x + y;
+    }
+
+    public static int i2c(int arg) {
+        int x = (char) arg;
+        int y = (char) arg;
+        return x + y;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(20, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(22, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(24, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization integer conversions.
+ */
+public class VN_Convert02 {
+
+    private static boolean cond = true;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return i2b(arg + 10);
+        }
+        if (arg == 1) {
+            return i2s(arg + 10);
+        }
+        if (arg == 2) {
+            return i2c(arg + 10);
+        }
+        return 0;
+    }
+
+    public static int i2b(int arg) {
+        int x = (byte) arg;
+        if (cond) {
+            int y = (byte) arg;
+            return x + y;
+        }
+        return 0;
+    }
+
+    public static int i2s(int arg) {
+        int x = (short) arg;
+        if (cond) {
+            int y = (short) arg;
+            return x + y;
+        }
+        return 0;
+    }
+
+    public static int i2c(int arg) {
+        int x = (char) arg;
+        if (cond) {
+            int y = (char) arg;
+            return x + y;
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(20, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(22, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(24, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of float operations.
+ */
+public class VN_Double01 {
+
+    public static double test(double arg) {
+        if (arg == 0) {
+            return add(arg + 10);
+        }
+        if (arg == 1) {
+            return sub(arg + 10);
+        }
+        if (arg == 2) {
+            return mul(arg + 10);
+        }
+        if (arg == 3) {
+            return div(arg + 10);
+        }
+        return 0;
+    }
+
+    public static double add(double x) {
+        double c = 1;
+        double t = x + c;
+        double u = x + c;
+        return t + u;
+    }
+
+    public static double sub(double x) {
+        double c = 1;
+        double t = x - c;
+        double u = x - c;
+        return t - u;
+    }
+
+    public static double mul(double x) {
+        double c = 1;
+        double t = x * c;
+        double u = x * c;
+        return t * u;
+    }
+
+    public static double div(double x) {
+        double c = 1;
+        double t = x / c;
+        double u = x / c;
+        return t / u;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(22d, test(0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0d, test(1d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(144d, test(2d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1d, test(3d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of float operations.
+ */
+public class VN_Double02 {
+
+    private static boolean cond = true;
+
+    public static double test(double arg) {
+        if (arg == 0) {
+            return add(arg + 10);
+        }
+        if (arg == 1) {
+            return sub(arg + 10);
+        }
+        if (arg == 2) {
+            return mul(arg + 10);
+        }
+        if (arg == 3) {
+            return div(arg + 10);
+        }
+        return 0;
+    }
+
+    public static double add(double x) {
+        double c = 1.0d;
+        double t = x + c;
+        if (cond) {
+            double u = x + c;
+            return t + u;
+        }
+        return 1;
+    }
+
+    public static double sub(double x) {
+        double c = 1.0d;
+        double t = x - c;
+        if (cond) {
+            double u = x - c;
+            return t - u;
+        }
+        return 1;
+    }
+
+    public static double mul(double x) {
+        double c = 1.0d;
+        double t = x * c;
+        if (cond) {
+            double u = x * c;
+            return t * u;
+        }
+        return 1.0d;
+    }
+
+    public static double div(double x) {
+        double c = 1.0d;
+        double t = x / c;
+        if (cond) {
+            double u = x / c;
+            return t / u;
+        }
+        return 1.0d;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(22d, test(0d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0d, test(1d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(144d, test(2d), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1d, test(3d), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class VN_Field01 {
+
+    static final VN_Field01 object = new VN_Field01();
+
+    int field = 9;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return test1();
+        }
+        if (arg == 1) {
+            return test2();
+        }
+        if (arg == 2) {
+            return test3();
+        }
+        return 0;
+    }
+
+    private static int test1() {
+        VN_Field01 a = object;
+        return a.field + a.field;
+    }
+
+    private static int test2() {
+        VN_Field01 a = object;
+        VN_Field01 b = object;
+        return a.field + b.field;
+    }
+
+    @SuppressWarnings("all")
+    private static int test3() {
+        VN_Field01 a = null;
+        VN_Field01 b = null;
+        return a.field + b.field;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(18, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(18, test(1));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests constant folding of integer operations.
+ */
+public class VN_Field02 {
+
+    private static boolean cond = true;
+    static final VN_Field02 object = new VN_Field02();
+
+    int field = 9;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return test1();
+        }
+        if (arg == 1) {
+            return test2();
+        }
+        if (arg == 2) {
+            return test3();
+        }
+        return 0;
+    }
+
+    private static int test1() {
+        VN_Field02 a = object;
+        int c = a.field;
+        if (cond) {
+            return c + a.field;
+        }
+        return 0;
+    }
+
+    private static int test2() {
+        VN_Field02 a = object;
+        if (cond) {
+            VN_Field02 b = object;
+            return a.field + b.field;
+        }
+        return 0;
+    }
+
+    @SuppressWarnings("all")
+    private static int test3() {
+        VN_Field02 a = null;
+        if (cond) {
+            VN_Field02 b = null;
+            return a.field + b.field;
+        }
+        return 0;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(18, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(18, test(1));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of float operations.
+ */
+public class VN_Float01 {
+
+    public static float test(float arg) {
+        if (arg == 0) {
+            return add(arg + 10);
+        }
+        if (arg == 1) {
+            return sub(arg + 10);
+        }
+        if (arg == 2) {
+            return mul(arg + 10);
+        }
+        if (arg == 3) {
+            return div(arg + 10);
+        }
+        return 0;
+    }
+
+    public static float add(float x) {
+        float c = 1;
+        float t = x + c;
+        float u = x + c;
+        return t + u;
+    }
+
+    public static float sub(float x) {
+        float c = 1;
+        float t = x - c;
+        float u = x - c;
+        return t - u;
+    }
+
+    public static float mul(float x) {
+        float c = 1;
+        float t = x * c;
+        float u = x * c;
+        return t * u;
+    }
+
+    public static float div(float x) {
+        float c = 1;
+        float t = x / c;
+        float u = x / c;
+        return t / u;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(22f, test(0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0f, test(1f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(144f, test(2f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1f, test(3f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of float operations.
+ */
+public class VN_Float02 {
+
+    private static boolean cond = true;
+
+    public static float test(float arg) {
+        if (arg == 0) {
+            return add(arg + 10);
+        }
+        if (arg == 1) {
+            return sub(arg + 10);
+        }
+        if (arg == 2) {
+            return mul(arg + 10);
+        }
+        if (arg == 3) {
+            return div(arg + 10);
+        }
+        return 0;
+    }
+
+    public static float add(float x) {
+        float c = 1.0f;
+        float t = x + c;
+        if (cond) {
+            float u = x + c;
+            return t + u;
+        }
+        return 1.0f;
+    }
+
+    public static float sub(float x) {
+        float c = 1.0f;
+        float t = x - c;
+        if (cond) {
+            float u = x - c;
+            return t - u;
+        }
+        return 1.0f;
+    }
+
+    public static float mul(float x) {
+        float c = 1.0f;
+        float t = x * c;
+        if (cond) {
+            float u = x * c;
+            return t * u;
+        }
+        return 1.0f;
+    }
+
+    public static float div(float x) {
+        float c = 1.0f;
+        float t = x / c;
+        if (cond) {
+            float u = x / c;
+            return t / u;
+        }
+        return 1.0f;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(22f, test(0f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0f, test(1f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(144f, test(2f), 0);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1f, test(3f), 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of instanceof operations.
+ */
+public class VN_InstanceOf01 {
+
+    static final Object object = new VN_InstanceOf01();
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return foo1();
+        }
+        if (arg == 1) {
+            return foo2();
+        }
+        if (arg == 2) {
+            return foo3();
+        }
+        // do nothing
+        return false;
+    }
+
+    private static boolean foo1() {
+        boolean a = object instanceof VN_InstanceOf01;
+        boolean b = object instanceof VN_InstanceOf01;
+        return a | b;
+    }
+
+    private static boolean foo2() {
+        Object obj = new VN_InstanceOf01();
+        boolean a = obj instanceof VN_InstanceOf01;
+        boolean b = obj instanceof VN_InstanceOf01;
+        return a | b;
+    }
+
+    private static boolean foo3() {
+        boolean a = null instanceof VN_InstanceOf01;
+        boolean b = null instanceof VN_InstanceOf01;
+        return a | b;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of instanceof operations.
+ */
+public class VN_InstanceOf02 {
+
+    private static boolean cond = true;
+
+    static final Object object = new VN_InstanceOf02();
+
+    public static boolean test(int arg) {
+        if (arg == 0) {
+            return foo1();
+        }
+        if (arg == 1) {
+            return foo2();
+        }
+        if (arg == 2) {
+            return foo3();
+        }
+        // do nothing
+        return false;
+    }
+
+    private static boolean foo1() {
+        boolean a = object instanceof VN_InstanceOf02;
+        if (cond) {
+            boolean b = object instanceof VN_InstanceOf02;
+            return a | b;
+        }
+        return false;
+    }
+
+    private static boolean foo2() {
+        Object obj = new VN_InstanceOf02();
+        boolean a = obj instanceof VN_InstanceOf02;
+        if (cond) {
+            boolean b = obj instanceof VN_InstanceOf02;
+            return a | b;
+        }
+        return false;
+    }
+
+    private static boolean foo3() {
+        boolean a = null instanceof VN_InstanceOf02;
+        if (cond) {
+            boolean b = null instanceof VN_InstanceOf02;
+            return a | b;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(false, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf03.java	Thu Mar 08 19:24:17 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.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of instanceof operations.
+ */
+public class VN_InstanceOf03 {
+
+    private static boolean cond = true;
+
+    static final Object object = new VN_InstanceOf03();
+
+    public static boolean test() {
+        return foo();
+    }
+
+    private static boolean foo() {
+        Object obj = new VN_InstanceOf03();
+        boolean a = obj instanceof VN_InstanceOf03;
+        if (cond) {
+            boolean b = obj instanceof VN_InstanceOf03;
+            return a | b;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of integer operations.
+ */
+public class VN_Int01 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return add(arg);
+        }
+        if (arg == 1) {
+            return sub(arg);
+        }
+        if (arg == 2) {
+            return mul(arg);
+        }
+        if (arg == 3) {
+            return div(arg);
+        }
+        if (arg == 4) {
+            return mod(arg);
+        }
+        if (arg == 5) {
+            return and(arg);
+        }
+        if (arg == 6) {
+            return or(arg);
+        }
+        if (arg == 7) {
+            return xor(arg);
+        }
+        return 0;
+    }
+
+    public static int add(int x) {
+        int c = 3;
+        int t = x + c;
+        int u = x + c;
+        return t + u;
+    }
+
+    public static int sub(int x) {
+        int c = 3;
+        int t = x - c;
+        int u = x - c;
+        return t - u;
+    }
+
+    public static int mul(int x) {
+        int i = 3;
+        int t = x * i;
+        int u = x * i;
+        return t * u;
+    }
+
+    public static int div(int x) {
+        int i = 9;
+        int t = i / x;
+        int u = i / x;
+        return t / u;
+    }
+
+    public static int mod(int x) {
+        int i = 7;
+        int t = i % x;
+        int u = i % x;
+        return t % u;
+    }
+
+    public static int and(int x) {
+        int i = 7;
+        int t = i & x;
+        int u = i & x;
+        return t & u;
+    }
+
+    public static int or(int x) {
+        int i = 7;
+        int t = i | x;
+        int u = i | x;
+        return t | u;
+    }
+
+    public static int xor(int x) {
+        int i = 7;
+        int t = i ^ x;
+        int u = i ^ x;
+        return t ^ u;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(6, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(36, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(5, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of integer operations.
+ */
+public class VN_Int02 {
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return shift0(arg + 10);
+        }
+        if (arg == 1) {
+            return shift1(arg + 10);
+        }
+        if (arg == 2) {
+            return shift2(arg + 10);
+        }
+        return 0;
+    }
+
+    public static int shift0(int x) {
+        int c = 1;
+        int t = x >> c;
+        int u = x >> c;
+        return t + u;
+    }
+
+    public static int shift1(int x) {
+        int c = 1;
+        int t = x >>> c;
+        int u = x >>> c;
+        return t + u;
+    }
+
+    public static int shift2(int x) {
+        int c = 1;
+        int t = x << c;
+        int u = x << c;
+        return t + u;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(10, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(48, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of integer operations.
+ */
+public class VN_Int03 {
+
+    private static boolean cond = true;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return add(arg);
+        }
+        if (arg == 1) {
+            return sub(arg);
+        }
+        if (arg == 2) {
+            return mul(arg);
+        }
+        if (arg == 3) {
+            return div(arg);
+        }
+        if (arg == 4) {
+            return mod(arg);
+        }
+        if (arg == 5) {
+            return and(arg);
+        }
+        if (arg == 6) {
+            return or(arg);
+        }
+        if (arg == 7) {
+            return xor(arg);
+        }
+        return 0;
+    }
+
+    public static int add(int x) {
+        int c = 3;
+        int t = x + c;
+        if (cond) {
+            int u = x + c;
+            return t + u;
+        }
+        return 0;
+    }
+
+    public static int sub(int x) {
+        int c = 3;
+        int t = x - c;
+        if (cond) {
+            int u = x - c;
+            return t - u;
+        }
+        return 3;
+    }
+
+    public static int mul(int x) {
+        int i = 3;
+        int t = x * i;
+        if (cond) {
+            int u = x * i;
+            return t * u;
+        }
+        return 3;
+    }
+
+    public static int div(int x) {
+        int i = 9;
+        int t = i / x;
+        if (cond) {
+            int u = i / x;
+            return t / u;
+        }
+        return 9;
+    }
+
+    public static int mod(int x) {
+        int i = 7;
+        int t = i % x;
+        if (cond) {
+            int u = i % x;
+            return t % u;
+        }
+        return 7;
+    }
+
+    public static int and(int x) {
+        int i = 7;
+        int t = i & x;
+        if (cond) {
+            int u = i & x;
+            return t & u;
+        }
+        return 7;
+    }
+
+    public static int or(int x) {
+        int i = 7;
+        int t = i | x;
+        if (cond) {
+            int u = i | x;
+            return t | u;
+        }
+        return 7;
+    }
+
+    public static int xor(int x) {
+        int i = 7;
+        int t = i ^ x;
+        if (cond) {
+            int u = i ^ x;
+            return t ^ u;
+        }
+        return 7;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(6, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(36, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(5, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of long operations.
+ */
+public class VN_Long01 {
+
+    public static long test(int arg) {
+        if (arg == 0) {
+            return add(arg);
+        }
+        if (arg == 1) {
+            return sub(arg);
+        }
+        if (arg == 2) {
+            return mul(arg);
+        }
+        if (arg == 3) {
+            return div(arg);
+        }
+        if (arg == 4) {
+            return mod(arg);
+        }
+        if (arg == 5) {
+            return and(arg);
+        }
+        if (arg == 6) {
+            return or(arg);
+        }
+        if (arg == 7) {
+            return xor(arg);
+        }
+        return 0;
+    }
+
+    public static long add(long x) {
+        long t = x + 3;
+        long u = x + 3;
+        return t + u;
+    }
+
+    public static long sub(long x) {
+        long t = x - 3;
+        long u = x - 3;
+        return t - u;
+    }
+
+    public static long mul(long x) {
+        long t = x * 3;
+        long u = x * 3;
+        return t * u;
+    }
+
+    public static long div(long x) {
+        long t = 9 / x;
+        long u = 9 / x;
+        return t / u;
+    }
+
+    public static long mod(long x) {
+        long t = 7 % x;
+        long u = 7 % x;
+        return t % u;
+    }
+
+    public static long and(long x) {
+        long t = 7 & x;
+        long u = 7 & x;
+        return t & u;
+    }
+
+    public static long or(long x) {
+        long t = 7 | x;
+        long u = 7 | x;
+        return t | u;
+    }
+
+    public static long xor(long x) {
+        long t = 7 ^ x;
+        long u = 7 ^ x;
+        return t ^ u;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(6L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(36L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0L, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(5L, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7L, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0L, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests optimization of integer operations.
+ */
+public class VN_Long02 {
+
+    public static long test(int arg) {
+        if (arg == 0) {
+            return shift0(arg + 10);
+        }
+        if (arg == 1) {
+            return shift1(arg + 10);
+        }
+        if (arg == 2) {
+            return shift2(arg + 10);
+        }
+        return 0;
+    }
+
+    public static long shift0(long x) {
+        long c = 1;
+        long t = x >> c;
+        long u = x >> c;
+        return t + u;
+    }
+
+    public static long shift1(long x) {
+        long c = 1;
+        long t = x >>> c;
+        long u = x >>> c;
+        return t + u;
+    }
+
+    public static long shift2(long x) {
+        long c = 1;
+        long t = x << c;
+        long u = x << c;
+        return t + u;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(10L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(10L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(48L, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of long operations.
+ */
+public class VN_Long03 {
+
+    private static boolean cond = true;
+
+    public static long test(int arg) {
+        if (arg == 0) {
+            return add(arg);
+        }
+        if (arg == 1) {
+            return sub(arg);
+        }
+        if (arg == 2) {
+            return mul(arg);
+        }
+        if (arg == 3) {
+            return div(arg);
+        }
+        if (arg == 4) {
+            return mod(arg);
+        }
+        if (arg == 5) {
+            return and(arg);
+        }
+        if (arg == 6) {
+            return or(arg);
+        }
+        if (arg == 7) {
+            return xor(arg);
+        }
+        return 0;
+    }
+
+    public static long add(long x) {
+        long t = x + 3;
+        if (cond) {
+            long u = x + 3;
+            return t + u;
+        }
+        return 3;
+    }
+
+    public static long sub(long x) {
+        long t = x - 3;
+        if (cond) {
+            long u = x - 3;
+            return t - u;
+        }
+        return 3;
+    }
+
+    public static long mul(long x) {
+        long t = x * 3;
+        if (cond) {
+            long u = x * 3;
+            return t * u;
+        }
+        return 3;
+    }
+
+    public static long div(long x) {
+        long t = 9 / x;
+        if (cond) {
+            long u = 9 / x;
+            return t / u;
+        }
+        return 9;
+    }
+
+    public static long mod(long x) {
+        long t = 7 % x;
+        if (cond) {
+            long u = 7 % x;
+            return t % u;
+        }
+        return 7;
+    }
+
+    public static long and(long x) {
+        long t = 7 & x;
+        if (cond) {
+            long u = 7 & x;
+            return t & u;
+        }
+        return 7;
+    }
+
+    public static long or(long x) {
+        long t = 7 | x;
+        if (cond) {
+            long u = 7 | x;
+            return t | u;
+        }
+        return 7;
+    }
+
+    public static long xor(long x) {
+        long t = 7 ^ x;
+        if (cond) {
+            long u = 7 ^ x;
+            return t ^ u;
+        }
+        return 7;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(6L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(0L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(36L, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(1L, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0L, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(5L, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(7L, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(0L, test(7));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Loop01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.optimize;
+
+import org.junit.*;
+
+/*
+ * Tests value numbering of integer operations.
+ */
+public class VN_Loop01 {
+
+    private static boolean cond1 = true;
+    private static boolean cond2 = true;
+
+    public static int test(int arg) {
+        if (arg == 0) {
+            return test1(arg);
+        }
+        if (arg == 1) {
+            return test2(arg);
+        }
+        if (arg == 2) {
+            return test3(arg);
+        }
+        if (arg == 3) {
+            return test4(arg);
+        }
+        return 0;
+    }
+
+    public static int test1(int x) {
+        int c = 3;
+        int t = x + c;
+        while (cond1) {
+            if (cond2) {
+                int u = x + c; // GVN should recognize u == t
+                return t + u;
+            }
+        }
+        return 3; // GVN should recognize 3 == 3
+    }
+
+    public static int test2(int x) {
+        int c = 3;
+        while (cond1) {
+            int t = x + c;
+            if (cond2) {
+                int u = x + c; // GVN should recognize u == t
+                return t + u;
+            }
+        }
+        return 3;
+    }
+
+    public static int test3(int x) {
+        int c = 3;
+        int t = x + c;
+        while (cond1) {
+            if (cond2) {
+                int u = x + c; // GVN should recognize u == t
+                return t + u;
+            }
+            int u = x + c; // GVN should recognize u == t
+            return t + u;
+        }
+        return 3; // GVN should recognize 3 == 3
+    }
+
+    public static int test4(int x) {
+        int c = 3;
+        int t = x + c;
+        while (cond1) {
+            if (!cond2) {
+                int u = x + c;
+                return t + u;
+            }
+            int u = x + c;
+            return t + u;
+        }
+        return 3;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(6, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(8, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(10, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(12, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(0, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_get01 {
+
+    private static final String[] array = {"0", "1", "2"};
+
+    public static String test(int i) {
+        return (String) Array.get(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("0", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("1", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("2", test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_get02 {
+
+    private static final int[] array = {11, 21, 42};
+
+    public static int test(int i) {
+        return (Integer) Array.get(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_get03 {
+
+    private static final byte[] array = {11, 21, 42};
+
+    public static byte test(int i) {
+        return (Byte) Array.get(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 11), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 21), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) 42), test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getBoolean01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getBoolean01 {
+
+    private static final boolean[] array = {true, false, true};
+
+    public static boolean test(int i) {
+        return Array.getBoolean(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getByte01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getByte01 {
+
+    private static final byte[] array = {11, 21, 42};
+
+    public static byte test(int i) {
+        return Array.getByte(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 11), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 21), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) 42), test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getChar01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getChar01 {
+
+    private static final char[] array = {11, 21, 42};
+
+    public static char test(int i) {
+        return Array.getChar(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 11), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 21), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 42), test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getDouble01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getDouble01 {
+
+    private static final double[] array = {11.1d, 21.1d, 42.1d};
+
+    public static double test(int i) {
+        return Array.getDouble(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11.1d, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21.1d, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42.1d, test(2), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getFloat01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getFloat01 {
+
+    private static final float[] array = {11.1f, 21.1f, 42.1f};
+
+    public static float test(int i) {
+        return Array.getFloat(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11.1f, test(0), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21.1f, test(1), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42.1f, test(2), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getInt01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getInt01 {
+
+    private static final int[] array = {11, 21, 42};
+
+    public static int test(int i) {
+        return Array.getInt(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLength01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getLength01 {
+
+    private static final int[] array0 = {11, 21, 42};
+    private static final boolean[] array1 = {true, true, false, false};
+    private static final String[] array2 = {"String"};
+
+    public static int test(int i) {
+        Object array = null;
+        if (i == 0) {
+            array = array0;
+        } else if (i == 1) {
+            array = array1;
+        } else if (i == 2) {
+            array = array2;
+        }
+        return Array.getLength(array);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(3, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(4, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(1, test(2));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLong01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getLong01 {
+
+    private static final long[] array = {11, 21, 42};
+
+    public static long test(int i) {
+        return Array.getLong(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11L, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21L, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42L, test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getShort01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_getShort01 {
+
+    private static final short[] array = {11, 21, 42};
+
+    public static short test(int i) {
+        return Array.getShort(array, i);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 11), test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) 21), test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) 42), test(2));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_newInstance01 {
+
+    public static boolean test(int i) {
+        return Array.newInstance(Array_newInstance01.class, i) != null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test(expected = java.lang.NegativeArraySizeException.class)
+    public void run3() throws Throwable {
+        test(-1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_newInstance02 {
+
+    public static boolean test(int i) {
+        Class< ? > javaClass;
+        if (i == 2) {
+            javaClass = void.class;
+        } else if (i == 3) {
+            javaClass = null;
+        } else {
+            javaClass = int.class;
+        }
+        return Array.newInstance(javaClass, 0) != null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test(expected = java.lang.IllegalArgumentException.class)
+    public void run1() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(3);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_newInstance03 {
+
+    public static boolean test(int i) {
+        Class< ? > javaClass;
+        if (i == 2) {
+            javaClass = int.class;
+        } else if (i == 3) {
+            javaClass = Object.class;
+        } else {
+            javaClass = Array_newInstance03.class;
+        }
+        return Array.newInstance(javaClass, 0).getClass().getComponentType() == javaClass;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_newInstance04 {
+
+    public static boolean test(int i, int j) {
+        final int[] dims = {i, j};
+        return Array.newInstance(Array_newInstance04.class, dims) != null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(1, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(2, 2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(3, 2));
+    }
+
+    @Test(expected = java.lang.NegativeArraySizeException.class)
+    public void run3() throws Throwable {
+        test(0, -1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_newInstance05 {
+
+    public static boolean test(int i, int j) {
+        final int[] dims = {i, j};
+        Class< ? > javaClass;
+        if (i == 2) {
+            javaClass = void.class;
+        } else if (i == 3) {
+            javaClass = null;
+        } else {
+            javaClass = int.class;
+        }
+        return Array.newInstance(javaClass, dims) != null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(1, 3));
+    }
+
+    @Test(expected = java.lang.IllegalArgumentException.class)
+    public void run1() throws Throwable {
+        test(2, 3);
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(3, 4);
+    }
+
+    @Test(expected = java.lang.NegativeArraySizeException.class)
+    public void run3() throws Throwable {
+        test(1, -1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_newInstance06 {
+
+    public static boolean test(int i) {
+        final int[] dims = {i, 3};
+        Class< ? > javaClass;
+        if (i == 2) {
+            javaClass = int.class;
+        } else if (i == 3) {
+            javaClass = Object.class;
+        } else {
+            javaClass = Array_newInstance06.class;
+        }
+        return Array.newInstance(javaClass, dims).getClass().getComponentType().getComponentType() == javaClass;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_set01 {
+
+    private static final String[] array = {"x", "x", "x"};
+
+    public static String test(int i, String value) {
+        Array.set(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("1", test(0, "1"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("2", test(1, "2"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("XXd", test(0, "XXd"));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, "--");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_set02 {
+
+    private static final int[] array = {-1, -1, -1};
+
+    public static int test(int i, int value) {
+        Array.set(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(0, 11));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21, test(1, 21));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(0, 42));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_set03 {
+
+    private static final byte[] array = {-1, -1, -1};
+
+    public static byte test(int i, byte value) {
+        Array.set(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 11), test(0, ((byte) 11)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 21), test(1, ((byte) 21)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) 42), test(0, ((byte) 42)));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, ((byte) 0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setBoolean01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setBoolean01 {
+
+    private static final boolean[] array = {false, false, false};
+
+    public static boolean test(int i, boolean value) {
+        Array.setBoolean(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0, true));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1, false));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2, true));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, false);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setByte01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setByte01 {
+
+    private static final byte[] array = {-1, -1, -1};
+
+    public static byte test(int i, byte value) {
+        Array.setByte(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((byte) 11), test(0, ((byte) 11)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((byte) 21), test(1, ((byte) 21)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((byte) 42), test(0, ((byte) 42)));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, ((byte) 0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setChar01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setChar01 {
+
+    private static final char[] array = {0, 0, 0};
+
+    public static char test(int i, char value) {
+        Array.setChar(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((char) 11), test(0, ((char) 11)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((char) 21), test(1, ((char) 21)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((char) 42), test(0, ((char) 42)));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, ((char) 0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setDouble01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setDouble01 {
+
+    private static final double[] array = {-1, -1, -1};
+
+    public static double test(int i, double value) {
+        Array.setDouble(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11.1d, test(0, 11.1d), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21.1d, test(1, 21.1d), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42.1d, test(0, 42.1d), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, 0.1d);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setFloat01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setFloat01 {
+
+    private static final float[] array = {-1, -1, -1};
+
+    public static float test(int i, float value) {
+        Array.setFloat(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11.1f, test(0, 11.1f), 0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21.1f, test(1, 21.1f), 0);
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42.1f, test(0, 42.1f), 0);
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, 0.1f);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setInt01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setInt01 {
+
+    private static final int[] array = {-1, -1, -1};
+
+    public static int test(int i, int value) {
+        Array.setInt(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11, test(0, 11));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21, test(1, 21));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42, test(0, 42));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, 0);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setLong01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setLong01 {
+
+    private static final long[] array = {-1, -1, -1};
+
+    public static long test(int i, long value) {
+        Array.setLong(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(11L, test(0, 11L));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(21L, test(1, 21L));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(42L, test(0, 42L));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, 0L);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setShort01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+public class Array_setShort01 {
+
+    private static final short[] array = {-1, -1, -1};
+
+    public static short test(int i, short value) {
+        Array.setShort(array, i, value);
+        return array[i];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(((short) 11), test(0, ((short) 11)));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(((short) 21), test(1, ((short) 21)));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(((short) 42), test(0, ((short) 42)));
+    }
+
+    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
+    public void run3() throws Throwable {
+        test(3, ((short) 0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredField01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Class_getDeclaredField01 {
+
+    static String field;
+    static int f2;
+
+    public static String test(String input) throws NoSuchFieldException {
+        return Class_getDeclaredField01.class.getDeclaredField(input).getName();
+    }
+
+    public static void main(String[] args) {
+        field = args[0];
+    }
+
+    @Test(expected = java.lang.NoSuchFieldException.class)
+    public void run0() throws Throwable {
+        test("test");
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("field", test("field"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("f2", test("f2"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredMethod01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Class_getDeclaredMethod01 {
+
+    static String field;
+
+    public static String test(String input) throws NoSuchMethodException {
+        return Class_getDeclaredMethod01.class.getDeclaredMethod(input, String[].class).getName();
+    }
+
+    public static void main(String[] args) {
+        field = args[0];
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run0() throws Throwable {
+        test("test");
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("main", test("main"));
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run2() throws Throwable {
+        test("xx");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Class_getField01 {
+
+    public static String field;
+    public String field2;
+    String field3;
+
+    public static String test(String input) throws NoSuchFieldException {
+        return Class_getField01.class.getField(input).getName();
+    }
+
+    @Test(expected = java.lang.NoSuchFieldException.class)
+    public void run0() throws Throwable {
+        test("test");
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("field", test("field"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("field2", test("field2"));
+    }
+
+    @Test(expected = java.lang.NoSuchFieldException.class)
+    public void run3() throws Throwable {
+        test("field3");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Class_getField02 {
+
+    public static String field;
+    public String field2;
+    String field3;
+
+    public static String test(String input) throws NoSuchFieldException {
+        return Class_getField02b.class.getField(input).getName();
+    }
+
+    static class Class_getField02b extends Class_getField02 {
+
+        public String field4;
+    }
+
+    @Test(expected = java.lang.NoSuchFieldException.class)
+    public void run0() throws Throwable {
+        test("test");
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("field", test("field"));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("field2", test("field2"));
+    }
+
+    @Test(expected = java.lang.NoSuchFieldException.class)
+    public void run3() throws Throwable {
+        test("field3");
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals("field4", test("field4"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Class_getMethod01 {
+
+    static String field;
+
+    public static String test(String input) throws NoSuchMethodException {
+        return Class_getMethod01.class.getMethod(input, String[].class).getName();
+    }
+
+    public static void main(String[] args) {
+        field = args[0];
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run0() throws Throwable {
+        test("test");
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("main", test("main"));
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run2() throws Throwable {
+        test("xx");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Class_getMethod02 {
+
+    static String field;
+
+    public static String test(int arg) throws NoSuchMethodException {
+        if (arg == 0) {
+            return Class_getMethod02.class.getMethod("test").getName();
+        } else if (arg == 1) {
+            return Class_getMethod02.class.getMethod("test", int.class).getName();
+        } else if (arg == 2) {
+            return Class_getMethod02.class.getMethod("main").getName();
+        } else if (arg == 3) {
+            return Class_getMethod02.class.getMethod("main", String[].class).getName();
+        } else if (arg == 4) {
+            return Class_getMethod02.class.getMethod("<init>").getName();
+        } else if (arg == 5) {
+            return Class_getMethod02.class.getMethod("<clinit>").getName();
+        }
+        return null;
+    }
+
+    public static void main(String[] args) {
+        field = args[0];
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("test", test(1));
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("main", test(3));
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+    @Test(expected = java.lang.NoSuchMethodException.class)
+    public void run5() throws Throwable {
+        test(5);
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(null, test(6));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_newInstance01 {
+
+    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
+        if (i == 0) {
+            return Class_newInstance01.class.newInstance() != null;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_newInstance02 {
+
+    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
+        if (i == 0) {
+            // note: we rely on the other class here.
+            return Class_newInstance07.Class_newInstance.class.newInstance() != null;
+        }
+        return false;
+    }
+
+    @Test(expected = java.lang.IllegalAccessException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+public class Class_newInstance03 {
+
+    public abstract static class AbstractClass {
+    }
+
+    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
+        if (i == 0) {
+            return AbstractClass.class.newInstance() != null;
+        } else if (i == 1) {
+            return Cloneable.class.newInstance() != null;
+        } else if (i == 2) {
+            return int[].class.newInstance() != null;
+        } else if (i == 3) {
+            return int.class.newInstance() != null;
+        }
+        return false;
+    }
+
+    @Test(expected = java.lang.InstantiationException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test(expected = java.lang.InstantiationException.class)
+    public void run1() throws Throwable {
+        test(1);
+    }
+
+    @Test(expected = java.lang.InstantiationException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.InstantiationException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance06.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_newInstance06 {
+
+    public static final class Class_newInstance {
+
+        @SuppressWarnings("unused")
+        private Class_newInstance(int i) {
+            // do nothing. xx
+        }
+    }
+
+    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
+        if (i == 0) {
+            return Class_newInstance.class.newInstance() != null;
+        }
+        return false;
+    }
+
+    @Test(expected = java.lang.InstantiationException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance07.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Class_newInstance07 {
+
+    public static final class Class_newInstance {
+
+        private Class_newInstance() throws Exception {
+            throw new Exception();
+        }
+    }
+
+    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
+        if (i == 0) {
+            return Class_newInstance.class.newInstance() != null;
+        }
+        return false;
+    }
+
+    @Test(expected = java.lang.Exception.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_get01 {
+
+    public static final byte byteField = 11;
+    public static final short shortField = 12;
+    public static final char charField = 13;
+    public static final int intField = 14;
+    public static final long longField = 15;
+    public static final float floatField = 16;
+    public static final double doubleField = 17;
+    public static final boolean booleanField = true;
+
+    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
+        if (arg == 0) {
+            return Field_get01.class.getField("byteField").get(null).equals(byteField);
+        } else if (arg == 1) {
+            return Field_get01.class.getField("shortField").get(null).equals(shortField);
+        } else if (arg == 2) {
+            return Field_get01.class.getField("charField").get(null).equals(charField);
+        } else if (arg == 3) {
+            return Field_get01.class.getField("intField").get(null).equals(intField);
+        } else if (arg == 4) {
+            return Field_get01.class.getField("longField").get(null).equals(longField);
+        } else if (arg == 5) {
+            return Field_get01.class.getField("floatField").get(null).equals(floatField);
+        } else if (arg == 6) {
+            return Field_get01.class.getField("doubleField").get(null).equals(doubleField);
+        } else if (arg == 7) {
+            return Field_get01.class.getField("booleanField").get(null).equals(booleanField);
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_get02 {
+
+    private static final Field_get02 object = new Field_get02();
+
+    public final byte byteField = 11;
+    public final short shortField = 12;
+    public final char charField = 13;
+    public final int intField = 14;
+    public final long longField = 15;
+    public final float floatField = 16;
+    public final double doubleField = 17;
+    public final boolean booleanField = true;
+
+    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
+        if (arg == 0) {
+            return Field_get02.class.getField("byteField").get(object).equals(object.byteField);
+        } else if (arg == 1) {
+            return Field_get02.class.getField("shortField").get(object).equals(object.shortField);
+        } else if (arg == 2) {
+            return Field_get02.class.getField("charField").get(object).equals(object.charField);
+        } else if (arg == 3) {
+            return Field_get02.class.getField("intField").get(object).equals(object.intField);
+        } else if (arg == 4) {
+            return Field_get02.class.getField("longField").get(object).equals(object.longField);
+        } else if (arg == 5) {
+            return Field_get02.class.getField("floatField").get(object).equals(object.floatField);
+        } else if (arg == 6) {
+            return Field_get02.class.getField("doubleField").get(object).equals(object.doubleField);
+        } else if (arg == 7) {
+            return Field_get02.class.getField("booleanField").get(object).equals(object.booleanField);
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_get03 {
+
+    private static Field ByteField;
+    private static Field ShortField;
+    private static Field CharField;
+    private static Field IntField;
+    private static Field LongField;
+    private static Field FloatField;
+    private static Field DoubleField;
+    private static Field BooleanField;
+
+    static {
+        try {
+            ByteField = Field_get03.class.getField("byteField");
+            ShortField = Field_get03.class.getField("shortField");
+            CharField = Field_get03.class.getField("charField");
+            IntField = Field_get03.class.getField("intField");
+            LongField = Field_get03.class.getField("longField");
+            FloatField = Field_get03.class.getField("floatField");
+            DoubleField = Field_get03.class.getField("doubleField");
+            BooleanField = Field_get03.class.getField("booleanField");
+        } catch (SecurityException e) {
+            e.printStackTrace();
+        } catch (NoSuchFieldException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static final Field_get03 object = new Field_get03();
+
+    public final byte byteField = 11;
+    public final short shortField = 12;
+    public final char charField = 13;
+    public final int intField = 14;
+    public final long longField = 15;
+    public final float floatField = 16;
+    public final double doubleField = 17;
+    public final boolean booleanField = true;
+
+    public static boolean test(int arg) throws IllegalAccessException {
+        if (arg == 0) {
+            return ByteField.get(object).equals(object.byteField);
+        } else if (arg == 1) {
+            return ShortField.get(object).equals(object.shortField);
+        } else if (arg == 2) {
+            return CharField.get(object).equals(object.charField);
+        } else if (arg == 3) {
+            return IntField.get(object).equals(object.intField);
+        } else if (arg == 4) {
+            return LongField.get(object).equals(object.longField);
+        } else if (arg == 5) {
+            return FloatField.get(object).equals(object.floatField);
+        } else if (arg == 6) {
+            return DoubleField.get(object).equals(object.doubleField);
+        } else if (arg == 7) {
+            return BooleanField.get(object).equals(object.booleanField);
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_get04 {
+
+    private static final Field_get04 object = new Field_get04();
+
+    public final byte byteField = 11;
+    public final short shortField = 12;
+    public final char charField = 13;
+    public final int intField = 14;
+    public final long longField = 15;
+    public final float floatField = 16;
+    public final double doubleField = 17;
+    public final boolean booleanField = true;
+
+    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
+        if (arg == 0) {
+            return Field_get04.class.getField("byteField").getByte(object) == object.byteField;
+        } else if (arg == 1) {
+            return Field_get04.class.getField("shortField").getShort(object) == object.shortField;
+        } else if (arg == 2) {
+            return Field_get04.class.getField("charField").getChar(object) == object.charField;
+        } else if (arg == 3) {
+            return Field_get04.class.getField("intField").getInt(object) == object.intField;
+        } else if (arg == 4) {
+            return Field_get04.class.getField("longField").getLong(object) == object.longField;
+        } else if (arg == 5) {
+            return Field_get04.class.getField("floatField").getFloat(object) == object.floatField;
+        } else if (arg == 6) {
+            return Field_get04.class.getField("doubleField").getDouble(object) == object.doubleField;
+        } else if (arg == 7) {
+            return Field_get04.class.getField("booleanField").getBoolean(object) == object.booleanField;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_getType01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_getType01 {
+
+    public static final byte byteField = 11;
+    public static final short shortField = 12;
+    public static final char charField = 13;
+    public static final int intField = 14;
+    public static final long longField = 15;
+    public static final float floatField = 16;
+    public static final double doubleField = 17;
+    public static final boolean booleanField = true;
+
+    public static boolean test(int arg) throws NoSuchFieldException {
+        if (arg == 0) {
+            return Field_getType01.class.getField("byteField").getType() == byte.class;
+        } else if (arg == 1) {
+            return Field_getType01.class.getField("shortField").getType() == short.class;
+        } else if (arg == 2) {
+            return Field_getType01.class.getField("charField").getType() == char.class;
+        } else if (arg == 3) {
+            return Field_getType01.class.getField("intField").getType() == int.class;
+        } else if (arg == 4) {
+            return Field_getType01.class.getField("longField").getType() == long.class;
+        } else if (arg == 5) {
+            return Field_getType01.class.getField("floatField").getType() == float.class;
+        } else if (arg == 6) {
+            return Field_getType01.class.getField("doubleField").getType() == double.class;
+        } else if (arg == 7) {
+            return Field_getType01.class.getField("booleanField").getType() == boolean.class;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_set01 {
+
+    public static byte byteField;
+    public static short shortField;
+    public static char charField;
+    public static int intField;
+    public static long longField;
+    public static float floatField;
+    public static double doubleField;
+    public static boolean booleanField;
+
+    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
+        if (arg == 0) {
+            Field_set01.class.getField("byteField").set(null, Byte.valueOf((byte) 11));
+            return byteField == 11;
+        } else if (arg == 1) {
+            Field_set01.class.getField("shortField").set(null, Short.valueOf((short) 12));
+            return shortField == 12;
+        } else if (arg == 2) {
+            Field_set01.class.getField("charField").set(null, Character.valueOf((char) 13));
+            return charField == 13;
+        } else if (arg == 3) {
+            Field_set01.class.getField("intField").set(null, Integer.valueOf(14));
+            return intField == 14;
+        } else if (arg == 4) {
+            Field_set01.class.getField("longField").set(null, Long.valueOf(15L));
+            return longField == 15;
+        } else if (arg == 5) {
+            Field_set01.class.getField("floatField").set(null, Float.valueOf(16));
+            return floatField == 16;
+        } else if (arg == 6) {
+            Field_set01.class.getField("doubleField").set(null, Double.valueOf(17));
+            return doubleField == 17;
+        } else if (arg == 7) {
+            Field_set01.class.getField("booleanField").set(null, true);
+            return booleanField == true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_set02 {
+
+    private static final Field_set02 object = new Field_set02();
+
+    public byte byteField;
+    public short shortField;
+    public char charField;
+    public int intField;
+    public long longField;
+    public float floatField;
+    public double doubleField;
+    public boolean booleanField;
+
+    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
+        if (arg == 0) {
+            Field_set02.class.getField("byteField").set(object, Byte.valueOf((byte) 11));
+            return object.byteField == 11;
+        } else if (arg == 1) {
+            Field_set02.class.getField("shortField").set(object, Short.valueOf((short) 12));
+            return object.shortField == 12;
+        } else if (arg == 2) {
+            Field_set02.class.getField("charField").set(object, Character.valueOf((char) 13));
+            return object.charField == 13;
+        } else if (arg == 3) {
+            Field_set02.class.getField("intField").set(object, Integer.valueOf(14));
+            return object.intField == 14;
+        } else if (arg == 4) {
+            Field_set02.class.getField("longField").set(object, Long.valueOf(15L));
+            return object.longField == 15;
+        } else if (arg == 5) {
+            Field_set02.class.getField("floatField").set(object, Float.valueOf(16));
+            return object.floatField == 16;
+        } else if (arg == 6) {
+            Field_set02.class.getField("doubleField").set(object, Double.valueOf(17));
+            return object.doubleField == 17;
+        } else if (arg == 7) {
+            Field_set02.class.getField("booleanField").set(object, true);
+            return object.booleanField == true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Field_set03 {
+
+    private static final Field_set03 object = new Field_set03();
+
+    public byte byteField;
+    public short shortField;
+    public char charField;
+    public int intField;
+    public long longField;
+    public float floatField;
+    public double doubleField;
+    public boolean booleanField;
+
+    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
+        if (arg == 0) {
+            Field_set03.class.getField("byteField").setByte(object, (byte) 11);
+            return object.byteField == 11;
+        } else if (arg == 1) {
+            Field_set03.class.getField("shortField").setShort(object, (short) 12);
+            return object.shortField == 12;
+        } else if (arg == 2) {
+            Field_set03.class.getField("charField").setChar(object, (char) 13);
+            return object.charField == 13;
+        } else if (arg == 3) {
+            Field_set03.class.getField("intField").setInt(object, 14);
+            return object.intField == 14;
+        } else if (arg == 4) {
+            Field_set03.class.getField("longField").setLong(object, 15L);
+            return object.longField == 15;
+        } else if (arg == 5) {
+            Field_set03.class.getField("floatField").setFloat(object, 16);
+            return object.floatField == 16;
+        } else if (arg == 6) {
+            Field_set03.class.getField("doubleField").setDouble(object, 17);
+            return object.doubleField == 17;
+        } else if (arg == 7) {
+            Field_set03.class.getField("booleanField").setBoolean(object, true);
+            return object.booleanField == true;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run6() throws Throwable {
+        Assert.assertEquals(true, test(6));
+    }
+
+    @Test
+    public void run7() throws Throwable {
+        Assert.assertEquals(true, test(7));
+    }
+
+    @Test
+    public void run8() throws Throwable {
+        Assert.assertEquals(false, test(8));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_except01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+/*
+ */
+public class Invoke_except01 {
+
+    public static int test(int arg) throws IllegalAccessException, InvocationTargetException {
+        Object[] args;
+        if (arg == 0) {
+            args = new Object[]{new int[0]};
+        } else if (arg == 1) {
+            args = new Object[]{new int[3]};
+        } else if (arg == 2) {
+            args = new Object[]{null};
+        } else if (arg == 3) {
+            args = new Object[]{new char[3]};
+        } else {
+            args = null;
+        }
+        for (Method m : Invoke_except01.class.getDeclaredMethods()) {
+            if ("method".equals(m.getName())) {
+                return (Integer) m.invoke(null, args);
+            }
+        }
+        return 42;
+    }
+
+    public static int method(int[] arg) {
+        return arg.length;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(3, test(1));
+    }
+
+    @Test(expected = java.lang.reflect.InvocationTargetException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test(expected = java.lang.IllegalArgumentException.class)
+    public void run3() throws Throwable {
+        test(3);
+    }
+
+    @Test(expected = java.lang.IllegalArgumentException.class)
+    public void run4() throws Throwable {
+        test(4);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+/*
+ */
+public class Invoke_main01 {
+
+    static String field;
+
+    public static String test(String input) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+        field = null;
+        final String[] args = {input};
+        Invoke_main01.class.getMethod("main", String[].class).invoke(null, new Object[]{args});
+        return field;
+    }
+
+    public static void main(String[] args) {
+        field = args[0];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("test1", test("test1"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("test2", test("test2"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+/*
+ */
+public class Invoke_main02 {
+
+    static String field;
+
+    public static String test(String input) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+        field = null;
+        final String[] args = {input};
+        Invoke_main02.class.getDeclaredMethod("main", String[].class).invoke(null, new Object[]{args});
+        return field;
+    }
+
+    public static void main(String[] args) {
+        field = args[0];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("test1", test("test1"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("test2", test("test2"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+/*
+ */
+public class Invoke_main03 {
+
+    static String field;
+
+    public static String test(String input) throws IllegalAccessException, InvocationTargetException {
+        field = null;
+        final String[] args = {input};
+        for (Method m : Invoke_main03.class.getDeclaredMethods()) {
+            if ("main".equals(m.getName())) {
+                m.invoke(null, new Object[]{args});
+            }
+        }
+        return field;
+    }
+
+    public static void main(String[] args) {
+        field = args[0];
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("test1", test("test1"));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("test2", test("test2"));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_virtual01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+/*
+ */
+public class Invoke_virtual01 {
+
+    static final HelperTest helper = new HelperTest(55);
+
+    public static int test(int input) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+        if (input == 1) {
+            final Method m = HelperTest.class.getDeclaredMethod("getInt");
+            Object o = m.invoke(helper);
+            return ((Integer) o).intValue();
+        }
+        return 0;
+    }
+
+    public static class HelperTest {
+
+        private int intField;
+
+        public int getInt() {
+            return intField;
+        }
+
+        public HelperTest(int i) {
+            intField = i;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(55, test(1));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getParameterTypes01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+@SuppressWarnings("unused")
+public class Method_getParameterTypes01 {
+
+    public static int test(int arg) throws NoSuchMethodException {
+        if (arg == 0) {
+            return Method_getParameterTypes01.class.getMethod("method1").getParameterTypes().length;
+        } else if (arg == 1) {
+            return Method_getParameterTypes01.class.getMethod("method2", int.class).getParameterTypes().length;
+        } else if (arg == 2) {
+            return Method_getParameterTypes01.class.getMethod("method3", int.class, Object.class).getParameterTypes().length;
+        }
+        return -1;
+    }
+
+    public int method1() {
+        return 0;
+    }
+
+    public void method2(int arg1) {
+    }
+
+    public void method3(int arg1, Object arg2) {
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(1, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(2, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(-1, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getReturnType01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+/*
+ */
+public class Method_getReturnType01 {
+
+    public static String test(int arg) throws NoSuchMethodException {
+        if (arg == 0) {
+            return Method_getReturnType01.class.getMethod("method1").getReturnType().getName();
+        } else if (arg == 1) {
+            return Method_getReturnType01.class.getMethod("method2").getReturnType().getName();
+        } else if (arg == 2) {
+            return Method_getReturnType01.class.getMethod("method3").getReturnType().getName();
+        }
+        return null;
+    }
+
+    public int method1() {
+        return 0;
+    }
+
+    public String method2() {
+        return null;
+    }
+
+    public void method3() {
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("int", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("java.lang.String", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("void", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(null, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/reflect/Reflection_getCallerClass01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.reflect;
+
+import org.junit.*;
+
+import sun.reflect.*;
+
+/*
+ */
+@SuppressWarnings("static-method")
+public final class Reflection_getCallerClass01 {
+
+    public static final class Caller1 {
+
+        private Caller1() {
+        }
+
+        static String caller1(int depth) {
+            return Reflection.getCallerClass(depth).getName();
+        }
+    }
+
+    public static final class Caller2 {
+
+        private Caller2() {
+        }
+
+        static String caller2(int depth) {
+            return Caller1.caller1(depth);
+        }
+    }
+
+    public static String test(int depth) {
+        return Caller2.caller2(depth);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals("sun.reflect.Reflection", test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.reflect.Reflection_getCallerClass01$Caller1", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("com.oracle.graal.jtt.reflect.Reflection_getCallerClass01$Caller2", test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_contended01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Monitor_contended01 implements Runnable {
+
+    static final Object cond = new Object();
+    static final Object obj = new Object();
+
+    boolean started = false;
+    boolean acquired = false;
+
+    public static boolean test() throws InterruptedException {
+        // test contention for monitor
+        final Monitor_contended01 object = new Monitor_contended01();
+        synchronized (obj) {
+            new Thread(object).start();
+            // wait for other thread to startup and contend
+            synchronized (cond) {
+                cond.wait(1000);
+                if (!object.started) {
+                    return false;
+                }
+            }
+        }
+        // wait for other thread to acquire monitor and then exit
+        synchronized (cond) {
+            cond.wait(1000);
+        }
+        return object.acquired;
+    }
+
+    public void run() {
+        // signal that we have started up so first thread will release lock
+        synchronized (cond) {
+            started = true;
+            cond.notifyAll();
+        }
+        synchronized (obj) {
+
+        }
+        // signal that we have successfully acquired and released the monitor
+        synchronized (cond) {
+            acquired = true;
+            cond.notifyAll();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_notowner01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Monitor_notowner01 {
+
+    static Object monitor = new Object();
+    static Object finished = new Object();
+
+    public static boolean test() throws InterruptedException {
+        final BadRunnable badRunnable = new BadRunnable();
+        synchronized (monitor) {
+            new Thread(badRunnable).start();
+            synchronized (finished) {
+                finished.wait(1000);
+            }
+        }
+        return badRunnable.caught;
+    }
+
+    static class BadRunnable implements Runnable {
+
+        protected boolean caught = false;
+
+        public void run() {
+            try {
+                // we don't own this!
+                monitor.wait();
+            } catch (InterruptedException ex) {
+
+            } catch (IllegalMonitorStateException ex) {
+                caught = true;
+                synchronized (finished) {
+                    finished.notifyAll();
+                }
+            }
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Monitorenter01 {
+
+    static final Object object = new Object();
+
+    public static boolean test() {
+        // test nested locking.
+        synchronized (object) {
+            synchronized (object) {
+                return true;
+            }
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Monitorenter02 {
+
+    static final Object object = new Object();
+
+    public static boolean test() {
+        // test nested locking.
+        synchronized (object) {
+            return test2();
+        }
+    }
+
+    private static boolean test2() {
+        synchronized (object) {
+            return true;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Object_wait01 implements Runnable {
+
+    static volatile int count = 0;
+    static volatile boolean done;
+    static final Object object = new Object();
+
+    public static boolean test(int i) throws InterruptedException {
+        count = 0;
+        done = false;
+        new Thread(new Object_wait01()).start();
+        synchronized (object) {
+            while (count < i) {
+                object.wait();
+            }
+            done = true;
+            return count >= i;
+        }
+
+    }
+
+    public void run() {
+        int i = 0;
+        while (i++ < 1000000 && !done) {
+            synchronized (object) {
+                count++;
+                object.notifyAll();
+            }
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(15));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Object_wait02 implements Runnable {
+
+    static volatile boolean done;
+    static final Object object = new Object();
+    static int sleep;
+
+    public static boolean test(int i) throws InterruptedException {
+        done = false;
+        sleep = i * 200;
+        new Thread(new Object_wait02()).start();
+        synchronized (object) {
+            while (!done) {
+                object.wait(200);
+            }
+        }
+        return done;
+    }
+
+    public void run() {
+        try {
+            Thread.sleep(sleep);
+        } catch (InterruptedException ex) {
+
+        }
+        synchronized (object) {
+            done = true;
+            object.notifyAll();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Object_wait03 implements Runnable {
+
+    static volatile boolean done;
+    static final Object object = new Object();
+    static int sleep;
+
+    public static boolean test(int i) throws InterruptedException {
+        done = false;
+        sleep = i * 200;
+        synchronized (object) {
+            new Thread(new Object_wait03()).start();
+            dowait();
+        }
+        return done;
+    }
+
+    private static void dowait() throws InterruptedException {
+        synchronized (object) {
+            while (!done) {
+                object.wait(200);
+            }
+        }
+    }
+
+    public void run() {
+        try {
+            Thread.sleep(sleep);
+        } catch (InterruptedException ex) {
+
+        }
+        synchronized (object) {
+            done = true;
+            object.notifyAll();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Object_wait04 implements Runnable {
+
+    static volatile boolean done;
+    static final Object object = new Object();
+    static int sleep;
+
+    public static boolean test(int i) throws InterruptedException {
+        done = false;
+        sleep = i * 50;
+        synchronized (object) {
+            new Thread(new Object_wait04()).start();
+            dowait(i);
+        }
+        return done;
+    }
+
+    private static void dowait(int i) throws InterruptedException {
+        if (i == 0) {
+            while (!done) {
+                object.wait(100);
+            }
+        } else {
+            synchronized (object) {
+                dowait(i - 1);
+            }
+        }
+    }
+
+    public void run() {
+        try {
+            Thread.sleep(sleep);
+        } catch (InterruptedException ex) {
+
+        }
+        synchronized (object) {
+            done = true;
+            object.notifyAll();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(true, test(4));
+    }
+
+    @Test
+    public void run5() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+/*
+ */
+public class ThreadLocal01 {
+
+    private static final ThreadLocal<Integer> local = new ThreadLocal<>();
+
+    public static int test(int i) {
+        local.set(i + 5);
+        return local.get();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(6, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(7, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+/*
+ */
+public class ThreadLocal02 {
+
+    public static int test(int i) {
+        ThreadLocal<Integer> local = new ThreadLocal<>();
+        local.set(i + 5);
+        return local.get();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(5, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(6, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(7, test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+/*
+ */
+public class ThreadLocal03 {
+
+    static final ThreadLocal<Integer> local = new ThreadLocal<>();
+
+    public static int test(int i) {
+        int sum = 0;
+        for (int j = 0; j < i; j++) {
+            TThread t = new TThread();
+            t.input = 10 + j;
+            t.run();
+            try {
+                t.join();
+            } catch (InterruptedException e) {
+                return -1;
+            }
+            sum += t.output;
+        }
+        return sum;
+    }
+
+    private static class TThread extends Thread {
+
+        int input;
+        int output;
+
+        @Override
+        public void run() {
+            local.set(input + 5);
+            output = local.get();
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(0, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(15, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(31, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(48, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_currentThread01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_currentThread01 {
+
+    public static boolean test() {
+        return Thread.currentThread() != null;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_getState01 {
+
+    public static boolean test() {
+        return Thread.currentThread().getState() == Thread.State.RUNNABLE;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_getState02 {
+
+    public static boolean test() {
+        return new Thread().getState() == Thread.State.NEW;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_holdsLock01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_holdsLock01 {
+
+    static final Object monitor = new Object();
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            synchronized (monitor) {
+                return Thread.holdsLock(monitor);
+            }
+        } else if (i == 1) {
+            synchronized (monitor) {
+                // do nothing.
+            }
+            return Thread.holdsLock(monitor);
+        } else if (i == 2) {
+            return Thread.holdsLock(null);
+        }
+        return Thread.holdsLock(monitor);
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(false, test(1));
+    }
+
+    @Test(expected = java.lang.NullPointerException.class)
+    public void run2() throws Throwable {
+        test(2);
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(false, test(3));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isAlive01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_isAlive01 {
+
+    public static boolean test() {
+        return Thread.currentThread().isAlive();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_isInterrupted01 {
+
+    public static boolean test() {
+        return Thread.currentThread().isInterrupted();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ */
+
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+//Test all, mainly monitors
+public class Thread_isInterrupted02 {
+
+    private static final Object start = new Object();
+    private static final Object end = new Object();
+    private static int waitTime;
+
+    @SuppressWarnings("unused")
+    public static boolean test(int i, int time) throws InterruptedException {
+        waitTime = time;
+        final Thread thread = new Thread();
+        synchronized (thread) {
+            // start the thread and wait for it
+            thread.setDaemon(true); // in case the thread gets stuck
+            thread.start();
+            thread.wait();
+        }
+        synchronized (start) {
+            thread.interrupt();
+        }
+        synchronized (end) {
+            end.wait(200);
+        }
+        return thread.interrupted;
+    }
+
+    private static class Thread extends java.lang.Thread {
+
+        private boolean interrupted;
+
+        @Override
+        public void run() {
+            try {
+                synchronized (start) {
+                    synchronized (this) {
+                        // signal test thread that we are running
+                        notify();
+                    }
+                    // wait for the condition, which should be interrupted
+                    if (waitTime == 0) {
+                        start.wait();
+                    } else {
+                        start.wait(waitTime);
+                    }
+                }
+            } catch (InterruptedException e) {
+                // interrupted successfully.
+                interrupted = true;
+                synchronized (end) {
+                    // notify the other thread we are done
+                    end.notify();
+                }
+            }
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0, 0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1, 500));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+/*
+ */
+
+// Interrupted while sleeping, throws an interrupted exception
+public class Thread_isInterrupted03 {
+
+    public static boolean test() throws InterruptedException {
+        final Thread1 thread = new Thread1();
+        thread.start();
+        Thread.sleep(1000);
+        thread.interrupt();
+        Thread.sleep(1000);
+        // Did thread get interrupted?
+        final boolean result = thread.getInterrupted();
+        // This stops the thread even if the interrupt didn't!
+        thread.setInterrupted(true);
+        return result;
+    }
+
+    private static class Thread1 extends java.lang.Thread {
+
+        private boolean interrupted = false;
+
+        @Override
+        public void run() {
+            while (!interrupted) {
+                try {
+                    sleep(10000);
+                } catch (InterruptedException e) {
+                    interrupted = true;
+                }
+            }
+        }
+
+        public void setInterrupted(boolean val) {
+            interrupted = val;
+        }
+
+        public boolean getInterrupted() {
+            return interrupted;
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted04.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+/*
+ */
+
+// Interrupted while running, do nothing, just set the flag and continue
+// (thomaswue) This test will exercise deoptimization on HotSpot, because a volatile unloaded field is accessed.
+// (thomaswue) The temporary result variable is needed, because in order to query the isInterrupted flag, the thread must be alive.
+public class Thread_isInterrupted04 {
+
+    public static boolean test() throws InterruptedException {
+        final Thread1 thread = new Thread1();
+        thread.start();
+        while (!thread.running) {
+            Thread.sleep(10);
+        }
+        Thread.sleep(100);
+        thread.interrupt();
+        boolean result = thread.isInterrupted();
+        thread.setStop(true);
+        return result;
+    }
+
+    public static class Thread1 extends java.lang.Thread {
+
+        private volatile boolean stop = false;
+        public volatile boolean running = false;
+        public long i = 0;
+
+        @Override
+        public void run() {
+            running = true;
+            while (!stop) {
+                i++;
+            }
+        }
+
+        public void setStop(boolean value) {
+            stop = value;
+        }
+
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted05.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+/*
+ */
+
+// Interrupted during wait, with interrupter joining
+public class Thread_isInterrupted05 {
+
+    public static boolean test() throws InterruptedException {
+        final WaitInterruptee waitInterruptee = new WaitInterruptee();
+        waitInterruptee.start();
+        waitInterruptee.interrupt();
+        waitInterruptee.join();
+
+        if (waitInterruptee.throwable != null) {
+            throw new RuntimeException(waitInterruptee.throwable);
+        }
+        return true;
+    }
+
+    static class WaitInterruptee extends Thread {
+
+        Throwable throwable;
+
+        public WaitInterruptee() {
+            super("WaitInterruptee");
+        }
+
+        @Override
+        public void run() {
+            try {
+                synchronized (this) {
+                    try {
+                        wait();
+                    } catch (InterruptedException ex) {
+                    }
+                }
+            } catch (Throwable t) {
+                throwable = t;
+            }
+        }
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Thread_join01 implements Runnable {
+
+    static volatile boolean cont;
+
+    public static boolean test() throws InterruptedException {
+        cont = true;
+        final Thread thread = new Thread(new Thread_join01());
+        thread.start();
+        thread.join();
+        return cont;
+    }
+
+    public void run() {
+        cont = false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ *
+ * This test sleeps the thread that is joined to, which should ensure that the joining thread
+ * actually does wait for completeion.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Thread_join02 implements Runnable {
+
+    static volatile boolean cont;
+
+    public static boolean test() throws InterruptedException {
+        cont = true;
+        final Thread thread = new Thread(new Thread_join02());
+        thread.start();
+        thread.join();
+        return cont;
+    }
+
+    public void run() {
+        try {
+            Thread.sleep(200);
+        } catch (InterruptedException ex) {
+        }
+        cont = false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join03.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2007, 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.
+ */
+/*
+ *
+ * This test sleeps the joining thread, which should enure that the joinee is
+ * terminated by the time the join occurs.
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Thread_join03 implements Runnable {
+
+    static volatile boolean cont;
+
+    public static boolean test() throws InterruptedException {
+        cont = true;
+        final Thread thread = new Thread(new Thread_join03());
+        thread.start();
+        Thread.sleep(200);
+        thread.join();
+        return cont;
+    }
+
+    public void run() {
+        cont = false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(false, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_new01 {
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return new Thread() != null;
+        }
+        if (i == 1) {
+            return new Thread("Thread_new01") != null;
+        }
+        if (i == 2) {
+            return new Thread(new Thread()) != null;
+        }
+        if (i == 3) {
+            return new Thread(new Thread(), "Thread_new01") != null;
+        }
+        return false;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new02.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+public class Thread_new02 implements Runnable {
+
+    static final Thread_new02 thisObject = new Thread_new02();
+
+    public static boolean test(int i) {
+        if (i == 0) {
+            return new Thread() != null;
+        }
+        if (i == 1) {
+            return new Thread("Thread_new01") != null;
+        }
+        if (i == 2) {
+            return new Thread(thisObject) != null;
+        }
+        if (i == 3) {
+            return new Thread(thisObject, "Thread_new01") != null;
+        }
+        return false;
+    }
+
+    public void run() {
+        // do nothing.
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(0));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals(false, test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_setPriority01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_setPriority01 {
+
+    public static boolean test(int i) {
+        final Thread currentThread = Thread.currentThread();
+        final int prev = currentThread.getPriority();
+        currentThread.setPriority(i);
+        currentThread.setPriority(prev);
+        return true;
+    }
+
+    @Test(expected = java.lang.IllegalArgumentException.class)
+    public void run0() throws Throwable {
+        test(0);
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(5));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals(true, test(10));
+    }
+
+    @Test(expected = java.lang.IllegalArgumentException.class)
+    public void run4() throws Throwable {
+        test(11);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_sleep01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_sleep01 {
+
+    public static boolean test(int i) throws InterruptedException {
+        final long before = System.currentTimeMillis();
+        Thread.sleep(i);
+        return System.currentTimeMillis() - before >= i;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test(10));
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        Assert.assertEquals(true, test(20));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals(true, test(100));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_yield01.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.graal.jtt.threads;
+
+import org.junit.*;
+
+@SuppressWarnings("static-method")
+public final class Thread_yield01 {
+
+    public static boolean test() {
+        Thread.yield();
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        Assert.assertEquals(true, test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,559 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.amd64;
+
+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.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+
+public enum AMD64Arithmetic {
+    IADD, ISUB, IMUL, IDIV, IREM, IUDIV, IUREM, IAND, IOR, IXOR, ISHL, ISHR, IUSHR,
+    LADD, LSUB, LMUL, LDIV, LREM, LUDIV, LUREM, LAND, LOR, LXOR, LSHL, LSHR, LUSHR,
+    FADD, FSUB, FMUL, FDIV, FAND, FOR, FXOR,
+    DADD, DSUB, DMUL, DDIV, DAND, DOR, DXOR,
+    INEG, LNEG,
+    I2L, L2I, I2B, I2C, I2S,
+    F2D, D2F,
+    I2F, I2D, F2I, D2I,
+    L2F, L2D, F2L, D2L,
+    MOV_I2F, MOV_L2D, MOV_F2I, MOV_D2L;
+
+
+    public static class Op1Reg extends AMD64LIRInstruction {
+        public Op1Reg(AMD64Arithmetic opcode, CiValue result, CiValue x) {
+            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue result = output(0);
+            CiValue x = input(0);
+
+            emit(tasm, masm, (AMD64Arithmetic) code, result, x, null);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    public static class Op1Stack extends AMD64LIRInstruction {
+        public Op1Stack(AMD64Arithmetic opcode, CiValue result, CiValue x) {
+            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue result = output(0);
+            CiValue x = input(0);
+
+            AMD64Move.move(tasm, masm, result, x);
+            emit(tasm, masm, (AMD64Arithmetic) code, result);
+        }
+
+        @Override
+        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    public static class Op2Stack extends AMD64LIRInstruction {
+        public Op2Stack(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
+            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, new CiValue[] {y}, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = alive(0);
+
+            AMD64Move.move(tasm, masm, result, x);
+            emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Alive && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        @Override
+        public void verify() {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = alive(0);
+
+            super.verify();
+            assert differentRegisters(result, y) || sameRegister(x, y);
+            verifyKind((AMD64Arithmetic) code, result, x, y);
+        }
+    }
+
+    public static class Op2Reg extends AMD64LIRInstruction {
+        public Op2Reg(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
+            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, new CiValue[] {y}, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = alive(0);
+
+            AMD64Move.move(tasm, masm, result, x);
+            emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Alive && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        @Override
+        public void verify() {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = alive(0);
+
+            super.verify();
+            assert differentRegisters(result, y) || sameRegister(x, y);
+            verifyKind((AMD64Arithmetic) code, result, x, y);
+        }
+    }
+
+    public static class Op2RegCommutative extends AMD64LIRInstruction {
+        public Op2RegCommutative(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
+            super(opcode, new CiValue[] {result}, null, new CiValue[] {x, y}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = input(1);
+
+            if (sameRegister(result, y)) {
+                emit(tasm, masm, (AMD64Arithmetic) code, result, x, null);
+            } else {
+                AMD64Move.move(tasm, masm, result, x);
+                emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
+            }
+        }
+
+        @Override
+        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Input && index == 1) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        @Override
+        protected void verify() {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = input(1);
+
+            super.verify();
+            verifyKind((AMD64Arithmetic) code, result, x, y);
+        }
+    }
+
+    public static class ShiftOp extends AMD64LIRInstruction {
+        public ShiftOp(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
+            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, new CiValue[] {y}, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = alive(0);
+
+            AMD64Move.move(tasm, masm, result, x);
+            emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
+        }
+
+        @Override
+        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Alive && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        @Override
+        public void verify() {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = alive(0);
+
+            super.verify();
+            assert isConstant(y) || asRegister(y) == AMD64.rcx;
+            assert differentRegisters(result, y) || sameRegister(x, y);
+            verifyKind((AMD64Arithmetic) code, result, x, x);
+            assert y.kind.stackKind() == CiKind.Int;
+        }
+    }
+
+    public static class DivOp extends AMD64LIRInstruction {
+        public DivOp(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y, LIRDebugInfo info) {
+            super(opcode, new CiValue[] {result}, info, new CiValue[] {x}, new CiValue[] {y}, new CiValue[] {asRegister(result) == AMD64.rax ? AMD64.rdx.asValue(result.kind) : AMD64.rax.asValue(result.kind)});
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue result = output(0);
+            CiValue y = alive(0);
+
+            emit(tasm, masm, (AMD64Arithmetic) code, result, y, info);
+        }
+
+        @Override
+        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Alive && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Temp && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        @Override
+        protected void verify() {
+            CiValue result = output(0);
+            CiValue x = input(0);
+            CiValue y = alive(0);
+
+            super.verify();
+            // left input in rax, right input in any register but rax and rdx, result quotient in rax, result remainder in rdx
+            assert asRegister(x) == AMD64.rax;
+            assert differentRegisters(y, AMD64.rax.asValue(), AMD64.rdx.asValue());
+            assert (name().endsWith("DIV") && asRegister(result) == AMD64.rax) || (name().endsWith("REM") && asRegister(result) == AMD64.rdx);
+            verifyKind((AMD64Arithmetic) code, result, x, y);
+        }
+    }
+
+
+    @SuppressWarnings("unused")
+    protected static void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Arithmetic opcode, CiValue result) {
+        switch (opcode) {
+            case INEG: masm.negl(asIntReg(result)); break;
+            case LNEG: masm.negq(asLongReg(result)); break;
+            case L2I:  masm.andl(asIntReg(result), 0xFFFFFFFF); break;
+            case I2B:  masm.signExtendByte(asIntReg(result)); break;
+            case I2C:  masm.andl(asIntReg(result), 0xFFFF); break;
+            case I2S:  masm.signExtendShort(asIntReg(result)); break;
+            default:   throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    public static void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Arithmetic opcode, CiValue dst, CiValue src, LIRDebugInfo info) {
+        int exceptionOffset = -1;
+        if (isRegister(src)) {
+            switch (opcode) {
+                case IADD: masm.addl(asIntReg(dst),  asIntReg(src)); break;
+                case ISUB: masm.subl(asIntReg(dst),  asIntReg(src)); break;
+                case IAND: masm.andl(asIntReg(dst),  asIntReg(src)); break;
+                case IMUL: masm.imull(asIntReg(dst), asIntReg(src)); break;
+                case IOR:  masm.orl(asIntReg(dst),   asIntReg(src)); break;
+                case IXOR: masm.xorl(asIntReg(dst),  asIntReg(src)); break;
+                case ISHL: masm.shll(asIntReg(dst)); break;
+                case ISHR: masm.sarl(asIntReg(dst)); break;
+                case IUSHR:masm.shrl(asIntReg(dst)); break;
+
+                case LADD: masm.addq(asLongReg(dst),  asLongReg(src)); break;
+                case LSUB: masm.subq(asLongReg(dst),  asLongReg(src)); break;
+                case LMUL: masm.imulq(asLongReg(dst), asLongReg(src)); break;
+                case LAND: masm.andq(asLongReg(dst),  asLongReg(src)); break;
+                case LOR:  masm.orq(asLongReg(dst),   asLongReg(src)); break;
+                case LXOR: masm.xorq(asLongReg(dst),  asLongReg(src)); break;
+                case LSHL: masm.shlq(asLongReg(dst)); break;
+                case LSHR: masm.sarq(asLongReg(dst)); break;
+                case LUSHR:masm.shrq(asLongReg(dst)); break;
+
+                case FADD: masm.addss(asFloatReg(dst), asFloatReg(src)); break;
+                case FSUB: masm.subss(asFloatReg(dst), asFloatReg(src)); break;
+                case FMUL: masm.mulss(asFloatReg(dst), asFloatReg(src)); break;
+                case FDIV: masm.divss(asFloatReg(dst), asFloatReg(src)); break;
+                case FAND: masm.andps(asFloatReg(dst), asFloatReg(src)); break;
+                case FOR:  masm.orps(asFloatReg(dst),  asFloatReg(src)); break;
+                case FXOR: masm.xorps(asFloatReg(dst), asFloatReg(src)); break;
+
+                case DADD: masm.addsd(asDoubleReg(dst), asDoubleReg(src)); break;
+                case DSUB: masm.subsd(asDoubleReg(dst), asDoubleReg(src)); break;
+                case DMUL: masm.mulsd(asDoubleReg(dst), asDoubleReg(src)); break;
+                case DDIV: masm.divsd(asDoubleReg(dst), asDoubleReg(src)); break;
+                case DAND: masm.andpd(asDoubleReg(dst), asDoubleReg(src)); break;
+                case DOR:  masm.orpd(asDoubleReg(dst),  asDoubleReg(src)); break;
+                case DXOR: masm.xorpd(asDoubleReg(dst), asDoubleReg(src)); break;
+
+                case I2L: masm.movslq(asLongReg(dst), asIntReg(src)); break;
+                case F2D: masm.cvtss2sd(asDoubleReg(dst), asFloatReg(src)); break;
+                case D2F: masm.cvtsd2ss(asFloatReg(dst), asDoubleReg(src)); break;
+                case I2F: masm.cvtsi2ssl(asFloatReg(dst), asIntReg(src)); break;
+                case I2D: masm.cvtsi2sdl(asDoubleReg(dst), asIntReg(src)); break;
+                case L2F: masm.cvtsi2ssq(asFloatReg(dst), asLongReg(src)); break;
+                case L2D: masm.cvtsi2sdq(asDoubleReg(dst), asLongReg(src)); break;
+                case F2I:
+                    masm.cvttss2sil(asIntReg(dst), asFloatReg(src));
+                    emitConvertFixup(tasm, masm, dst, src);
+                    break;
+                case D2I:
+                    masm.cvttsd2sil(asIntReg(dst), asDoubleReg(src));
+                    emitConvertFixup(tasm, masm, dst, src);
+                    break;
+                case F2L:
+                    masm.cvttss2siq(asLongReg(dst), asFloatReg(src));
+                    emitConvertFixup(tasm, masm, dst, src);
+                    break;
+                case D2L:
+                    masm.cvttsd2siq(asLongReg(dst), asDoubleReg(src));
+                    emitConvertFixup(tasm, masm, dst, src);
+                    break;
+                case MOV_I2F: masm.movdl(asFloatReg(dst), asIntReg(src)); break;
+                case MOV_L2D: masm.movdq(asDoubleReg(dst), asLongReg(src)); break;
+                case MOV_F2I: masm.movdl(asIntReg(dst), asFloatReg(src)); break;
+                case MOV_D2L: masm.movdq(asLongReg(dst), asDoubleReg(src)); break;
+
+                case IDIV:
+                case IREM:
+                    masm.cdql();
+                    exceptionOffset = masm.codeBuffer.position();
+                    masm.idivl(asRegister(src));
+                    break;
+
+                case LDIV:
+                case LREM:
+                    Label continuation = new Label();
+                    if (opcode == LDIV) {
+                        // check for special case of Long.MIN_VALUE / -1
+                        Label normalCase = new Label();
+                        masm.movq(AMD64.rdx, java.lang.Long.MIN_VALUE);
+                        masm.cmpq(AMD64.rax, AMD64.rdx);
+                        masm.jcc(ConditionFlag.notEqual, normalCase);
+                        masm.cmpl(asRegister(src), -1);
+                        masm.jcc(ConditionFlag.equal, continuation);
+                        masm.bind(normalCase);
+                    }
+
+                    masm.cdqq();
+                    exceptionOffset = masm.codeBuffer.position();
+                    masm.idivq(asRegister(src));
+                    masm.bind(continuation);
+                    break;
+
+                case IUDIV:
+                case IUREM:
+                    // Must zero the high 64-bit word (in RDX) of the dividend
+                    masm.xorq(AMD64.rdx, AMD64.rdx);
+                    exceptionOffset = masm.codeBuffer.position();
+                    masm.divl(asRegister(src));
+                    break;
+
+                case LUDIV:
+                case LUREM:
+                    // Must zero the high 64-bit word (in RDX) of the dividend
+                    masm.xorq(AMD64.rdx, AMD64.rdx);
+                    exceptionOffset = masm.codeBuffer.position();
+                    masm.divq(asRegister(src));
+                    break;
+                default:
+                    throw GraalInternalError.shouldNotReachHere();
+            }
+        } else if (isConstant(src)) {
+            switch (opcode) {
+                case IADD: masm.incrementl(asIntReg(dst), tasm.asIntConst(src)); break;
+                case ISUB: masm.decrementl(asIntReg(dst), tasm.asIntConst(src)); break;
+                case IMUL: masm.imull(asIntReg(dst), asIntReg(dst), tasm.asIntConst(src)); break;
+                case IAND: masm.andl(asIntReg(dst), tasm.asIntConst(src)); break;
+                case IOR:  masm.orl(asIntReg(dst),  tasm.asIntConst(src)); break;
+                case IXOR: masm.xorl(asIntReg(dst), tasm.asIntConst(src)); break;
+                case ISHL: masm.shll(asIntReg(dst), tasm.asIntConst(src) & 31); break;
+                case ISHR: masm.sarl(asIntReg(dst), tasm.asIntConst(src) & 31); break;
+                case IUSHR:masm.shrl(asIntReg(dst), tasm.asIntConst(src) & 31); break;
+
+                case LADD: masm.addq(asLongReg(dst), tasm.asIntConst(src)); break;
+                case LSUB: masm.subq(asLongReg(dst), tasm.asIntConst(src)); break;
+                case LMUL: masm.imulq(asLongReg(dst), asLongReg(dst), tasm.asIntConst(src)); break;
+                case LAND: masm.andq(asLongReg(dst), tasm.asIntConst(src)); break;
+                case LOR:  masm.orq(asLongReg(dst),  tasm.asIntConst(src)); break;
+                case LXOR: masm.xorq(asLongReg(dst), tasm.asIntConst(src)); break;
+                case LSHL: masm.shlq(asLongReg(dst), tasm.asIntConst(src) & 63); break;
+                case LSHR: masm.sarq(asLongReg(dst), tasm.asIntConst(src) & 63); break;
+                case LUSHR:masm.shrq(asLongReg(dst), tasm.asIntConst(src) & 63); break;
+
+                case FADD: masm.addss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
+                case FSUB: masm.subss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
+                case FMUL: masm.mulss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
+                case FAND: masm.andps(asFloatReg(dst), tasm.asFloatConstRef(src, 16)); break;
+                case FOR:  masm.orps(asFloatReg(dst),  tasm.asFloatConstRef(src, 16)); break;
+                case FXOR: masm.xorps(asFloatReg(dst), tasm.asFloatConstRef(src, 16)); break;
+                case FDIV: masm.divss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
+
+                case DADD: masm.addsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
+                case DSUB: masm.subsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
+                case DMUL: masm.mulsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
+                case DDIV: masm.divsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
+                case DAND: masm.andpd(asDoubleReg(dst), tasm.asDoubleConstRef(src, 16)); break;
+                case DOR:  masm.orpd(asDoubleReg(dst),  tasm.asDoubleConstRef(src, 16)); break;
+                case DXOR: masm.xorpd(asDoubleReg(dst), tasm.asDoubleConstRef(src, 16)); break;
+                default:   throw GraalInternalError.shouldNotReachHere();
+            }
+        } else {
+            switch (opcode) {
+                case IADD: masm.addl(asIntReg(dst), tasm.asIntAddr(src)); break;
+                case ISUB: masm.subl(asIntReg(dst), tasm.asIntAddr(src)); break;
+                case IAND: masm.andl(asIntReg(dst), tasm.asIntAddr(src)); break;
+                case IOR:  masm.orl(asIntReg(dst),  tasm.asIntAddr(src)); break;
+                case IXOR: masm.xorl(asIntReg(dst), tasm.asIntAddr(src)); break;
+
+                case LADD: masm.addq(asLongReg(dst), tasm.asLongAddr(src)); break;
+                case LSUB: masm.subq(asLongReg(dst), tasm.asLongAddr(src)); break;
+                case LAND: masm.andq(asLongReg(dst), tasm.asLongAddr(src)); break;
+                case LOR:  masm.orq(asLongReg(dst),  tasm.asLongAddr(src)); break;
+                case LXOR: masm.xorq(asLongReg(dst), tasm.asLongAddr(src)); break;
+
+                case FADD: masm.addss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
+                case FSUB: masm.subss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
+                case FMUL: masm.mulss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
+                case FDIV: masm.divss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
+
+                case DADD: masm.addsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
+                case DSUB: masm.subsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
+                case DMUL: masm.mulsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
+                case DDIV: masm.divsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
+                default:   throw GraalInternalError.shouldNotReachHere();
+            }
+        }
+
+        if (info != null) {
+            assert exceptionOffset != -1;
+            tasm.recordImplicitException(exceptionOffset, info);
+        }
+    }
+
+    private static void emitConvertFixup(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue x) {
+        ConvertSlowPath slowPath = new ConvertSlowPath(result, x);
+        tasm.slowPaths.add(slowPath);
+        switch (result.kind) {
+            case Int:  masm.cmpl(asIntReg(result),  Integer.MIN_VALUE); break;
+            case Long: masm.cmpq(asLongReg(result), tasm.asLongConstRef(CiConstant.forLong(java.lang.Long.MIN_VALUE))); break;
+            default:   throw GraalInternalError.shouldNotReachHere();
+        }
+        masm.jcc(ConditionFlag.equal, slowPath.start);
+        masm.bind(slowPath.continuation);
+    }
+
+    private static class ConvertSlowPath extends AMD64SlowPath {
+        public final Label start = new Label();
+        public final Label continuation = new Label();
+        private final CiValue result;
+        private final CiValue x;
+
+        public ConvertSlowPath(CiValue result, CiValue x) {
+            this.result = result;
+            this.x = x;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            masm.bind(start);
+            switch (x.kind) {
+                case Float:  masm.ucomiss(asFloatReg(x),  tasm.asFloatConstRef(CiConstant.FLOAT_0)); break;
+                case Double: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(CiConstant.DOUBLE_0)); break;
+                default:     throw GraalInternalError.shouldNotReachHere();
+            }
+            Label nan = new Label();
+            masm.jcc(ConditionFlag.parity, nan);
+            masm.jcc(ConditionFlag.below, continuation);
+
+            // input is > 0 -> return maxInt
+            // result register already contains 0x80000000, so subtracting 1 gives 0x7fffffff
+            switch (result.kind) {
+                case Int:  masm.decrementl(asIntReg(result),  1); break;
+                case Long: masm.decrementq(asLongReg(result), 1); break;
+                default:   throw GraalInternalError.shouldNotReachHere();
+            }
+            masm.jmp(continuation);
+
+            // input is NaN -> return 0
+            masm.bind(nan);
+            masm.xorptr(asRegister(result), asRegister(result));
+            masm.jmp(continuation);
+        }
+    }
+
+
+    private static void verifyKind(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
+        assert (opcode.name().startsWith("I") && result.kind == CiKind.Int && x.kind.stackKind() == CiKind.Int && y.kind.stackKind() == CiKind.Int)
+            || (opcode.name().startsWith("L") && result.kind == CiKind.Long && x.kind == CiKind.Long && y.kind == CiKind.Long)
+            || (opcode.name().startsWith("F") && result.kind == CiKind.Float && x.kind == CiKind.Float && y.kind == CiKind.Float)
+            || (opcode.name().startsWith("D") && result.kind == CiKind.Double && x.kind == CiKind.Double && y.kind == CiKind.Double);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.amd64;
+
+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.Mark;
+import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+
+public class AMD64Call {
+
+    public static class DirectCallOp extends AMD64LIRInstruction implements StandardOp.CallOp {
+        private final Object targetMethod;
+        private final Map<XirMark, Mark> marks;
+
+        public DirectCallOp(Object targetMethod, CiValue result, CiValue[] parameters, LIRDebugInfo info, Map<XirMark, Mark> marks) {
+            super("CALL_DIRECT", new CiValue[] {result}, info, parameters, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+            this.targetMethod = targetMethod;
+            this.marks = marks;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            callAlignment(tasm, masm);
+            if (marks != null) {
+                marks.put(XirMark.CALLSITE, tasm.recordMark(null, new Mark[0]));
+            }
+            directCall(tasm, masm, targetMethod, info);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+            } else if (mode == OperandMode.Output) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    public static class IndirectCallOp extends AMD64LIRInstruction implements StandardOp.CallOp {
+        private final Object targetMethod;
+        private final Map<XirMark, Mark> marks;
+
+        private static CiValue[] concat(CiValue[] parameters, CiValue targetAddress) {
+            CiValue[] result = Arrays.copyOf(parameters, parameters.length + 1);
+            result[result.length - 1] = targetAddress;
+            return result;
+        }
+
+        public IndirectCallOp(Object targetMethod, CiValue result, CiValue[] parameters, CiValue targetAddress, LIRDebugInfo info, Map<XirMark, Mark> marks) {
+            super("CALL_INDIRECT", new CiValue[] {result}, info, concat(parameters, targetAddress), LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+            this.targetMethod = targetMethod;
+            this.marks = marks;
+        }
+
+        private CiValue targetAddress() {
+            return input(inputs.length - 1);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            callAlignment(tasm, masm);
+            if (marks != null) {
+                marks.put(XirMark.CALLSITE, tasm.recordMark(null, new Mark[0]));
+            }
+            indirectCall(tasm, masm, asRegister(targetAddress()), targetMethod, info);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+            } else if (mode == OperandMode.Output) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static void callAlignment(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+        // make sure that the displacement word of the call ends up word aligned
+        int offset = masm.codeBuffer.position();
+        offset += tasm.target.arch.machineCodeCallDisplacementOffset;
+        while (offset++ % tasm.target.wordSize != 0) {
+            masm.nop();
+        }
+    }
+
+    public static void directCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Object target, LIRDebugInfo info) {
+        int before = masm.codeBuffer.position();
+        if (target instanceof CiRuntimeCall) {
+            long maxOffset = tasm.runtime.getMaxCallTargetOffset((CiRuntimeCall) target);
+            if (maxOffset != (int) maxOffset) {
+                // offset might not fit a 32-bit immediate, generate an
+                // indirect call with a 64-bit immediate
+                CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
+                // TODO (cwimmer): we want to get rid of a generally reserved scratch register.
+                masm.movq(scratch, 0L);
+                masm.call(scratch);
+            } else {
+                masm.call();
+            }
+        } else {
+            masm.call();
+        }
+        int after = masm.codeBuffer.position();
+        tasm.recordDirectCall(before, after, tasm.runtime.asCallTarget(target), info);
+        tasm.recordExceptionHandlers(after, info);
+        masm.ensureUniquePC();
+    }
+
+    public static void directJmp(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Object target) {
+        int before = masm.codeBuffer.position();
+        masm.jmp(0, true);
+        int after = masm.codeBuffer.position();
+        tasm.recordDirectCall(before, after, tasm.runtime.asCallTarget(target), null);
+        masm.ensureUniquePC();
+    }
+
+    public static void indirectCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiRegister dst, Object target, LIRDebugInfo info) {
+        int before = masm.codeBuffer.position();
+        masm.call(dst);
+        int after = masm.codeBuffer.position();
+        tasm.recordIndirectCall(before, after, tasm.runtime.asCallTarget(target), info);
+        tasm.recordExceptionHandlers(after, info);
+        masm.ensureUniquePC();
+    }
+
+    public static void shouldNotReachHere(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+        boolean assertions = false;
+        assert (assertions = true) == true;
+
+        if (assertions) {
+            directCall(tasm, masm, CiRuntimeCall.Debug, null);
+            masm.hlt();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.amd64;
+
+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.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+
+public enum AMD64Compare {
+    ICMP, LCMP, ACMP, FCMP, DCMP;
+
+    public static class CompareOp extends AMD64LIRInstruction {
+        public CompareOp(AMD64Compare opcode, CiValue x, CiValue y) {
+            super(opcode, LIRInstruction.NO_OPERANDS, null, new CiValue[] {x, y}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            CiValue x = input(0);
+            CiValue y = input(1);
+            emit(tasm, masm, (AMD64Compare) code, x, y);
+        }
+
+        @Override
+        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Input && index == 1) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        @Override
+        protected void verify() {
+            CiValue x = input(0);
+            CiValue y = input(1);
+
+            super.verify();
+            assert (name().startsWith("I") && x.kind == CiKind.Int && y.kind.stackKind() == CiKind.Int)
+                || (name().startsWith("I") && x.kind == CiKind.Jsr && y.kind == CiKind.Jsr)
+                || (name().startsWith("L") && x.kind == CiKind.Long && y.kind == CiKind.Long)
+                || (name().startsWith("A") && x.kind == CiKind.Object && y.kind == CiKind.Object)
+                || (name().startsWith("F") && x.kind == CiKind.Float && y.kind == CiKind.Float)
+                || (name().startsWith("D") && x.kind == CiKind.Double && y.kind == CiKind.Double);
+        }
+    }
+
+    public static void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Compare opcode, CiValue x, CiValue y) {
+        if (isRegister(y)) {
+            switch (opcode) {
+                case ICMP: masm.cmpl(asIntReg(x), asIntReg(y)); break;
+                case LCMP: masm.cmpq(asLongReg(x), asLongReg(y)); break;
+                case ACMP: masm.cmpptr(asObjectReg(x), asObjectReg(y)); break;
+                case FCMP: masm.ucomiss(asFloatReg(x), asFloatReg(y)); break;
+                case DCMP: masm.ucomisd(asDoubleReg(x), asDoubleReg(y)); break;
+                default:   throw GraalInternalError.shouldNotReachHere();
+            }
+        } else if (isConstant(y)) {
+            switch (opcode) {
+                case ICMP: masm.cmpl(asIntReg(x), tasm.asIntConst(y)); break;
+                case LCMP: masm.cmpq(asLongReg(x), tasm.asIntConst(y)); break;
+                case ACMP:
+                    if (((CiConstant) y).isNull()) {
+                        masm.cmpq(asObjectReg(x), 0); break;
+                    } else {
+                        throw GraalInternalError.shouldNotReachHere("Only null object constants are allowed in comparisons");
+                    }
+                case FCMP: masm.ucomiss(asFloatReg(x), tasm.asFloatConstRef(y)); break;
+                case DCMP: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(y)); break;
+                default:   throw GraalInternalError.shouldNotReachHere();
+            }
+        } else {
+            switch (opcode) {
+                case ICMP: masm.cmpl(asIntReg(x), tasm.asIntAddr(y)); break;
+                case LCMP: masm.cmpq(asLongReg(x), tasm.asLongAddr(y)); break;
+                case ACMP: masm.cmpptr(asObjectReg(x), tasm.asObjectAddr(y)); break;
+                case FCMP: masm.ucomiss(asFloatReg(x), tasm.asFloatAddr(y)); break;
+                case DCMP: masm.ucomisd(asDoubleReg(x), tasm.asDoubleAddr(y)); break;
+                default:  throw GraalInternalError.shouldNotReachHere();
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.amd64;
+
+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.CiAddress.Scale;
+import com.oracle.max.cri.ci.CiTargetMethod.JumpTable;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+import com.oracle.graal.nodes.calc.*;
+
+public class AMD64ControlFlow {
+
+    public static class ReturnOp extends AMD64LIRInstruction {
+        public ReturnOp(CiValue input) {
+            super("RETURN", LIRInstruction.NO_OPERANDS, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            masm.ret(0);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class BranchOp extends AMD64LIRInstruction implements StandardOp.BranchOp {
+        protected Condition condition;
+        protected LabelRef destination;
+
+        public BranchOp(Condition condition, LabelRef destination, LIRDebugInfo info) {
+            super("BRANCH", LIRInstruction.NO_OPERANDS, info, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+            this.condition = condition;
+            this.destination = destination;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            masm.jcc(intCond(condition), destination.label());
+        }
+
+        @Override
+        public LabelRef destination() {
+            return destination;
+        }
+
+        @Override
+        public void negate(LabelRef newDestination) {
+            destination = newDestination;
+            condition = condition.negate();
+        }
+
+        @Override
+        public String operationString() {
+            return condition.operator + " [" + destination + "]";
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class FloatBranchOp extends BranchOp {
+        protected boolean unorderedIsTrue;
+
+        public FloatBranchOp(Condition condition, boolean unorderedIsTrue, LabelRef destination, LIRDebugInfo info) {
+            super(condition, destination, info);
+            this.unorderedIsTrue = unorderedIsTrue;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            floatJcc(masm, condition, unorderedIsTrue, destination.label());
+        }
+
+        @Override
+        public void negate(LabelRef newDestination) {
+            super.negate(newDestination);
+            unorderedIsTrue = !unorderedIsTrue;
+        }
+
+        @Override
+        public String operationString() {
+            return condition.operator + " [" + destination + "]" + (unorderedIsTrue ? " unorderedIsTrue" : " unorderedIsFalse");
+        }
+    }
+
+
+    public static class TableSwitchOp extends AMD64LIRInstruction {
+        private final int lowKey;
+        private final LabelRef defaultTarget;
+        private final LabelRef[] targets;
+
+        public TableSwitchOp(final int lowKey, final LabelRef defaultTarget, final LabelRef[] targets, Variable index, Variable scratch) {
+            super("TABLE_SWITCH", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, new CiValue[] {index}, new CiValue[] {scratch});
+            this.lowKey = lowKey;
+            this.defaultTarget = defaultTarget;
+            this.targets = targets;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            tableswitch(tasm, masm, lowKey, defaultTarget, targets, asIntReg(alive(0)), asLongReg(temp(0)));
+        }
+
+        @Override
+        public String operationString() {
+            StringBuilder buf = new StringBuilder(super.operationString());
+            buf.append("\ndefault: [").append(defaultTarget).append(']');
+            int key = lowKey;
+            for (LabelRef l : targets) {
+                buf.append("\ncase ").append(key).append(": [").append(l).append(']');
+                key++;
+            }
+            return buf.toString();
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Alive && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Temp && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class CondMoveOp extends AMD64LIRInstruction {
+        private final Condition condition;
+
+        public CondMoveOp(Variable result, Condition condition, Variable trueValue, CiValue falseValue) {
+            super("CMOVE", new CiValue[] {result}, null, new CiValue[] {falseValue}, new CiValue[] {trueValue}, LIRInstruction.NO_OPERANDS);
+            this.condition = condition;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            cmove(tasm, masm, output(0), false, condition, false, alive(0), input(0));
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Alive && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        @Override
+        public String operationString() {
+            return condition.toString() + " " + super.operationString();
+        }
+    }
+
+
+    public static class FloatCondMoveOp extends AMD64LIRInstruction {
+        private final Condition condition;
+        private final boolean unorderedIsTrue;
+
+        public FloatCondMoveOp(Variable result, Condition condition, boolean unorderedIsTrue, Variable trueValue, Variable falseValue) {
+            super("FLOAT_CMOVE", new CiValue[] {result}, null, LIRInstruction.NO_OPERANDS, new CiValue[] {trueValue, falseValue}, LIRInstruction.NO_OPERANDS);
+            this.condition = condition;
+            this.unorderedIsTrue = unorderedIsTrue;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            cmove(tasm, masm, output(0), true, condition, unorderedIsTrue, alive(0), alive(1));
+        }
+
+        @Override
+        public String operationString() {
+            return condition.toString() + " unordered=" + unorderedIsTrue + " " + super.operationString();
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Alive && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Alive && index == 1) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    private static void tableswitch(TargetMethodAssembler tasm, AMD64MacroAssembler masm, int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiRegister value, CiRegister scratch) {
+        Buffer buf = masm.codeBuffer;
+        // Compare index against jump table bounds
+        int highKey = lowKey + targets.length - 1;
+        if (lowKey != 0) {
+            // subtract the low value from the switch value
+            masm.subl(value, lowKey);
+            masm.cmpl(value, highKey - lowKey);
+        } else {
+            masm.cmpl(value, highKey);
+        }
+
+        // Jump to default target if index is not within the jump table
+        masm.jcc(ConditionFlag.above, defaultTarget.label());
+
+        // Set scratch to address of jump table
+        int leaPos = buf.position();
+        masm.leaq(scratch, new CiAddress(tasm.target.wordKind, AMD64.rip.asValue(), 0));
+        int afterLea = buf.position();
+
+        // Load jump table entry into scratch and jump to it
+        masm.movslq(value, new CiAddress(CiKind.Int, scratch.asValue(), value.asValue(), Scale.Times4, 0));
+        masm.addq(scratch, value);
+        masm.jmp(scratch);
+
+        // Inserting padding so that jump table address is 4-byte aligned
+        if ((buf.position() & 0x3) != 0) {
+            masm.nop(4 - (buf.position() & 0x3));
+        }
+
+        // Patch LEA instruction above now that we know the position of the jump table
+        int jumpTablePos = buf.position();
+        buf.setPosition(leaPos);
+        masm.leaq(scratch, new CiAddress(tasm.target.wordKind, AMD64.rip.asValue(), jumpTablePos - afterLea));
+        buf.setPosition(jumpTablePos);
+
+        // Emit jump table entries
+        for (LabelRef target : targets) {
+            Label label = target.label();
+            int offsetToJumpTableBase = buf.position() - jumpTablePos;
+            if (label.isBound()) {
+                int imm32 = label.position() - jumpTablePos;
+                buf.emitInt(imm32);
+            } else {
+                label.addPatchAt(buf.position());
+
+                buf.emitByte(0); // psuedo-opcode for jump table entry
+                buf.emitShort(offsetToJumpTableBase);
+                buf.emitByte(0); // padding to make jump table entry 4 bytes wide
+            }
+        }
+
+        JumpTable jt = new JumpTable(jumpTablePos, lowKey, highKey, 4);
+        tasm.targetMethod.addAnnotation(jt);
+    }
+
+    private static void floatJcc(AMD64MacroAssembler masm, Condition condition, boolean unorderedIsTrue, Label label) {
+        ConditionFlag cond = floatCond(condition);
+        Label endLabel = new Label();
+        if (unorderedIsTrue && !trueOnUnordered(cond)) {
+            masm.jcc(ConditionFlag.parity, label);
+        } else if (!unorderedIsTrue && trueOnUnordered(cond)) {
+            masm.jcc(ConditionFlag.parity, endLabel);
+        }
+        masm.jcc(cond, label);
+        masm.bind(endLabel);
+    }
+
+    private static void cmove(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, boolean isFloat, Condition condition, boolean unorderedIsTrue, CiValue trueValue, CiValue falseValue) {
+        ConditionFlag cond = isFloat ? floatCond(condition) : intCond(condition);
+        // check that we don't overwrite an input operand before it is used.
+        assert !result.equals(trueValue);
+
+        AMD64Move.move(tasm, masm, result, falseValue);
+        cmove(tasm, masm, result, cond, trueValue);
+
+        if (isFloat) {
+            if (unorderedIsTrue && !trueOnUnordered(cond)) {
+                cmove(tasm, masm, result, ConditionFlag.parity, trueValue);
+            } else if (!unorderedIsTrue && trueOnUnordered(cond)) {
+                cmove(tasm, masm, result, ConditionFlag.parity, falseValue);
+            }
+        }
+    }
+
+    private static void cmove(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, ConditionFlag cond, CiValue other) {
+        if (isRegister(other)) {
+            assert asRegister(other) != asRegister(result) : "other already overwritten by previous move";
+            switch (other.kind) {
+                case Int:  masm.cmovl(cond, asRegister(result), asRegister(other)); break;
+                case Long: masm.cmovq(cond, asRegister(result), asRegister(other)); break;
+                default:   throw GraalInternalError.shouldNotReachHere();
+            }
+        } else {
+            switch (other.kind) {
+                case Int:  masm.cmovl(cond, asRegister(result), tasm.asAddress(other)); break;
+                case Long: masm.cmovq(cond, asRegister(result), tasm.asAddress(other)); break;
+                default:   throw GraalInternalError.shouldNotReachHere();
+            }
+        }
+    }
+
+    private static ConditionFlag intCond(Condition cond) {
+        switch (cond) {
+            case EQ: return ConditionFlag.equal;
+            case NE: return ConditionFlag.notEqual;
+            case LT: return ConditionFlag.less;
+            case LE: return ConditionFlag.lessEqual;
+            case GE: return ConditionFlag.greaterEqual;
+            case GT: return ConditionFlag.greater;
+            case BE: return ConditionFlag.belowEqual;
+            case AE: return ConditionFlag.aboveEqual;
+            case AT: return ConditionFlag.above;
+            case BT: return ConditionFlag.below;
+            case OF: return ConditionFlag.overflow;
+            case NOF: return ConditionFlag.noOverflow;
+            default: throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private static ConditionFlag floatCond(Condition cond) {
+        switch (cond) {
+            case EQ: return ConditionFlag.equal;
+            case NE: return ConditionFlag.notEqual;
+            case LT: return ConditionFlag.below;
+            case LE: return ConditionFlag.belowEqual;
+            case GE: return ConditionFlag.aboveEqual;
+            case GT: return ConditionFlag.above;
+            default: throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private static boolean trueOnUnordered(ConditionFlag condition) {
+        switch(condition) {
+            case aboveEqual:
+            case notEqual:
+            case above:
+            case less:
+            case overflow:
+                return false;
+            case equal:
+            case belowEqual:
+            case below:
+            case greaterEqual:
+            case noOverflow:
+                return true;
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64LIRInstruction.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.amd64;
+
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+
+/**
+ * Convenience class to provide AMD64MacroAssembler for the {@link #emitCode} method.
+ */
+public abstract class AMD64LIRInstruction extends LIRInstruction {
+
+    public AMD64LIRInstruction(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps) {
+        super(opcode, outputs, info, inputs, alives, temps);
+    }
+
+    @Override
+    public final void emitCode(TargetMethodAssembler tasm) {
+        emitCode(tasm, (AMD64MacroAssembler) tasm.asm);
+    }
+
+    public abstract void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,489 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.amd64;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static java.lang.Double.*;
+import static java.lang.Float.*;
+
+import java.util.*;
+
+import com.oracle.max.asm.*;
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.StandardOp.*;
+import com.oracle.graal.lir.asm.*;
+
+public class AMD64Move {
+
+    public static class SpillMoveOp extends AMD64LIRInstruction implements MoveOp {
+        public SpillMoveOp(CiValue result, CiValue input) {
+            super("MOVE", new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            move(tasm, masm, getResult(), getInput());
+        }
+
+        @Override
+        public CiValue getInput() {
+            return input(0);
+        }
+        @Override
+        public CiValue getResult() {
+            return output(0);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class MoveToRegOp extends AMD64LIRInstruction implements MoveOp {
+        public MoveToRegOp(CiValue result, CiValue input) {
+            super("MOVE", new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            move(tasm, masm, getResult(), getInput());
+        }
+
+        @Override
+        public CiValue getInput() {
+            return input(0);
+        }
+        @Override
+        public CiValue getResult() {
+            return output(0);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class MoveFromRegOp extends AMD64LIRInstruction implements MoveOp {
+        public MoveFromRegOp(CiValue result, CiValue input) {
+            super("MOVE", new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            move(tasm, masm, getResult(), getInput());
+        }
+
+        @Override
+        public CiValue getInput() {
+            return input(0);
+        }
+        @Override
+        public CiValue getResult() {
+            return output(0);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant, OperandFlag.RegisterHint);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class LoadOp extends AMD64LIRInstruction {
+        public LoadOp(CiValue result, CiValue address, LIRDebugInfo info) {
+            super("LOAD", new CiValue[] {result}, info, new CiValue[] {address}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            load(tasm, masm, output(0), (CiAddress) input(0), info);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Address);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class StoreOp extends AMD64LIRInstruction {
+        public StoreOp(CiValue address, CiValue input, LIRDebugInfo info) {
+            super("STORE", LIRInstruction.NO_OPERANDS, info, new CiValue[] {address, input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            store(tasm, masm, (CiAddress) input(0), input(1), info);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Address);
+            } else if (mode == OperandMode.Input && index == 1) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class LeaOp extends AMD64LIRInstruction {
+        public LeaOp(CiValue result, CiValue address) {
+            super("LEA", new CiValue[] {result}, null, new CiValue[] {address}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            masm.leaq(asLongReg(output(0)), tasm.asAddress(input(0)));
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Address, OperandFlag.Stack, OperandFlag.Uninitialized);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class MembarOp extends AMD64LIRInstruction {
+        private final int barriers;
+
+        public MembarOp(final int barriers) {
+            super("MEMBAR", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+            this.barriers = barriers;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            masm.membar(barriers);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class NullCheckOp extends AMD64LIRInstruction {
+        public NullCheckOp(Variable input, LIRDebugInfo info) {
+            super("NULL_CHECK", LIRInstruction.NO_OPERANDS, info, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            tasm.recordImplicitException(masm.codeBuffer.position(), info);
+            masm.nullCheck(asRegister(input(0)));
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static class CompareAndSwapOp extends AMD64LIRInstruction {
+        public CompareAndSwapOp(CiValue result, CiAddress address, CiValue cmpValue, CiValue newValue) {
+            super("CAS", new CiValue[] {result}, null, new CiValue[] {address, cmpValue, newValue}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            compareAndSwap(tasm, masm, output(0), asAddress(input(0)), input(1), input(2));
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Input && index == 0) {
+                return EnumSet.of(OperandFlag.Address);
+            } else if (mode == OperandMode.Input && index == 1) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Input && index == 2) {
+                return EnumSet.of(OperandFlag.Register);
+            } else if (mode == OperandMode.Output && index == 0) {
+                return EnumSet.of(OperandFlag.Register);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static void move(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
+        if (isRegister(input)) {
+            if (isRegister(result)) {
+                reg2reg(masm, result, input);
+            } else if (isStackSlot(result)) {
+                reg2stack(tasm, masm, result, input);
+            } else {
+                throw GraalInternalError.shouldNotReachHere();
+            }
+        } else if (isStackSlot(input)) {
+            if (isRegister(result)) {
+                stack2reg(tasm, masm, result, input);
+            } else {
+                throw GraalInternalError.shouldNotReachHere();
+            }
+        } else if (isConstant(input)) {
+            if (isRegister(result)) {
+                const2reg(tasm, masm, result, (CiConstant) input);
+            } else if (isStackSlot(result)) {
+                const2stack(tasm, masm, result, (CiConstant) input);
+            } else {
+                throw GraalInternalError.shouldNotReachHere();
+            }
+        } else {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private static void reg2reg(AMD64MacroAssembler masm, CiValue result, CiValue input) {
+        if (input.equals(result)) {
+            return;
+        }
+        switch (input.kind) {
+            case Jsr:
+            case Int:    masm.movl(asRegister(result),    asRegister(input)); break;
+            case Long:   masm.movq(asRegister(result),    asRegister(input)); break;
+            case Float:  masm.movflt(asFloatReg(result),  asFloatReg(input)); break;
+            case Double: masm.movdbl(asDoubleReg(result), asDoubleReg(input)); break;
+            case Object: masm.movq(asRegister(result),    asRegister(input)); break;
+            default:     throw GraalInternalError.shouldNotReachHere("kind=" + result.kind);
+        }
+    }
+
+    private static void reg2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
+        switch (input.kind) {
+            case Jsr:
+            case Int:    masm.movl(tasm.asAddress(result),   asRegister(input)); break;
+            case Long:   masm.movq(tasm.asAddress(result),   asRegister(input)); break;
+            case Float:  masm.movflt(tasm.asAddress(result), asFloatReg(input)); break;
+            case Double: masm.movsd(tasm.asAddress(result),  asDoubleReg(input)); break;
+            case Object: masm.movq(tasm.asAddress(result),   asRegister(input)); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private static void stack2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
+        switch (input.kind) {
+            case Jsr:
+            case Int:    masm.movl(asRegister(result),    tasm.asAddress(input)); break;
+            case Long:   masm.movq(asRegister(result),    tasm.asAddress(input)); break;
+            case Float:  masm.movflt(asFloatReg(result),  tasm.asAddress(input)); break;
+            case Double: masm.movdbl(asDoubleReg(result), tasm.asAddress(input)); break;
+            case Object: masm.movq(asRegister(result),    tasm.asAddress(input)); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private static void const2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiConstant input) {
+        // Note: we use the kind of the input operand (and not the kind of the result operand) because they don't match
+        // in all cases. For example, an object constant can be loaded to a long register when unsafe casts occurred (e.g.,
+        // for a write barrier where arithmetic operations are then performed on the pointer).
+        switch (input.kind.stackKind()) {
+            case Jsr:
+            case Int:
+                // Do not optimize with an XOR as this instruction may be between
+                // a CMP and a Jcc in which case the XOR will modify the condition
+                // flags and interfere with the Jcc.
+                masm.movl(asRegister(result), tasm.asIntConst(input));
+                break;
+            case Long:
+                // Do not optimize with an XOR as this instruction may be between
+                // a CMP and a Jcc in which case the XOR will modify the condition
+                // flags and interfere with the Jcc.
+                masm.movq(asRegister(result), input.asLong());
+                break;
+            case Float:
+                // This is *not* the same as 'constant == 0.0f' in the case where constant is -0.0f
+                if (Float.floatToRawIntBits(input.asFloat()) == Float.floatToRawIntBits(0.0f)) {
+                    masm.xorps(asFloatReg(result), asFloatReg(result));
+                } else {
+                    masm.movflt(asFloatReg(result), tasm.asFloatConstRef(input));
+                }
+                break;
+            case Double:
+                // This is *not* the same as 'constant == 0.0d' in the case where constant is -0.0d
+                if (Double.doubleToRawLongBits(input.asDouble()) == Double.doubleToRawLongBits(0.0d)) {
+                    masm.xorpd(asDoubleReg(result), asDoubleReg(result));
+                } else {
+                    masm.movdbl(asDoubleReg(result), tasm.asDoubleConstRef(input));
+                }
+                break;
+            case Object:
+                // Do not optimize with an XOR as this instruction may be between
+                // a CMP and a Jcc in which case the XOR will modify the condition
+                // flags and interfere with the Jcc.
+                if (input.isNull()) {
+                    masm.movq(asRegister(result), 0x0L);
+                } else if (tasm.target.inlineObjects) {
+                    tasm.recordDataReferenceInCode(input, 0);
+                    masm.movq(asRegister(result), 0xDEADDEADDEADDEADL);
+                } else {
+                    masm.movq(asRegister(result), tasm.recordDataReferenceInCode(input, 0));
+                }
+                break;
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    private static void const2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiConstant input) {
+        switch (input.kind.stackKind()) {
+            case Jsr:
+            case Int:    masm.movl(tasm.asAddress(result), input.asInt()); break;
+            case Long:   masm.movlong(tasm.asAddress(result), input.asLong()); break;
+            case Float:  masm.movl(tasm.asAddress(result), floatToRawIntBits(input.asFloat())); break;
+            case Double: masm.movlong(tasm.asAddress(result), doubleToRawLongBits(input.asDouble())); break;
+            case Object:
+                if (input.isNull()) {
+                    masm.movlong(tasm.asAddress(result), 0L);
+                } else {
+                    throw GraalInternalError.shouldNotReachHere("Non-null object constants must be in register");
+                }
+                break;
+            default:
+                throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+
+    public static void load(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiAddress loadAddr, LIRDebugInfo info) {
+        if (info != null) {
+            tasm.recordImplicitException(masm.codeBuffer.position(), info);
+        }
+        switch (loadAddr.kind) {
+            case Boolean:
+            case Byte:   masm.movsxb(asRegister(result),  loadAddr); break;
+            case Char:   masm.movzxl(asRegister(result),  loadAddr); break;
+            case Short:  masm.movswl(asRegister(result),  loadAddr); break;
+            case Int:    masm.movslq(asRegister(result),  loadAddr); break;
+            case Long:   masm.movq(asRegister(result),    loadAddr); break;
+            case Float:  masm.movflt(asFloatReg(result),  loadAddr); break;
+            case Double: masm.movdbl(asDoubleReg(result), loadAddr); break;
+            case Object: masm.movq(asRegister(result),    loadAddr); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    public static void store(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiAddress storeAddr, CiValue input, LIRDebugInfo info) {
+        if (info != null) {
+            tasm.recordImplicitException(masm.codeBuffer.position(), info);
+        }
+
+        if (isRegister(input)) {
+            switch (storeAddr.kind) {
+                case Boolean:
+                case Byte:   masm.movb(storeAddr,   asRegister(input)); break;
+                case Char:
+                case Short:  masm.movw(storeAddr,   asRegister(input)); break;
+                case Int:    masm.movl(storeAddr,   asRegister(input)); break;
+                case Long:   masm.movq(storeAddr,   asRegister(input)); break;
+                case Float:  masm.movflt(storeAddr, asFloatReg(input)); break;
+                case Double: masm.movsd(storeAddr,  asDoubleReg(input)); break;
+                case Object: masm.movq(storeAddr,   asRegister(input)); break;
+                default:     throw GraalInternalError.shouldNotReachHere();
+            }
+        } else if (isConstant(input)) {
+            CiConstant c = (CiConstant) input;
+            switch (storeAddr.kind) {
+                case Boolean:
+                case Byte:   masm.movb(storeAddr, c.asInt() & 0xFF); break;
+                case Char:
+                case Short:  masm.movw(storeAddr, c.asInt() & 0xFFFF); break;
+                case Jsr:
+                case Int:    masm.movl(storeAddr, c.asInt()); break;
+                case Long:
+                    if (NumUtil.isInt(c.asLong())) {
+                        masm.movslq(storeAddr, (int) c.asLong());
+                    } else {
+                        throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory");
+                    }
+                    break;
+                case Float:  masm.movl(storeAddr, floatToRawIntBits(c.asFloat())); break;
+                case Double: throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory");
+                case Object:
+                    if (c.isNull()) {
+                        masm.movptr(storeAddr, 0);
+                    } else {
+                        throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory");
+                    }
+                    break;
+                default:
+                    throw GraalInternalError.shouldNotReachHere();
+            }
+
+        } else {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    protected static void compareAndSwap(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiAddress address, CiValue cmpValue, CiValue newValue) {
+        assert asRegister(cmpValue) == AMD64.rax && asRegister(result) == AMD64.rax;
+
+        if (tasm.target.isMP) {
+            masm.lock();
+        }
+        switch (cmpValue.kind) {
+            case Int:    masm.cmpxchgl(asRegister(newValue), address); break;
+            case Long:
+            case Object: masm.cmpxchgq(asRegister(newValue), address); break;
+            default:     throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SlowPath.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.amd64;
+
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+
+/**
+ * Convenience class to provide AMD64MacroAssembler for the {@link #emitCode} method.
+ */
+public abstract class AMD64SlowPath implements LIR.SlowPath {
+    @Override
+    public final void emitCode(TargetMethodAssembler tasm) {
+        emitCode(tasm, (AMD64MacroAssembler) tasm.asm);
+    }
+
+    public abstract void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+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.CiCallingConvention.Type;
+import com.oracle.max.cri.ri.*;
+
+/**
+ * This class is used to build the stack frame layout for a compiled method.
+ * A {@link CiStackSlot} is used to index slots of the frame relative to the stack pointer.
+ * The frame size is only fixed after register allocation when all spill slots have
+ * been allocated. Both the outgoing argument area and the spill are can grow until then.
+ * Therefore, outgoing arguments are indexed from the stack pointer, while spill slots
+ * are indexed from the beginning of the frame (and the total frame size has to be added
+ * to get the actual offset from the stack pointer).
+ * <br>
+ * This is the format of a stack frame:
+ * <pre>
+ *   Base       Contents
+ *
+ *            :                                :  -----
+ *   caller   | incoming overflow argument n   |    ^
+ *   frame    :     ...                        :    | positive
+ *            | incoming overflow argument 0   |    | offsets
+ *   ---------+--------------------------------+---------------------
+ *            | return address                 |    |            ^
+ *   current  +--------------------------------+    |            |    -----
+ *   frame    |                                |    |            |      ^
+ *            : callee save area               :    |            |      |
+ *            |                                |    |            |      |
+ *            +--------------------------------+    |            |      |
+ *            | spill slot 0                   |    | negative   |      |
+ *            :     ...                        :    v offsets    |      |
+ *            | spill slot n                   |  -----        total  frame
+ *            +--------------------------------+               frame  size
+ *            | alignment padding              |               size     |
+ *            +--------------------------------+  -----          |      |
+ *            | outgoing overflow argument n   |    ^            |      |
+ *            :     ...                        :    | positive   |      |
+ *            | outgoing overflow argument 0   |    | offsets    v      v
+ *    %sp-->  +--------------------------------+---------------------------
+ *
+ * </pre>
+ * The spill slot area also includes stack allocated memory blocks (ALLOCA blocks). The size
+ * of such a block may be greater than the size of a normal spill slot or the word size.
+ * <br>
+ * A runtime has two ways to reserve space in the stack frame for its own use: <ul>
+ * <li>A memory block somewhere in the frame of size {@link RiRuntime#getCustomStackAreaSize()}. The offset
+ *     to this block is returned in {@link CiTargetMethod#customStackAreaOffset()}.
+ * <li>At the beginning of the overflow argument area: The calling convention can specify that the first
+ *     overflow stack argument is not at offset 0, but at a specified offset o. Use
+ *     {@link RiRuntime#getMinimumOutgoingSize()} to make sure that call-free methods also have this space
+ *     reserved. Then the VM can use memory the memory at offset 0 relative to the stack pointer.
+ * </ul>
+ */
+public final class FrameMap {
+    public final RiRuntime runtime;
+    public final CiTarget target;
+    public final RiRegisterConfig registerConfig;
+
+    /**
+     * The final frame size, not including the size of the return address.
+     * The value is only set after register allocation is complete, i.e., after all spill slots have been allocated.
+     */
+    private int frameSize;
+
+    /**
+     * Size of the area occupied by spill slots and other stack-allocated memory blocks.
+     */
+    private int spillSize;
+
+    /**
+     * Size of the area occupied by outgoing overflow arguments.
+     * This value is adjusted as calling conventions for outgoing calls are retrieved.
+     */
+    private int outgoingSize;
+
+    /**
+     * The list of stack areas allocated in this frame that are present in every reference map.
+     */
+    private final List<CiStackSlot> objectStackBlocks;
+
+    /**
+     * The stack area reserved for use by the VM, or {@code null} if the VM does not request stack space.
+     */
+    private final CiStackSlot customArea;
+
+    /**
+     * Creates a new frame map for the specified method.
+     */
+    public FrameMap(RiRuntime runtime, CiTarget target, RiRegisterConfig registerConfig) {
+        this.runtime = runtime;
+        this.target = target;
+        this.registerConfig = registerConfig;
+        this.frameSize = -1;
+        this.spillSize = returnAddressSize() + calleeSaveAreaSize();
+        this.outgoingSize = runtime.getMinimumOutgoingSize();
+        this.objectStackBlocks = new ArrayList<>();
+        this.customArea = allocateStackBlock(runtime.getCustomStackAreaSize(), false);
+    }
+
+
+    private int returnAddressSize() {
+        return target.arch.returnAddressSize;
+    }
+
+    private int calleeSaveAreaSize() {
+        CiCalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
+        return csl != null ? csl.size : 0;
+    }
+
+    /**
+     * Gets the frame size of the compiled frame, not including the size of the return address.
+     * @return The size of the frame (in bytes).
+     */
+    public int frameSize() {
+        assert frameSize != -1 : "frame size not computed yet";
+        return frameSize;
+    }
+
+    /**
+     * Gets the total frame size of the compiled frame, including the size of the return address.
+     * @return The total size of the frame (in bytes).
+     */
+    public int totalFrameSize() {
+        return frameSize() + returnAddressSize();
+    }
+
+    /**
+     * Sets the frame size for this frame.
+     * @param frameSize The frame size (in bytes).
+     */
+    public void setFrameSize(int frameSize) {
+        assert this.frameSize == -1 : "must only be set once";
+        this.frameSize = frameSize;
+    }
+
+    /**
+     * Computes the frame size for this frame. After this method has been called, methods that change the
+     * frame size cannot be called anymore, e.g., no more spill slots or outgoing arguments can be requested.
+     */
+    public void finish() {
+        setFrameSize(target.alignFrameSize(outgoingSize + spillSize - returnAddressSize()));
+    }
+
+    /**
+     * Computes the offset of a stack slot relative to the frame register.
+     * This is also the bit index of stack slots in the reference map.
+     *
+     * @param slot a stack slot
+     * @return the offset of the stack slot
+     */
+    public int offsetForStackSlot(CiStackSlot slot) {
+        assert (!slot.rawAddFrameSize() && slot.rawOffset() < outgoingSize) ||
+            (slot.rawAddFrameSize() && slot.rawOffset() < 0 && -slot.rawOffset() <= spillSize) ||
+            (slot.rawAddFrameSize() && slot.rawOffset() >= 0);
+        return slot.offset(totalFrameSize());
+    }
+
+    /**
+     * Gets the offset to the stack area where callee-saved registers are stored.
+     * @return The offset to the callee save area (in bytes).
+     */
+    public int offsetToCalleeSaveArea() {
+        return frameSize() - calleeSaveAreaSize();
+    }
+
+    /**
+     * Gets the offset of the stack area stack block reserved for use by the VM, or -1 if the VM does not request stack space.
+     * @return The offset to the custom area (in bytes).
+     */
+    public int offsetToCustomArea() {
+        return customArea == null ? -1 : offsetForStackSlot(customArea);
+    }
+
+    /**
+     * Informs the frame map that the compiled code calls a particular method, which
+     * may need stack space for outgoing arguments.
+     * @param cc The calling convention for the called method.
+     * @param type The type of calling convention.
+     */
+    public void callsMethod(CiCallingConvention cc, Type type) {
+        // TODO look at the actual stack offsets?
+        assert type.out;
+        reserveOutgoing(cc.stackSize);
+    }
+
+    /**
+     * Reserves space for stack-based outgoing arguments.
+     * @param argsSize The amount of space (in bytes) to reserve for stack-based outgoing arguments.
+     */
+    public void reserveOutgoing(int argsSize) {
+        assert frameSize == -1 : "frame size must not yet be fixed";
+        outgoingSize = Math.max(outgoingSize, argsSize);
+    }
+
+    private CiStackSlot getSlot(CiKind kind, int additionalOffset) {
+        return CiStackSlot.get(kind, -spillSize + additionalOffset, true);
+    }
+
+    /**
+     * Reserves a spill slot in the frame of the method being compiled. The returned slot is aligned on its natural alignment,
+     * i.e., an 8-byte spill slot is aligned at an 8-byte boundary.
+     * @param kind The kind of the spill slot to be reserved.
+     * @return A spill slot denoting the reserved memory area.
+     */
+    public CiStackSlot allocateSpillSlot(CiKind kind) {
+        assert frameSize == -1 : "frame size must not yet be fixed";
+        int size = target.sizeInBytes(kind);
+        spillSize = NumUtil.roundUp(spillSize + size, size);
+        return getSlot(kind, 0);
+    }
+
+    /**
+     * Reserves a block of memory in the frame of the method being compiled. The returned block is aligned on a word boundary.
+     * If the requested size is 0, the method returns {@code null}.
+     *
+     * @param size The size to reserve (in bytes).
+     * @param refs Specifies if the block is all references. If true, the block will be in all reference maps for this method.
+     *             The caller is responsible to initialize the memory block before the first instruction that uses a reference map.
+     * @return A stack slot describing the begin of the memory block.
+     */
+    public CiStackSlot allocateStackBlock(int size, boolean refs) {
+        assert frameSize == -1 : "frame size must not yet be fixed";
+        if (size == 0) {
+            return null;
+        }
+        spillSize = NumUtil.roundUp(spillSize + size, target.wordSize);
+
+        if (refs) {
+            assert size % target.wordSize == 0;
+            CiStackSlot result = getSlot(CiKind.Object, 0);
+            objectStackBlocks.add(result);
+            for (int i = target.wordSize; i < size; i += target.wordSize) {
+                objectStackBlocks.add(getSlot(CiKind.Object, i));
+            }
+            return result;
+
+        } else {
+            return getSlot(target.wordKind, 0);
+        }
+    }
+
+
+    private int frameRefMapIndex(CiStackSlot slot) {
+        assert offsetForStackSlot(slot) % target.wordSize == 0;
+        return offsetForStackSlot(slot) / target.wordSize;
+    }
+
+    /**
+     * Initializes a reference map that covers all registers of the target architecture.
+     */
+    public CiBitMap initRegisterRefMap() {
+        return new CiBitMap(target.arch.registerReferenceMapBitCount);
+    }
+
+    /**
+     * Initializes a reference map. Initially, the size is large enough to cover all the
+     * slots in the frame. If the method has incoming reference arguments on the stack,
+     * the reference map might grow later when such a reference is set.
+     */
+    public CiBitMap initFrameRefMap() {
+        CiBitMap frameRefMap = new CiBitMap(frameSize() / target.wordSize);
+        for (CiStackSlot slot : objectStackBlocks) {
+            setReference(slot, null, frameRefMap);
+        }
+        return frameRefMap;
+    }
+
+    /**
+     * Marks the specified location as a reference in the reference map of the debug information.
+     * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
+     * {@link CiConstant} is automatically tracked.
+     *
+     * @param location The location to be added to the reference map.
+     * @param registerRefMap A register reference map, as created by {@link #initRegisterRefMap()}.
+     * @param frameRefMap A frame reference map, as created by {@link #initFrameRefMap()}.
+     */
+    public void setReference(CiValue location, CiBitMap registerRefMap, CiBitMap frameRefMap) {
+        if (location.kind == CiKind.Object) {
+            if (isRegister(location)) {
+                assert registerRefMap.size() == target.arch.registerReferenceMapBitCount;
+                registerRefMap.set(asRegister(location).number);
+            } else if (isStackSlot(location)) {
+                int index = frameRefMapIndex(asStackSlot(location));
+                frameRefMap.grow(index + 1);
+                frameRefMap.set(index);
+            } else {
+                assert isConstant(location);
+            }
+        }
+    }
+
+    /**
+     * Clears the specified location as a reference in the reference map of the debug information.
+     * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
+     * {@link CiConstant} is automatically tracked.
+     *
+     * @param location The location to be removed from the reference map.
+     * @param registerRefMap A register reference map, as created by {@link #initRegisterRefMap()}.
+     * @param frameRefMap A frame reference map, as created by {@link #initFrameRefMap()}.
+     */
+    public void clearReference(CiValue location, CiBitMap registerRefMap, CiBitMap frameRefMap) {
+        if (location.kind == CiKind.Object) {
+            if (location instanceof CiRegisterValue) {
+                assert registerRefMap.size() == target.arch.registerReferenceMapBitCount;
+                registerRefMap.clear(asRegister(location).number);
+            } else if (isStackSlot(location)) {
+                int index = frameRefMapIndex(asStackSlot(location));
+                if (index < frameRefMap.size()) {
+                    frameRefMap.clear(index);
+                }
+            } else {
+                assert isConstant(location);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.asm.*;
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ * This class implements the overall container for the LIR graph
+ * and directs its construction, optimization, and finalization.
+ */
+public class LIR {
+
+    public final ControlFlowGraph cfg;
+
+    /**
+     * The nodes for the blocks.
+     * TODO: This should go away, we want all nodes connected with a next-pointer.
+     */
+    private final BlockMap<List<Node>> nodesFor;
+
+    /**
+     * The linear-scan ordered list of blocks.
+     */
+    private final List<Block> linearScanOrder;
+
+    /**
+     * The order in which the code is emitted.
+     */
+    private final List<Block> codeEmittingOrder;
+
+
+    public final List<SlowPath> slowPaths;
+
+    public final List<SlowPath> deoptimizationStubs;
+
+    /**
+     * The last slow path emitted, which can be used emit marker bytes.
+     */
+    public SlowPath methodEndMarker;
+
+    private int numVariables;
+
+    public SpillMoveFactory spillMoveFactory;
+
+    public interface SpillMoveFactory {
+        LIRInstruction createMove(CiValue result, CiValue input);
+        LIRInstruction createExchange(CiValue input1, CiValue input2);
+    }
+
+    public interface SlowPath {
+        void emitCode(TargetMethodAssembler tasm);
+    }
+
+    /**
+     * Creates a new LIR instance for the specified compilation.
+     * @param numLoops number of loops
+     * @param compilation the compilation
+     */
+    public LIR(ControlFlowGraph cfg, BlockMap<List<Node>> nodesFor, List<Block> linearScanOrder, List<Block> codeEmittingOrder) {
+        this.cfg = cfg;
+        this.nodesFor = nodesFor;
+        this.codeEmittingOrder = codeEmittingOrder;
+        this.linearScanOrder = linearScanOrder;
+
+        slowPaths = new ArrayList<>();
+        deoptimizationStubs = new ArrayList<>();
+    }
+
+    public List<Node> nodesFor(Block block) {
+        return nodesFor.get(block);
+    }
+
+    /**
+     * Gets the linear scan ordering of blocks as a list.
+     * @return the blocks in linear scan order
+     */
+    public List<Block> linearScanOrder() {
+        return linearScanOrder;
+    }
+
+    public List<Block> codeEmittingOrder() {
+        return codeEmittingOrder;
+    }
+
+    public int numVariables() {
+        return numVariables;
+    }
+
+    public int nextVariable() {
+        return numVariables++;
+    }
+
+    public void emitCode(TargetMethodAssembler tasm) {
+        for (Block b : codeEmittingOrder()) {
+            emitBlock(tasm, b);
+        }
+
+        // generate code for slow cases
+        for (SlowPath sp : slowPaths) {
+            emitSlowPath(tasm, sp);
+        }
+        // generate deoptimization stubs
+        for (SlowPath sp : deoptimizationStubs) {
+            emitSlowPath(tasm, sp);
+        }
+        // generate traps at the end of the method
+        emitSlowPath(tasm, methodEndMarker);
+    }
+
+    private static void emitBlock(TargetMethodAssembler tasm, Block block) {
+        if (Debug.isDumpEnabled()) {
+            tasm.blockComment(String.format("block B%d %s", block.getId(), block.getLoop()));
+        }
+
+        for (LIRInstruction op : block.lir) {
+            if (Debug.isDumpEnabled()) {
+                tasm.blockComment(String.format("%d %s", op.id(), op));
+            }
+
+            emitOp(tasm, op);
+        }
+    }
+
+    private static void emitOp(TargetMethodAssembler tasm, LIRInstruction op) {
+        try {
+            try {
+                op.emitCode(tasm);
+            } catch (AssertionError t) {
+                throw new GraalInternalError(t);
+            } catch (RuntimeException t) {
+                throw new GraalInternalError(t);
+            }
+        } catch (GraalInternalError e) {
+            throw e.addContext("lir instruction", op);
+        }
+    }
+
+    private static void emitSlowPath(TargetMethodAssembler tasm, SlowPath sp) {
+        if (Debug.isDumpEnabled()) {
+            tasm.blockComment(String.format("slow case %s", sp.getClass().getName()));
+        }
+        sp.emitCode(tasm);
+    }
+
+/*
+    private int lastDecodeStart;
+
+    private void printAssembly(TargetMethodAssembler tasm) {
+        byte[] currentBytes = tasm.asm.codeBuffer.copyData(lastDecodeStart, tasm.asm.codeBuffer.position());
+        if (currentBytes.length > 0) {
+            String disasm = tasm.runtime.disassemble(currentBytes, lastDecodeStart);
+            if (disasm.length() != 0) {
+                TTY.println(disasm);
+            } else {
+                TTY.println("Code [+%d]: %d bytes", lastDecodeStart, currentBytes.length);
+                Util.printBytes(lastDecodeStart, currentBytes, GraalOptions.PrintAssemblyBytesPerLine);
+            }
+        }
+        lastDecodeStart = tasm.asm.codeBuffer.position();
+    }
+
+
+    public static void printBlock(Block x) {
+        // print block id
+        TTY.print("B%d ", x.getId());
+
+        // print flags
+        if (x.isLoopHeader()) {
+            TTY.print("lh ");
+        }
+        if (x.isLoopEnd()) {
+            TTY.print("le ");
+        }
+
+        // print block bci range
+        TTY.print("[%d, %d] ", -1, -1);
+
+        // print predecessors and successors
+        if (x.numberOfPreds() > 0) {
+            TTY.print("preds: ");
+            for (int i = 0; i < x.numberOfPreds(); i++) {
+                TTY.print("B%d ", x.predAt(i).getId());
+            }
+        }
+
+        if (x.numberOfSux() > 0) {
+            TTY.print("sux: ");
+            for (int i = 0; i < x.numberOfSux(); i++) {
+                TTY.print("B%d ", x.suxAt(i).getId());
+            }
+        }
+
+        TTY.println();
+    }
+
+    public static void printLIR(List<Block> blocks) {
+        if (TTY.isSuppressed()) {
+            return;
+        }
+        TTY.println("LIR:");
+        int i;
+        for (i = 0; i < blocks.size(); i++) {
+            Block bb = blocks.get(i);
+            printBlock(bb);
+            TTY.println("__id_Instruction___________________________________________");
+            for (LIRInstruction op : bb.lir) {
+                TTY.println(op.toStringWithIdPrefix());
+                TTY.println();
+            }
+            TTY.println();
+        }
+    }
+*/
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.lir.LIRInstruction.OperandFlag;
+import com.oracle.graal.lir.LIRInstruction.OperandMode;
+import com.oracle.graal.lir.LIRInstruction.ValueProcedure;
+
+/**
+ * This class represents garbage collection and deoptimization information attached to a LIR instruction.
+ */
+public class LIRDebugInfo {
+    public final CiFrame topFrame;
+    private final CiVirtualObject[] virtualObjects;
+    private final List<CiStackSlot> pointerSlots;
+    public final LabelRef exceptionEdge;
+    private CiDebugInfo debugInfo;
+
+    public LIRDebugInfo(CiFrame topFrame, CiVirtualObject[] virtualObjects, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
+        this.topFrame = topFrame;
+        this.virtualObjects = virtualObjects;
+        this.pointerSlots = pointerSlots;
+        this.exceptionEdge = exceptionEdge;
+    }
+
+    public boolean hasDebugInfo() {
+        return debugInfo != null;
+    }
+
+    public CiDebugInfo debugInfo() {
+        assert debugInfo != null : "debug info not allocated yet";
+        return debugInfo;
+    }
+
+    /**
+     * Iterates the frame state and calls the {@link ValueProcedure} for every variable.
+     *
+     * @param proc The procedure called for variables.
+     */
+    public void forEachState(ValueProcedure proc) {
+        for (CiFrame cur = topFrame; cur != null; cur = cur.caller()) {
+            processValues(cur.values, proc);
+        }
+        if (virtualObjects != null) {
+            for (CiVirtualObject obj : virtualObjects) {
+                processValues(obj.values(), proc);
+            }
+        }
+    }
+
+    /**
+     * We filter out constant and illegal values ourself before calling the procedure, so {@link OperandFlag#Constant} and {@link OperandFlag#Illegal} need not be set.
+     */
+    private static final EnumSet<OperandFlag> STATE_FLAGS = EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+
+    private void processValues(CiValue[] values, ValueProcedure proc) {
+        for (int i = 0; i < values.length; i++) {
+            CiValue value = values[i];
+            if (value instanceof CiMonitorValue) {
+                CiMonitorValue monitor = (CiMonitorValue) value;
+                if (processed(monitor.owner)) {
+                    monitor.owner = proc.doValue(monitor.owner, OperandMode.Alive, STATE_FLAGS);
+                }
+
+            } else if (processed(value)) {
+                values[i] = proc.doValue(value, OperandMode.Alive, STATE_FLAGS);
+            }
+        }
+    }
+
+    private boolean processed(CiValue value) {
+        if (isIllegal(value)) {
+            // Ignore dead local variables.
+            return false;
+        } else if (isConstant(value)) {
+            // Ignore constants, the register allocator does not need to see them.
+            return false;
+        } else if (isVirtualObject(value)) {
+            assert Arrays.asList(virtualObjects).contains(value);
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+
+    public void finish(CiBitMap registerRefMap, CiBitMap frameRefMap, FrameMap frameMap) {
+        debugInfo = new CiDebugInfo(topFrame, registerRefMap, frameRefMap);
+
+        // Add additional stack slots for outgoing method parameters.
+        if (pointerSlots != null) {
+            for (CiStackSlot v : pointerSlots) {
+                frameMap.setReference(v, registerRefMap, frameRefMap);
+            }
+        }
+    }
+
+
+    @Override
+    public String toString() {
+        return debugInfo != null ? debugInfo.toString() : topFrame.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInsertionBuffer.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import java.util.*;
+
+/**
+ * A buffer to enqueue updates to a list. This avoids frequent re-sizing of the list and copying of list elements
+ * when insertions are done at multiple positions of the list. Additionally, it ensures that the list is not modified
+ * while it is, e.g., iterated, and instead only modified once after the iteration is done.
+ * <br>
+ * The buffer uses internal data structures to store the enqueued updates. To avoid allocations, a buffer can be re-used.
+ * Call the methods in the following order:
+ * {@link #init()}, {@link #append()}, {@link #append()}, ..., {@link #finish()}, {@link #init()}, ...
+ * <br>
+ * Note: This class does not depend on LIRInstruction, so we could make it a generic utility class.
+ */
+public final class LIRInsertionBuffer {
+
+    /**
+     * The lir list where ops of this buffer should be inserted later (null when uninitialized).
+     */
+    private List<LIRInstruction> lir;
+
+    /**
+     * List of insertion points. index and count are stored alternately:
+     * indexAndCount[i * 2]: the index into lir list where "count" ops should be inserted
+     * indexAndCount[i * 2 + 1]: the number of ops to be inserted at index
+     */
+    private final List<Integer> indexAndCount;
+
+    /**
+     * The LIROps to be inserted.
+     */
+    private final List<LIRInstruction> ops;
+
+
+    public LIRInsertionBuffer() {
+        indexAndCount = new ArrayList<>(8);
+        ops = new ArrayList<>(8);
+    }
+
+    /**
+     * Initialize this buffer. This method must be called before using {@link #append()}.
+     */
+    public void init(List<LIRInstruction> newLir) {
+        assert !initialized() : "already initialized";
+        assert indexAndCount.size() == 0 && ops.size() == 0;
+        this.lir = newLir;
+    }
+
+    public boolean initialized() {
+        return lir != null;
+    }
+
+    public List<LIRInstruction> lirList() {
+        return lir;
+    }
+
+    /**
+     * Enqueue a new instruction that will be appended to the instruction list when {@link #finish()} is called.
+     * The new instruction is added <b>before</b> the existing instruction with the given index. This method can only be called
+     * with increasing values of index, e.g., once an instruction was appended with index 4, subsequent instructions can
+     * only be appended with index 4 or higher.
+     */
+    public void append(int index, LIRInstruction op) {
+        int i = numberOfInsertionPoints() - 1;
+        if (i < 0 || indexAt(i) < index) {
+            appendNew(index, 1);
+        } else {
+            assert indexAt(i) == index : "can append LIROps in ascending order only";
+            assert countAt(i) > 0 : "check";
+            setCountAt(i, countAt(i) + 1);
+        }
+        ops.add(op);
+
+        assert verify();
+    }
+
+    /**
+     * Append all enqueued instructions to the instruction list. After that, {@link init()} can be called again to re-use this buffer.
+     */
+    public void finish() {
+        if (ops.size() > 0) {
+            int n = lir.size();
+            // increase size of instructions list
+            for (int i = 0; i < ops.size(); i++) {
+                lir.add(null);
+            }
+            // insert ops from buffer into instructions list
+            int opIndex = ops.size() - 1;
+            int ipIndex = numberOfInsertionPoints() - 1;
+            int fromIndex = n - 1;
+            int toIndex = lir.size() - 1;
+            while (ipIndex >= 0) {
+                int index = indexAt(ipIndex);
+                // make room after insertion point
+                while (fromIndex >= index) {
+                    lir.set(toIndex--, lir.get(fromIndex--));
+                }
+                // insert ops from buffer
+                for (int i = countAt(ipIndex); i > 0; i--) {
+                    lir.set(toIndex--, ops.get(opIndex--));
+                }
+                ipIndex--;
+            }
+            indexAndCount.clear();
+            ops.clear();
+        }
+        lir = null;
+    }
+
+    private void appendNew(int index, int count) {
+        indexAndCount.add(index);
+        indexAndCount.add(count);
+    }
+
+    private void setCountAt(int i, int value) {
+        indexAndCount.set((i << 1) + 1, value);
+    }
+
+    private int numberOfInsertionPoints() {
+        assert indexAndCount.size() % 2 == 0 : "must have a count for each index";
+        return indexAndCount.size() >> 1;
+    }
+
+    private int indexAt(int i) {
+        return indexAndCount.get((i << 1));
+    }
+
+    private int countAt(int i) {
+        return indexAndCount.get((i << 1) + 1);
+    }
+
+    private boolean verify() {
+        int sum = 0;
+        int prevIdx = -1;
+
+        for (int i = 0; i < numberOfInsertionPoints(); i++) {
+            assert prevIdx < indexAt(i) : "index must be ordered ascending";
+            sum += countAt(i);
+        }
+        assert sum == ops.size() : "wrong total sum";
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,447 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.asm.*;
+
+/**
+ * The {@code LIRInstruction} class definition.
+ */
+public abstract class LIRInstruction {
+
+    public static final CiValue[] NO_OPERANDS = {};
+
+    /**
+     * Iterator for iterating over a list of values. Subclasses must overwrite one of the doValue methods.
+     * Clients of the class must only call the doValue method that takes additional parameters.
+     */
+    public abstract static class ValueProcedure {
+        /**
+         * Iterator method to be overwritten. This version of the iterator does not take additional parameters
+         * to keep the signature short.
+         *
+         * @param value The value that is iterated.
+         * @return The new value to replace the value that was passed in.
+         */
+        protected CiValue doValue(CiValue value) {
+            throw GraalInternalError.shouldNotReachHere("One of the doValue() methods must be overwritten");
+        }
+
+        /**
+         * Iterator method to be overwritten. This version of the iterator gets additional parameters about the
+         * processed value.
+         *
+         * @param value The value that is iterated.
+         * @param mode The operand mode for the value.
+         * @param flags A set of flags for the value.
+         * @return The new value to replace the value that was passed in.
+         */
+        public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+            return doValue(value);
+        }
+    }
+
+
+    /**
+     * Constants denoting how a LIR instruction uses an operand.
+     */
+    public enum OperandMode {
+        /**
+         * The value must have been defined before. It is alive before the instruction until the beginning of the
+         * instruction, but not necessarily throughout the instruction. A register assigned to it can also be assigend
+         * to a Temp or Output operand. The value can be used again after the instruction, so the instruction must not
+         * modify the register.
+         */
+        Input,
+
+        /**
+         * The value must have been defined before. It is alive before the instruction and throughout the instruction. A
+         * register assigned to it cannot be assigned to a Temp or Output operand. The value can be used again after the
+         * instruction, so the instruction must not modify the register.
+         */
+        Alive,
+
+        /**
+         * The value must not have been defined before, and must not be used after the instruction. The instruction can
+         * do whatever it wants with the register assigned to it (or not use it at all).
+         */
+        Temp,
+
+        /**
+         * The value must not have been defined before. The instruction has to assign a value to the register. The
+         * value can (and most likely will) be used after the instruction.
+         */
+        Output,
+    }
+
+    /**
+     * Flags for an operand.
+     */
+    public enum OperandFlag {
+        /**
+         * The value can be a {@link CiRegisterValue}.
+         */
+        Register,
+
+        /**
+         * The value can be a {@link CiStackSlot}.
+         */
+        Stack,
+
+        /**
+         * The value can be a {@link CiAddress}.
+         */
+        Address,
+
+        /**
+         * The value can be a {@link CiConstant}.
+         */
+        Constant,
+
+        /**
+         * The value can be {@link CiValue#IllegalValue}.
+         */
+        Illegal,
+
+        /**
+         * The register allocator should try to assign a certain register to improve code quality.
+         * Use {@link LIRInstruction#forEachRegisterHint} to access the register hints.
+         */
+        RegisterHint,
+
+        /**
+         * The value can be uninitialized, e.g., a stack slot that has not written to before. This is only
+         * used to avoid false positives in verification code.
+         */
+        Uninitialized,
+    }
+
+    /**
+     * For validity checking of the operand flags defined by instruction subclasses.
+     */
+    private static final EnumMap<OperandMode, EnumSet<OperandFlag>> ALLOWED_FLAGS;
+
+    static {
+        ALLOWED_FLAGS = new EnumMap<>(OperandMode.class);
+        ALLOWED_FLAGS.put(OperandMode.Input,  EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Address, OperandFlag.Constant, OperandFlag.Illegal, OperandFlag.RegisterHint, OperandFlag.Uninitialized));
+        ALLOWED_FLAGS.put(OperandMode.Alive,  EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Address, OperandFlag.Constant, OperandFlag.Illegal, OperandFlag.RegisterHint, OperandFlag.Uninitialized));
+        ALLOWED_FLAGS.put(OperandMode.Temp,   EnumSet.of(OperandFlag.Register, OperandFlag.Constant, OperandFlag.Illegal, OperandFlag.RegisterHint));
+        ALLOWED_FLAGS.put(OperandMode.Output, EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Illegal, OperandFlag.RegisterHint));
+    }
+
+    /**
+     * The opcode of this instruction.
+     */
+    protected final Object code;
+
+    /**
+     * The output operands for this instruction (modified by the register allocator).
+     */
+    protected CiValue[] outputs;
+
+    /**
+     * The input operands for this instruction (modified by the register allocator).
+     */
+    protected CiValue[] inputs;
+
+    /**
+     * The alive operands for this instruction (modified by the register allocator).
+     */
+    protected CiValue[] alives;
+
+    /**
+     * The temp operands for this instruction (modified by the register allocator).
+     */
+    protected CiValue[] temps;
+
+    /**
+     * Used to emit debug information.
+     */
+    public final LIRDebugInfo info;
+
+    /**
+     * Instruction id for register allocation.
+     */
+    private int id;
+
+    /**
+     * Constructs a new LIR instruction that has input and temp operands.
+     *
+     * @param opcode the opcode of the new instruction
+     * @param outputs the operands that holds the operation results of this instruction.
+     * @param info the {@link LIRDebugInfo} info that is to be preserved for the instruction. This will be {@code null} when no debug info is required for the instruction.
+     * @param inputs the input operands for the instruction.
+     * @param temps the temp operands for the instruction.
+     */
+    public LIRInstruction(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps) {
+        this.code = opcode;
+        this.outputs = outputs;
+        this.inputs = inputs;
+        this.alives = alives;
+        this.temps = temps;
+        this.info = info;
+        this.id = -1;
+    }
+
+    public abstract void emitCode(TargetMethodAssembler tasm);
+
+
+    public final int id() {
+        return id;
+    }
+
+    public final void setId(int id) {
+        this.id = id;
+    }
+
+    /**
+     * Gets an input operand of this instruction.
+     *
+     * @param index the index of the operand requested.
+     * @return the {@code index}'th input operand.
+     */
+    protected final CiValue input(int index) {
+        return inputs[index];
+    }
+
+    /**
+     * Gets an alive operand of this instruction.
+     *
+     * @param index the index of the operand requested.
+     * @return the {@code index}'th alive operand.
+     */
+    protected final CiValue alive(int index) {
+        return alives[index];
+    }
+
+    /**
+     * Gets a temp operand of this instruction.
+     *
+     * @param index the index of the operand requested.
+     * @return the {@code index}'th temp operand.
+     */
+    protected final CiValue temp(int index) {
+        return temps[index];
+    }
+
+    /**
+     * Gets the result operand for this instruction.
+     *
+     * @return return the result operand
+     */
+    protected final CiValue output(int index) {
+        return outputs[index];
+    }
+
+    /**
+     * Gets the instruction name.
+     */
+    public String name() {
+        return code.toString();
+    }
+
+    public boolean hasOperands() {
+        return inputs.length > 0 || alives.length > 0 || temps.length > 0 || outputs.length > 0 || info != null || hasCall();
+    }
+
+    private static final EnumSet<OperandFlag> ADDRESS_FLAGS = EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
+
+    private void forEach(CiValue[] values, OperandMode mode, ValueProcedure proc) {
+        for (int i = 0; i < values.length; i++) {
+            assert ALLOWED_FLAGS.get(mode).containsAll(flagsFor(mode, i));
+
+            CiValue value = values[i];
+            if (isAddress(value)) {
+                assert flagsFor(mode, i).contains(OperandFlag.Address);
+                CiAddress address = asAddress(value);
+                address.base = proc.doValue(address.base, mode, ADDRESS_FLAGS);
+                address.index = proc.doValue(address.index, mode, ADDRESS_FLAGS);
+            } else {
+                values[i] = proc.doValue(values[i], mode, flagsFor(mode, i));
+            }
+        }
+    }
+
+    public final void forEachInput(ValueProcedure proc) {
+        forEach(inputs, OperandMode.Input, proc);
+    }
+
+    public final void forEachAlive(ValueProcedure proc) {
+        forEach(alives, OperandMode.Alive, proc);
+    }
+
+    public final void forEachTemp(ValueProcedure proc) {
+        forEach(temps, OperandMode.Temp, proc);
+    }
+
+    public final void forEachOutput(ValueProcedure proc) {
+        forEach(outputs, OperandMode.Output, proc);
+    }
+
+    public final void forEachState(ValueProcedure proc) {
+        if (info != null) {
+            info.forEachState(proc);
+
+            if (this instanceof LIRXirInstruction) {
+                LIRXirInstruction xir = (LIRXirInstruction) this;
+                if (xir.infoAfter != null) {
+                    xir.infoAfter.forEachState(proc);
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns true when this instruction is a call instruction that destroys all caller-saved registers.
+     */
+    public final boolean hasCall() {
+        return this instanceof StandardOp.CallOp;
+    }
+
+    /**
+     * Iterates all register hints for the specified value, i.e., all preferred candidates for the register to be
+     * assigned to the value.
+     * <br>
+     * Subclasses can override this method. The default implementation processes all Input operands as the hints for
+     * an Output operand, and all Output operands as the hints for an Input operand.
+     *
+     * @param value The value the hints are needed for.
+     * @param mode The operand mode of the value.
+     * @param proc The procedure invoked for all the hints. If the procedure returns a non-null value, the iteration is stopped
+     *             and the value is returned by this method, i.e., clients can stop the iteration once a suitable hint has been found.
+     * @return The non-null value returned by the procedure, or null.
+     */
+    public CiValue forEachRegisterHint(CiValue value, OperandMode mode, ValueProcedure proc) {
+        CiValue[] hints;
+        if (mode == OperandMode.Input) {
+            hints = outputs;
+        } else if (mode == OperandMode.Output) {
+            hints = inputs;
+        } else {
+            return null;
+        }
+
+        for (int i = 0; i < hints.length; i++) {
+            CiValue result = proc.doValue(hints[i], null, null);
+            if (result != null) {
+                return result;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Used by the register allocator to decide which kind of location can be assigned to the operand.
+     * @param mode The kind of operand.
+     * @param index The index of the operand.
+     * @return The flags for the operand.
+     */
+    // TODO (cwimmer) this method will go away when we have named operands, the flags will be specified as annotations instead.
+    protected abstract EnumSet<OperandFlag> flagsFor(OperandMode mode, int index);
+
+    protected void verify() {
+    }
+
+
+    public final String toStringWithIdPrefix() {
+        if (id != -1) {
+            return String.format("%4d %s", id, toString());
+        }
+        return "     " + toString();
+    }
+
+    /**
+     * Gets the operation performed by this instruction in terms of its operands as a string.
+     */
+    public String operationString() {
+        StringBuilder buf = new StringBuilder();
+        String sep = "";
+        if (outputs.length > 1) {
+            buf.append("(");
+        }
+        for (CiValue output : outputs) {
+            buf.append(sep).append(output);
+            sep = ", ";
+        }
+        if (outputs.length > 1) {
+            buf.append(")");
+        }
+        if (outputs.length > 0) {
+            buf.append(" = ");
+        }
+
+        if (inputs.length + alives.length != 1) {
+            buf.append("(");
+        }
+        sep = "";
+        for (CiValue input : inputs) {
+            buf.append(sep).append(input);
+            sep = ", ";
+        }
+        for (CiValue input : alives) {
+            buf.append(sep).append(input).append(" ~");
+            sep = ", ";
+        }
+        if (inputs.length + alives.length != 1) {
+            buf.append(")");
+        }
+
+        if (temps.length > 0) {
+            buf.append(" [");
+        }
+        sep = "";
+        for (CiValue temp : temps) {
+            buf.append(sep).append(temp);
+            sep = ", ";
+        }
+        if (temps.length > 0) {
+            buf.append("]");
+        }
+        return buf.toString();
+    }
+
+    protected void appendDebugInfo(StringBuilder buf) {
+        if (info != null) {
+            buf.append(" [bci:");
+            String sep = "";
+            for (CiFrame cur = info.topFrame; cur != null; cur = cur.caller()) {
+                buf.append(sep).append(cur.bci);
+                sep = ",";
+            }
+            buf.append("]");
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder buf = new StringBuilder(name()).append(' ').append(operationString());
+        appendDebugInfo(buf);
+        return buf.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+import static com.oracle.graal.lir.ValueUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.cfg.*;
+
+public final class LIRVerifier {
+    private final LIR lir;
+    private final FrameMap frameMap;
+
+    private final boolean beforeRegisterAllocation;
+
+    private final BitSet[] blockLiveOut;
+    private final Object[] variableDefinitions;
+
+    private BitSet liveOutFor(Block block) {
+        return blockLiveOut[block.getId()];
+    }
+    private void setLiveOutFor(Block block, BitSet liveOut) {
+        blockLiveOut[block.getId()] = liveOut;
+    }
+
+    private int maxRegisterNum() {
+        return frameMap.target.arch.registers.length;
+    }
+
+    private boolean isAllocatableRegister(CiValue value) {
+        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+    }
+
+    public static boolean verify(final LIRInstruction op) {
+        ValueProcedure allowedProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return allowed(op, value, mode, flags); } };
+
+        op.forEachInput(allowedProc);
+        op.forEachAlive(allowedProc);
+        op.forEachState(allowedProc);
+        op.forEachTemp(allowedProc);
+        op.forEachOutput(allowedProc);
+
+        op.verify();
+        return true;
+    }
+
+    public static boolean verify(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap) {
+        LIRVerifier verifier = new LIRVerifier(beforeRegisterAllocation, lir, frameMap);
+        verifier.verify();
+        return true;
+    }
+
+
+    private LIRVerifier(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap) {
+        this.beforeRegisterAllocation = beforeRegisterAllocation;
+        this.lir = lir;
+        this.frameMap = frameMap;
+        this.blockLiveOut = new BitSet[lir.linearScanOrder().size()];
+        this.variableDefinitions = new Object[lir.numVariables()];
+    }
+
+    private BitSet curVariablesLive;
+    private CiValue[] curRegistersLive;
+
+    private Block curBlock;
+    private Object curInstruction;
+    private BitSet curRegistersDefined;
+
+    private void verify() {
+        ValueProcedure useProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, mode, flags); } };
+        ValueProcedure defProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return def(value, mode, flags); } };
+
+        curRegistersDefined = new BitSet();
+        for (Block block : lir.linearScanOrder()) {
+            curBlock = block;
+            curVariablesLive = new BitSet();
+            curRegistersLive = new CiValue[maxRegisterNum()];
+
+            if (block.getDominator() != null) {
+                curVariablesLive.or(liveOutFor(block.getDominator()));
+            }
+
+            assert block.lir.get(0) instanceof StandardOp.LabelOp : "block must start with label";
+            if (block.numberOfPreds() > 1) {
+                assert block.lir.get(0) instanceof StandardOp.PhiLabelOp : "phi mapping required for multiple predecessors";
+                CiValue[] phiDefinitions = ((StandardOp.PhiLabelOp) block.lir.get(0)).getPhiDefinitions();
+                if (!beforeRegisterAllocation) {
+                    assert phiDefinitions.length == 0;
+                }
+                for (Block pred : block.getPredecessors()) {
+                    assert pred.numberOfSux() == 1;
+                    LIRInstruction last = pred.lir.get(pred.lir.size() - 1);
+                    assert last instanceof StandardOp.PhiJumpOp : "phi mapping required for multiple successors";
+                    CiValue[] phiUses = ((StandardOp.PhiJumpOp) last).getPhiInputs();
+                    if (!beforeRegisterAllocation) {
+                        assert phiUses.length == 0;
+                    }
+                }
+            }
+
+            if (block.numberOfSux() > 0) {
+                LIRInstruction last = block.lir.get(block.lir.size() - 1);
+                assert last instanceof StandardOp.JumpOp || last instanceof LIRXirInstruction : "block with successor must end with unconditional jump";
+            }
+
+            for (LIRInstruction op : block.lir) {
+                curInstruction = op;
+
+                op.forEachInput(useProc);
+                if (op.hasCall()) {
+                    for (CiRegister register : frameMap.registerConfig.getCallerSaveRegisters()) {
+                        curRegistersLive[register.number] = null;
+                    }
+                }
+                curRegistersDefined.clear();
+                op.forEachAlive(useProc);
+                op.forEachState(useProc);
+                op.forEachTemp(defProc);
+                op.forEachOutput(defProc);
+
+                curInstruction = null;
+            }
+
+            setLiveOutFor(block, curVariablesLive);
+        }
+    }
+
+    private CiValue use(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        allowed(curInstruction, value, mode, flags);
+
+        if (isVariable(value)) {
+            assert beforeRegisterAllocation;
+
+            int variableIdx = asVariable(value).index;
+            if (!curVariablesLive.get(variableIdx)) {
+                TTY.println("block %s  instruction %s", curBlock, curInstruction);
+                TTY.println("live variables: %s", curVariablesLive);
+                if (variableDefinitions[variableIdx] != null) {
+                    TTY.println("definition of %s: %s", value, variableDefinitions[variableIdx]);
+                }
+                TTY.println("ERROR: Use of variable %s that is not defined in dominator", value);
+                throw GraalInternalError.shouldNotReachHere();
+            }
+
+        } else if (isAllocatableRegister(value)) {
+            int regNum = asRegister(value).number;
+            if (mode == OperandMode.Alive) {
+                curRegistersDefined.set(regNum);
+            }
+
+            if (beforeRegisterAllocation && curRegistersLive[regNum] != value) {
+                TTY.println("block %s  instruction %s", curBlock, curInstruction);
+                TTY.println("live registers: %s", Arrays.toString(curRegistersLive));
+                TTY.println("ERROR: Use of fixed register %s that is not defined in this block", value);
+                throw GraalInternalError.shouldNotReachHere();
+            }
+        }
+        return value;
+    }
+
+    private CiValue def(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        allowed(curInstruction, value, mode, flags);
+
+        if (isVariable(value)) {
+            assert beforeRegisterAllocation;
+
+            int variableIdx = asVariable(value).index;
+            if (variableDefinitions[variableIdx] != null) {
+                TTY.println("block %s  instruction %s", curBlock, curInstruction);
+                TTY.println("live variables: %s", curVariablesLive);
+                TTY.println("definition of %s: %s", value, variableDefinitions[variableIdx]);
+                TTY.println("ERROR: Variable %s defined multiple times", value);
+                throw GraalInternalError.shouldNotReachHere();
+            }
+            assert curInstruction != null;
+            variableDefinitions[variableIdx] = curInstruction;
+            assert !curVariablesLive.get(variableIdx);
+            if (mode == OperandMode.Output) {
+                curVariablesLive.set(variableIdx);
+            }
+
+        } else if (isAllocatableRegister(value)) {
+            int regNum = asRegister(value).number;
+            if (curRegistersDefined.get(regNum)) {
+                TTY.println("block %s  instruction %s", curBlock, curInstruction);
+                TTY.println("ERROR: Same register defined twice in the same instruction: %s", value);
+                throw GraalInternalError.shouldNotReachHere();
+            }
+            curRegistersDefined.set(regNum);
+
+            if (beforeRegisterAllocation) {
+                if (mode == OperandMode.Output) {
+                    curRegistersLive[regNum] = value;
+                } else {
+                    curRegistersLive[regNum] = null;
+                }
+            }
+        }
+        return value;
+    }
+
+    private static CiValue allowed(Object op, CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
+        if ((isVariable(value)  && flags.contains(OperandFlag.Register)) ||
+            (isRegister(value)  && flags.contains(OperandFlag.Register)) ||
+            (isStackSlot(value) && flags.contains(OperandFlag.Stack)) ||
+            (isConstant(value)  && flags.contains(OperandFlag.Constant) && mode != OperandMode.Output) ||
+            (isIllegal(value)   && flags.contains(OperandFlag.Illegal))) {
+            return value;
+        }
+        TTY.println("instruction %s", op);
+        TTY.println("mode: %s  flags: %s", mode, flags);
+        TTY.println("Unexpected value: %s %s", value.getClass().getSimpleName(), value);
+        throw GraalInternalError.shouldNotReachHere();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRXirInstruction.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.xir.*;
+import com.oracle.graal.graph.*;
+
+public abstract class LIRXirInstruction extends LIRInstruction {
+
+    public final CiValue[] originalOperands;
+    public final int outputOperandIndex;
+    public final int[] inputOperandIndices;
+    public final int[] tempOperandIndices;
+    public final XirSnippet snippet;
+    public final LIRDebugInfo infoAfter;
+    public final LabelRef trueSuccessor;
+    public final LabelRef falseSuccessor;
+
+    public LIRXirInstruction(Object opcode,
+                             XirSnippet snippet,
+                             CiValue[] originalOperands,
+                             CiValue outputOperand,
+                             CiValue[] inputs, CiValue[] temps,
+                             int[] inputOperandIndices, int[] tempOperandIndices,
+                             int outputOperandIndex,
+                             LIRDebugInfo info,
+                             LIRDebugInfo infoAfter,
+                             LabelRef trueSuccessor,
+                             LabelRef falseSuccessor) {
+        // Note that we register the XIR input operands as Alive, because the XIR specification allows that input operands
+        // are used at any time, even when the temp operands and the actual output operands have already be assigned.
+        super(opcode, isLegal(outputOperand) ? new CiValue[] {outputOperand} : LIRInstruction.NO_OPERANDS, info, LIRInstruction.NO_OPERANDS, inputs, temps);
+        this.infoAfter = infoAfter;
+        this.snippet = snippet;
+        this.inputOperandIndices = inputOperandIndices;
+        this.tempOperandIndices = tempOperandIndices;
+        this.outputOperandIndex = outputOperandIndex;
+        this.originalOperands = originalOperands;
+        this.falseSuccessor = falseSuccessor;
+        this.trueSuccessor = trueSuccessor;
+        assert isLegal(outputOperand) || outputOperandIndex == -1;
+    }
+
+    @Override
+    protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+        if (mode == OperandMode.Alive || mode == OperandMode.Temp) {
+            return EnumSet.of(OperandFlag.Register, OperandFlag.Constant, OperandFlag.Illegal);
+        } else if (mode == OperandMode.Output && index == 0) {
+            return EnumSet.of(OperandFlag.Register);
+        }
+        throw GraalInternalError.shouldNotReachHere();
+    }
+
+    public CiValue[] getOperands() {
+        for (int i = 0; i < inputOperandIndices.length; i++) {
+            originalOperands[inputOperandIndices[i]] = alive(i);
+        }
+        for (int i = 0; i < tempOperandIndices.length; i++) {
+            originalOperands[tempOperandIndices[i]] = temp(i);
+        }
+        if (outputOperandIndex != -1) {
+            originalOperands[outputOperandIndex] = output(0);
+        }
+        return originalOperands;
+    }
+
+    @Override
+    public String name() {
+        return "XIR: " + snippet.template;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import com.oracle.max.asm.*;
+import com.oracle.graal.lir.cfg.*;
+
+/**
+ * LIR instructions such as JUMP and BRANCH need to reference their target {@link Block}. However,
+ * direct references are not possible since the control flow graph (and therefore successors lists) can
+ * be changed by optimizations - and fixing the instructions is error prone.
+ * Therefore, we only reference of block B from block A only via the tuple (A, successor-index-of-B), i.e.,
+ * indirectly by storing the index into the successor list of A.
+ * Note that therefore it is not allowed to reorder the successor list!
+ *
+ * Labels of out-of-line stubs can be referenced directly, therefore it is also possible to construct a
+ * LabelRef for a Label directly via {@link #forLabel}.
+ */
+public abstract class LabelRef {
+
+    public abstract Label label();
+
+    /**
+     * Returns a new reference to a statically defined label.
+     * @param label The label that is always returned.
+     * @return The newly created label reference.
+     */
+    public static LabelRef forLabel(final Label label) {
+       return new LabelRef() {
+           @Override
+           public Label label() {
+               return label;
+           }
+
+           @Override
+           public String toString() {
+               return label.toString();
+           }
+       };
+    }
+
+    /**
+     * Returns a new reference to a successor of the given block.
+     * This allows to reference the given successor even when the successor list
+     * is modified between the creation of the reference and the call to {@link #getLabel}.
+     * @param block The base block that contains the successor list.
+     * @param suxIndex The index of the successor.
+     * @return The newly created label reference.
+     */
+    public static LabelRef forSuccessor(final Block block, final int suxIndex) {
+        return new LabelRef() {
+            @Override
+            public Label label() {
+                return ((StandardOp.LabelOp) block.suxAt(suxIndex).lir.get(0)).getLabel();
+            }
+
+            @Override
+            public String toString() {
+                return suxIndex < block.numberOfSux() ? block.suxAt(suxIndex).toString() : "?" + block + ":" + suxIndex + "?";
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import java.util.*;
+
+import com.oracle.max.asm.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.asm.*;
+
+/**
+ * A collection of machine-independent LIR operations, as well as interfaces to be implemented for specific kinds or LIR
+ * operations.
+ */
+public class StandardOp {
+
+    private static CiValue[] EMPTY = new CiValue[0];
+
+    /**
+     * LIR operation that defines the position of a label.
+     * The first operation of every block must implement this interface.
+     */
+    public static class LabelOp extends LIRInstruction {
+        private final Label label;
+        private final boolean align;
+
+        protected LabelOp(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps, Label label, boolean align) {
+            super(opcode, outputs, info, inputs, alives, temps);
+            this.label = label;
+            this.align = align;
+        }
+
+        public LabelOp(Label label, boolean align) {
+            this("LABEL", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, label, align);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm) {
+            if (align) {
+                tasm.asm.align(tasm.target.wordSize);
+            }
+            tasm.asm.bind(label);
+        }
+
+        @Override
+        public String operationString() {
+            return label.toString() + " " + super.operationString();
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        public Label getLabel() {
+            return label;
+        }
+    }
+
+    public static class PhiLabelOp extends LabelOp {
+        public PhiLabelOp(Label label, boolean align, CiValue[] phiDefinitions) {
+            super("PHI_LABEL", phiDefinitions, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, label, align);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Output) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        public void markResolved() {
+            outputs = EMPTY;
+        }
+
+        public CiValue[] getPhiDefinitions() {
+            return outputs;
+        }
+    }
+
+    /**
+     * LIR operation that is an unconditional jump to {@link #destination()}.
+     * When the LIR is constructed, the last operation of every block must implement this interface. After
+     * register allocation, unnecessary jumps can be deleted.
+     *
+     * TODO (cwimmer) Currently, a block can also end with an XIR operation.
+     */
+    public static class JumpOp extends LIRInstruction {
+        private final LabelRef destination;
+
+        protected JumpOp(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps, LabelRef destination) {
+            super(opcode, outputs, info, inputs, alives, temps);
+            this.destination = destination;
+        }
+
+        public JumpOp(LabelRef destination, LIRDebugInfo info) {
+            this("JUMP", LIRInstruction.NO_OPERANDS, info, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, destination);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm) {
+            tasm.asm.jmp(destination.label());
+        }
+
+        @Override
+        public String operationString() {
+            return  destination + " " + super.operationString();
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        public LabelRef destination() {
+            return destination;
+        }
+    }
+
+    public static class PhiJumpOp extends JumpOp {
+        public PhiJumpOp(LabelRef destination, CiValue[] phiInputs) {
+            super("PHI_JUMP", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, phiInputs, LIRInstruction.NO_OPERANDS, destination);
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Alive) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+
+        public void markResolved() {
+            alives = EMPTY;
+        }
+
+        public CiValue[] getPhiInputs() {
+            return alives;
+        }
+    }
+
+    /**
+     * Marker interface for a LIR operation that is a conditional jump to {@link #destination()}.
+     * Conditional jumps may be negated or optimized away after register allocation.
+     */
+    public interface BranchOp {
+        LabelRef destination();
+        void negate(LabelRef newDestination);
+    }
+
+    /**
+     * Marker interface for a LIR operation that moves a value from {@link #getInput()} to {@link #getResult()}.
+     */
+    public interface MoveOp {
+        CiValue getInput();
+        CiValue getResult();
+    }
+
+    /**
+     * Marker interface for a LIR operation that calls a method, i.e., destroys all caller-saved registers.
+     */
+    public interface CallOp {
+    }
+
+
+    /**
+     * Meta-operation that defines the incoming method parameters. In the LIR, every register and variable must be
+     * defined before it is used. This operation is the definition point of method parameters, but is otherwise a no-op.
+     * In particular, it is not the actual method prologue.
+     */
+    public static final class ParametersOp extends LIRInstruction {
+        public ParametersOp(CiValue[] params) {
+            super("PARAMS", params, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm) {
+            // No code to emit.
+        }
+
+        @Override
+        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+            if (mode == OperandMode.Output) {
+                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
+            }
+            throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueUtil.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import com.oracle.max.cri.ci.*;
+
+public class ValueUtil extends CiValueUtil {
+
+    public static boolean isVariable(CiValue value) {
+        assert value != null;
+        return value instanceof Variable;
+    }
+
+    public static Variable asVariable(CiValue value) {
+        assert value != null;
+        return (Variable) value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Represents a value that is yet to be bound to a machine location (such as
+ * a {@link CiRegisterValue} or {@link CiStackSlot}) by a register allocator.
+ */
+public final class Variable 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;
+
+    /**
+     * The type of register that this variable needs to get assigned.
+     */
+    public final CiRegister.RegisterFlag flag;
+
+    /**
+     * Creates a new variable.
+     * @param kind
+     * @param index
+     */
+    public Variable(CiKind kind, int index, CiRegister.RegisterFlag flag) {
+        super(kind);
+        assert kind == kind.stackKind() : "Variables can be only created for stack kinds";
+        assert index >= 0;
+        this.index = index;
+        this.flag = flag;
+    }
+
+    @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.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.asm;
+
+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.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIR.*;
+
+public class TargetMethodAssembler {
+
+    private static class ExceptionInfo {
+        public final int codeOffset;
+        public final LabelRef exceptionEdge;
+
+        public ExceptionInfo(int pcOffset, LabelRef exceptionEdge) {
+            this.codeOffset = pcOffset;
+            this.exceptionEdge = exceptionEdge;
+        }
+    }
+
+    public final AbstractAssembler asm;
+    public final CiTargetMethod targetMethod;
+    public final CiTarget target;
+    public final RiRuntime runtime;
+    public final FrameMap frameMap;
+    public final List<SlowPath> slowPaths;
+
+    private List<ExceptionInfo> exceptionInfoList;
+    private int lastSafepointPos;
+
+    public TargetMethodAssembler(CiTarget target, RiRuntime runtime, FrameMap frameMap, List<SlowPath> slowPaths, AbstractAssembler asm) {
+        this.target = target;
+        this.runtime = runtime;
+        this.frameMap = frameMap;
+        this.slowPaths = slowPaths;
+        this.asm = asm;
+        this.targetMethod = new CiTargetMethod();
+        // 0 is a valid pc for safepoints in template methods
+        this.lastSafepointPos = -1;
+    }
+
+    public void setFrameSize(int frameSize) {
+        targetMethod.setFrameSize(frameSize);
+    }
+
+    public CiTargetMethod.Mark recordMark(Object id, CiTargetMethod.Mark[] references) {
+        return targetMethod.recordMark(asm.codeBuffer.position(), id, references);
+    }
+
+    public void blockComment(String s) {
+        targetMethod.addAnnotation(new CiTargetMethod.CodeComment(asm.codeBuffer.position(), s));
+    }
+
+    public CiTargetMethod finishTargetMethod(Object name, boolean isStub) {
+        // Install code, data and frame size
+        targetMethod.setTargetCode(asm.codeBuffer.close(false), asm.codeBuffer.position());
+
+        // Record exception handlers if they exist
+        if (exceptionInfoList != null) {
+            for (ExceptionInfo ei : exceptionInfoList) {
+                int codeOffset = ei.codeOffset;
+                targetMethod.recordExceptionHandler(codeOffset, ei.exceptionEdge.label().position());
+            }
+        }
+
+        Debug.metric("TargetMethods").increment();
+        Debug.metric("CodeBytesEmitted").add(targetMethod.targetCodeSize());
+        Debug.metric("SafepointsEmitted").add(targetMethod.safepoints.size());
+        Debug.metric("DataPatches").add(targetMethod.dataReferences.size());
+        Debug.metric("ExceptionHandlersEmitted").add(targetMethod.exceptionHandlers.size());
+
+        Debug.log("Finished target method %s, isStub %b", name, isStub);
+/*
+        if (GraalOptions.PrintAssembly && !TTY.isSuppressed() && !isStub) {
+            Util.printSection("Target Method", Util.SECTION_CHARACTER);
+            TTY.println("Name: " + name);
+            TTY.println("Frame size: " + targetMethod.frameSize());
+            TTY.println("Register size: " + asm.target.arch.registerReferenceMapBitCount);
+
+            if (GraalOptions.PrintCodeBytes) {
+                Util.printSection("Code", Util.SUB_SECTION_CHARACTER);
+                TTY.println("Code: %d bytes", targetMethod.targetCodeSize());
+                Util.printBytes(0L, targetMethod.targetCode(), 0, targetMethod.targetCodeSize(), GraalOptions.PrintAssemblyBytesPerLine);
+            }
+
+            Util.printSection("Disassembly", Util.SUB_SECTION_CHARACTER);
+            String disassembly = runtime.disassemble(targetMethod);
+            TTY.println(disassembly);
+            boolean noDis = disassembly == null || disassembly.length() == 0;
+
+            Util.printSection("Safepoints", Util.SUB_SECTION_CHARACTER);
+            for (CiTargetMethod.Safepoint x : targetMethod.safepoints) {
+                TTY.println(x.toString());
+                if (noDis && x.debugInfo != null) {
+                    TTY.println(CiUtil.indent(x.debugInfo.toString(), "  "));
+                }
+            }
+
+            Util.printSection("Data Patches", Util.SUB_SECTION_CHARACTER);
+            for (CiTargetMethod.DataPatch x : targetMethod.dataReferences) {
+                TTY.println(x.toString());
+            }
+
+            Util.printSection("Marks", Util.SUB_SECTION_CHARACTER);
+            for (CiTargetMethod.Mark x : targetMethod.marks) {
+                TTY.println(x.toString());
+            }
+
+            Util.printSection("Exception Handlers", Util.SUB_SECTION_CHARACTER);
+            for (CiTargetMethod.ExceptionHandler x : targetMethod.exceptionHandlers) {
+                TTY.println(x.toString());
+            }
+        }
+*/
+
+        return targetMethod;
+    }
+
+    public void recordExceptionHandlers(int pcOffset, LIRDebugInfo info) {
+        if (info != null) {
+            if (info.exceptionEdge != null) {
+                if (exceptionInfoList == null) {
+                    exceptionInfoList = new ArrayList<>(4);
+                }
+                exceptionInfoList.add(new ExceptionInfo(pcOffset, info.exceptionEdge));
+            }
+        }
+    }
+
+    public void recordImplicitException(int pcOffset, LIRDebugInfo info) {
+        // record an implicit exception point
+        if (info != null) {
+            assert lastSafepointPos < pcOffset : lastSafepointPos + "<" + pcOffset;
+            lastSafepointPos = pcOffset;
+            targetMethod.recordSafepoint(pcOffset, info.debugInfo());
+            assert info.exceptionEdge == null;
+        }
+    }
+
+    public void recordDirectCall(int posBefore, int posAfter, Object callTarget, LIRDebugInfo info) {
+        CiDebugInfo debugInfo = info != null ? info.debugInfo() : null;
+        assert lastSafepointPos < posAfter;
+        lastSafepointPos = posAfter;
+        targetMethod.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, true);
+    }
+
+    public void recordIndirectCall(int posBefore, int posAfter, Object callTarget, LIRDebugInfo info) {
+        CiDebugInfo debugInfo = info != null ? info.debugInfo() : null;
+        assert lastSafepointPos < posAfter;
+        lastSafepointPos = posAfter;
+        targetMethod.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, false);
+    }
+
+    public void recordSafepoint(int pos, LIRDebugInfo info) {
+        // safepoints always need debug info
+        CiDebugInfo debugInfo = info.debugInfo();
+        assert lastSafepointPos < pos;
+        lastSafepointPos = pos;
+        targetMethod.recordSafepoint(pos, debugInfo);
+    }
+
+    public CiAddress recordDataReferenceInCode(CiConstant data, int alignment) {
+        assert data != null;
+        int pos = asm.codeBuffer.position();
+        Debug.log("Data reference in code: pos = %d, data = %s", pos, data.toString());
+        targetMethod.recordDataReference(pos, data, alignment);
+        return CiAddress.Placeholder;
+    }
+
+    public int lastSafepointPos() {
+        return lastSafepointPos;
+    }
+
+
+    /**
+     * Returns the integer value of any constants that can be represented by a 32-bit integer value,
+     * including long constants that fit into the 32-bit range.
+     */
+    public int asIntConst(CiValue value) {
+        assert (value.kind.stackKind() == CiKind.Int || value.kind == CiKind.Jsr || value.kind == CiKind.Long) && isConstant(value);
+        long c = ((CiConstant) value).asLong();
+        if (!(NumUtil.isInt(c))) {
+            throw GraalInternalError.shouldNotReachHere();
+        }
+        return (int) c;
+    }
+
+    /**
+     * Returns the address of a float constant that is embedded as a data references into the code.
+     */
+    public CiAddress asFloatConstRef(CiValue value) {
+        return asFloatConstRef(value, 4);
+    }
+
+    public CiAddress asFloatConstRef(CiValue value, int alignment) {
+        assert value.kind == CiKind.Float && isConstant(value);
+        return recordDataReferenceInCode((CiConstant) value, alignment);
+    }
+
+    /**
+     * Returns the address of a double constant that is embedded as a data references into the code.
+     */
+    public CiAddress asDoubleConstRef(CiValue value) {
+        return asDoubleConstRef(value, 8);
+    }
+
+    public CiAddress asDoubleConstRef(CiValue value, int alignment) {
+        assert value.kind == CiKind.Double && isConstant(value);
+        return recordDataReferenceInCode((CiConstant) value, alignment);
+    }
+
+    /**
+     * Returns the address of a long constant that is embedded as a data references into the code.
+     */
+    public CiAddress asLongConstRef(CiValue value) {
+        assert value.kind == CiKind.Long && isConstant(value);
+        return recordDataReferenceInCode((CiConstant) value, 8);
+    }
+
+    public CiAddress asIntAddr(CiValue value) {
+        assert value.kind == CiKind.Int;
+        return asAddress(value);
+    }
+
+    public CiAddress asLongAddr(CiValue value) {
+        assert value.kind == CiKind.Long;
+        return asAddress(value);
+    }
+
+    public CiAddress asObjectAddr(CiValue value) {
+        assert value.kind == CiKind.Object;
+        return asAddress(value);
+    }
+
+    public CiAddress asFloatAddr(CiValue value) {
+        assert value.kind == CiKind.Float;
+        return asAddress(value);
+    }
+
+    public CiAddress asDoubleAddr(CiValue value) {
+        assert value.kind == CiKind.Double;
+        return asAddress(value);
+    }
+
+    public CiAddress asAddress(CiValue value) {
+        if (isStackSlot(value)) {
+            CiStackSlot slot = (CiStackSlot) value;
+            return new CiAddress(slot.kind, frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot));
+        }
+        return (CiAddress) value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/Block.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.cfg;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
+
+public class Block {
+    protected int id;
+
+    protected BeginNode beginNode;
+    protected Node endNode;
+    protected Loop loop;
+    protected double probability;
+
+    protected List<Block> predecessors;
+    protected List<Block> successors;
+
+    protected Block dominator;
+    protected List<Block> dominated;
+    protected Block postdominator;
+
+    // Fields that still need to be worked on, try to remove them later.
+    public List<LIRInstruction> lir;
+    public boolean align;
+    public int linearScanNumber;
+
+    public Block() {
+        id = ControlFlowGraph.BLOCK_ID_INITIAL;
+    }
+
+    public int getId() {
+        assert id >= 0;
+        return id;
+    }
+
+    public BeginNode getBeginNode() {
+        return beginNode;
+    }
+
+    public Node getEndNode() {
+        return endNode;
+    }
+
+    public Loop getLoop() {
+        return loop;
+    }
+
+    public int getLoopDepth() {
+        return loop == null ? 0 : loop.depth;
+    }
+
+    public boolean isLoopHeader() {
+        return getBeginNode() instanceof LoopBeginNode;
+    }
+
+    public boolean isLoopEnd() {
+        return getEndNode() instanceof LoopEndNode;
+    }
+
+    public boolean isExceptionEntry() {
+        return getBeginNode().next() instanceof ExceptionObjectNode;
+    }
+
+    public List<Block> getPredecessors() {
+        return predecessors;
+    }
+
+    public List<Block> getSuccessors() {
+        return successors;
+    }
+
+    public Block getDominator() {
+        return dominator;
+    }
+
+    public Block getEarliestPostDominated() {
+        Block b = this;
+        while (true) {
+            Block dom = b.getDominator();
+            if (dom != null && dom.getPostdominator() == b) {
+                b = dom;
+            } else {
+                break;
+            }
+        }
+        return b;
+    }
+
+    public List<Block> getDominated() {
+        if (dominated == null) {
+            return Collections.emptyList();
+        }
+        return dominated;
+    }
+
+    public Block getPostdominator() {
+        return postdominator;
+    }
+
+    private class NodeIterator implements Iterator<Node> {
+        private Node cur;
+
+        public NodeIterator() {
+            cur = getBeginNode();
+        }
+
+        @Override
+        public boolean hasNext() {
+            return cur != null;
+        }
+
+        @Override
+        public Node next() {
+            Node result = cur;
+            if (cur == getEndNode()) {
+                cur = null;
+            } else {
+                cur = ((FixedWithNextNode) cur).next();
+            }
+            assert !(cur instanceof BeginNode);
+            return result;
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    public Iterable<Node> getNodes() {
+        return new Iterable<Node>() {
+            @Override
+            public Iterator<Node> iterator() {
+                return new NodeIterator();
+            }
+        };
+    }
+
+    public int getFirstLirInstructionId() {
+        int result = lir.get(0).id();
+        assert result >= 0;
+        return result;
+    }
+
+    public int getLastLirInstructionId() {
+        int result = lir.get(lir.size() - 1).id();
+        assert result >= 0;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "B" + id;
+    }
+
+
+// to be inlined later on
+    public int numberOfPreds() {
+        return getPredecessors().size();
+    }
+
+    public int numberOfSux() {
+        return getSuccessors().size();
+    }
+
+    public Block predAt(int i) {
+        return getPredecessors().get(i);
+    }
+
+    public Block suxAt(int i) {
+        return getSuccessors().get(i);
+    }
+// end to be inlined later on
+
+    public boolean dominates(Block block) {
+        return block.isDominatedBy(this);
+    }
+
+    public boolean isDominatedBy(Block block) {
+        if (block == this) {
+            return true;
+        }
+        if (dominator == null) {
+            return false;
+        }
+        return dominator.isDominatedBy(block);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/BlockMap.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.cfg;
+
+public class BlockMap<T> {
+    private final T[] data;
+
+    @SuppressWarnings("unchecked")
+    public BlockMap(ControlFlowGraph cfg) {
+        data = (T[]) new Object[cfg.getBlocks().length];
+    }
+
+    public T get(Block block) {
+        return data[block.getId()];
+    }
+
+    public void put(Block block, T value) {
+        data[block.getId()] = value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/CFGVerifier.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.cfg;
+
+public class CFGVerifier {
+    public static boolean verify(ControlFlowGraph cfg) {
+        for (Block block : cfg.getBlocks()) {
+            assert cfg.getBlocks()[block.getId()] == block;
+
+            for (Block pred : block.getPredecessors()) {
+                assert pred.getSuccessors().contains(block);
+                assert pred.getId() < block.getId() || pred.isLoopEnd();
+            }
+
+            for (Block sux : block.getSuccessors()) {
+                assert sux.getPredecessors().contains(block);
+                assert sux.getId() > block.getId() || sux.isLoopHeader();
+            }
+
+            if (block.getDominator() != null) {
+                assert block.getDominator().getId() < block.getId();
+                assert block.getDominator().getDominated().contains(block);
+            }
+            for (Block dominated : block.getDominated()) {
+                assert dominated.getId() > block.getId();
+                assert dominated.getDominator() == block;
+            }
+
+            assert cfg.getLoops() == null || !block.isLoopHeader() || block.getLoop().header == block;
+        }
+
+        if (cfg.getLoops() != null) {
+            for (Loop loop : cfg.getLoops()) {
+                assert loop.header.isLoopHeader();
+
+                for (Block block : loop.blocks) {
+                    assert block.getId() >= loop.header.getId();
+
+                    Loop blockLoop = block.getLoop();
+                    while (blockLoop != loop) {
+                        blockLoop = blockLoop.parent;
+                        assert blockLoop != null;
+                    }
+                }
+
+                for (Block block : loop.exits) {
+                    assert block.getId() >= loop.header.getId();
+
+                    Loop blockLoop = block.getLoop();
+                    while (blockLoop != null) {
+                        blockLoop = blockLoop.parent;
+                        assert blockLoop != loop;
+                    }
+                }
+            }
+        }
+
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/ControlFlowGraph.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,319 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.cfg;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+public class ControlFlowGraph {
+
+    public final StructuredGraph graph;
+
+    private final NodeMap<Block> nodeToBlock;
+    private Block[] reversePostOrder;
+    private Loop[] loops;
+
+    public static ControlFlowGraph compute(StructuredGraph graph, boolean connectBlocks, boolean computeLoops, boolean computeDominators, boolean computePostdominators) {
+        ControlFlowGraph cfg = new ControlFlowGraph(graph);
+        cfg.identifyBlocks();
+        if (connectBlocks || computeLoops || computeDominators || computePostdominators) {
+            cfg.connectBlocks();
+        }
+        if (computeLoops) {
+            cfg.computeLoopInformation();
+        }
+        if (computeDominators) {
+            cfg.computeDominators();
+        }
+        if (computePostdominators) {
+            cfg.computePostdominators();
+        }
+        assert CFGVerifier.verify(cfg);
+        return cfg;
+    }
+
+    protected ControlFlowGraph(StructuredGraph graph) {
+        this.graph = graph;
+        this.nodeToBlock = graph.createNodeMap();
+    }
+
+    public Block[] getBlocks() {
+        return reversePostOrder;
+    }
+
+    public Block getStartBlock() {
+        return reversePostOrder[0];
+    }
+
+    public NodeMap<Block> getNodeToBlock() {
+        return nodeToBlock;
+    }
+
+    public Block blockFor(Node node) {
+        return nodeToBlock.get(node);
+    }
+
+    public Loop[] getLoops() {
+        return loops;
+    }
+
+    protected static final int BLOCK_ID_INITIAL = -1;
+    protected static final int BLOCK_ID_VISITED = -2;
+
+    private void identifyBlocks() {
+        // Find all block headers
+        int numBlocks = 0;
+        for (Node node : graph.getNodes()) {
+            if (node instanceof BeginNode) {
+                Block block = new Block();
+                numBlocks++;
+
+                block.beginNode = (BeginNode) node;
+                Node cur = node;
+                do {
+                    assert !cur.isDeleted();
+                    block.endNode = cur;
+
+                    assert nodeToBlock.get(cur) == null;
+                    nodeToBlock.set(cur, block);
+                    if (cur instanceof MergeNode) {
+                        for (PhiNode phi : ((MergeNode) cur).phis()) {
+                            nodeToBlock.set(phi, block);
+                        }
+                    }
+
+                    if (cur instanceof FixedNode) {
+                        double probability = ((FixedNode) cur).probability();
+                        if (probability > block.probability) {
+                            block.probability = probability;
+                        }
+                    }
+
+                    Node next = null;
+                    for (Node sux : cur.successors()) {
+                        if (sux != null && !(sux instanceof BeginNode)) {
+                            assert next == null;
+                            next = sux;
+                        }
+                    }
+                    cur = next;
+                } while (cur != null);
+            }
+        }
+
+        // Compute postorder.
+        ArrayList<Block> postOrder = new ArrayList<>(numBlocks);
+        ArrayList<Block> stack = new ArrayList<>();
+        stack.add(blockFor(graph.start()));
+
+        do {
+            Block block = stack.get(stack.size() - 1);
+            if (block.id == BLOCK_ID_INITIAL) {
+                // First time we see this block: push all successors.
+                for (Node suxNode : block.getEndNode().cfgSuccessors()) {
+                    Block suxBlock = blockFor(suxNode);
+                    if (suxBlock.id == BLOCK_ID_INITIAL) {
+                        stack.add(suxBlock);
+                    }
+                }
+                block.id = BLOCK_ID_VISITED;
+            } else if (block.id == BLOCK_ID_VISITED) {
+                // Second time we see this block: All successors have been processed, so add block to postorder list.
+                stack.remove(stack.size() - 1);
+                postOrder.add(block);
+            } else {
+                throw GraalInternalError.shouldNotReachHere();
+            }
+        } while (!stack.isEmpty());
+
+        // Compute reverse postorder and number blocks.
+        assert postOrder.size() <= numBlocks : "some blocks originally created can be unreachable, so actual block list can be shorter";
+        numBlocks = postOrder.size();
+        reversePostOrder = new Block[numBlocks];
+        for (int i = 0; i < numBlocks; i++) {
+            reversePostOrder[i] = postOrder.get(numBlocks - i - 1);
+            reversePostOrder[i].id = i;
+        }
+    }
+
+    // Connect blocks (including loop backward edges), but ignoring dead code (blocks with id < 0).
+    private void connectBlocks() {
+        for (Block block : reversePostOrder) {
+            List<Block> predecessors = new ArrayList<>();
+            for (Node predNode : block.getBeginNode().cfgPredecessors()) {
+                Block predBlock = nodeToBlock.get(predNode);
+                if (predBlock.id >= 0) {
+                    predecessors.add(predBlock);
+                }
+            }
+            if (block.getBeginNode() instanceof LoopBeginNode) {
+                for (LoopEndNode predNode : ((LoopBeginNode) block.getBeginNode()).orderedLoopEnds()) {
+                    Block predBlock = nodeToBlock.get(predNode);
+                    if (predBlock.id >= 0) {
+                        predecessors.add(predBlock);
+                    }
+                }
+            }
+            block.predecessors = predecessors;
+
+            List<Block> successors = new ArrayList<>();
+            for (Node suxNode : block.getEndNode().cfgSuccessors()) {
+                Block suxBlock = nodeToBlock.get(suxNode);
+                assert suxBlock.id >= 0;
+                successors.add(suxBlock);
+            }
+            if (block.getEndNode() instanceof LoopEndNode) {
+                Block suxBlock = nodeToBlock.get(((LoopEndNode) block.getEndNode()).loopBegin());
+                assert suxBlock.id >= 0;
+                successors.add(suxBlock);
+            }
+            block.successors = successors;
+        }
+    }
+
+    private void computeLoopInformation() {
+        List<Loop> loopsList = new ArrayList<>();
+        for (Block block : reversePostOrder) {
+            Node beginNode = block.getBeginNode();
+            if (beginNode instanceof LoopBeginNode) {
+                Loop loop = new Loop(block.getLoop(), loopsList.size(), block);
+                loopsList.add(loop);
+
+                for (LoopEndNode end : ((LoopBeginNode) beginNode).loopEnds()) {
+                    Block endBlock = nodeToBlock.get(end);
+                    computeLoopBlocks(endBlock, loop);
+                }
+            }
+        }
+        loops = loopsList.toArray(new Loop[loopsList.size()]);
+
+        for (Loop loop : loops) {
+            for (Block block : loop.blocks) {
+                for (Block sux : block.getSuccessors()) {
+                    if (sux.getLoopDepth() < loop.depth) {
+                        loop.exits.add(sux);
+                    }
+                }
+            }
+        }
+    }
+
+    private void computeLoopBlocks(Block block, Loop loop) {
+        if (block.getLoop() == loop) {
+            return;
+        }
+        assert block.loop == loop.parent;
+        block.loop = loop;
+
+        assert !loop.blocks.contains(block);
+        loop.blocks.add(block);
+
+        if (block != loop.header) {
+            for (Block pred : block.getPredecessors()) {
+                computeLoopBlocks(pred, loop);
+            }
+        }
+    }
+
+    private void computeDominators() {
+        assert reversePostOrder[0].getPredecessors().size() == 0 : "start block has no predecessor and therefore no dominator";
+        for (int i = 1; i < reversePostOrder.length; i++) {
+            Block block = reversePostOrder[i];
+            List<Block> predecessors = block.getPredecessors();
+            assert predecessors.size() > 0;
+
+            Block dominator = predecessors.get(0);
+            for (int j = 1; j < predecessors.size(); j++) {
+                Block pred = predecessors.get(j);
+                if (!pred.isLoopEnd()) {
+                    dominator = commonDominator(dominator, pred);
+                }
+            }
+            setDominator(block, dominator);
+        }
+    }
+
+    private static void setDominator(Block block, Block dominator) {
+        block.dominator = dominator;
+        if (dominator.dominated == null) {
+            dominator.dominated = new ArrayList<>();
+        }
+        dominator.dominated.add(block);
+    }
+
+    public static Block commonDominator(Block a, Block b) {
+        Block iterA = a;
+        Block iterB = b;
+        while (iterA != iterB) {
+            if (iterA.getId() > iterB.getId()) {
+                iterA = iterA.getDominator();
+            } else {
+                assert iterB.getId() > iterA.getId();
+                iterB = iterB.getDominator();
+            }
+        }
+        return iterA;
+    }
+
+    private void computePostdominators() {
+        for (Block block : reversePostOrder) {
+            if (block.isLoopEnd()) {
+                // We do not want the loop header registered as the postdominator of the loop end.
+                continue;
+            }
+            Block postdominator = null;
+            for (Block sux : block.getSuccessors()) {
+                if (sux.isExceptionEntry()) {
+                    // We ignore exception handlers.
+                } else if (postdominator == null) {
+                    postdominator = sux;
+                } else {
+                    postdominator = commonPostdominator(postdominator, sux);
+                }
+            }
+            block.postdominator = postdominator;
+        }
+    }
+
+    private static Block commonPostdominator(Block a, Block b) {
+        Block iterA = a;
+        Block iterB = b;
+        while (iterA != iterB) {
+            if (iterA.getId() < iterB.getId()) {
+                iterA = iterA.getPostdominator();
+                if (iterA == null) {
+                    return null;
+                }
+            } else {
+                assert iterB.getId() < iterA.getId();
+                iterB = iterB.getPostdominator();
+                if (iterB == null) {
+                    return null;
+                }
+            }
+        }
+        return iterA;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/cfg/Loop.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.cfg;
+
+import java.util.*;
+
+public class Loop {
+    public final Loop parent;
+    public final List<Loop> children;
+
+    public final int depth;
+    public final int index;
+    public final Block header;
+    public final List<Block> blocks;
+    public final List<Block> exits;
+
+    protected Loop(Loop parent, int index, Block header) {
+        this.parent = parent;
+        if (parent != null) {
+            this.depth = parent.depth + 1;
+            parent.children.add(this);
+        } else {
+            this.depth = 1;
+        }
+        this.index = index;
+        this.header = header;
+        this.blocks = new ArrayList<>();
+        this.children = new ArrayList<>();
+        this.exits = new ArrayList<>();
+    }
+
+    @Override
+    public String toString() {
+        return "loop " + index + " depth " + depth + (parent != null ? " outer " + parent.index : "");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.cri;
+
+import com.oracle.graal.graph.*;
+
+public interface CiLoweringTool {
+    GraalRuntime getRuntime();
+    Node getGuardAnchor();
+    Node createGuard(Node condition);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/GraalRuntime.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.cri;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * Graal-specific extensions for the runtime interface that must be implemented by the VM.
+ */
+public interface GraalRuntime extends RiRuntime {
+
+    void lower(Node n, CiLoweringTool tool);
+
+    StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List<? extends Node> parameters);
+
+    CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractStateSplit.java	Thu Mar 08 19:24:17 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.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code AbstractStateSplit} class is the abstract base class of all instructions
+ * that store an immutable copy of the frame state.
+ */
+public abstract class AbstractStateSplit extends FixedWithNextNode implements StateSplit {
+
+    @Input(notDataflow = true) private FrameState stateAfter;
+
+    @Override
+    public FrameState stateAfter() {
+        return stateAfter;
+    }
+
+    @Override
+    public void setStateAfter(FrameState x) {
+        assert x == null || x.isAlive() : "frame state must be in a graph";
+        updateUsages(stateAfter, x);
+        stateAfter = x;
+    }
+
+    /**
+     * Creates a new state split with the specified value type.
+     * @param kind the type of the value that this instruction produces
+     */
+    public AbstractStateSplit(Stamp stamp) {
+        super(stamp);
+    }
+
+    @Override
+    public boolean needsStateAfter() {
+        return true;
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> debugProperties = super.getDebugProperties();
+        if (stateAfter() != null) {
+            debugProperties.put("stateAfter", stateAfter().toString(Verbosity.Debugger));
+        }
+        return debugProperties;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AnchorNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code AnchorNode} can be used a lower bound for a Guard. It can also be used as an upper bound if no other FixedNode can be used for that purpose.
+ */
+public final class AnchorNode extends FixedWithNextNode implements LIRLowerable, Canonicalizable {
+
+    @Input(notDataflow = true) private final NodeInputList<GuardNode> guards = new NodeInputList<>(this);
+
+    public AnchorNode() {
+        super(StampFactory.illegal());
+    }
+
+    public void addGuard(GuardNode x) {
+        guards.add(x);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (this.usages().size() == 0 && guards.size() == 0) {
+            return null;
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // Currently, there is nothing to emit since anchors are only a structural element with no execution semantics.
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class BeginNode extends AbstractStateSplit implements LIRLowerable, Simplifiable, Node.IterableNodeType {
+    public BeginNode() {
+        super(StampFactory.illegal());
+    }
+
+    public static BeginNode begin(FixedNode with) {
+        if (with instanceof BeginNode) {
+            return (BeginNode) with;
+        }
+        BeginNode begin =  with.graph().add(new BeginNode());
+        begin.setNext(with);
+        return begin;
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> debugProperties = super.getDebugProperties();
+        debugProperties.put("shortName", "B");
+        return debugProperties;
+    }
+
+    @Override
+    public void simplify(SimplifierTool tool) {
+        FixedNode prev = (FixedNode) this.predecessor();
+        if (prev == null) {
+            // This is the start node.
+        } else if (prev instanceof ControlSplitNode) {
+            // This begin node is necessary.
+        } else {
+            // This begin node can be removed and all guards moved up to the preceding begin node.
+            if (!usages().isEmpty()) {
+                Node prevBegin = prev;
+                while (!(prevBegin instanceof BeginNode)) {
+                    prevBegin = prevBegin.predecessor();
+                }
+                for (Node usage : usages()) {
+                    tool.addToWorkList(usage);
+                }
+                replaceAtUsages(prevBegin);
+            }
+            ((StructuredGraph) graph()).removeFixed(this);
+        }
+    }
+
+    public void evacuateGuards() {
+        if (!usages().isEmpty()) {
+            Node prevBegin = predecessor();
+            assert prevBegin != null;
+            while (!(prevBegin instanceof BeginNode)) {
+                prevBegin = prevBegin.predecessor();
+            }
+            replaceAtUsages(prevBegin);
+        }
+    }
+
+    @Override
+    public boolean verify() {
+        assertTrue(predecessor() != null || this == ((StructuredGraph) graph()).start() || this instanceof MergeNode, "begin nodes must be connected");
+        return super.verify();
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // nop
+    }
+
+    public NodeIterable<GuardNode> guards() {
+        return usages().filter(GuardNode.class);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BooleanNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.type.*;
+
+
+public abstract class BooleanNode extends FloatingNode {
+
+    public BooleanNode(Stamp stamp) {
+        super(stamp);
+    }
+
+    public abstract BooleanNode negate();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public abstract class CallTargetNode extends ValueNode implements LIRLowerable {
+    @Input protected final NodeInputList<ValueNode> arguments;
+
+    public CallTargetNode(ValueNode[] arguments) {
+        super(StampFactory.illegal());
+        this.arguments = new NodeInputList<>(this, arguments);
+    }
+
+    public NodeInputList<ValueNode> arguments() {
+        return arguments;
+    }
+
+    public abstract RiType returnType();
+
+    public abstract CiKind returnKind();
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        //nop
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code ConstantNode} represents a constant such as an integer value,
+ * long, float, object reference, address, etc.
+ */
+@NodeInfo(shortName = "Const")
+public class ConstantNode extends BooleanNode implements LIRLowerable {
+
+    @Data public final CiConstant value;
+
+    protected ConstantNode(CiConstant value) {
+        this(value, null);
+    }
+
+    /**
+     * Constructs a new ConstantNode representing the specified constant.
+     * @param value the constant
+     */
+    protected ConstantNode(CiConstant value, RiRuntime runtime) {
+        super(StampFactory.forConstant(value, runtime));
+        this.value = value;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        if (gen.canInlineConstant(value) || onlyUsedInFrameState()) {
+            gen.setResult(this, value);
+        } else {
+            gen.setResult(this, gen.emitMove(value));
+        }
+    }
+
+    private boolean onlyUsedInFrameState() {
+        return usages().filter(NodePredicates.isNotA(FrameState.class)).isEmpty();
+    }
+
+    public static ConstantNode forCiConstant(CiConstant constant, RiRuntime runtime, Graph graph) {
+        return graph.unique(new ConstantNode(constant, runtime));
+    }
+
+    /**
+     * Returns a node for a double constant.
+     * @param d the double value for which to create the instruction
+     * @param graph
+     * @return a node for a double constant
+     */
+    public static ConstantNode forDouble(double d, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forDouble(d)));
+    }
+
+    /**
+     * Returns a node for a float constant.
+     * @param f the float value for which to create the instruction
+     * @param graph
+     * @return a node for a float constant
+     */
+    public static ConstantNode forFloat(float f, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forFloat(f)));
+    }
+
+    /**
+     * Returns a node for an long constant.
+     * @param i the long value for which to create the instruction
+     * @param graph
+     * @return a node for an long constant
+     */
+    public static ConstantNode forLong(long i, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forLong(i)));
+    }
+
+    /**
+     * Returns a node for an integer constant.
+     * @param i the integer value for which to create the instruction
+     * @param graph
+     * @return a node for an integer constant
+     */
+    public static ConstantNode forInt(int i, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forInt(i)));
+    }
+
+    /**
+     * Returns a node for a boolean constant.
+     * @param i the boolean value for which to create the instruction
+     * @param graph
+     * @return a node representing the boolean
+     */
+    public static ConstantNode forBoolean(boolean i, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forBoolean(i)));
+    }
+
+    /**
+     * Returns a node for a byte constant.
+     * @param i the byte value for which to create the instruction
+     * @param graph
+     * @return a node representing the byte
+     */
+    public static ConstantNode forByte(byte i, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forByte(i)));
+    }
+
+    /**
+     * Returns a node for a char constant.
+     * @param i the char value for which to create the instruction
+     * @param graph
+     * @return a node representing the char
+     */
+    public static ConstantNode forChar(char i, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forChar(i)));
+    }
+
+    /**
+     * Returns a node for a short constant.
+     * @param i the short value for which to create the instruction
+     * @param graph
+     * @return a node representing the short
+     */
+    public static ConstantNode forShort(short i, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forShort(i)));
+    }
+
+    /**
+     * Returns a node for an address (jsr/ret address) constant.
+     * @param i the address value for which to create the instruction
+     * @param graph
+     * @return a node representing the address
+     */
+    public static ConstantNode forJsr(int i, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forJsr(i)));
+    }
+
+    /**
+     * Returns a node for an object constant.
+     * @param o the object value for which to create the instruction
+     * @param graph
+     * @return a node representing the object
+     */
+    public static ConstantNode forObject(Object o, RiRuntime runtime, Graph graph) {
+        return graph.unique(new ConstantNode(CiConstant.forObject(o), runtime));
+    }
+
+    public static ConstantNode forIntegerKind(CiKind kind, long value, Graph graph) {
+        switch (kind) {
+            case Byte:
+            case Short:
+            case Int:
+                return ConstantNode.forInt((int) value, graph);
+            case Long:
+                return ConstantNode.forLong(value, graph);
+            default:
+                throw new InternalError("Should not reach here");
+        }
+    }
+
+    public static ConstantNode forFloatingKind(CiKind kind, double value, Graph graph) {
+        switch (kind) {
+            case Float:
+                return ConstantNode.forFloat((float) value, graph);
+            case Double:
+                return ConstantNode.forDouble(value, graph);
+            default:
+                throw new InternalError("Should not reach here");
+        }
+    }
+
+    public static ConstantNode defaultForKind(CiKind kind, Graph graph) {
+        switch(kind) {
+            case Boolean:
+                return ConstantNode.forBoolean(false, graph);
+            case Byte:
+            case Char:
+            case Short:
+            case Int:
+                return ConstantNode.forInt(0, graph);
+            case Double:
+                return ConstantNode.forDouble(0.0, graph);
+            case Float:
+                return ConstantNode.forFloat(0.0f, graph);
+            case Long:
+                return ConstantNode.forLong(0L, graph);
+            case Object:
+                return ConstantNode.forObject(null, null, graph);
+            default:
+                return null;
+        }
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Name) {
+            return super.toString(Verbosity.Name) + "(" + value.kind.format(value.boxedValue()) + ")";
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    @Override
+    public BooleanNode negate() {
+        return ConstantNode.forBoolean(!value.asBoolean(), graph());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSplitNode.java	Thu Mar 08 19:24:17 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.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code ControlSplitNode} is a base class for all instructions that split the control flow (ie. have more than one successor).
+ */
+public abstract class ControlSplitNode extends FixedNode {
+
+    @Successor private final NodeSuccessorList<BeginNode> blockSuccessors;
+
+    public BeginNode blockSuccessor(int index) {
+        return blockSuccessors.get(index);
+    }
+
+    public void setBlockSuccessor(int index, BeginNode x) {
+        blockSuccessors.set(index, x);
+    }
+
+    public int blockSuccessorCount() {
+        return blockSuccessors.size();
+    }
+
+    protected final double[] branchProbability;
+
+    public ControlSplitNode(Stamp stamp, BeginNode[] blockSuccessors, double[] branchProbability) {
+        super(stamp);
+        assert branchProbability.length == blockSuccessors.length;
+        this.blockSuccessors = new NodeSuccessorList<>(this, blockSuccessors);
+        this.branchProbability = branchProbability;
+    }
+
+    public double probability(int successorIndex) {
+        return branchProbability[successorIndex];
+    }
+
+    public void setProbability(int successorIndex, double x) {
+        branchProbability[successorIndex] = x;
+    }
+
+    /**
+     * Gets the successor corresponding to the default (fall through) case.
+     * @return the default successor
+     */
+    public FixedNode defaultSuccessor() {
+        return blockSuccessor(blockSuccessorCount() - 1);
+    }
+
+    public Iterable<BeginNode> blockSuccessors() {
+        return new Iterable<BeginNode>() {
+            @Override
+            public Iterator<BeginNode> iterator() {
+                return new Iterator<BeginNode>() {
+                    int i = 0;
+                    @Override
+                    public void remove() {
+                        throw new UnsupportedOperationException();
+                    }
+                    @Override
+                    public BeginNode next() {
+                        return ControlSplitNode.this.blockSuccessor(i++);
+                    }
+
+                    @Override
+                    public boolean hasNext() {
+                        return i < ControlSplitNode.this.blockSuccessorCount();
+                    }
+                };
+            }
+        };
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        StringBuilder str = new StringBuilder();
+        for (int i = 0; i < branchProbability.length; i++) {
+            str.append(i == 0 ? "" : ", ").append(String.format(Locale.ENGLISH, "%7.5f", branchProbability[i]));
+        }
+        properties.put("branchProbability", str.toString());
+        return properties;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+@NodeInfo(shortName = "Deopt")
+public class DeoptimizeNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
+
+    public static enum DeoptAction {
+        None,                           // just interpret, do not invalidate nmethod
+        Recompile,                      // recompile the nmethod; need not invalidate
+        InvalidateReprofile,            // invalidate the nmethod, reset IC, maybe recompile
+        InvalidateRecompile,            // invalidate the nmethod, recompile (probably)
+        InvalidateStopCompiling,        // invalidate the nmethod and do not compile
+    }
+
+    @Data private String message;
+    @Data private final DeoptAction action;
+
+    public DeoptimizeNode() {
+        this(DeoptAction.InvalidateReprofile);
+    }
+
+    public DeoptimizeNode(DeoptAction action) {
+        super(StampFactory.illegal());
+        this.action = action;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public String message() {
+        return message;
+    }
+
+    public DeoptAction action() {
+        return action;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitDeoptimizeOn(null, action, message);
+    }
+
+    @NodeIntrinsic
+    public static void deopt() {
+        throw new UnsupportedOperationException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EndNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class EndNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
+
+    public EndNode() {
+        super(StampFactory.illegal());
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitEndNode(this);
+    }
+
+    public MergeNode merge() {
+        return (MergeNode) usages().first();
+    }
+
+    @Override
+    public boolean verify() {
+        assertTrue(usages().size() <= 1, "at most one usage");
+        return super.verify();
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> debugProperties = super.getDebugProperties();
+        debugProperties.put("shortName", "E");
+        return debugProperties;
+    }
+
+    @Override
+    public Iterable< ? extends Node> cfgSuccessors() {
+        return Arrays.asList(merge());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.cri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public final class FixedGuardNode extends FixedWithNextNode implements Simplifiable, Lowerable, LIRLowerable {
+
+    @Input private final NodeInputList<BooleanNode> conditions;
+
+    public FixedGuardNode(BooleanNode condition) {
+        super(StampFactory.illegal());
+        this.conditions = new NodeInputList<>(this, new BooleanNode[] {condition});
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        for (BooleanNode condition : conditions()) {
+            gen.emitGuardCheck(condition);
+        }
+    }
+
+    public void addCondition(BooleanNode x) {
+        conditions.add(x);
+    }
+
+    public NodeInputList<BooleanNode> conditions() {
+        return conditions;
+    }
+
+    @Override
+    public void simplify(SimplifierTool tool) {
+        for (BooleanNode n : conditions.snapshot()) {
+            if (n instanceof ConstantNode) {
+                ConstantNode c = (ConstantNode) n;
+                if (c.asConstant().asBoolean()) {
+                    conditions.remove(n);
+                } else {
+                    FixedNode next = this.next();
+                    if (next != null) {
+                        tool.deleteBranch(next);
+                    }
+                    setNext(graph().add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
+                    return;
+                }
+            }
+        }
+        if (conditions.isEmpty()) {
+            ((StructuredGraph) graph()).removeFixed(this);
+        }
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        AnchorNode newAnchor = graph().add(new AnchorNode());
+        for (BooleanNode b : conditions) {
+            newAnchor.addGuard((GuardNode) tool.createGuard(b));
+        }
+        ((StructuredGraph) graph()).replaceFixedWithFixed(this, newAnchor);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.nodes.type.*;
+
+public abstract class FixedNode extends ValueNode {
+
+    private double probability;
+
+    public FixedNode(Stamp stamp) {
+        super(stamp);
+    }
+
+    public double probability() {
+        return probability;
+    }
+
+    public void setProbability(double probability) {
+        this.probability = probability;
+    }
+
+    protected void copyInto(FixedNode newNode) {
+        newNode.setProbability(probability);
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("probability", String.format(Locale.ENGLISH, "%7.5f", probability));
+        return properties;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * Base class of all nodes that are fixed within the control flow graph and have an immediate successor.
+ */
+public abstract class FixedWithNextNode extends FixedNode {
+
+    public FixedNode next() {
+        assert scheduledNext() == null || scheduledNext() instanceof FixedNode : "next() cannot be used while the graph is scheduled";
+        return (FixedNode) scheduledNext();
+    }
+
+    public void setNext(FixedNode x) {
+        setScheduledNext(x);
+    }
+
+    public FixedWithNextNode(Stamp stamp) {
+        super(stamp);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.virtual.*;
+
+/**
+ * The {@code FrameState} class encapsulates the frame state (i.e. local variables and
+ * operand stack) at a particular point in the abstract interpretation.
+ */
+public final class FrameState extends Node implements Node.IterableNodeType, LIRLowerable {
+
+    protected final int localsSize;
+
+    protected final int stackSize;
+
+    private boolean rethrowException;
+
+    private boolean duringCall;
+
+    /**
+     * This BCI should be used for frame states that are built for code with no meaningful BCI.
+     */
+    public static final int UNKNOWN_BCI = -4;
+
+    /**
+     * When a node whose frame state has this BCI value is inlined, its frame state
+     * will be replaced with the frame state before the inlined invoke node.
+     */
+    public static final int BEFORE_BCI = -1;
+
+    /**
+     * When a node whose frame state has this BCI value is inlined, its frame state
+     * will be replaced with the frame state {@linkplain Invoke#stateAfter() after}
+     * the inlined invoke node.
+     */
+    public static final int AFTER_BCI = -2;
+
+    /**
+     * When a node whose frame state has this BCI value is inlined, its frame state
+     * will be replaced with the frame state at the exception edge of the inlined
+     * invoke node.
+     */
+    public static final int AFTER_EXCEPTION_BCI = -3;
+
+    @Input private FrameState outerFrameState;
+
+    @Input private final NodeInputList<ValueNode> values;
+
+    @Input private final NodeInputList<Node> virtualObjectMappings;
+
+    /**
+     * The bytecode index to which this frame state applies. This will be {@code -1}
+     * iff this state is mutable.
+     */
+    public final int bci;
+
+    private final RiResolvedMethod method;
+
+    /**
+     * Creates a {@code FrameState} for the given scope and maximum number of stack and local variables.
+     *
+     * @param method the method for this frame state
+     * @param bci the bytecode index of the frame state
+     * @param localsSize number of locals
+     * @param stackSize size of the stack
+     * @param rethrowException if true the VM should re-throw the exception on top of the stack when deopt'ing using this framestate
+     */
+    public FrameState(RiResolvedMethod method, int bci, int localsSize, int stackSize, boolean rethrowException, boolean duringCall) {
+        assert stackSize >= 0;
+        this.method = method;
+        this.bci = bci;
+        this.localsSize = localsSize;
+        this.stackSize = stackSize;
+        this.values = new NodeInputList<>(this, localsSize + stackSize);
+        this.virtualObjectMappings = new NodeInputList<>(this);
+        this.rethrowException = rethrowException;
+        this.duringCall = duringCall;
+        assert !rethrowException || stackSize == 1 : "must have exception on top of the stack";
+    }
+
+    public FrameState(RiResolvedMethod method, int bci, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException, boolean duringCall) {
+        this.method = method;
+        this.bci = bci;
+        this.localsSize = locals.length;
+        this.stackSize = stackSize;
+        final ValueNode[] newValues = new ValueNode[locals.length + stackSize];
+        for (int i = 0; i < locals.length; i++) {
+            assert locals[i] == null || !locals[i].isDeleted();
+            newValues[i] = locals[i];
+        }
+        for (int i = 0; i < stackSize; i++) {
+            assert stack[i] == null || !stack[i].isDeleted();
+            newValues[localsSize + i] = stack[i];
+        }
+        this.values = new NodeInputList<>(this, newValues);
+        this.virtualObjectMappings = new NodeInputList<>(this);
+        this.rethrowException = rethrowException;
+        this.duringCall = duringCall;
+        assert !rethrowException || stackSize == 1 : "must have exception on top of the stack";
+    }
+
+    public NodeIterable<ValueNode> values() {
+        return values;
+    }
+
+    public FrameState outerFrameState() {
+        return outerFrameState;
+    }
+
+    public void setOuterFrameState(FrameState x) {
+        updateUsages(this.outerFrameState, x);
+        this.outerFrameState = x;
+    }
+
+    private void setValueAt(int i, ValueNode x) {
+        values.set(i, x);
+    }
+
+    public boolean rethrowException() {
+        return rethrowException;
+    }
+
+    public boolean duringCall() {
+        return duringCall;
+    }
+
+    public void setDuringCall(boolean b) {
+        this.duringCall = b;
+    }
+
+    public RiResolvedMethod method() {
+        return method;
+    }
+
+    public void addVirtualObjectMapping(Node virtualObject) {
+        assert virtualObject instanceof VirtualObjectFieldNode || virtualObject instanceof PhiNode : virtualObject;
+        virtualObjectMappings.add(virtualObject);
+    }
+
+    public int virtualObjectMappingCount() {
+        return virtualObjectMappings.size();
+    }
+
+    public Node virtualObjectMappingAt(int i) {
+        return virtualObjectMappings.get(i);
+    }
+
+    public Iterable<Node> virtualObjectMappings() {
+        return virtualObjectMappings;
+    }
+
+    /**
+     * Gets a copy of this frame state.
+     */
+    public FrameState duplicate(int newBci) {
+        return duplicate(newBci, false);
+    }
+
+    public FrameState duplicate(int newBci, boolean duplicateOuter) {
+        FrameState other = graph().add(new FrameState(method, newBci, localsSize, stackSize, rethrowException, duringCall));
+        other.values.setAll(values);
+        other.virtualObjectMappings.setAll(virtualObjectMappings);
+        FrameState newOuterFrameState = outerFrameState();
+        if (duplicateOuter && newOuterFrameState != null) {
+            newOuterFrameState = newOuterFrameState.duplicate(newOuterFrameState.bci, duplicateOuter);
+        }
+        other.setOuterFrameState(newOuterFrameState);
+        return other;
+    }
+
+    /**
+     * Creates a copy of this frame state with one stack element of type popKind popped from the stack and the
+     * values in pushedValues pushed on the stack. The pushedValues are expected to be in slot encoding: a long
+     * or double is followed by a null slot.
+     */
+    public FrameState duplicateModified(int newBci, boolean newRethrowException, CiKind popKind, ValueNode... pushedValues) {
+        int popSlots = 0;
+        if (popKind != CiKind.Void) {
+            if (stackAt(stackSize() - 1) == null) {
+                popSlots = 2;
+            } else {
+                popSlots = 1;
+            }
+            assert stackAt(stackSize() - popSlots).kind().stackKind() == popKind.stackKind();
+        }
+
+        int pushSlots = pushedValues.length;
+        FrameState other = graph().add(new FrameState(method, newBci, localsSize, stackSize - popSlots + pushSlots, newRethrowException, false));
+        for (int i = 0; i < localsSize; i++) {
+            other.setValueAt(i, localAt(i));
+        }
+        for (int i = 0; i < stackSize - popSlots; i++) {
+            other.setValueAt(localsSize + i, stackAt(i));
+        }
+        int slot = localsSize + stackSize - popSlots;
+        for (int i = 0; i < pushSlots; i++) {
+            other.setValueAt(slot++, pushedValues[i]);
+        }
+        other.virtualObjectMappings.setAll(virtualObjectMappings);
+        other.setOuterFrameState(outerFrameState());
+        return other;
+    }
+
+    /**
+     * Gets the size of the local variables.
+     */
+    public int localsSize() {
+        return localsSize;
+    }
+
+    /**
+     * Gets the current size (height) of the stack.
+     */
+    public int stackSize() {
+        return stackSize;
+    }
+
+    /**
+     * Gets the value in the local variables at the specified index.
+     *
+     * @param i the index into the locals
+     * @return the instruction that produced the value for the specified local
+     */
+    public ValueNode localAt(int i) {
+        assert i >= 0 && i < localsSize : "local variable index out of range: " + i;
+        return values.get(i);
+    }
+
+    /**
+     * Get the value on the stack at the specified stack index.
+     *
+     * @param i the index into the stack, with {@code 0} being the bottom of the stack
+     * @return the instruction at the specified position in the stack
+     */
+    public ValueNode stackAt(int i) {
+        assert i >= 0 && i < stackSize;
+        return values.get(localsSize + i);
+    }
+
+    public MergeNode block() {
+        return usages().filter(MergeNode.class).first();
+    }
+
+    public NodeIterable<FrameState> innerFrameStates() {
+        return usages().filter(FrameState.class);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // Nothing to do, frame states are processed as part of the handling of AbstractStateSplit nodes.
+    }
+
+    private static String toString(FrameState frameState) {
+        StringBuilder sb = new StringBuilder();
+        String nl = CiUtil.NEW_LINE;
+        FrameState fs = frameState;
+        while (fs != null) {
+            CiUtil.appendLocation(sb, fs.method, fs.bci).append(nl);
+            sb.append("locals: [");
+            for (int i = 0; i < fs.localsSize(); i++) {
+                sb.append(i == 0 ? "" : ", ").append(fs.localAt(i) == null ? "_" : fs.localAt(i).toString(Verbosity.Id));
+            }
+            sb.append("]").append(nl).append("stack: ");
+            for (int i = 0; i < fs.stackSize(); i++) {
+                sb.append(i == 0 ? "" : ", ").append(fs.stackAt(i) == null ? "_" : fs.stackAt(i).toString(Verbosity.Id));
+            }
+            sb.append(nl);
+            fs = fs.outerFrameState();
+        }
+        return sb.toString();
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Debugger) {
+            return toString(this);
+        } else if (verbosity == Verbosity.Name) {
+            return super.toString(Verbosity.Name) + "@" + bci;
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("bci", bci);
+        if (method != null) {
+            properties.put("method", CiUtil.format("%H.%n(%p):%r", method));
+        } else {
+            properties.put("method", "None");
+        }
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < localsSize(); i++) {
+            sb.append(i == 0 ? "" : ", ").append(localAt(i) == null ? "_" : localAt(i).toString(Verbosity.Id));
+        }
+        properties.put("locals", sb.toString());
+        sb = new StringBuilder();
+        for (int i = 0; i < stackSize(); i++) {
+            sb.append(i == 0 ? "" : ", ").append(stackAt(i) == null ? "_" : stackAt(i).toString(Verbosity.Id));
+        }
+        properties.put("stack", sb.toString());
+        properties.put("rethrowException", rethrowException);
+        properties.put("duringCall", duringCall);
+        return properties;
+    }
+
+    @Override
+    public boolean verify() {
+        for (ValueNode value : values) {
+            assert assertTrue(value == null || !value.isDeleted(), "frame state must not contain deleted nodes");
+            assert assertTrue(value == null || value instanceof VirtualObjectNode || (value.kind() != CiKind.Void && value.kind() != CiKind.Illegal), "unexpected value: %s", value);
+        }
+        return super.verify();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public final class GuardNode extends FloatingNode implements Canonicalizable, LIRLowerable {
+
+    @Input private BooleanNode condition;
+    @Input(notDataflow = true) private FixedNode anchor;
+
+    public FixedNode anchor() {
+        return anchor;
+    }
+
+    public void setAnchor(FixedNode x) {
+        updateUsages(anchor, x);
+        anchor = x;
+    }
+
+    /**
+     * The instruction that produces the tested boolean value.
+     */
+    public BooleanNode condition() {
+        return condition;
+    }
+
+    public GuardNode(BooleanNode condition, FixedNode anchor) {
+        super(StampFactory.illegal());
+        this.condition = condition;
+        this.anchor = anchor;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitGuardCheck(condition());
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (condition() instanceof ConstantNode) {
+            ConstantNode c = (ConstantNode) condition();
+            if (c.asConstant().asBoolean()) {
+                this.replaceAtUsages(null);
+                return null;
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code IfNode} represents a branch that can go one of two directions depending on the outcome of a
+ * comparison.
+ */
+public final class IfNode extends ControlSplitNode implements Simplifiable, LIRLowerable {
+    public static final int TRUE_EDGE = 0;
+    public static final int FALSE_EDGE = 1;
+
+    private static final BeginNode[] EMPTY_IF_SUCCESSORS = new BeginNode[] {null, null};
+
+    @Input private BooleanNode compare;
+
+    public BooleanNode compare() {
+        return compare;
+    }
+
+    public IfNode(BooleanNode condition, FixedNode trueSuccessor, FixedNode falseSuccessor, double takenProbability) {
+        super(StampFactory.illegal(), new BeginNode[] {BeginNode.begin(trueSuccessor), BeginNode.begin(falseSuccessor)}, new double[] {takenProbability, 1 - takenProbability});
+        this.compare = condition;
+    }
+
+    public IfNode(BooleanNode condition, double probability) {
+        super(StampFactory.illegal(), EMPTY_IF_SUCCESSORS, new double[] {probability, 1 - probability});
+        this.compare = condition;
+    }
+
+    /**
+     * Gets the true successor.
+     *
+     * @return the true successor
+     */
+    public BeginNode trueSuccessor() {
+        return blockSuccessor(0);
+    }
+
+    /**
+     * Gets the false successor.
+     *
+     * @return the false successor
+     */
+    public BeginNode falseSuccessor() {
+        return blockSuccessor(1);
+    }
+
+    public void setTrueSuccessor(BeginNode node) {
+        setBlockSuccessor(0, node);
+    }
+
+    public void setFalseSuccessor(BeginNode node) {
+        setBlockSuccessor(1, node);
+    }
+
+    /**
+     * Gets the node corresponding to the specified outcome of the branch.
+     *
+     * @param istrue {@code true} if the true successor is requested, {@code false} otherwise
+     * @return the corresponding successor
+     */
+    public BeginNode successor(boolean istrue) {
+        return blockSuccessor(istrue ? 0 : 1);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitIf(this);
+    }
+
+    @Override
+    public boolean verify() {
+        assertTrue(compare() != null, "missing compare");
+        assertTrue(trueSuccessor() != null, "missing trueSuccessor");
+        assertTrue(falseSuccessor() != null, "missing falseSuccessor");
+        return super.verify();
+    }
+
+    @Override
+    public void simplify(SimplifierTool tool) {
+        if (compare() instanceof ConstantNode) {
+            ConstantNode c = (ConstantNode) compare();
+            if (c.asConstant().asBoolean()) {
+                tool.deleteBranch(falseSuccessor());
+                tool.addToWorkList(trueSuccessor());
+                ((StructuredGraph) graph()).removeSplit(this, TRUE_EDGE);
+            } else {
+                tool.deleteBranch(trueSuccessor());
+                tool.addToWorkList(falseSuccessor());
+                ((StructuredGraph) graph()).removeSplit(this, FALSE_EDGE);
+            }
+        } else {
+            if (trueSuccessor().next() instanceof EndNode && falseSuccessor().next() instanceof EndNode) {
+                EndNode trueEnd = (EndNode) trueSuccessor().next();
+                EndNode falseEnd = (EndNode) falseSuccessor().next();
+                MergeNode merge = trueEnd.merge();
+                if (merge == falseEnd.merge() && merge.forwardEndCount() == 2) {
+                    Iterator<PhiNode> phis = merge.phis().iterator();
+                    if (!phis.hasNext()) {
+                        // empty if construct with no phis: remove it
+                        removeEmptyIf(tool);
+                    } else {
+                        PhiNode singlePhi = phis.next();
+                        if (!phis.hasNext()) {
+                            // one phi at the merge of an otherwise empty if construct: try to convert into a MaterializeNode
+                            boolean inverted = trueEnd == merge.forwardEndAt(FALSE_EDGE);
+                            ValueNode trueValue = singlePhi.valueAt(inverted ? 1 : 0);
+                            ValueNode falseValue = singlePhi.valueAt(inverted ? 0 : 1);
+                            if (trueValue.kind() != falseValue.kind()) {
+                                return;
+                            }
+                            if (trueValue.kind() != CiKind.Int && trueValue.kind() != CiKind.Long) {
+                                return;
+                            }
+                            if (trueValue.isConstant() && falseValue.isConstant()) {
+                                MaterializeNode materialize = MaterializeNode.create(compare(), graph(), trueValue, falseValue);
+                                ((StructuredGraph) graph()).replaceFloating(singlePhi, materialize);
+                                removeEmptyIf(tool);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private void removeEmptyIf(SimplifierTool tool) {
+        BeginNode trueSuccessor = trueSuccessor();
+        BeginNode falseSuccessor = falseSuccessor();
+        assert trueSuccessor.next() instanceof EndNode && falseSuccessor.next() instanceof EndNode;
+
+        EndNode trueEnd = (EndNode) trueSuccessor.next();
+        EndNode falseEnd = (EndNode) falseSuccessor.next();
+        assert trueEnd.merge() == falseEnd.merge();
+
+        MergeNode merge = trueEnd.merge();
+        assert merge.usages().isEmpty();
+
+        FixedNode next = merge.next();
+        merge.setNext(null);
+        setTrueSuccessor(null);
+        setFalseSuccessor(null);
+        ((FixedWithNextNode) predecessor()).setNext(next);
+        safeDelete();
+        trueSuccessor.safeDelete();
+        falseSuccessor.safeDelete();
+        merge.safeDelete();
+        trueEnd.safeDelete();
+        falseEnd.safeDelete();
+        tool.addToWorkList(next);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java	Thu Mar 08 19:24:17 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.graal.nodes;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.java.*;
+
+public interface Invoke extends StateSplit {
+
+    FixedNode next();
+
+    void setNext(FixedNode x);
+
+    MethodCallTargetNode callTarget();
+
+    int bci();
+
+    FixedNode node();
+
+    FrameState stateDuring();
+
+    FrameState stateAfter();
+
+    Node predecessor();
+
+    void intrinsify(Node node);
+
+    Graph graph();
+
+    double probability();
+
+    void setProbability(double value);
+
+    boolean useForInlining();
+
+    void setUseForInlining(boolean value);
+
+    boolean megamorph();
+
+    void setMegamorph(boolean megamorph);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.util.*;
+
+/**
+ * The {@code InvokeNode} represents all kinds of method calls.
+ */
+public final class InvokeNode extends AbstractStateSplit implements Node.IterableNodeType, Invoke, LIRLowerable, MemoryCheckpoint  {
+
+    @Input private final MethodCallTargetNode callTarget;
+    @Data private final int bci;
+    // megamorph should only be true when the compiler is sure that the call site is megamorph, and false when in doubt
+    @Data private boolean megamorph;
+    private boolean useForInlining;
+
+    /**
+     * Constructs a new Invoke instruction.
+     *
+     * @param bci the bytecode index of the original invoke (used for debug infos)
+     * @param opcode the opcode of the invoke
+     * @param target the target method being called
+     * @param args the list of instructions producing arguments to the invocation, including the receiver object
+     */
+    public InvokeNode(MethodCallTargetNode callTarget, int bci) {
+        super(callTarget.returnStamp());
+        this.callTarget = callTarget;
+        this.bci = bci;
+        this.megamorph = false;
+        this.useForInlining = true;
+    }
+
+    public MethodCallTargetNode callTarget() {
+        return callTarget;
+    }
+
+    @Override
+    public boolean megamorph() {
+        return megamorph;
+    }
+
+    @Override
+    public void setMegamorph(boolean megamorph) {
+        this.megamorph = megamorph;
+    }
+
+    public boolean useForInlining() {
+        return useForInlining;
+    }
+
+    @Override
+    public void setUseForInlining(boolean value) {
+        this.useForInlining = value;
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> debugProperties = super.getDebugProperties();
+        if (callTarget != null && callTarget.targetMethod() != null) {
+            debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
+        }
+        return debugProperties;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitInvoke(this);
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Long) {
+            return super.toString(Verbosity.Short) + "(bci=" + bci() + ")";
+        } else if (verbosity == Verbosity.Name) {
+            if (callTarget == null || callTarget.targetMethod() == null) {
+                return "Invoke#??Invalid!";
+            }
+            return "Invoke#" + callTarget.targetMethod().name();
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    public int bci() {
+        return bci;
+    }
+
+    @Override
+    public FixedNode node() {
+        return this;
+    }
+
+    @Override
+    public FrameState stateDuring() {
+        FrameState stateAfter = stateAfter();
+        FrameState stateDuring = stateAfter.duplicateModified(bci(), stateAfter.rethrowException(), this.callTarget.targetMethod().signature().returnKind(false));
+        stateDuring.setDuringCall(true);
+        return stateDuring;
+    }
+
+    @Override
+    public void intrinsify(Node node) {
+        MethodCallTargetNode call = callTarget;
+        FrameState stateAfter = stateAfter();
+        if (node instanceof StateSplit) {
+            StateSplit stateSplit = (StateSplit) node;
+            stateSplit.setStateAfter(stateAfter);
+        }
+        if (node == null) {
+            assert kind() == CiKind.Void && usages().isEmpty();
+            ((StructuredGraph) graph()).removeFixed(this);
+        } else {
+            if (node instanceof FixedWithNextNode) {
+                ((StructuredGraph) graph()).replaceFixedWithFixed(this, (FixedWithNextNode) node);
+            } else if (node instanceof DeoptimizeNode) {
+                this.replaceAtPredecessors(node);
+                this.replaceAtUsages(null);
+                GraphUtil.killCFG(this);
+                return;
+            } else {
+                ((StructuredGraph) graph()).replaceFixed(this, node);
+            }
+        }
+        call.safeDelete();
+        if (stateAfter.usages().isEmpty()) {
+            stateAfter.safeDelete();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.util.*;
+
+public class InvokeWithExceptionNode extends ControlSplitNode implements Node.IterableNodeType, Invoke, MemoryCheckpoint, LIRLowerable {
+    public static final int NORMAL_EDGE = 0;
+    public static final int EXCEPTION_EDGE = 1;
+
+    @Input private final MethodCallTargetNode callTarget;
+    @Input private FrameState stateAfter;
+    @Data private final int bci;
+    // megamorph should only be true when the compiler is sure that the call site is megamorph, and false when in doubt
+    @Data private boolean megamorph;
+    private boolean useForInlining;
+
+    /**
+     * @param kind
+     * @param blockSuccessors
+     * @param branchProbability
+     */
+    public InvokeWithExceptionNode(MethodCallTargetNode callTarget, BeginNode exceptionEdge, int bci) {
+        super(callTarget.returnStamp(), new BeginNode[]{null, exceptionEdge}, new double[]{1.0, 0.0});
+        this.bci = bci;
+        this.callTarget = callTarget;
+        this.megamorph = true;
+        this.useForInlining = true;
+    }
+
+    public BeginNode exceptionEdge() {
+        return blockSuccessor(EXCEPTION_EDGE);
+    }
+
+    public void setExceptionEdge(BeginNode x) {
+        setBlockSuccessor(EXCEPTION_EDGE, x);
+    }
+
+    public BeginNode next() {
+        return blockSuccessor(NORMAL_EDGE);
+    }
+
+    public void setNext(BeginNode x) {
+        setBlockSuccessor(NORMAL_EDGE, x);
+    }
+
+    public MethodCallTargetNode callTarget() {
+        return callTarget;
+    }
+
+    @Override
+    public boolean megamorph() {
+        return megamorph;
+    }
+
+    @Override
+    public void setMegamorph(boolean megamorph) {
+        this.megamorph = megamorph;
+    }
+
+    @Override
+    public boolean useForInlining() {
+        return useForInlining;
+    }
+
+    @Override
+    public void setUseForInlining(boolean value) {
+        this.useForInlining = value;
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Long) {
+            return super.toString(Verbosity.Short) + "(bci=" + bci() + ")";
+        } else if (verbosity == Verbosity.Name) {
+            return "Invoke!#" + callTarget.targetMethod().name();
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    public int bci() {
+        return bci;
+    }
+
+    @Override
+    public FixedNode node() {
+        return this;
+    }
+
+    @Override
+    public void setNext(FixedNode x) {
+        if (x != null) {
+            this.setNext(BeginNode.begin(x));
+        } else {
+            this.setNext(null);
+        }
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitInvoke(this);
+    }
+
+    public FrameState stateAfter() {
+        return stateAfter;
+    }
+
+    public void setStateAfter(FrameState stateAfter) {
+        updateUsages(this.stateAfter, stateAfter);
+        this.stateAfter = stateAfter;
+    }
+
+    public FrameState stateDuring() {
+        FrameState tempStateAfter = stateAfter();
+        FrameState stateDuring = tempStateAfter.duplicateModified(bci(), tempStateAfter.rethrowException(), this.callTarget.targetMethod().signature().returnKind(false));
+        stateDuring.setDuringCall(true);
+        return stateDuring;
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> debugProperties = super.getDebugProperties();
+        debugProperties.put("memoryCheckpoint", "true");
+        if (callTarget != null && callTarget.targetMethod() != null) {
+            debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
+        }
+        return debugProperties;
+    }
+
+    public void killExceptionEdge() {
+        BeginNode exceptionEdge = exceptionEdge();
+        setExceptionEdge(null);
+        GraphUtil.killCFG(exceptionEdge);
+    }
+
+    @Override
+    public boolean needsStateAfter() {
+        return true;
+    }
+
+    @Override
+    public void intrinsify(Node node) {
+        MethodCallTargetNode call = callTarget;
+        FrameState state = stateAfter();
+        killExceptionEdge();
+        if (node instanceof StateSplit) {
+            StateSplit stateSplit = (StateSplit) node;
+            stateSplit.setStateAfter(state);
+        }
+        if (node == null) {
+            assert kind() == CiKind.Void && usages().isEmpty();
+            ((StructuredGraph) graph()).removeSplit(this, NORMAL_EDGE);
+        } else {
+            ((StructuredGraph) graph()).replaceSplit(this, node, NORMAL_EDGE);
+        }
+        call.safeDelete();
+        if (state.usages().isEmpty()) {
+            state.safeDelete();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LocalNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code Local} instruction is a placeholder for an incoming argument
+ * to a function call.
+ */
+
+public final class LocalNode extends FloatingNode implements Node.IterableNodeType {
+
+    @Data private final int index;
+
+    public LocalNode(CiKind kind, int index) {
+        this(index, StampFactory.forKind(kind));
+    }
+
+    public LocalNode(int index, Stamp stamp) {
+        super(stamp);
+        this.index = index;
+    }
+
+    /**
+     * Gets the index of this local in the array of parameters. This is NOT the JVM local index.
+     * @return the index
+     */
+    public int index() {
+        return index;
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Name) {
+            return super.toString(Verbosity.Name) + "(" + index + ")";
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public class LoopBeginNode extends MergeNode implements Node.IterableNodeType, LIRLowerable {
+    private double loopFrequency;
+    private int nextEndIndex;
+
+    public LoopBeginNode() {
+        loopFrequency = 1;
+    }
+
+    public double loopFrequency() {
+        return loopFrequency;
+    }
+
+    public void setLoopFrequency(double loopFrequency) {
+        this.loopFrequency = loopFrequency;
+    }
+
+    public NodeIterable<LoopEndNode> loopEnds() {
+        return usages().filter(LoopEndNode.class);
+    }
+
+    public List<LoopEndNode> orderedLoopEnds() {
+        List<LoopEndNode> snapshot = usages().filter(LoopEndNode.class).snapshot();
+        Collections.sort(snapshot, new Comparator<LoopEndNode>() {
+            @Override
+            public int compare(LoopEndNode o1, LoopEndNode o2) {
+                return o1.endIndex() - o2.endIndex();
+            }
+        });
+        return snapshot;
+    }
+
+    public EndNode forwardEnd() {
+        assert forwardEndCount() == 1;
+        return forwardEndAt(0);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // Nothing to emit, since this is node is used for structural purposes only.
+    }
+
+    @Override
+    protected void deleteEnd(EndNode end) {
+        if (end instanceof LoopEndNode) {
+            LoopEndNode loopEnd = (LoopEndNode) end;
+            loopEnd.setLoopBegin(null);
+            int idx = loopEnd.endIndex();
+            for (LoopEndNode le : loopEnds()) {
+                int leIdx = le.endIndex();
+                assert leIdx != idx;
+                if (leIdx > idx) {
+                    le.setEndIndex(leIdx - 1);
+                }
+            }
+            nextEndIndex--;
+        } else {
+            super.deleteEnd(end);
+        }
+    }
+
+    @Override
+    public int phiPredecessorCount() {
+        return forwardEndCount() + loopEnds().count();
+    }
+
+    @Override
+    public int phiPredecessorIndex(EndNode pred) {
+        if (pred instanceof LoopEndNode) {
+            LoopEndNode loopEnd = (LoopEndNode) pred;
+            if (loopEnd.loopBegin() == this) {
+                assert loopEnd.endIndex() < loopEnds().count() : "Invalid endIndex : " + loopEnd;
+                return loopEnd.endIndex() + forwardEndCount();
+            }
+        } else {
+            return super.forwardEndIndex(pred);
+        }
+        throw ValueUtil.shouldNotReachHere("unknown pred : " + pred);
+    }
+
+    @Override
+    public EndNode phiPredecessorAt(int index) {
+        if (index < forwardEndCount()) {
+            return forwardEndAt(index);
+        }
+        for (LoopEndNode end : loopEnds()) {
+            int idx = index - forwardEndCount();
+            assert idx >= 0;
+            if (end.endIndex() == idx) {
+                return end;
+            }
+        }
+        throw ValueUtil.shouldNotReachHere();
+    }
+
+    @Override
+    public boolean verify() {
+        assertTrue(loopEnds().isNotEmpty(), "missing loopEnd");
+        return super.verify();
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("loopFrequency", String.format("%7.1f", loopFrequency));
+        return properties;
+    }
+
+    public int nextEndIndex() {
+        return nextEndIndex++;
+    }
+
+    @Override
+    public void simplify(SimplifierTool tool) {
+        // nothing yet
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopEndNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public final class LoopEndNode extends EndNode {
+
+    @Input(notDataflow = true) private LoopBeginNode loopBegin;
+    @Data private boolean safepointPolling;
+    @Data private int endIndex;
+
+    public LoopEndNode(LoopBeginNode begin) {
+        int idx = begin.nextEndIndex();
+        assert idx >= 0;
+        this.safepointPolling = true;
+        this.endIndex = idx;
+        this.loopBegin = begin;
+    }
+
+    @Override
+    public MergeNode merge() {
+        return loopBegin();
+    }
+
+    public LoopBeginNode loopBegin() {
+        return loopBegin;
+    }
+
+    public void setLoopBegin(LoopBeginNode x) {
+        updateUsages(this.loopBegin, x);
+        this.loopBegin = x;
+    }
+
+
+    public void setSafepointPolling(boolean safePointPolling) {
+        this.safepointPolling = safePointPolling;
+    }
+
+    public boolean hasSafepointPolling() {
+        return safepointPolling;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitLoopEnd(this);
+        super.generate(gen);
+    }
+
+    @Override
+    public boolean verify() {
+        assertTrue(loopBegin != null, "must have a loop begin");
+        assertTrue(usages().count() == 0, "LoopEnds can not be used");
+        return super.verify();
+    }
+
+    public int endIndex() {
+        return endIndex;
+    }
+
+    public void setEndIndex(int idx) {
+        this.endIndex = idx;
+    }
+
+    @Override
+    public Iterable< ? extends Node> cfgSuccessors() {
+        return Collections.emptyList();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.calc.*;
+
+public final class MaterializeNode extends ConditionalNode {
+
+    private MaterializeNode(BooleanNode condition, ValueNode trueValue, ValueNode falseValue) {
+        super(condition, trueValue, falseValue);
+    }
+
+    public static MaterializeNode create(BooleanNode condition, Graph graph, ValueNode trueValue, ValueNode falseValue) {
+        MaterializeNode result = new MaterializeNode(condition, trueValue, falseValue);
+        return graph.unique(result);
+
+    }
+
+    public static MaterializeNode create(BooleanNode condition, Graph graph) {
+        return create(condition, graph, ConstantNode.forInt(1, graph), ConstantNode.forInt(0, graph));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.spi.*;
+
+/**
+ * Denotes the merging of multiple control-flow paths.
+ */
+public class MergeNode extends BeginNode implements Node.IterableNodeType, LIRLowerable {
+
+    @Input(notDataflow = true) private final NodeInputList<EndNode> ends = new NodeInputList<>(this);
+
+    @Override
+    public boolean needsStateAfter() {
+        return false;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitMerge(this);
+    }
+
+    public int forwardEndIndex(EndNode end) {
+        return ends.indexOf(end);
+    }
+
+    public void addForwardEnd(EndNode end) {
+        ends.add(end);
+    }
+
+    public int forwardEndCount() {
+        return ends.size();
+    }
+
+    public EndNode forwardEndAt(int index) {
+        return ends.get(index);
+    }
+
+    @Override
+    public NodeIterable<EndNode> cfgPredecessors() {
+        return ends;
+    }
+
+    /**
+     * Determines if a given node is a phi whose {@linkplain PhiNode#merge() merge} is this node.
+     *
+     * @param value the instruction to test
+     * @return {@code true} if {@code value} is a phi and its merge is {@code this}
+     */
+    public boolean isPhiAtMerge(Node value) {
+        return value instanceof PhiNode && ((PhiNode) value).merge() == this;
+    }
+
+    /**
+     * Removes the given end from the merge, along with the entries corresponding to this end in the phis connected to the merge.
+     * @param pred the end to remove
+     */
+    public void removeEnd(EndNode pred) {
+        int predIndex = phiPredecessorIndex(pred);
+        assert predIndex != -1;
+        deleteEnd(pred);
+        for (PhiNode phi : phis()) {
+            phi.removeInput(predIndex);
+        }
+    }
+
+    protected void deleteEnd(EndNode end) {
+        ends.remove(end);
+    }
+
+    public void clearEnds() {
+        ends.clear();
+    }
+
+    public NodeIterable<EndNode> forwardEnds() {
+        return ends;
+    }
+
+    public int phiPredecessorCount() {
+        return forwardEndCount();
+    }
+
+    public int phiPredecessorIndex(EndNode pred) {
+        return forwardEndIndex(pred);
+    }
+
+    public EndNode phiPredecessorAt(int index) {
+        return forwardEndAt(index);
+    }
+
+    public NodeIterable<PhiNode> phis() {
+        return this.usages().filter(PhiNode.class);
+    }
+
+    @Override
+    public void simplify(SimplifierTool tool) {
+        FixedNode next = next();
+        if (next instanceof LoopEndNode) {
+            LoopEndNode origLoopEnd = (LoopEndNode) next;
+            LoopBeginNode begin = origLoopEnd.loopBegin();
+            for (PhiNode phi : phis()) {
+                for (Node usage : phi.usages().filter(isNotA(FrameState.class))) {
+                    if (!begin.isPhiAtMerge(usage)) {
+                        return;
+                    }
+                }
+            }
+            Debug.log("Split %s into loop ends for %s", this, begin);
+            int numEnds = this.forwardEndCount();
+            StructuredGraph graph = (StructuredGraph) graph();
+            for (int i = 0; i < numEnds - 1; i++) {
+                EndNode end = forwardEndAt(numEnds - 1 - i);
+                LoopEndNode loopEnd = graph.add(new LoopEndNode(begin));
+                for (PhiNode phi : begin.phis()) {
+                    ValueNode v = phi.valueAt(origLoopEnd);
+                    ValueNode newInput;
+                    if (isPhiAtMerge(v)) {
+                        PhiNode endPhi = (PhiNode) v;
+                        newInput = endPhi.valueAt(end);
+                    } else {
+                        newInput = v;
+                    }
+                    phi.addInput(newInput);
+                }
+                this.removeEnd(end);
+                end.replaceAtPredecessors(loopEnd);
+                end.safeDelete();
+                tool.addToWorkList(loopEnd.predecessor());
+            }
+            graph.reduceTrivialMerge(this);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code PhiNode} represents the merging of dataflow in the graph. It refers to a merge
+ * and a variable.
+ */
+public final class PhiNode extends FloatingNode implements Canonicalizable, Node.IterableNodeType {
+
+    @Input(notDataflow = true) private MergeNode merge;
+
+    @Input private final NodeInputList<ValueNode> values = new NodeInputList<>(this);
+
+    public MergeNode merge() {
+        return merge;
+    }
+
+    public static enum PhiType {
+        Value, // normal value phis
+        Memory, // memory phis
+        Virtual // phis used for VirtualObjectField merges
+    }
+
+    private final PhiType type;
+
+    public PhiNode(CiKind kind, MergeNode merge, PhiType type) {
+        super(StampFactory.forKind(kind));
+        this.type = type;
+        this.merge = merge;
+    }
+
+    public PhiType type() {
+        return type;
+    }
+
+    public NodeInputList<ValueNode> values() {
+        return values;
+    }
+
+    public boolean inferStamp() {
+        Stamp newStamp = StampFactory.or(values());
+        if (stamp().equals(newStamp)) {
+            return false;
+        } else {
+            setStamp(newStamp);
+            return true;
+        }
+    }
+
+    @Override
+    public boolean verify() {
+        assertTrue(merge() != null, "missing merge");
+        assertTrue(merge().phiPredecessorCount() == valueCount(), "mismatch between merge predecessor count and phi value count: %d != %d", merge().phiPredecessorCount(), valueCount());
+        if (type == PhiType.Value) {
+            for (ValueNode v : values()) {
+                assertTrue(v.kind() == kind(), "all phi values must have same kind");
+            }
+        }
+        return super.verify();
+    }
+
+    /**
+     * Get the instruction that produces the value associated with the i'th predecessor of the merge.
+     *
+     * @param i the index of the predecessor
+     * @return the instruction that produced the value in the i'th predecessor
+     */
+    public ValueNode valueAt(int i) {
+        return values.get(i);
+    }
+
+    public void setValueAt(int i, ValueNode x) {
+        values.set(i, x);
+    }
+
+    public ValueNode valueAt(EndNode pred) {
+        return valueAt(merge().phiPredecessorIndex(pred));
+    }
+
+    /**
+     * Get the number of inputs to this phi (i.e. the number of predecessors to the merge).
+     *
+     * @return the number of inputs in this phi
+     */
+    public int valueCount() {
+        return values.size();
+    }
+
+    public void clearValues() {
+        values.clear();
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Name) {
+            StringBuilder str = new StringBuilder();
+            for (int i = 0; i < valueCount(); ++i) {
+                if (i != 0) {
+                    str.append(' ');
+                }
+                str.append(valueAt(i) == null ? "-" : valueAt(i).toString(Verbosity.Id));
+            }
+            if (type == PhiType.Value) {
+                return super.toString(Verbosity.Name) + "(" + str + ")";
+            } else {
+                return type + super.toString(Verbosity.Name) + "(" + str + ")";
+            }
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    public void addInput(ValueNode x) {
+        values.add(x);
+    }
+
+    public void removeInput(int index) {
+        values.remove(index);
+    }
+
+    public ValueNode singleValue() {
+        ValueNode differentValue = null;
+        for (ValueNode n : values()) {
+            if (n != this) {
+                if (differentValue == null) {
+                    differentValue = n;
+                } else if (differentValue != n) {
+                    return null;
+                }
+            }
+        }
+        return differentValue;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        ValueNode singleValue = singleValue();
+
+        if (singleValue != null) {
+            return singleValue;
+        }
+
+        return this;
+    }
+
+    public ValueNode firstValue() {
+        return valueAt(0);
+    }
+
+    public boolean isLoopPhi() {
+        return merge() instanceof LoopBeginNode;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+
+public class PiNode extends FloatingNode implements LIRLowerable {
+
+    @Input private ValueNode value;
+    @Input private BeginNode anchor;
+
+    public ValueNode value() {
+        return value;
+    }
+
+    public BeginNode anchor() {
+        return anchor;
+    }
+
+    public PiNode(ValueNode value, BeginNode anchor, Stamp stamp) {
+        super(stamp);
+        this.value = value;
+        this.anchor = anchor;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        generator.setResult(this, generator.operand(value));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ReturnNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public final class ReturnNode extends FixedNode implements LIRLowerable, Node.IterableNodeType {
+
+    @Input private ValueNode result;
+
+    public ValueNode result() {
+        return result;
+    }
+
+    /**
+     * Constructs a new Return instruction.
+     * @param result the instruction producing the result for this return; {@code null} if this is a void return
+     */
+    public ReturnNode(ValueNode result) {
+        super(StampFactory.forKind(result == null ? CiKind.Void : result.kind()));
+        this.result = result;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitReturn(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ScheduledNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.graph.*;
+
+public class ScheduledNode extends Node {
+
+    @Successor private ScheduledNode scheduledNext; // the immediate successor of the current node
+
+    public ScheduledNode scheduledNext() {
+        return scheduledNext;
+    }
+
+    public void setScheduledNext(ScheduledNode x) {
+        updatePredecessors(scheduledNext, x);
+        scheduledNext = x;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+public interface StateSplit {
+
+    /**
+     * Gets the state of the JVM frame after execution of this node.
+     */
+    FrameState stateAfter();
+
+    /**
+     * Sets the state of the JVM frame after execution of this node.
+     */
+    void setStateAfter(FrameState x);
+
+    /**
+     * Determines if the caller should create an {@link #stateAfter() after}
+     * frame state for this node if it doesn't already have one.
+     */
+    boolean needsStateAfter();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.util.*;
+
+
+/**
+ * A graph that contains at least one distinguished node : the {@link #start() start} node.
+ * This node is the start of the control flow of the graph.
+ */
+public class StructuredGraph extends Graph {
+    private final BeginNode start;
+    private final RiResolvedMethod method;
+
+    /**
+     * Creates a new Graph containing a single {@link BeginNode} as the {@link #start() start} node.
+     */
+    public StructuredGraph(String name) {
+        this(name, null);
+    }
+
+    public StructuredGraph(String name, RiResolvedMethod method) {
+        super(name);
+        this.start = add(new BeginNode());
+        this.method = method;
+    }
+
+    /**
+     * Creates a new Graph containing a single {@link BeginNode} as the {@link #start() start} node.
+     */
+    public StructuredGraph() {
+        this((String) null);
+    }
+
+    public StructuredGraph(RiResolvedMethod method) {
+        this(null, method);
+    }
+
+    public BeginNode start() {
+        return start;
+    }
+
+    public RiResolvedMethod method() {
+        return method;
+    }
+
+    @Override
+    public StructuredGraph copy() {
+        return copy(name);
+    }
+
+    @Override
+    public StructuredGraph copy(String newName) {
+        StructuredGraph copy = new StructuredGraph(newName);
+        HashMap<Node, Node> replacements = new HashMap<>();
+        replacements.put(start, copy.start);
+        copy.addDuplicates(getNodes(), replacements);
+        return copy;
+    }
+
+    public LocalNode getLocal(int index) {
+        for (LocalNode local : getNodes(LocalNode.class)) {
+            if (local.index() == index) {
+                return local;
+            }
+        }
+        return null;
+    }
+
+    public Iterable<Invoke> getInvokes() {
+        final Iterator<MethodCallTargetNode> callTargets = getNodes(MethodCallTargetNode.class).iterator();
+        return new Iterable<Invoke>() {
+            private Invoke next;
+
+            @Override
+            public Iterator<Invoke> iterator() {
+                return new Iterator<Invoke>() {
+
+                    @Override
+                    public boolean hasNext() {
+                        if (next == null) {
+                            while (callTargets.hasNext()) {
+                                Invoke i = callTargets.next().invoke();
+                                if (i != null) {
+                                    next = i;
+                                    return true;
+                                }
+                            }
+                            return false;
+                        } else {
+                            return true;
+                        }
+                    }
+
+                    @Override
+                    public Invoke next() {
+                        try {
+                            return next;
+                        } finally {
+                            next = null;
+                        }
+                    }
+
+                    @Override
+                    public void remove() {
+                        throw new UnsupportedOperationException();
+                    }
+                };
+            }
+        };
+    }
+
+    public boolean hasLoops() {
+        return getNodes(LoopBeginNode.class).iterator().hasNext();
+    }
+
+    public void removeFloating(FloatingNode node) {
+        assert node != null && node.isAlive() : "cannot remove " + node;
+        node.safeDelete();
+    }
+
+    public void replaceFloating(FloatingNode node, ValueNode replacement) {
+        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
+        node.replaceAtUsages(replacement);
+        node.safeDelete();
+    }
+
+    public void removeFixed(FixedWithNextNode node) {
+        assert node != null;
+        assert node.usages().isEmpty() : node + " " + node.usages();
+        FixedNode next = node.next();
+        node.setNext(null);
+        node.replaceAtPredecessors(next);
+        node.safeDelete();
+    }
+
+    public void replaceFixed(FixedWithNextNode node, Node replacement) {
+        if (replacement instanceof FixedWithNextNode) {
+            replaceFixedWithFixed(node, (FixedWithNextNode) replacement);
+        } else {
+            assert replacement != null : "cannot replace " + node + " with null";
+            assert replacement instanceof FloatingNode : "cannot replace " + node + " with " + replacement;
+            replaceFixedWithFloating(node, (FloatingNode) replacement);
+        }
+    }
+
+    public void replaceFixedWithFixed(FixedWithNextNode node, FixedWithNextNode replacement) {
+        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
+        replacement.setProbability(node.probability());
+        FixedNode next = node.next();
+        node.setNext(null);
+        replacement.setNext(next);
+        node.replaceAndDelete(replacement);
+    }
+
+    public void replaceFixedWithFloating(FixedWithNextNode node, FloatingNode replacement) {
+        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
+        FixedNode next = node.next();
+        node.setNext(null);
+        node.replaceAtPredecessors(next);
+        node.replaceAtUsages(replacement);
+        node.safeDelete();
+    }
+
+    public void removeSplit(ControlSplitNode node, int survivingSuccessor) {
+        assert node != null;
+        assert node.usages().isEmpty();
+        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
+        BeginNode begin = node.blockSuccessor(survivingSuccessor);
+        begin.evacuateGuards();
+        FixedNode next = begin.next();
+        begin.setNext(null);
+        for (int i = 0; i < node.blockSuccessorCount(); i++) {
+            node.setBlockSuccessor(i, null);
+        }
+        node.replaceAtPredecessors(next);
+        node.safeDelete();
+        begin.safeDelete();
+    }
+
+    public void removeSplitPropagate(ControlSplitNode node, int survivingSuccessor) {
+        assert node != null;
+        assert node.usages().isEmpty();
+        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
+        BeginNode begin = node.blockSuccessor(survivingSuccessor);
+        begin.evacuateGuards();
+        FixedNode next = begin.next();
+        begin.setNext(null);
+        for (int i = 0; i < node.blockSuccessorCount(); i++) {
+            BeginNode successor = node.blockSuccessor(i);
+            node.setBlockSuccessor(i, null);
+            if (successor != begin && successor.isAlive()) {
+                GraphUtil.killCFG(successor);
+            }
+        }
+        if (next.isAlive()) {
+            node.replaceAtPredecessors(next);
+            node.safeDelete();
+            begin.safeDelete();
+        } else {
+            assert node.isDeleted();
+        }
+    }
+
+    public void replaceSplit(ControlSplitNode node, Node replacement, int survivingSuccessor) {
+        if (replacement instanceof FixedWithNextNode) {
+            replaceSplitWithFixed(node, (FixedWithNextNode) replacement, survivingSuccessor);
+        } else {
+            assert replacement != null : "cannot replace " + node + " with null";
+            assert replacement instanceof FloatingNode : "cannot replace " + node + " with " + replacement;
+            replaceSplitWithFloating(node, (FloatingNode) replacement, survivingSuccessor);
+        }
+    }
+
+    public void replaceSplitWithFixed(ControlSplitNode node, FixedWithNextNode replacement, int survivingSuccessor) {
+        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
+        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
+        BeginNode begin = node.blockSuccessor(survivingSuccessor);
+        begin.evacuateGuards();
+        FixedNode next = begin.next();
+        begin.setNext(null);
+        for (int i = 0; i < node.blockSuccessorCount(); i++) {
+            node.setBlockSuccessor(i, null);
+        }
+        replacement.setNext(next);
+        node.replaceAndDelete(replacement);
+        begin.safeDelete();
+    }
+
+    public void replaceSplitWithFloating(ControlSplitNode node, FloatingNode replacement, int survivingSuccessor) {
+        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
+        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
+        BeginNode begin = node.blockSuccessor(survivingSuccessor);
+        begin.evacuateGuards();
+        FixedNode next = begin.next();
+        begin.setNext(null);
+        for (int i = 0; i < node.blockSuccessorCount(); i++) {
+            node.setBlockSuccessor(i, null);
+        }
+        node.replaceAtPredecessors(next);
+        node.replaceAtUsages(replacement);
+        node.safeDelete();
+        begin.safeDelete();
+    }
+
+    public void addAfterFixed(FixedWithNextNode node, FixedWithNextNode newNode) {
+        assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " after " + node;
+        assert newNode.next() == null;
+        newNode.setProbability(node.probability());
+        FixedNode next = node.next();
+        node.setNext(newNode);
+        newNode.setNext(next);
+    }
+
+    public void addBeforeFixed(FixedNode node, FixedWithNextNode newNode) {
+        assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " before " + node;
+        assert node.predecessor() != null && node.predecessor() instanceof FixedWithNextNode : "cannot add " + newNode + " before " + node;
+        assert newNode.next() == null;
+        newNode.setProbability(node.probability());
+        FixedWithNextNode pred = (FixedWithNextNode) node.predecessor();
+        pred.setNext(newNode);
+        newNode.setNext(node);
+    }
+
+    public void reduceDegenerateLoopBegin(LoopBeginNode begin) {
+        assert begin.loopEnds().isEmpty() : "Loop begin still has backedges";
+        if (begin.forwardEndCount() == 1) { // bypass merge and remove
+            reduceTrivialMerge(begin);
+        } else { // convert to merge
+            MergeNode merge = this.add(new MergeNode());
+            this.replaceFixedWithFixed(begin, merge);
+        }
+    }
+
+    public void reduceTrivialMerge(MergeNode merge) {
+        assert merge.forwardEndCount() == 1;
+        assert !(merge instanceof LoopBeginNode) || ((LoopBeginNode) merge).loopEnds().isEmpty();
+        for (PhiNode phi : merge.phis().snapshot()) {
+            assert phi.valueCount() == 1;
+            ValueNode singleValue = phi.valueAt(0);
+            phi.replaceAtUsages(singleValue);
+            phi.safeDelete();
+        }
+        EndNode singleEnd = merge.forwardEndAt(0);
+        FixedNode sux = merge.next();
+        FrameState stateAfter = merge.stateAfter();
+        // evacuateGuards
+        Node prevBegin = singleEnd.predecessor();
+        assert prevBegin != null;
+        while (!(prevBegin instanceof BeginNode)) {
+            prevBegin = prevBegin.predecessor();
+        }
+        merge.replaceAtUsages(prevBegin);
+
+        merge.safeDelete();
+        if (stateAfter != null && stateAfter.usages().isEmpty()) {
+            stateAfter.safeDelete();
+        }
+        if (sux == null) {
+            singleEnd.replaceAtPredecessors(null);
+            singleEnd.safeDelete();
+        } else {
+            singleEnd.replaceAndDelete(sux);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * Unwind takes an exception object, destroys the current stack frame and passes the exception object to the system's exception dispatch code.
+ */
+public final class UnwindNode extends FixedNode implements LIRLowerable, Node.IterableNodeType {
+
+    @Input private ValueNode exception;
+
+    public ValueNode exception() {
+        return exception;
+    }
+
+    public UnwindNode(ValueNode exception) {
+        super(StampFactory.forKind(CiKind.Object));
+        assert exception == null || exception.kind() == CiKind.Object;
+        this.exception = exception;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitCallToRuntime(CiRuntimeCall.UnwindException, false, gen.operand(exception()));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java	Thu Mar 08 19:24:17 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.graal.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * This class represents a value within the graph, including local variables, phis, and
+ * all other instructions.
+ */
+public abstract class ValueNode extends ScheduledNode implements StampProvider {
+
+    /**
+     * The kind of this value. This is {@link CiKind#Void} for instructions that produce no value.
+     * This kind is guaranteed to be a {@linkplain CiKind#stackKind() stack kind}.
+     */
+    @Data private Stamp stamp;
+
+    /**
+     * Creates a new value with the specified kind.
+     * @param kind the type of this value
+     * @param inputCount
+     * @param successorCount
+     * @param graph
+     */
+    public ValueNode(Stamp stamp) {
+        this.stamp = stamp;
+        assert kind() != null && kind() == kind().stackKind() : kind() + " != " + kind().stackKind();
+    }
+
+    public Stamp stamp() {
+        return stamp;
+    }
+
+    public void setStamp(Stamp stamp) {
+        this.stamp = stamp;
+    }
+
+    public CiKind kind() {
+        return stamp.kind();
+    }
+
+    /**
+     * Checks whether this value is a constant (i.e. it is of type {@link ConstantNode}.
+     * @return {@code true} if this value is a constant
+     */
+    public final boolean isConstant() {
+        return this instanceof ConstantNode;
+    }
+
+    /**
+     * Checks whether this value represents the null constant.
+     * @return {@code true} if this value represents the null constant
+     */
+    public final boolean isNullConstant() {
+        return this instanceof ConstantNode && ((ConstantNode) this).value.isNull();
+    }
+
+    /**
+     * Convert this value to a constant if it is a constant, otherwise return null.
+     * @return the {@link CiConstant} represented by this value if it is a constant; {@code null}
+     * otherwise
+     */
+    public final CiConstant asConstant() {
+        if (this instanceof ConstantNode) {
+            return ((ConstantNode) this).value;
+        }
+        return null;
+    }
+
+    /**
+     * Computes the exact type of the result of this node, if possible.
+     * @return the exact type of the result of this node, if it is known; {@code null} otherwise
+     */
+    public final RiResolvedType exactType() {
+        return stamp.exactType();
+    }
+
+    /**
+     * Computes the declared type of the result of this node, if possible.
+     * @return the declared type of the result of this node, if it is known; {@code null} otherwise
+     */
+    public final RiResolvedType declaredType() {
+        return stamp.declaredType();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueUtil.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.Verbosity;
+
+
+public class ValueUtil {
+
+    public static ValueNode assertKind(CiKind kind, ValueNode x) {
+        assert x != null && ((x.kind() == kind) || (x.kind() == CiKind.Jsr && kind == CiKind.Object)) : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.kind());
+        return x;
+    }
+
+    public static RuntimeException shouldNotReachHere(String msg) {
+        throw new InternalError("should not reach here: " + msg);
+    }
+
+    public static RuntimeException shouldNotReachHere() {
+        throw new InternalError("should not reach here");
+    }
+
+    public static ValueNode assertLong(ValueNode x) {
+        assert x != null && (x.kind() == CiKind.Long);
+        return x;
+    }
+
+    public static ValueNode assertJsr(ValueNode x) {
+        assert x != null && (x.kind() == CiKind.Jsr);
+        return x;
+    }
+
+    public static ValueNode assertInt(ValueNode x) {
+        assert x != null && (x.kind() == CiKind.Int);
+        return x;
+    }
+
+    public static ValueNode assertFloat(ValueNode x) {
+        assert x != null && (x.kind() == CiKind.Float);
+        return x;
+    }
+
+    public static ValueNode assertObject(ValueNode x) {
+        assert x != null && (x.kind() == CiKind.Object);
+        return x;
+    }
+
+    public static ValueNode assertDouble(ValueNode x) {
+        assert x != null && (x.kind() == CiKind.Double);
+        return x;
+    }
+
+    public static void assertHigh(ValueNode x) {
+        assert x == null;
+    }
+
+    public static boolean typeMismatch(ValueNode x, ValueNode y) {
+        return y == null || x == null || x.kind() != y.kind();
+    }
+
+
+    @SuppressWarnings("unchecked")
+    public static <T extends Node> Collection<T> filter(Iterable<Node> nodes, Class<T> clazz) {
+        ArrayList<T> phis = new ArrayList<>();
+        for (Node node : nodes) {
+            if (clazz.isInstance(node)) {
+                phis.add((T) node);
+            }
+        }
+        return phis;
+    }
+
+    /**
+     * Converts a given instruction to a value string. The representation of an node as
+     * a value is formed by concatenating the {@linkplain com.oracle.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.
+     * @return the instruction representation as a string
+     */
+    public static String valueString(ValueNode value) {
+        return (value == null) ? "-" : ("" + value.kind().typeChar + value.toString(Verbosity.Id));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "&")
+public final class AndNode extends LogicNode implements Canonicalizable, LIRLowerable {
+
+    public AndNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x() == y()) {
+            return x();
+        }
+        if (x().isConstant() && !y().isConstant()) {
+            return graph().unique(new AndNode(kind(), y(), x()));
+        }
+        if (x().isConstant()) {
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() & y().asConstant().asInt(), graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() & y().asConstant().asLong(), graph());
+            }
+        } else if (y().isConstant()) {
+            if (kind() == CiKind.Int) {
+                int c = y().asConstant().asInt();
+                if (c == -1) {
+                    return x();
+                }
+                if (c == 0) {
+                    return ConstantNode.forInt(0, graph());
+                }
+            } else {
+                assert kind() == CiKind.Long;
+                long c = y().asConstant().asLong();
+                if (c == -1) {
+                    return x();
+                }
+                if (c == 0) {
+                    return ConstantNode.forLong(0, graph());
+                }
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitAnd(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ArithmeticNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * The {@code ArithmeticOp} class represents arithmetic operations such as addition, subtraction, etc.
+ */
+public abstract class ArithmeticNode extends BinaryNode {
+
+    private final boolean isStrictFP;
+
+    /**
+     * Creates a new arithmetic operation.
+     * @param kind the result kind of the operation
+     * @param x the first input instruction
+     * @param y the second input instruction
+     * @param isStrictFP indicates this operation has strict rounding semantics
+     */
+    public ArithmeticNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
+        super(kind, x, y);
+        this.isStrictFP = isStrictFP;
+    }
+
+    /**
+     * Checks whether this instruction has strict fp semantics.
+     * @return {@code true} if this instruction has strict fp semantics
+     */
+    public boolean isStrictFP() {
+        return isStrictFP;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code BinaryNode} class is the base of arithmetic and logic operations with two inputs.
+ */
+public abstract class BinaryNode extends FloatingNode {
+
+    @Input private ValueNode x;
+    @Input private ValueNode y;
+
+    public ValueNode x() {
+        return x;
+    }
+
+    public ValueNode y() {
+        return y;
+    }
+
+    /**
+     * Creates a new BinaryNode instance.
+     * @param kind the result type of this instruction
+     * @param x the first input instruction
+     * @param y the second input instruction
+     */
+    public BinaryNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(StampFactory.forKind(kind));
+        this.x = x;
+        this.y = y;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/* TODO (thomaswue/gdub) 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)
+ *
+ * Compare should probably be made a value (so that it can be canonicalized for example) and in later stages some Compare usage should be transformed
+ * into variants that do not materialize the value (CompareIf, CompareGuard...)
+ */
+public final class CompareNode extends BooleanNode implements Canonicalizable, LIRLowerable {
+
+    @Input private ValueNode x;
+    @Input private ValueNode y;
+
+    @Data private final Condition condition;
+    @Data private final boolean unorderedIsTrue;
+
+    public ValueNode x() {
+        return x;
+    }
+
+    public ValueNode y() {
+        return y;
+    }
+
+    /**
+     * Constructs a new Compare instruction.
+     *
+     * @param x the instruction producing the first input to the instruction
+     * @param condition the condition (comparison operation)
+     * @param y the instruction that produces the second input to this instruction
+     * @param graph
+     */
+    public CompareNode(ValueNode x, Condition condition, ValueNode y) {
+        this(x, condition, false, y);
+    }
+
+    /**
+     * Constructs a new Compare instruction.
+     *
+     * @param x the instruction producing the first input to the instruction
+     * @param condition the condition (comparison operation)
+     * @param y the instruction that produces the second input to this instruction
+     * @param graph
+     */
+    public CompareNode(ValueNode x, Condition condition, boolean unorderedIsTrue, ValueNode y) {
+        super(StampFactory.illegal());
+        assert (x == null && y == null) || x.kind() == y.kind();
+        this.condition = condition;
+        this.unorderedIsTrue = unorderedIsTrue;
+        this.x = x;
+        this.y = y;
+    }
+
+    /**
+     * Gets the condition (comparison operation) for this instruction.
+     *
+     * @return the condition
+     */
+    public Condition condition() {
+        return condition;
+    }
+
+    /**
+     * Checks whether unordered inputs mean true or false.
+     *
+     * @return {@code true} if unordered inputs produce true
+     */
+    public boolean unorderedIsTrue() {
+        return unorderedIsTrue;
+    }
+
+    @Override
+    public BooleanNode negate() {
+        return graph().unique(new CompareNode(x(), condition.negate(), !unorderedIsTrue, y()));
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Name) {
+            return super.toString(Verbosity.Name) + " " + condition.operator;
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    private ValueNode optimizeMaterialize(CiConstant constant, MaterializeNode materializeNode, RiRuntime runtime) {
+        CiConstant trueConstant = materializeNode.trueValue().asConstant();
+        CiConstant falseConstant = materializeNode.falseValue().asConstant();
+
+        if (falseConstant != null && trueConstant != null) {
+            Boolean trueResult = condition().foldCondition(trueConstant, constant, runtime, unorderedIsTrue());
+            Boolean falseResult = condition().foldCondition(falseConstant, constant, runtime, unorderedIsTrue());
+
+            if (trueResult != null && falseResult != null) {
+                boolean trueUnboxedResult = trueResult;
+                boolean falseUnboxedResult = falseResult;
+                if (trueUnboxedResult == falseUnboxedResult) {
+                    return ConstantNode.forBoolean(trueUnboxedResult, graph());
+                } else {
+                    if (trueUnboxedResult) {
+                        assert falseUnboxedResult == false;
+                        return materializeNode.condition();
+                    } else {
+                        assert falseUnboxedResult == true;
+                        return materializeNode.condition().negate();
+
+                    }
+                }
+            }
+        }
+        return this;
+    }
+
+    private ValueNode optimizeNormalizeCmp(CiConstant constant, NormalizeCompareNode normalizeNode) {
+        if (constant.kind == CiKind.Int && constant.asInt() == 0) {
+            Condition cond = condition();
+            boolean isLess = cond == Condition.LE || cond == Condition.LT || cond == Condition.BE || cond == Condition.BT;
+            boolean canonUnorderedIsTrue = cond != Condition.EQ && (cond == Condition.NE || !(isLess ^ normalizeNode.isUnorderedLess));
+            CompareNode result = graph().unique(new CompareNode(normalizeNode.x(), cond, canonUnorderedIsTrue, normalizeNode.y()));
+            return result;
+        }
+        return this;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && !y().isConstant()) { // move constants to the left (y)
+            return graph().unique(new CompareNode(y(), condition.mirror(), unorderedIsTrue(), x()));
+        } else if (x().isConstant() && y().isConstant()) {
+            CiConstant constX = x().asConstant();
+            CiConstant constY = y().asConstant();
+            Boolean result = condition().foldCondition(constX, constY, tool.runtime(), unorderedIsTrue());
+            if (result != null) {
+                return ConstantNode.forBoolean(result, graph());
+            }
+        }
+
+        if (y().isConstant()) {
+            if (x() instanceof MaterializeNode) {
+                return optimizeMaterialize(y().asConstant(), (MaterializeNode) x(), tool.runtime());
+            } else if (x() instanceof NormalizeCompareNode) {
+                return optimizeNormalizeCmp(y().asConstant(), (NormalizeCompareNode) x());
+            }
+        }
+
+        if (x() == y() && x().kind() != CiKind.Float && x().kind() != CiKind.Double) {
+            return ConstantNode.forBoolean(condition().check(1, 1), graph());
+        }
+        if ((condition == Condition.NE || condition == Condition.EQ) && x().kind() == CiKind.Object) {
+            ValueNode object = null;
+            if (x().isNullConstant()) {
+                object = y();
+            } else if (y().isNullConstant()) {
+                object = x();
+            }
+            if (object != null) {
+                return graph().unique(new NullCheckNode(object, condition == Condition.EQ));
+            } else {
+                Stamp xStamp = x.stamp();
+                Stamp yStamp = y.stamp();
+                if (xStamp.alwaysDistinct(yStamp)) {
+                    return ConstantNode.forBoolean(condition == Condition.NE, graph());
+                }
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.util.*;
+
+/**
+ * Condition codes used in conditionals.
+ */
+public enum Condition {
+    /**
+     * Equal.
+     */
+    EQ("=="),
+
+    /**
+     * Not equal.
+     */
+    NE("!="),
+
+    /**
+     * Signed less than.
+     */
+    LT("<"),
+
+    /**
+     * Signed less than or equal.
+     */
+    LE("<="),
+
+    /**
+     * Signed greater than.
+     */
+    GT(">"),
+
+    /**
+     * Signed greater than or equal.
+     */
+    GE(">="),
+
+    /**
+     * Unsigned greater than or equal ("above than or equal").
+     */
+    AE("|>=|"),
+
+    /**
+     * Unsigned less than or equal ("below than or equal").
+     */
+    BE("|<=|"),
+
+    /**
+     * Unsigned greater than ("above than").
+     */
+    AT("|>|"),
+
+    /**
+     * Unsigned less than ("below than").
+     */
+    BT("|<|"),
+
+    /**
+     * Operation produced an overflow.
+     */
+    OF("overflow"),
+
+    /**
+     * Operation did not produce an overflow.
+     */
+    NOF("noOverflow");
+
+    public final String operator;
+
+    private Condition(String operator) {
+        this.operator = operator;
+    }
+
+    public boolean check(int left, int right) {
+        switch (this) {
+            case EQ: return left == right;
+            case NE: return left != right;
+            case LT: return left < right;
+            case LE: return left <= right;
+            case GT: return left > right;
+            case GE: return left >= right;
+            case AE: return UnsignedMath.aboveOrEqual(left, right);
+            case BE: return UnsignedMath.belowOrEqual(left, right);
+            case AT: return UnsignedMath.aboveThan(left, right);
+            case BT: return UnsignedMath.belowThan(left, right);
+        }
+        throw new IllegalArgumentException();
+    }
+
+    /**
+     * Negate this conditional.
+     * @return the condition that represents the negation
+     */
+    public final Condition negate() {
+        switch (this) {
+            case EQ: return NE;
+            case NE: return EQ;
+            case LT: return GE;
+            case LE: return GT;
+            case GT: return LE;
+            case GE: return LT;
+            case BT: return AE;
+            case BE: return AT;
+            case AT: return BE;
+            case AE: return BT;
+            case OF: return NOF;
+            case NOF: return OF;
+        }
+        throw new IllegalArgumentException(this.toString());
+    }
+
+    public boolean implies(Condition other) {
+        if (other == this) {
+            return true;
+        }
+        switch (this) {
+            case EQ: return other == LE || other == GE || other == BE || other == AE;
+            case NE: return false;
+            case LT: return other == LE;
+            case LE: return false;
+            case GT: return other == GE;
+            case GE: return false;
+            case BT: return other == BE;
+            case BE: return false;
+            case AT: return other == AE;
+            case AE: return false;
+            case OF: return false;
+            case NOF: return false;
+        }
+        throw new IllegalArgumentException(this.toString());
+    }
+
+    /**
+     * Mirror this conditional (i.e. commute "a op b" to "b op' a")
+     * @return the condition representing the equivalent commuted operation
+     */
+    public final Condition mirror() {
+        switch (this) {
+            case EQ: return EQ;
+            case NE: return NE;
+            case LT: return GT;
+            case LE: return GE;
+            case GT: return LT;
+            case GE: return LE;
+            case BT: return AT;
+            case BE: return AE;
+            case AT: return BT;
+            case AE: return BE;
+        }
+        throw new IllegalArgumentException();
+    }
+
+    /**
+     * Checks if this conditional operation is commutative.
+     * @return {@code true} if this operation is commutative
+     */
+    public final boolean isCommutative() {
+        return this == EQ || this == NE;
+    }
+
+    /**
+     * Attempts to fold a comparison between two constants and return the result.
+     * @param lt the constant on the left side of the comparison
+     * @param rt the constant on the right side of the comparison
+     * @param runtime the RiRuntime (might be needed to compare runtime-specific types)
+     * @return {@link Boolean#TRUE} if the comparison is known to be true,
+     * {@link Boolean#FALSE} if the comparison is known to be false, {@code null} otherwise.
+     */
+    public Boolean foldCondition(CiConstant lt, CiConstant rt, RiRuntime runtime, boolean unorderedIsTrue) {
+        switch (lt.kind) {
+            case Boolean:
+            case Byte:
+            case Char:
+            case Short:
+            case Jsr:
+            case Int: {
+                int x = lt.asInt();
+                int y = rt.asInt();
+                switch (this) {
+                    case EQ: return x == y;
+                    case NE: return x != y;
+                    case LT: return x < y;
+                    case LE: return x <= y;
+                    case GT: return x > y;
+                    case GE: return x >= y;
+                    case AE: return UnsignedMath.aboveOrEqual(x, y);
+                    case BE: return UnsignedMath.belowOrEqual(x, y);
+                    case AT: return UnsignedMath.aboveThan(x, y);
+                    case BT: return UnsignedMath.belowThan(x, y);
+                }
+                break;
+            }
+            case Long: {
+                long x = lt.asLong();
+                long y = rt.asLong();
+                switch (this) {
+                    case EQ: return x == y;
+                    case NE: return x != y;
+                    case LT: return x < y;
+                    case LE: return x <= y;
+                    case GT: return x > y;
+                    case GE: return x >= y;
+                    case AE: return UnsignedMath.aboveOrEqual(x, y);
+                    case BE: return UnsignedMath.belowOrEqual(x, y);
+                    case AT: return UnsignedMath.aboveThan(x, y);
+                    case BT: return UnsignedMath.belowThan(x, y);
+                }
+                break;
+            }
+            case Object: {
+                switch (this) {
+                    case EQ: return runtime.areConstantObjectsEqual(lt, rt);
+                    case NE: return !runtime.areConstantObjectsEqual(lt, rt);
+                }
+                break;
+            }
+            case Float: {
+                float x = lt.asFloat();
+                float y = rt.asFloat();
+                if (Float.isNaN(x) || Float.isNaN(y)) {
+                    return unorderedIsTrue;
+                }
+                switch (this) {
+                    case EQ: return x == y;
+                    case NE: return x != y;
+                    case LT: return x < y;
+                    case LE: return x <= y;
+                    case GT: return x > y;
+                    case GE: return x >= y;
+                }
+            }
+            case Double: {
+                double x = lt.asDouble();
+                double y = rt.asDouble();
+                if (Double.isNaN(x) || Double.isNaN(y)) {
+                    return unorderedIsTrue;
+                }
+                switch (this) {
+                    case EQ: return x == y;
+                    case NE: return x != y;
+                    case LT: return x < y;
+                    case LE: return x <= y;
+                    case GT: return x > y;
+                    case GE: return x >= y;
+                }
+            }
+        }
+        assert false : "missed folding of constant operands: " + lt + " " + this + " " + rt;
+        return null;
+    }
+
+    public Condition join(Condition other) {
+        if (other == this) {
+            return this;
+        }
+        if (this == OF || this == NOF || other == OF || other == NOF) {
+            return null;
+        }
+        switch (this) {
+            case EQ:
+                if (other == LE || other == GE || other == BE || other == AE) {
+                    return EQ;
+                } else {
+                    return null;
+                }
+            case NE:
+                if (other == LT || other == GT || other == BT || other == AT) {
+                    return other;
+                } else if (other == LE) {
+                    return LT;
+                } else if (other == GE) {
+                    return GT;
+                } else if (other == BE) {
+                    return BT;
+                } else if (other == AE) {
+                    return AT;
+                } else {
+                    return null;
+                }
+            case LE:
+                if (other == GE || other == EQ) {
+                    return EQ;
+                } else if (other == NE || other == LT) {
+                    return LT;
+                } else {
+                    return null;
+                }
+            case LT:
+                if (other == NE || other == LE) {
+                    return LT;
+                } else {
+                    return null;
+                }
+            case GE:
+                if (other == LE || other == EQ) {
+                    return EQ;
+                } else if (other == NE || other == GT) {
+                    return GT;
+                } else {
+                    return null;
+                }
+            case GT:
+                if (other == NE || other == GE) {
+                    return GT;
+                } else {
+                    return null;
+                }
+            case BE:
+                if (other == AE || other == EQ) {
+                    return EQ;
+                } else if (other == NE || other == BT) {
+                    return BT;
+                } else {
+                    return null;
+                }
+            case BT:
+                if (other == NE || other == BE) {
+                    return BT;
+                } else {
+                    return null;
+                }
+            case AE:
+                if (other == BE || other == EQ) {
+                    return EQ;
+                } else if (other == NE || other == AT) {
+                    return AT;
+                } else {
+                    return null;
+                }
+            case AT:
+                if (other == NE || other == AE) {
+                    return AT;
+                } else {
+                    return null;
+                }
+        }
+        throw new IllegalArgumentException(this.toString());
+    }
+
+    public Condition meet(Condition other) {
+        if (other == this) {
+            return this;
+        }
+        if (this == OF || this == NOF || other == OF || other == NOF) {
+            return null;
+        }
+        switch (this) {
+            case EQ:
+                if (other == LE || other == GE || other == BE || other == AE) {
+                    return other;
+                } else if (other == LT) {
+                    return LE;
+                } else if (other == GT) {
+                    return GE;
+                } else if (other == BT) {
+                    return BE;
+                } else if (other == AT) {
+                    return AE;
+                } else {
+                    return null;
+                }
+            case NE:
+                if (other == LT || other == GT || other == BT || other == AT) {
+                    return NE;
+                } else {
+                    return null;
+                }
+            case LE:
+                if (other == EQ || other == LT) {
+                    return LE;
+                } else {
+                    return null;
+                }
+            case LT:
+                if (other == EQ || other == LE) {
+                    return LE;
+                } else if (other == NE || other == GT) {
+                    return NE;
+                } else {
+                    return null;
+                }
+            case GE:
+                if (other == EQ || other == GT) {
+                    return GE;
+                } else {
+                    return null;
+                }
+            case GT:
+                if (other == EQ || other == GE) {
+                    return GE;
+                } else if (other == NE || other == LT) {
+                    return NE;
+                } else {
+                    return null;
+                }
+            case BE:
+                if (other == EQ || other == BT) {
+                    return BE;
+                } else {
+                    return null;
+                }
+            case BT:
+                if (other == EQ || other == BE) {
+                    return BE;
+                } else if (other == NE || other == AT) {
+                    return NE;
+                } else {
+                    return null;
+                }
+            case AE:
+                if (other == EQ || other == AT) {
+                    return AE;
+                } else {
+                    return null;
+                }
+            case AT:
+                if (other == EQ || other == AE) {
+                    return AE;
+                } else if (other == NE || other == BT) {
+                    return NE;
+                } else {
+                    return null;
+                }
+        }
+        throw new IllegalArgumentException(this.toString());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java	Thu Mar 08 19:24:17 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.graal.nodes.calc;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+/**
+ * The {@code ConditionalNode} class represents a comparison that yields one of two values. Note that these nodes are not
+ * built directly from the bytecode but are introduced by canonicalization.
+ */
+public class ConditionalNode extends BinaryNode implements Canonicalizable, LIRLowerable {
+
+    @Input private BooleanNode condition;
+
+    public BooleanNode condition() {
+        return condition;
+    }
+
+    public ConditionalNode(BooleanNode condition, ValueNode trueValue, ValueNode falseValue) {
+        super(trueValue.kind(), trueValue, falseValue);
+        assert trueValue.kind() == falseValue.kind();
+        this.condition = condition;
+    }
+
+    public ValueNode trueValue() {
+        return x();
+    }
+
+    public ValueNode falseValue() {
+        return y();
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (condition instanceof ConstantNode) {
+            ConstantNode c = (ConstantNode) condition;
+            if (c.asConstant().asBoolean()) {
+                return trueValue();
+            } else {
+                return falseValue();
+            }
+        }
+        if (trueValue() == falseValue()) {
+            return trueValue();
+        }
+
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        generator.emitConditional(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import static com.oracle.max.cri.ci.CiKind.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code ConvertNode} class represents a conversion between primitive types.
+ */
+public final class ConvertNode extends FloatingNode implements Canonicalizable, LIRLowerable {
+
+    public enum Op {
+        I2L(Int, Long),
+        L2I(Long, Int),
+        I2B(Int, Byte),
+        I2C(Int, Char),
+        I2S(Int, Short),
+        F2D(Float, Double),
+        D2F(Double, Float),
+        I2F(Int, Float),
+        I2D(Int, Double),
+        F2I(Float, Int),
+        D2I(Double, Int),
+        L2F(Long, Float),
+        L2D(Long, Double),
+        F2L(Float, Long),
+        D2L(Double, Long),
+        MOV_I2F(Int, Float),
+        MOV_L2D(Long, Double),
+        MOV_F2I(Float, Int),
+        MOV_D2L(Double, Long);
+
+        public final CiKind from;
+        public final CiKind to;
+
+        private Op(CiKind from, CiKind to) {
+            this.from = from;
+            this.to = to;
+        }
+    }
+
+    @Input private ValueNode value;
+
+    @Data public final Op opcode;
+
+    public ValueNode value() {
+        return value;
+    }
+
+    /**
+     * Constructs a new Convert instance.
+     * @param kind the result type of this instruction
+     * @param opcode the operation
+     * @param value the instruction producing the input value
+     * @param graph
+     */
+    public ConvertNode(Op opcode, ValueNode value) {
+        super(StampFactory.forKind(opcode.to.stackKind()));
+        assert value.kind() == opcode.from : opcode + " : " + value.kind() + " != " + opcode.from;
+        this.opcode = opcode;
+        this.value = value;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (value instanceof ConstantNode) {
+            CiConstant c = ((ConstantNode) value).asConstant();
+            switch (opcode) {
+                case I2L: return ConstantNode.forLong(c.asInt(), graph());
+                case L2I: return ConstantNode.forInt((int) c.asLong(), graph());
+                case I2B: return ConstantNode.forByte((byte) c.asInt(), graph());
+                case I2C: return ConstantNode.forChar((char) c.asInt(), graph());
+                case I2S: return ConstantNode.forShort((short) c.asInt(), graph());
+                case F2D: return ConstantNode.forDouble(c.asFloat(), graph());
+                case D2F: return ConstantNode.forFloat((float) c.asDouble(), graph());
+                case I2F: return ConstantNode.forFloat(c.asInt(), graph());
+                case I2D: return ConstantNode.forDouble(c.asInt(), graph());
+                case F2I: return ConstantNode.forInt((int) c.asFloat(), graph());
+                case D2I: return ConstantNode.forInt((int) c.asDouble(), graph());
+                case L2F: return ConstantNode.forFloat(c.asLong(), graph());
+                case L2D: return ConstantNode.forDouble(c.asLong(), graph());
+                case F2L: return ConstantNode.forLong((long) c.asFloat(), graph());
+                case D2L: return ConstantNode.forLong((long) c.asDouble(), graph());
+                case MOV_I2F: return ConstantNode.forFloat(java.lang.Float.intBitsToFloat(c.asInt()), graph());
+                case MOV_L2D: return ConstantNode.forDouble(java.lang.Double.longBitsToDouble(c.asLong()), graph());
+                case MOV_F2I: return ConstantNode.forInt(java.lang.Float.floatToRawIntBits(c.asFloat()), graph());
+                case MOV_D2L: return ConstantNode.forLong(java.lang.Double.doubleToRawLongBits(c.asDouble()), graph());
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitConvert(opcode, gen.operand(value())));
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static <S, T> S convert(@ConstantNodeParameter Op op, T value) {
+        throw new UnsupportedOperationException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatAddNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "+")
+public final class FloatAddNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public FloatAddNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
+        super(kind, x, y, isStrictFP);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && !y().isConstant()) {
+            return graph().unique(new FloatAddNode(kind(), y(), x(), isStrictFP()));
+        }
+        if (x().isConstant()) {
+            if (kind() == CiKind.Float) {
+                return ConstantNode.forFloat(x().asConstant().asFloat() + y().asConstant().asFloat(), graph());
+            } else {
+                assert kind() == CiKind.Double;
+                return ConstantNode.forDouble(x().asConstant().asDouble() + y().asConstant().asDouble(), graph());
+            }
+        } else if (y().isConstant()) {
+            if (kind() == CiKind.Float) {
+                float c = y().asConstant().asFloat();
+                if (c == 0.0f) {
+                    return x();
+                }
+            } else {
+                assert kind() == CiKind.Double;
+                double c = y().asConstant().asDouble();
+                if (c == 0.0) {
+                    return x();
+                }
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        CiValue op1 = gen.operand(x());
+        CiValue op2 = gen.operand(y());
+        if (!y().isConstant() && !livesLonger(this, y(), gen)) {
+            CiValue op = op1;
+            op1 = op2;
+            op2 = op;
+        }
+        gen.setResult(this, gen.emitAdd(op1, op2));
+    }
+
+    public static boolean livesLonger(ValueNode after, ValueNode value, LIRGeneratorTool gen) {
+        for (Node usage : value.usages()) {
+            if (usage != after && usage instanceof ValueNode && gen.operand(((ValueNode) usage)) != null) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatArithmeticNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+
+public abstract class FloatArithmeticNode extends ArithmeticNode {
+
+    public FloatArithmeticNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
+        super(kind, x, y, isStrictFP);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatDivNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "/")
+public final class FloatDivNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public FloatDivNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
+        super(kind, x, y, isStrictFP);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && y().isConstant()) {
+            if (kind() == CiKind.Float) {
+                if (y().asConstant().asFloat() != 0) {
+                    return ConstantNode.forFloat(x().asConstant().asFloat() / y().asConstant().asFloat(), graph());
+                }
+            } else {
+                assert kind() == CiKind.Double;
+                if (y().asConstant().asDouble() != 0) {
+                    return ConstantNode.forDouble(x().asConstant().asDouble() / y().asConstant().asDouble(), graph());
+                }
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitDiv(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatMulNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "*")
+public final class FloatMulNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public FloatMulNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
+        super(kind, x, y, isStrictFP);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && !y().isConstant()) {
+            return graph().unique(new FloatMulNode(kind(), y(), x(), isStrictFP()));
+        }
+        if (x().isConstant()) {
+            if (kind() == CiKind.Float) {
+                return ConstantNode.forFloat(x().asConstant().asFloat() * y().asConstant().asFloat(), graph());
+            } else {
+                assert kind() == CiKind.Double;
+                return ConstantNode.forDouble(x().asConstant().asDouble() * y().asConstant().asDouble(), graph());
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        CiValue op1 = gen.operand(x());
+        CiValue op2 = gen.operand(y());
+        if (!y().isConstant() && !FloatAddNode.livesLonger(this, y(), gen)) {
+            CiValue op = op1;
+            op1 = op2;
+            op2 = op;
+        }
+        gen.setResult(this, gen.emitMul(op1, op2));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "%")
+public final class FloatRemNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public FloatRemNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
+        super(kind, x, y, isStrictFP);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && y().isConstant()) {
+            if (kind() == CiKind.Float) {
+                return ConstantNode.forFloat(x().asConstant().asFloat() % y().asConstant().asFloat(), graph());
+            } else {
+                assert kind() == CiKind.Double;
+                return ConstantNode.forDouble(x().asConstant().asDouble() % y().asConstant().asDouble(), graph());
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitRem(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatSubNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "-")
+public final class FloatSubNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public FloatSubNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
+        super(kind, x, y, isStrictFP);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x() == y()) {
+            return ConstantNode.forFloatingKind(kind(), 0.0f, graph());
+        }
+        if (x().isConstant() && y().isConstant()) {
+            if (kind() == CiKind.Float) {
+                return ConstantNode.forFloat(x().asConstant().asFloat() - y().asConstant().asFloat(), graph());
+            } else {
+                assert kind() == CiKind.Double;
+                return ConstantNode.forDouble(x().asConstant().asDouble() - y().asConstant().asDouble(), graph());
+            }
+        } else if (y().isConstant()) {
+            if (kind() == CiKind.Float) {
+                float c = y().asConstant().asFloat();
+                if (c == 0.0f) {
+                    return x();
+                }
+                return graph().unique(new FloatAddNode(kind(), x(), ConstantNode.forFloat(-c, graph()), isStrictFP()));
+            } else {
+                assert kind() == CiKind.Double;
+                double c = y().asConstant().asDouble();
+                if (c == 0.0) {
+                    return x();
+                }
+                return graph().unique(new FloatAddNode(kind(), x(), ConstantNode.forDouble(-c, graph()), isStrictFP()));
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitSub(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatingNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+public abstract class FloatingNode extends ValueNode implements Node.ValueNumberable {
+    public FloatingNode(Stamp stamp) {
+        super(stamp);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerAddNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "+")
+public class IntegerAddNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public IntegerAddNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && !y().isConstant()) {
+            return graph().unique(new IntegerAddNode(kind(), y(), x()));
+        }
+        if (x().isConstant()) {
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() + y().asConstant().asInt(), graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() + y().asConstant().asLong(), graph());
+            }
+        } else if (y().isConstant()) {
+            if (kind() == CiKind.Int) {
+                int c = y().asConstant().asInt();
+                if (c == 0) {
+                    return x();
+                }
+            } else {
+                assert kind() == CiKind.Long;
+                long c = y().asConstant().asLong();
+                if (c == 0) {
+                    return x();
+                }
+            }
+        }
+        return this;
+    }
+
+    public static boolean isIntegerAddition(ValueNode result, ValueNode a, ValueNode b) {
+        CiKind kind = result.kind();
+        if (kind != a.kind() || kind != b.kind() || !(kind.isInt() || kind.isLong())) {
+            return false;
+        }
+        if (result.isConstant() && a.isConstant() && b.isConstant()) {
+            if (kind.isInt()) {
+                return result.asConstant().asInt() == a.asConstant().asInt() + b.asConstant().asInt();
+            } else if (kind.isLong()) {
+                return result.asConstant().asLong() == a.asConstant().asLong() + b.asConstant().asLong();
+            }
+        } else if (result instanceof IntegerAddNode) {
+            IntegerAddNode add = (IntegerAddNode) result;
+            return (add.x() == a && add.y() == b) || (add.y() == a && add.x() == b);
+        }
+        return false;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        CiValue op1 = gen.operand(x());
+        assert op1 != null : x() + ", this=" + this;
+        CiValue op2 = gen.operand(y());
+        if (!y().isConstant() && !FloatAddNode.livesLonger(this, y(), gen)) {
+            CiValue op = op1;
+            op1 = op2;
+            op2 = op;
+        }
+        gen.setResult(this, gen.emitAdd(op1, op2));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+
+public abstract class IntegerArithmeticNode extends ArithmeticNode {
+
+    public IntegerArithmeticNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y, false);
+        assert kind == CiKind.Int || kind == CiKind.Long;
+    }
+
+    public static IntegerAddNode add(ValueNode v1, ValueNode v2) {
+        assert v1.kind() == v2.kind() && v1.graph() == v2.graph();
+        Graph graph = v1.graph();
+        switch(v1.kind()) {
+            case Int:
+                return graph.unique(new IntegerAddNode(CiKind.Int, v1, v2));
+            case Long:
+                return graph.unique(new IntegerAddNode(CiKind.Long, v1, v2));
+            default:
+                throw ValueUtil.shouldNotReachHere();
+        }
+    }
+
+    public static IntegerMulNode mul(ValueNode v1, ValueNode v2) {
+        assert v1.kind() == v2.kind() && v1.graph() == v2.graph();
+        Graph graph = v1.graph();
+        switch(v1.kind()) {
+            case Int:
+                return graph.unique(new IntegerMulNode(CiKind.Int, v1, v2));
+            case Long:
+                return graph.unique(new IntegerMulNode(CiKind.Long, v1, v2));
+            default:
+                throw ValueUtil.shouldNotReachHere();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "/")
+public final class IntegerDivNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public IntegerDivNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && y().isConstant()) {
+            long yConst = y().asConstant().asLong();
+            if (yConst == 0) {
+                return this; // this will trap, can not canonicalize
+            }
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() / (int) yConst, graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() / yConst, graph());
+            }
+        } else if (y().isConstant()) {
+            long c = y().asConstant().asLong();
+            if (c == 1) {
+                return x();
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitDiv(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "*")
+public final class IntegerMulNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public IntegerMulNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && !y().isConstant()) {
+            return graph().unique(new IntegerMulNode(kind(), y(), x()));
+        }
+        if (x().isConstant()) {
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() * y().asConstant().asInt(), graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() * y().asConstant().asLong(), graph());
+            }
+        } else if (y().isConstant()) {
+            long c = y().asConstant().asLong();
+            if (c == 1) {
+                return x();
+            }
+            if (c == 0) {
+                return ConstantNode.forInt(0, graph());
+            }
+            if (c > 0 && CiUtil.isPowerOf2(c)) {
+                return graph().unique(new LeftShiftNode(kind(), x(), ConstantNode.forInt(CiUtil.log2(c), graph())));
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        CiValue op1 = gen.operand(x());
+        CiValue op2 = gen.operand(y());
+        if (!y().isConstant() && !FloatAddNode.livesLonger(this, y(), gen)) {
+            CiValue op = op1;
+            op1 = op2;
+            op2 = op;
+        }
+        gen.setResult(this, gen.emitMul(op1, op2));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "%")
+public final class IntegerRemNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public IntegerRemNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant() && y().isConstant()) {
+            long yConst = y().asConstant().asLong();
+            if (yConst == 0) {
+                return this; // this will trap, can not canonicalize
+            }
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() % (int) yConst, graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() % yConst, graph());
+            }
+        } else if (y().isConstant()) {
+            long c = y().asConstant().asLong();
+            if (c == 1 || c == -1) {
+                return ConstantNode.forIntegerKind(kind(), 0, graph());
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitRem(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerSubNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "-")
+public final class IntegerSubNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
+
+    public IntegerSubNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x() == y()) {
+            return ConstantNode.forIntegerKind(kind(), 0, graph());
+        }
+        if (x().isConstant() && y().isConstant()) {
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() - y().asConstant().asInt(), graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() - y().asConstant().asLong(), graph());
+            }
+        } else if (y().isConstant()) {
+            long c = y().asConstant().asLong();
+            if (c == 0) {
+                return x();
+            }
+            if (kind() == CiKind.Int) {
+                return graph().unique(new IntegerAddNode(kind(), x(), ConstantNode.forInt((int) -c, graph())));
+            } else {
+                assert kind() == CiKind.Long;
+                return graph().unique(new IntegerAddNode(kind(), x(), ConstantNode.forLong(-c, graph())));
+            }
+        } else if (x().isConstant()) {
+            long c = x().asConstant().asLong();
+            if (c == 0) {
+                return graph().unique(new NegateNode(y()));
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitSub(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "<<")
+public final class LeftShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
+
+    public LeftShiftNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (y().isConstant()) {
+            int amount = y().asConstant().asInt();
+            int originalAmout = amount;
+            int mask;
+            if (kind() == CiKind.Int) {
+                mask = 0x1f;
+            } else {
+                assert kind() == CiKind.Long;
+                mask = 0x3f;
+            }
+            amount &= mask;
+            if (x().isConstant()) {
+                if (kind() == CiKind.Int) {
+                    return ConstantNode.forInt(x().asConstant().asInt() << amount, graph());
+                } else {
+                    assert kind() == CiKind.Long;
+                    return ConstantNode.forLong(x().asConstant().asLong() << amount, graph());
+                }
+            }
+            if (amount == 0) {
+                return x();
+            }
+            if (x() instanceof ShiftNode) {
+                ShiftNode other = (ShiftNode) x();
+                if (other.y().isConstant()) {
+                    int otherAmount = other.y().asConstant().asInt() & mask;
+                    if (other instanceof LeftShiftNode) {
+                        int total = amount + otherAmount;
+                        if (total != (total & mask)) {
+                            return ConstantNode.forInt(0, graph());
+                        }
+                        return graph().unique(new LeftShiftNode(kind(), other.x(), ConstantNode.forInt(total, graph())));
+                    } else if ((other instanceof RightShiftNode || other instanceof UnsignedRightShiftNode) && otherAmount == amount) {
+                        if (kind() == CiKind.Long) {
+                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forLong(-1L << amount, graph())));
+                        } else {
+                            assert kind() == CiKind.Int;
+                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forInt(-1 << amount, graph())));
+                        }
+                    }
+                }
+            }
+            if (originalAmout != amount) {
+                return graph().unique(new LeftShiftNode(kind(), x(), ConstantNode.forInt(amount, graph())));
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitShl(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LogicNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * The {@code LogicNode} class definition.
+ */
+public abstract class LogicNode extends BinaryNode {
+
+    /**
+     * Constructs a new logic operation node.
+     * @param x the first input into this node
+     * @param y the second input into this node
+     */
+    public LogicNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java	Thu Mar 08 19:24:17 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.graal.nodes.calc;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code NegateNode} node negates its operand.
+ */
+public final class NegateNode extends FloatingNode implements Canonicalizable, LIRLowerable {
+
+    @Input
+    private ValueNode x;
+
+    public ValueNode x() {
+        return x;
+    }
+
+    /**
+     * Creates new NegateOp instance.
+     *
+     * @param x the instruction producing the value that is input to this instruction
+     */
+    public NegateNode(ValueNode x) {
+        super(StampFactory.forKind(x.kind()));
+        this.x = x;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant()) {
+            switch (x().kind()) {
+                case Int:
+                    return ConstantNode.forInt(-x().asConstant().asInt(), graph());
+                case Long:
+                    return ConstantNode.forLong(-x().asConstant().asLong(), graph());
+                case Float:
+                    return ConstantNode.forFloat(-x().asConstant().asFloat(), graph());
+                case Double:
+                    return ConstantNode.forDouble(-x().asConstant().asDouble(), graph());
+            }
+        }
+        if (x() instanceof NegateNode) {
+            return ((NegateNode) x()).x();
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitNegate(gen.operand(x())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NormalizeCompareNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+/**
+ * Returns -1, 0, or 1 if either x < y, x == y, or x > y.
+ */
+public final class NormalizeCompareNode extends BinaryNode implements Lowerable {
+    @Data public final boolean isUnorderedLess;
+
+    /**
+     * Creates a new compare operation.
+     * @param x the first input
+     * @param y the second input
+     * @param isUnorderedLess true when an unordered floating point comparison is interpreted as less, false when greater.
+     */
+    public NormalizeCompareNode(ValueNode x, ValueNode y, boolean isUnorderedLess) {
+        super(CiKind.Int, x, y);
+        this.isUnorderedLess = isUnorderedLess;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        StructuredGraph graph = (StructuredGraph) graph();
+
+        CompareNode equalComp = graph.unique(new CompareNode(x(), Condition.EQ, false, y()));
+        MaterializeNode equalValue = MaterializeNode.create(equalComp, graph, ConstantNode.forInt(0, graph), ConstantNode.forInt(1, graph));
+
+        CompareNode lessComp = graph.unique(new CompareNode(x(), Condition.LT, isUnorderedLess, y()));
+        MaterializeNode value =  MaterializeNode.create(lessComp, graph, ConstantNode.forInt(-1, graph), equalValue);
+
+        graph.replaceFloating(this, value);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NullCheckNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public final class NullCheckNode extends BooleanNode implements Canonicalizable, LIRLowerable {
+
+    @Input private ValueNode object;
+    @Data public final boolean expectedNull;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    /**
+     * Constructs a new NullCheck instruction.
+     *
+     * @param object the instruction producing the object to check against null
+     * @param expectedNull True when this node checks that the value is null, false when this node checks for non-null
+     */
+    public NullCheckNode(ValueNode object, boolean expectedNull) {
+        super(StampFactory.illegal());
+        assert object.kind() == CiKind.Object : object.kind();
+        this.object = object;
+        this.expectedNull = expectedNull;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // Nothing to do.
+    }
+
+    @Override
+    public boolean verify() {
+        assertTrue(object().kind().isObject(), "null check input must be an object");
+        return super.verify();
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        CiConstant constant = object().asConstant();
+        if (constant != null) {
+            assert constant.kind == CiKind.Object;
+            return ConstantNode.forBoolean(constant.isNull() == expectedNull, graph());
+        }
+        if (object.stamp().nonNull()) {
+            return ConstantNode.forBoolean(!expectedNull, graph());
+        }
+        return this;
+    }
+
+    @Override
+    public BooleanNode negate() {
+        return graph().unique(new NullCheckNode(object(), !expectedNull));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "|")
+public final class OrNode extends LogicNode implements Canonicalizable, LIRLowerable {
+
+    public OrNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x() == y()) {
+            return x();
+        }
+        if (x().isConstant() && !y().isConstant()) {
+            return graph().unique(new OrNode(kind(), y(), x()));
+        }
+        if (x().isConstant()) {
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() | y().asConstant().asInt(), graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() | y().asConstant().asLong(), graph());
+            }
+        } else if (y().isConstant()) {
+            if (kind() == CiKind.Int) {
+                int c = y().asConstant().asInt();
+                if (c == -1) {
+                    return ConstantNode.forInt(-1, graph());
+                }
+                if (c == 0) {
+                    return x();
+                }
+            } else {
+                assert kind() == CiKind.Long;
+                long c = y().asConstant().asLong();
+                if (c == -1) {
+                    return ConstantNode.forLong(-1, graph());
+                }
+                if (c == 0) {
+                    return x();
+                }
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitOr(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = ">>")
+public final class RightShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
+
+    public RightShiftNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (y().isConstant()) {
+            int amount = y().asConstant().asInt();
+            int originalAmout = amount;
+            int mask;
+            if (kind() == CiKind.Int) {
+                mask = 0x1f;
+            } else {
+                assert kind() == CiKind.Long;
+                mask = 0x3f;
+            }
+            amount &= mask;
+            if (x().isConstant()) {
+                if (kind() == CiKind.Int) {
+                    return ConstantNode.forInt(x().asConstant().asInt() >> amount, graph());
+                } else {
+                    assert kind() == CiKind.Long;
+                    return ConstantNode.forLong(x().asConstant().asLong() >> amount, graph());
+                }
+            }
+            if (amount == 0) {
+                return x();
+            }
+            if (x() instanceof ShiftNode) {
+                ShiftNode other = (ShiftNode) x();
+                if (other.y().isConstant()) {
+                    int otherAmount = other.y().asConstant().asInt() & mask;
+                    if (other instanceof RightShiftNode) {
+                        int total = amount + otherAmount;
+                        if (total != (total & mask)) {
+                            return ConstantNode.forInt(0, graph());
+                        }
+                        return graph().unique(new RightShiftNode(kind(), other.x(), ConstantNode.forInt(total, graph())));
+                    }
+                }
+            }
+            if (originalAmout != amount) {
+                return graph().unique(new RightShiftNode(kind(), x(), ConstantNode.forInt(amount, graph())));
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitShr(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * The {@code ShiftOp} class represents shift operations.
+ */
+public abstract class ShiftNode extends BinaryNode {
+
+    /**
+     * Creates a new shift operation.
+     * @param x the first input value
+     * @param s the second input value
+     */
+    public ShiftNode(CiKind kind, ValueNode x, ValueNode s) {
+        super(kind, x, s);
+        // TODO (cwimmer) Why check for null here - what is a shift with no left operand?
+        assert x == null || x.kind() == kind;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = ">>>")
+public final class UnsignedRightShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
+
+    public UnsignedRightShiftNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (y().isConstant()) {
+            int amount = y().asConstant().asInt();
+            int originalAmout = amount;
+            int mask;
+            if (kind() == CiKind.Int) {
+                mask = 0x1f;
+            } else {
+                assert kind() == CiKind.Long;
+                mask = 0x3f;
+            }
+            amount &= mask;
+            if (x().isConstant()) {
+                if (kind() == CiKind.Int) {
+                    return ConstantNode.forInt(x().asConstant().asInt() >>> amount, graph());
+                } else {
+                    assert kind() == CiKind.Long;
+                    return ConstantNode.forLong(x().asConstant().asLong() >>> amount, graph());
+                }
+            }
+            if (amount == 0) {
+                return x();
+            }
+            if (x() instanceof ShiftNode) {
+                ShiftNode other = (ShiftNode) x();
+                if (other.y().isConstant()) {
+                    int otherAmount = other.y().asConstant().asInt() & mask;
+                    if (other instanceof UnsignedRightShiftNode) {
+                        int total = amount + otherAmount;
+                        if (total != (total & mask)) {
+                            return ConstantNode.forInt(0, graph());
+                        }
+                        return graph().unique(new UnsignedRightShiftNode(kind(), other.x(), ConstantNode.forInt(total, graph())));
+                    } else if (other instanceof LeftShiftNode && otherAmount == amount) {
+                        if (kind() == CiKind.Long) {
+                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forLong(-1L >>> amount, graph())));
+                        } else {
+                            assert kind() == CiKind.Int;
+                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forInt(-1 >>> amount, graph())));
+                        }
+                    }
+                }
+            }
+            if (originalAmout != amount) {
+                return graph().unique(new UnsignedRightShiftNode(kind(), x(), ConstantNode.forInt(amount, graph())));
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitUShr(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.calc;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+@NodeInfo(shortName = "^")
+public final class XorNode extends LogicNode implements Canonicalizable, LIRLowerable {
+
+    public XorNode(CiKind kind, ValueNode x, ValueNode y) {
+        super(kind, x, y);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x() == y()) {
+            return ConstantNode.forIntegerKind(kind(), 0, graph());
+        }
+        if (x().isConstant() && !y().isConstant()) {
+            return graph().unique(new XorNode(kind(), y(), x()));
+        }
+        if (x().isConstant()) {
+            if (kind() == CiKind.Int) {
+                return ConstantNode.forInt(x().asConstant().asInt() ^ y().asConstant().asInt(), graph());
+            } else {
+                assert kind() == CiKind.Long;
+                return ConstantNode.forLong(x().asConstant().asLong() ^ y().asConstant().asLong(), graph());
+            }
+        } else if (y().isConstant()) {
+            if (kind() == CiKind.Int) {
+                int c = y().asConstant().asInt();
+                if (c == 0) {
+                    return x();
+                }
+            } else {
+                assert kind() == CiKind.Long;
+                long c = y().asConstant().asLong();
+                if (c == 0) {
+                    return x();
+                }
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitXor(gen.operand(x()), gen.operand(y())));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AbstractCallNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+public abstract class AbstractCallNode extends AbstractStateSplit implements MemoryCheckpoint {
+
+    @Input
+    protected final NodeInputList<ValueNode> arguments;
+
+    public AbstractCallNode(Stamp stamp, ValueNode[] arguments) {
+        super(stamp);
+        this.arguments = new NodeInputList<>(this, arguments);
+    }
+
+    public NodeInputList<ValueNode> arguments() {
+        return arguments;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/Access.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.graal.nodes.*;
+
+public interface Access {
+
+    ValueNode object();
+
+    LocationNode location();
+
+    void setNullCheck(boolean check);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AccessNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+public abstract class AccessNode extends AbstractStateSplit implements Access {
+
+    @Input private ValueNode object;
+    @Input private GuardNode guard;
+    @Input private LocationNode location;
+    @Data private boolean nullCheck;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public GuardNode guard() {
+        return guard;
+    }
+
+    public void setGuard(GuardNode x) {
+        updateUsages(guard, x);
+        guard = x;
+    }
+
+    public LocationNode location() {
+        return location;
+    }
+
+    public boolean getNullCheck() {
+        return nullCheck;
+    }
+
+    public void setNullCheck(boolean check) {
+        this.nullCheck = check;
+    }
+
+    public AccessNode(CiKind kind, ValueNode object, LocationNode location) {
+        super(StampFactory.forKind(kind));
+        this.object = object;
+        this.location = location;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.java.MethodCallTargetNode.*;
+import com.oracle.graal.nodes.type.*;
+
+
+public final class BoxNode extends AbstractStateSplit implements Node.IterableNodeType {
+
+    @Input private ValueNode source;
+    @Data private int bci;
+    @Data private CiKind sourceKind;
+
+    public BoxNode(ValueNode value, RiResolvedType type, CiKind sourceKind, int bci) {
+        super(StampFactory.exactNonNull(type));
+        this.source = value;
+        this.bci = bci;
+        this.sourceKind = sourceKind;
+        assert value.kind() != CiKind.Object : "can only box from primitive type";
+    }
+
+    public ValueNode source() {
+        return source;
+    }
+
+
+    public CiKind getSourceKind() {
+        return sourceKind;
+    }
+
+    public void expand(BoxingMethodPool pool) {
+        RiResolvedMethod boxingMethod = pool.getBoxingMethod(sourceKind);
+        MethodCallTargetNode callTarget = graph().add(new MethodCallTargetNode(InvokeKind.Static, boxingMethod, new ValueNode[]{source}, boxingMethod.signature().returnType(boxingMethod.holder())));
+        InvokeNode invokeNode = graph().add(new InvokeNode(callTarget, bci));
+        invokeNode.setProbability(this.probability());
+        invokeNode.setStateAfter(stateAfter());
+        ((StructuredGraph) graph()).replaceFixedWithFixed(this, invokeNode);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxingMethodPool.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+
+public class BoxingMethodPool {
+
+    private final Set<RiMethod> specialMethods = new HashSet<>();
+    private final RiRuntime runtime;
+    private final RiResolvedMethod[] boxingMethods = new RiResolvedMethod[CiKind.values().length];
+    private final RiResolvedMethod[] unboxingMethods = new RiResolvedMethod[CiKind.values().length];
+    private final RiResolvedField[] boxFields = new RiResolvedField[CiKind.values().length];
+
+    public BoxingMethodPool(RiRuntime runtime) {
+        this.runtime = runtime;
+        initialize();
+    }
+
+    private void initialize() {
+        try {
+            initialize(CiKind.Boolean, Boolean.class, "booleanValue");
+            initialize(CiKind.Byte, Byte.class, "byteValue");
+            initialize(CiKind.Char, Character.class, "charValue");
+            initialize(CiKind.Short, Short.class, "shortValue");
+            initialize(CiKind.Int, Integer.class, "intValue");
+            initialize(CiKind.Long, Long.class, "longValue");
+            initialize(CiKind.Float, Float.class, "floatValue");
+            initialize(CiKind.Double, Double.class, "doubleValue");
+        } catch (SecurityException e) {
+            throw new RuntimeException(e);
+        } catch (NoSuchMethodException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private void initialize(CiKind kind, Class<?> type, String unboxMethod) throws SecurityException, NoSuchMethodException {
+
+        // Get boxing method from runtime.
+        RiResolvedMethod boxingMethod = runtime.getRiMethod(type.getDeclaredMethod("valueOf", kind.toJavaClass()));
+        specialMethods.add(boxingMethod);
+        boxingMethods[kind.ordinal()] = boxingMethod;
+
+        // Get unboxing method from runtime.
+        RiResolvedMethod unboxingMethod = runtime.getRiMethod(type.getDeclaredMethod(unboxMethod));
+        unboxingMethods[kind.ordinal()] = unboxingMethod;
+        specialMethods.add(unboxingMethod);
+
+        // Get the field that contains the boxed value.
+        RiResolvedField[] fields = runtime.getType(type).declaredFields();
+        RiResolvedField boxField = fields[0];
+        assert fields.length == 1 && boxField.kind(false) == kind;
+        boxFields[kind.ordinal()] = boxField;
+    }
+
+    public boolean isSpecialMethod(RiResolvedMethod method) {
+        return specialMethods.contains(method);
+    }
+
+    public boolean isBoxingMethod(RiResolvedMethod method) {
+        return isSpecialMethod(method) && method.signature().returnKind(false) == CiKind.Object;
+    }
+
+    public boolean isUnboxingMethod(RiResolvedMethod method) {
+        return isSpecialMethod(method) && method.signature().returnKind(false) != CiKind.Object;
+    }
+
+    public RiResolvedMethod getBoxingMethod(CiKind kind) {
+        return boxingMethods[kind.ordinal()];
+    }
+
+    public RiResolvedMethod getUnboxingMethod(CiKind kind) {
+        return unboxingMethods[kind.ordinal()];
+    }
+
+    public RiResolvedField getBoxField(CiKind kind) {
+        return boxFields[kind.ordinal()];
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingAccessNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.type.*;
+
+public abstract class FloatingAccessNode extends FloatingNode implements Access {
+
+    @Input private ValueNode object;
+    @Input private GuardNode guard;
+    @Input private LocationNode location;
+    @Data private boolean nullCheck;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public GuardNode guard() {
+        return guard;
+    }
+
+    public void setGuard(GuardNode x) {
+        updateUsages(guard, x);
+        guard = x;
+    }
+
+    public LocationNode location() {
+        return location;
+    }
+
+    public boolean getNullCheck() {
+        return nullCheck;
+    }
+
+    public void setNullCheck(boolean check) {
+        this.nullCheck = check;
+    }
+
+    public FloatingAccessNode(CiKind kind, ValueNode object, GuardNode guard, LocationNode location) {
+        super(StampFactory.forKind(kind));
+        this.object = object;
+        this.guard = guard;
+        this.location = location;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public final class FloatingReadNode extends FloatingAccessNode implements Node.IterableNodeType, LIRLowerable, Canonicalizable {
+
+    @Input private final NodeInputList<Node> dependencies;
+
+    public NodeInputList<Node> dependencies() {
+        return dependencies;
+    }
+
+    public FloatingReadNode(CiKind kind, ValueNode object, GuardNode guard, LocationNode location, Node... dependencies) {
+        super(kind, object, guard, location);
+        this.dependencies = new NodeInputList<>(this, dependencies);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitLoad(gen.makeAddress(location(), object()), getNullCheck()));
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (object() != null && object().isConstant() && object().kind() == CiKind.Object) {
+            if (this.location() == LocationNode.FINAL_LOCATION && location().getClass() == LocationNode.class) {
+                Object value = object().asConstant().asObject();
+                long displacement = location().displacement();
+                CiKind kind = location().kind();
+                RiRuntime runtime = tool.runtime();
+                CiConstant constant = kind.readUnsafeConstant(value, displacement);
+                if (constant != null) {
+                    return ConstantNode.forCiConstant(constant, runtime, graph());
+                }
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+public final class IndexedLocationNode extends LocationNode implements LIRLowerable, Canonicalizable {
+    @Input private ValueNode index;
+    @Data private boolean indexScalingEnabled;
+
+    public ValueNode index() {
+        return index;
+    }
+
+    public static Object getArrayLocation(CiKind elementKind) {
+        return elementKind;
+    }
+
+    /**
+     * @return whether scaling of the index by the value kind's size is enabled (the default) or disabled.
+     */
+    public boolean indexScalingEnabled() {
+        return indexScalingEnabled;
+    }
+
+    /**
+     * Enables or disables scaling of the index by the value kind's size. Has no effect if the index input is not used.
+     */
+    public void setIndexScalingEnabled(boolean enable) {
+        this.indexScalingEnabled = enable;
+    }
+
+    public static IndexedLocationNode create(Object identity, CiKind kind, int displacement, ValueNode index, Graph graph) {
+        return create(identity, kind, displacement, index, graph, true);
+    }
+
+    public static IndexedLocationNode create(Object identity, CiKind kind, int displacement, ValueNode index, Graph graph, boolean indexScalingEnabled) {
+        return graph.unique(new IndexedLocationNode(identity, kind, index, displacement, indexScalingEnabled));
+    }
+
+    private IndexedLocationNode(Object identity, CiKind kind, ValueNode index, int displacement, boolean indexScalingEnabled) {
+        super(identity, kind, displacement);
+        this.index = index;
+        this.indexScalingEnabled = indexScalingEnabled;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        CiConstant constantIndex = index.asConstant();
+        if (constantIndex != null && constantIndex.kind.stackKind().isInt()) {
+            long constantIndexLong = constantIndex.asInt();
+            if (indexScalingEnabled && tool.target() != null) {
+                constantIndexLong *= tool.target().sizeInBytes(getValueKind());
+            }
+            constantIndexLong += displacement();
+            int constantIndexInt = (int) constantIndexLong;
+            if (constantIndexLong == constantIndexInt) {
+                return LocationNode.create(locationIdentity(), getValueKind(), constantIndexInt, graph());
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.ValueNumberable;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class LocationNode extends FloatingNode implements LIRLowerable, ValueNumberable {
+
+    @Data private int displacement;
+    @Data private CiKind valueKind;
+    @Data private Object locationIdentity;
+
+    public static final Object ANY_LOCATION = new Object() {
+        @Override
+        public String toString() {
+            return "ANY_LOCATION";
+        }
+    };
+    public static final Object FINAL_LOCATION = new Object();
+
+    public static Object getArrayLocation(CiKind elementKind) {
+        return elementKind;
+    }
+
+    public int displacement() {
+        return displacement;
+    }
+
+    public static LocationNode create(Object identity, CiKind kind, int displacement, Graph graph) {
+        return graph.unique(new LocationNode(identity, kind, displacement));
+    }
+
+    protected LocationNode(Object identity, CiKind kind, int displacement) {
+        super(StampFactory.illegal());
+        assert kind != CiKind.Illegal && kind != CiKind.Void;
+        this.displacement = displacement;
+        this.valueKind = kind;
+        this.locationIdentity = identity;
+    }
+
+    public CiKind getValueKind() {
+        return valueKind;
+    }
+
+    public Object locationIdentity() {
+        return locationIdentity;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        // nothing to do...
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LookupSwitchNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+/**
+ * The {@code LookupSwitchNode} represents a lookup switch bytecode, which has a sorted
+ * array of key values.
+ */
+public final class LookupSwitchNode extends SwitchNode implements LIRLowerable, Simplifiable {
+
+    @Data private final int[] keys;
+
+    /**
+     * Constructs a new LookupSwitch instruction.
+     * @param value the instruction producing the value being switched on
+     * @param successors the list of successors
+     * @param keys the list of keys, sorted
+     */
+    public LookupSwitchNode(ValueNode value, BeginNode[] successors, int[] keys, double[] probability) {
+        super(value, successors, probability);
+        assert successors.length == keys.length + 1;
+        this.keys = keys;
+    }
+
+    public LookupSwitchNode(ValueNode value, int[] keys, double[] switchProbability) {
+        this(value, new BeginNode[switchProbability.length], keys, switchProbability);
+    }
+
+    /**
+     * Gets the key at the specified index.
+     * @param i the index
+     * @return the key at that index
+     */
+    public int keyAt(int i) {
+        return keys[i];
+    }
+
+    public int keysLength() {
+        return keys.length;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitLookupSwitch(this);
+    }
+
+    @Override
+    public void simplify(SimplifierTool tool) {
+        if (value() instanceof ConstantNode) {
+            ConstantNode constant = (ConstantNode) value();
+            int value = constant.value.asInt();
+
+            BeginNode remainingSux = (BeginNode) defaultSuccessor();
+            int remainingSuxIndex = blockSuccessorCount() - 1;
+            for (int i = 0; i < keys.length; i++) {
+                if (value == keys[i]) {
+                    remainingSux = blockSuccessor(i);
+                    remainingSuxIndex = i;
+                    break;
+                }
+            }
+
+            for (int i = 0; i < blockSuccessorCount(); i++) {
+                BeginNode sux = blockSuccessor(i);
+                if (sux != remainingSux) {
+                    tool.deleteBranch(sux);
+                }
+            }
+
+            tool.addToWorkList(remainingSux);
+            ((StructuredGraph) graph()).removeSplit(this, remainingSuxIndex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * Cretes a memory barrier.
+ */
+public class MembarNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
+
+    private final int barriers;
+
+    public MembarNode(int barriers) {
+        super(StampFactory.illegal());
+        this.barriers = barriers;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        generator.emitMembar(barriers);
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void get(@ConstantNodeParameter int barriers) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+
+public interface MemoryCheckpoint {
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadHubNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+// TODO (chaeubl) this should be a FloatingNode but Lowering is not possible in that case
+public final class ReadHubNode extends FixedWithNextNode implements Lowerable {
+    @Input private ValueNode object;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public ReadHubNode(ValueNode object) {
+        super(StampFactory.forKind(CiKind.Object));
+        this.object = object;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public final class ReadNode extends AccessNode implements Node.IterableNodeType, LIRLowerable, Canonicalizable {
+
+    public ReadNode(CiKind kind, ValueNode object, LocationNode location) {
+        super(kind, object, location);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.setResult(this, gen.emitLoad(gen.makeAddress(location(), object()), getNullCheck()));
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (object() != null && object().isConstant() && object().kind() == CiKind.Object) {
+            if (location() == LocationNode.FINAL_LOCATION && location().getClass() == LocationNode.class) {
+                Object value = object().asConstant().asObject();
+                long displacement = location().displacement();
+                CiKind kind = location().kind();
+                RiRuntime runtime = tool.runtime();
+                CiConstant constant = kind.readUnsafeConstant(value, displacement);
+                if (constant != null) {
+                    return ConstantNode.forCiConstant(constant, runtime, graph());
+                }
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public final class RuntimeCallNode extends AbstractCallNode implements LIRLowerable {
+
+    @Data private final CiRuntimeCall call;
+
+    public CiRuntimeCall call() {
+        return call;
+    }
+
+    public RuntimeCallNode(CiRuntimeCall call) {
+        this(call, new ValueNode[0]);
+    }
+
+    public RuntimeCallNode(CiRuntimeCall call, ValueNode arg1) {
+        this(call, new ValueNode[] {arg1});
+    }
+
+    public RuntimeCallNode(CiRuntimeCall call, ValueNode[] arguments) {
+        super(StampFactory.forKind(call.resultKind), arguments);
+        this.call = call;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitRuntimeCall(this);
+    }
+
+    // specialized on return type (instead of public static <T> T performCall) until boxing/unboxing is sorted out in intrinsification
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static <S> double performCall(@ConstantNodeParameter CiRuntimeCall call, S arg1) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static long performCall(@ConstantNodeParameter CiRuntimeCall call) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SafeAccessNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+
+public abstract class SafeAccessNode extends AbstractStateSplit {
+
+    @Input private ValueNode object;
+    @Input private LocationNode location;
+
+    public SafeAccessNode(CiKind kind, ValueNode object, LocationNode location) {
+        super(StampFactory.forKind(kind));
+        this.object = object;
+        this.location = location;
+    }
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public LocationNode location() {
+        return location;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SafeReadNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public class SafeReadNode extends SafeAccessNode implements Lowerable {
+
+    public SafeReadNode(CiKind kind, ValueNode object, LocationNode location) {
+        super(kind, object, location);
+        assert object != null && location != null;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        StructuredGraph graph = (StructuredGraph) graph();
+        GuardNode guard = (GuardNode) tool.createGuard(graph.unique(new NullCheckNode(object(), false)));
+        ReadNode read = graph.add(new ReadNode(kind(), object(), location()));
+        read.setGuard(guard);
+
+        graph.replaceFixedWithFixed(this, read);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SafeWriteNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public class SafeWriteNode extends SafeAccessNode implements Lowerable{
+
+    @Input private ValueNode value;
+
+    public SafeWriteNode(ValueNode object, ValueNode value, LocationNode location) {
+        super(CiKind.Void, object, location);
+        this.value = value;
+    }
+
+    public ValueNode value() {
+        return value;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        StructuredGraph graph = (StructuredGraph) graph();
+        GuardNode guard = (GuardNode) tool.createGuard(graph.unique(new NullCheckNode(object(), false)));
+        WriteNode write = graph.add(new WriteNode(object(), value(), location()));
+        write.setGuard(guard);
+        graph.replaceFixedWithFixed(this, write);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code SwitchNode} class is the base of both lookup and table switches.
+ */
+public abstract class SwitchNode extends ControlSplitNode {
+
+    @Input private ValueNode value;
+
+    public ValueNode value() {
+        return value;
+    }
+
+    /**
+     * Constructs a new Switch.
+     * @param value the instruction that provides the value to be switched over
+     * @param successors the list of successors of this switch
+     * @param stateAfter the state after the switch
+     */
+    public SwitchNode(ValueNode value, BeginNode[] successors, double[] probability) {
+        super(StampFactory.illegal(), successors, probability);
+        this.value = value;
+    }
+
+    /**
+     * Gets the number of cases that this switch covers (excluding the default case).
+     * @return the number of cases
+     */
+    public int numberOfCases() {
+        return blockSuccessorCount() - 1;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/TableSwitchNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+/**
+ * The {@code TableSwitchNode} represents a table switch.
+ */
+public final class TableSwitchNode extends SwitchNode implements LIRLowerable, Simplifiable {
+
+    @Data private final int lowKey;
+
+    /**
+     * Constructs a new TableSwitch instruction.
+     * @param value the instruction producing the value being switched on
+     * @param successors the list of successors
+     * @param lowKey the lowest integer key in the table
+     */
+    public TableSwitchNode(ValueNode value, BeginNode[] successors, int lowKey, double[] probability) {
+        super(value, successors, probability);
+        this.lowKey = lowKey;
+    }
+
+    public TableSwitchNode(ValueNode value, int lowKey, double[] switchProbability) {
+        this(value, new BeginNode[switchProbability.length], lowKey, switchProbability);
+    }
+
+    /**
+     * Gets the lowest key in the table switch (inclusive).
+     * @return the low key
+     */
+    public int lowKey() {
+        return lowKey;
+    }
+
+    /**
+     * Gets the highest key in the table switch (exclusive).
+     * @return the high key
+     */
+    public int highKey() {
+        return lowKey + numberOfCases();
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitTableSwitch(this);
+    }
+
+    @Override
+    public void simplify(SimplifierTool tool) {
+        if (value() instanceof ConstantNode) {
+            ConstantNode constant = (ConstantNode) value();
+            int value = constant.value.asInt();
+
+            int remainingSuxIndex;
+            if (value >= lowKey() && value <= highKey()) {
+                remainingSuxIndex = value - lowKey();
+            } else {
+                remainingSuxIndex = blockSuccessorCount() - 1;
+            }
+
+            BeginNode remainingSux = blockSuccessor(remainingSuxIndex);
+            for (int i = 0; i < blockSuccessorCount(); i++) {
+                BeginNode sux = blockSuccessor(i);
+                if (sux != remainingSux) {
+                    tool.deleteBranch(sux);
+                }
+            }
+
+            tool.addToWorkList(remainingSux);
+            ((StructuredGraph) graph()).removeSplit(this, remainingSuxIndex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+
+public final class UnboxNode extends FixedWithNextNode implements Node.IterableNodeType, Canonicalizable {
+
+    @Input private ValueNode source;
+    @Data private CiKind destinationKind;
+
+    public UnboxNode(CiKind kind, ValueNode source) {
+        super(StampFactory.forKind(kind));
+        this.source = source;
+        this.destinationKind = kind;
+        assert kind != CiKind.Object : "can only unbox to primitive";
+        assert source.kind() == CiKind.Object : "can only unbox objects";
+    }
+
+    public ValueNode source() {
+        return source;
+    }
+
+    public CiKind destinationKind() {
+        return destinationKind;
+    }
+
+    public void expand(BoxingMethodPool pool) {
+        RiResolvedField field = pool.getBoxField(kind());
+        LoadFieldNode loadField = graph().add(new LoadFieldNode(source, field));
+        loadField.setProbability(probability());
+        ((StructuredGraph) graph()).replaceFixedWithFixed(this, loadField);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (source.isConstant()) {
+            CiConstant constant = source.asConstant();
+            Object o = constant.asObject();
+            if (o != null) {
+                switch (destinationKind) {
+                    case Boolean:
+                        return ConstantNode.forBoolean((Boolean) o, graph());
+                    case Byte:
+                        return ConstantNode.forByte((Byte) o, graph());
+                    case Char:
+                        return ConstantNode.forChar((Character) o, graph());
+                    case Short:
+                        return ConstantNode.forShort((Short) o, graph());
+                    case Int:
+                        return ConstantNode.forInt((Integer) o, graph());
+                    case Long:
+                        return ConstantNode.forLong((Long) o, graph());
+                    case Float:
+                        return ConstantNode.forFloat((Long) o, graph());
+                    case Double:
+                        return ConstantNode.forDouble((Long) o, graph());
+                    default:
+                        ValueUtil.shouldNotReachHere();
+                }
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code UnsafeCastNode} produces the same value as its input, but with a different type.
+ */
+public final class UnsafeCastNode extends FloatingNode implements Canonicalizable, Lowerable {
+
+    @Input private ValueNode x;
+    @Data private RiResolvedType toType;
+
+    public ValueNode x() {
+        return x;
+    }
+
+    public UnsafeCastNode(ValueNode x, RiResolvedType toType) {
+        super(StampFactory.declared(toType));
+        this.x = x;
+        this.toType = toType;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x != null && x.declaredType() != null && x.declaredType().isSubtypeOf(toType)) {
+            return x;
+        }
+        return this;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        ((StructuredGraph) graph()).replaceFloating(this, x);
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static <T> T cast(Object object, @ConstantNodeParameter Class<?> toType) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * Load of a value from a location specified as an offset relative to an object.
+ */
+public class UnsafeLoadNode extends AbstractStateSplit implements Lowerable {
+
+    @Input private ValueNode object;
+    @Input private ValueNode offset;
+    @Data private final int displacement;
+    @Data private final CiKind loadKind;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public int displacement() {
+        return displacement;
+    }
+
+    public ValueNode offset() {
+        return offset;
+    }
+
+    public UnsafeLoadNode(ValueNode object, ValueNode offset, CiKind kind) {
+        this(object, 0, offset, kind);
+    }
+
+    public UnsafeLoadNode(ValueNode object, int displacement, ValueNode offset, CiKind kind) {
+        super(StampFactory.forKind(kind.stackKind()));
+        this.object = object;
+        this.displacement = displacement;
+        this.offset = offset;
+        this.loadKind = kind;
+    }
+
+    public CiKind loadKind() {
+        return loadKind;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static <T> T load(Object object, long offset, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * Store of a value at a location specified as an offset relative to an object.
+ */
+public class UnsafeStoreNode extends AbstractStateSplit implements Lowerable {
+
+    @Input private ValueNode object;
+    @Input private ValueNode offset;
+    @Input private ValueNode value;
+    @Data private final int displacement;
+    @Data private final CiKind storeKind;
+
+    public UnsafeStoreNode(ValueNode object, ValueNode offset, ValueNode value, CiKind kind) {
+        this(object, 0, offset, value, kind);
+    }
+
+    public UnsafeStoreNode(ValueNode object, int displacement, ValueNode offset, ValueNode value, CiKind kind) {
+        super(StampFactory.illegal());
+        assert kind != CiKind.Void && kind != CiKind.Illegal;
+        this.object = object;
+        this.displacement = displacement;
+        this.offset = offset;
+        this.value = value;
+        this.storeKind = kind;
+    }
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public int displacement() {
+        return displacement;
+    }
+
+    public ValueNode offset() {
+        return offset;
+    }
+
+    public ValueNode value() {
+        return value;
+    }
+
+    public CiKind storeKind() {
+        return storeKind;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+
+    // specialized on value type until boxing/unboxing is sorted out in intrinsification
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, Object value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, boolean value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, byte value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, char value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, double value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, float value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, int value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, long value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static void store(Object object, long offset, short value, @ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The ValueAnchor instruction keeps non-CFG (floating) nodes above a certain point in the graph.
+ */
+
+public final class ValueAnchorNode extends FixedWithNextNode implements Canonicalizable, LIRLowerable, Node.IterableNodeType {
+
+    @Input private ValueNode object;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public ValueAnchorNode(ValueNode object) {
+        super(StampFactory.illegal());
+        this.object = object;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // Nothing to emit, since this is node is used for structural purposes only.
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (object == null) {
+            return null;
+        }
+        if (object instanceof ConstantNode) {
+            return null;
+        }
+        if (object instanceof IntegerDivNode || object instanceof IntegerRemNode) {
+            if (((ArithmeticNode) object).y().isConstant()) {
+                CiConstant  constant = ((ArithmeticNode) object).y().asConstant();
+                assert constant.kind == object.kind() : constant.kind + " != " + object.kind();
+                if (constant.asLong() != 0) {
+                    return null;
+                }
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteMemoryCheckpointNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+
+public final class WriteMemoryCheckpointNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
+
+    public WriteMemoryCheckpointNode() {
+        this(StampFactory.illegal());
+    }
+
+    public WriteMemoryCheckpointNode(Stamp stamp) {
+        super(stamp);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool generator) {
+        // nothing to do...
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.extended;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public final class WriteNode extends AccessNode implements LIRLowerable {
+    @Input private ValueNode value;
+
+    public ValueNode value() {
+        return value;
+    }
+
+    public WriteNode(ValueNode object, ValueNode value, LocationNode location) {
+        super(CiKind.Void, object, location);
+        this.value = value;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitStore(gen.makeAddress(location(), object()), gen.operand(value()), getNullCheck());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessArrayNode.java	Thu Mar 08 19:24:17 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.graal.nodes.java;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * This the base class of all array operations.
+ */
+public abstract class AccessArrayNode extends AbstractStateSplit {
+
+    @Input private ValueNode array;
+
+    public ValueNode array() {
+        return array;
+    }
+
+    /**
+     * Creates a new AccessArrayNode.
+     * @param kind the type of the result of this instruction
+     * @param array the instruction that produces the array object value
+     */
+    public AccessArrayNode(Stamp stamp, ValueNode array) {
+        super(stamp);
+        this.array = array;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The base class of all instructions that access fields.
+ */
+public abstract class AccessFieldNode extends AbstractStateSplit implements Lowerable {
+
+    @Input private ValueNode object;
+
+    @Data protected final RiResolvedField field;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    /**
+     * Constructs a new access field object.
+     * @param kind the result kind of the access
+     * @param object the instruction producing the receiver object
+     * @param field the compiler interface representation of the field
+     * @param graph
+     */
+    public AccessFieldNode(Stamp stamp, ValueNode object, RiResolvedField field) {
+        super(stamp);
+        this.object = object;
+        this.field = field;
+        assert field.holder().isInitialized();
+    }
+
+    /**
+     * Gets the compiler interface field for this field access.
+     * @return the compiler interface field for this field access
+     */
+    public RiResolvedField field() {
+        return field;
+    }
+
+    /**
+     * Checks whether this field access is an access to a static field.
+     * @return {@code true} if this field access is to a static field
+     */
+    public boolean isStatic() {
+        return Modifier.isStatic(field.accessFlags());
+    }
+
+    /**
+     * Checks whether this field is declared volatile.
+     * @return {@code true} if the field is resolved and declared volatile
+     */
+    public boolean isVolatile() {
+        return Modifier.isVolatile(field.accessFlags());
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> debugProperties = super.getDebugProperties();
+        debugProperties.put("field", CiUtil.format("%h.%n", field));
+        return debugProperties;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java	Thu Mar 08 19:24:17 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.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code AccessIndexedNode} class is the base class of instructions that read or write
+ * elements of an array.
+ */
+public abstract class AccessIndexedNode extends AccessArrayNode {
+
+    @Input private ValueNode index;
+    @Input private ValueNode length;
+
+    public ValueNode index() {
+        return index;
+    }
+
+    public ValueNode length() {
+        return length;
+    }
+
+    private final CiKind elementType;
+
+    /**
+     * Create an new AccessIndexedNode.
+     * @param kind the result kind of the access
+     * @param array the instruction producing the array
+     * @param index the instruction producing the index
+     * @param length the instruction producing the length
+     * @param elementKind the type of the elements of the array
+     */
+    protected AccessIndexedNode(Stamp stamp, ValueNode array, ValueNode index, ValueNode length, CiKind elementKind) {
+        super(stamp, array);
+        this.index = index;
+        this.length = length;
+        this.elementType = elementKind;
+    }
+
+    /**
+     * Gets the element type of the array.
+     * @return the element type
+     */
+    public CiKind elementKind() {
+        return elementType;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessMonitorNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code AccessMonitorNode} is the base class of both monitor acquisition and release.
+ * <br>
+ * The VM needs information about monitors in the debug information. This information is built from
+ * the nesting level of {@link MonitorEnterNode} when the LIR is constructed. Therefore, monitor
+ * nodes must not be removed from the graph unless it is guaranteed that the nesting level does not change.
+ * For example, you must not remove a {@link MonitorEnterNode} for a thread-local object or for a recursive locking.
+ * Instead, mark the node as {@link #eliminated}. This makes sure that the meta data still contains the complete
+ * locking hierarchy.
+ * <br>
+ * The Java bytecode specification allows non-balanced locking. Graal does not handle such cases and throws a
+ * {@link CiBailout} instead. Detecting non-balanced monitors during bytecode parsing is difficult, since the
+ * node flowing into the {@link MonitorExitNode} can be a phi function hiding the node that was flowing into the
+ * {@link MonitorEnterNode}. Optimization phases are free to throw {@link CiBailout} if they detect such cases.
+ * Otherwise, they are detected during LIR construction.
+ */
+public abstract class AccessMonitorNode extends AbstractStateSplit implements MemoryCheckpoint {
+
+    @Input private ValueNode object;
+    @Data private boolean eliminated;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public boolean eliminated() {
+        return eliminated;
+    }
+
+    public void eliminate() {
+        eliminated = true;
+    }
+
+    /**
+     * Creates a new AccessMonitor instruction.
+     *
+     * @param object the instruction producing the object
+     */
+    public AccessMonitorNode(ValueNode object) {
+        super(StampFactory.illegal());
+        this.object = object;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Thu Mar 08 19:24:17 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.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code ArrayLength} instruction gets the length of an array.
+ */
+public final class ArrayLengthNode extends FixedWithNextNode implements Canonicalizable, Lowerable, LIRLowerable {
+
+    @Input private ValueNode array;
+
+    public ValueNode array() {
+        return array;
+    }
+
+    public ArrayLengthNode(ValueNode array) {
+        super(StampFactory.intValue());
+        this.array = array;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitArrayLength(this);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (array() instanceof NewArrayNode) {
+            ValueNode length = ((NewArrayNode) array()).dimension(0);
+            assert length != null;
+            return length;
+        }
+        CiConstant constantValue = null;
+        if (array().isConstant() && !array().isNullConstant()) {
+            constantValue = array().asConstant();
+            if (constantValue != null && constantValue.isNonNull()) {
+                RiRuntime runtime = tool.runtime();
+                return ConstantNode.forInt(runtime.getArrayLength(constantValue), graph());
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code CheckCastNode} represents a {@link Bytecodes#CHECKCAST}.
+ *
+ * The {@link #targetClass()} of a CheckCastNode can be null for array store checks!
+ */
+public final class CheckCastNode extends TypeCheckNode implements Canonicalizable, LIRLowerable, Node.IterableNodeType {
+
+    @Input protected final FixedNode anchor;
+    @Data  protected final boolean emitCode;
+
+    public FixedNode anchor() {
+        return anchor;
+    }
+
+    public boolean emitCode() {
+        return emitCode;
+    }
+
+    /**
+     * Creates a new CheckCast instruction.
+     *
+     * @param targetClassInstruction the instruction which produces the class which is being cast to
+     * @param targetClass the class being cast to
+     * @param object the instruction producing the object
+     */
+    public CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object) {
+        this(anchor, targetClassInstruction, targetClass, object, EMPTY_HINTS, false);
+    }
+
+    public CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, boolean emitCode) {
+        this(anchor, targetClassInstruction, targetClass, object, EMPTY_HINTS, false, emitCode);
+    }
+
+    public CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact) {
+        this(anchor, targetClassInstruction, targetClass, object, hints, hintsExact, true);
+    }
+
+    private CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact, boolean emitCode) {
+        super(targetClassInstruction, targetClass, object, hints, hintsExact, targetClass == null ? StampFactory.forKind(CiKind.Object) : StampFactory.declared(targetClass));
+        this.anchor = anchor;
+        this.emitCode = emitCode;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitCheckCast(this);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        RiResolvedType objectDeclaredType = object().declaredType();
+        RiResolvedType targetClass = targetClass();
+        if (objectDeclaredType != null && targetClass != null && objectDeclaredType.isSubtypeOf(targetClass)) {
+            freeAnchor();
+            return object();
+        }
+        CiConstant constant = object().asConstant();
+        if (constant != null) {
+            assert constant.kind == CiKind.Object;
+            if (constant.isNull()) {
+                freeAnchor();
+                return object();
+            }
+        }
+
+        if (tool.assumptions() != null && hints() != null && targetClass() != null) {
+            if (!hintsExact() && hints().length == 1 && hints()[0] == targetClass().uniqueConcreteSubtype()) {
+                tool.assumptions().recordConcreteSubtype(targetClass(), hints()[0]);
+                return graph().unique(new CheckCastNode(anchor, targetClassInstruction(), targetClass(), object(), hints(), true));
+            }
+        }
+        return this;
+    }
+
+    // TODO (thomaswue): Find a better way to handle anchors.
+    private void freeAnchor() {
+        ValueAnchorNode anchorUsage = usages().filter(ValueAnchorNode.class).first();
+        if (anchorUsage != null) {
+            anchorUsage.replaceFirstInput(this, null);
+        }
+    }
+
+    @Override
+    public BooleanNode negate() {
+        throw new Error("A CheckCast does not produce a boolean value, so it should actually not be a subclass of BooleanNode");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * Represents an atomic compare-and-swap operation. If {@link #directResult} is true then the value read from the memory location is produced.
+ * Otherwise the result is a boolean that contains whether the value matched the expected value.
+ */
+public class CompareAndSwapNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
+
+    @Input private ValueNode object;
+    @Input private ValueNode offset;
+    @Input private ValueNode expected;
+    @Input private ValueNode newValue;
+    @Data private final boolean directResult;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public ValueNode offset() {
+        return offset;
+    }
+
+    public ValueNode expected() {
+        return expected;
+    }
+
+    public ValueNode newValue() {
+        return newValue;
+    }
+
+    public boolean directResult() {
+        return directResult;
+    }
+
+    public CompareAndSwapNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue) {
+        this(object, offset, expected, newValue, false);
+    }
+
+    public CompareAndSwapNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, boolean directResult) {
+        super(StampFactory.forKind(directResult ? expected.kind().stackKind() : CiKind.Boolean.stackKind()));
+        assert expected.kind() == newValue.kind();
+        this.object = object;
+        this.offset = offset;
+        this.expected = expected;
+        this.newValue = newValue;
+        this.directResult = directResult;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitCompareAndSwap(this);
+    }
+
+    // specialized on value type until boxing/unboxing is sorted out in intrinsification
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static boolean compareAndSwap(Object object, long offset, Object expected, Object newValue) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static boolean compareAndSwap(Object object, long offset, long expected, long newValue) {
+        throw new UnsupportedOperationException();
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static boolean compareAndSwap(Object object, long offset, int expected, int newValue) {
+        throw new UnsupportedOperationException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code ExceptionObject} instruction represents the incoming exception object to an exception handler.
+ */
+public final class ExceptionObjectNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
+
+    /**
+     * Constructs a new ExceptionObject instruction.
+     */
+    public ExceptionObjectNode() {
+        super(StampFactory.forKind(CiKind.Object));
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitExceptionObject(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java	Thu Mar 08 19:24:17 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.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code InstanceOfNode} represents an instanceof test.
+ */
+public final class InstanceOfNode extends TypeCheckNode implements Canonicalizable, LIRLowerable {
+
+    @Data private final boolean negated;
+
+    public boolean negated() {
+        return negated;
+    }
+
+    /**
+     * Constructs a new InstanceOfNode.
+     *
+     * @param targetClassInstruction the instruction which produces the target class of the instanceof check
+     * @param targetClass the class which is the target of the instanceof check
+     * @param object the instruction producing the object input to this instruction
+     */
+    public InstanceOfNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, boolean negated) {
+        this(targetClassInstruction, targetClass, object, EMPTY_HINTS, false, negated);
+    }
+
+    public InstanceOfNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact, boolean negated) {
+        super(targetClassInstruction, targetClass, object, hints, hintsExact, StampFactory.illegal());
+        this.negated = negated;
+        assert targetClass != null;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        assert object() != null : this;
+        RiResolvedType exact = object().exactType();
+        if (exact != null) {
+            boolean result = exact.isSubtypeOf(targetClass());
+            if (result != negated) {
+                // The instanceof check reduces to a null check.
+                return graph().unique(new NullCheckNode(object(), false));
+            } else {
+                // The instanceof check can never succeed.
+                return ConstantNode.forBoolean(false, graph());
+            }
+        }
+        CiConstant constant = object().asConstant();
+        if (constant != null) {
+            assert constant.kind == CiKind.Object;
+            if (constant.isNull()) {
+                return ConstantNode.forBoolean(negated, graph());
+            } else {
+                assert false : "non-null constants are always expected to provide an exactType";
+            }
+        }
+        if (tool.assumptions() != null && hints() != null && targetClass() != null) {
+            if (!hintsExact() && hints().length == 1 && hints()[0] == targetClass().uniqueConcreteSubtype()) {
+                tool.assumptions().recordConcreteSubtype(targetClass(), hints()[0]);
+                return graph().unique(new InstanceOfNode(targetClassInstruction(), targetClass(), object(), hints(), true, negated));
+            }
+        }
+        return this;
+    }
+
+    @Override
+    public BooleanNode negate() {
+        return graph().unique(new InstanceOfNode(targetClassInstruction(), targetClass(), object(), hints(), hintsExact(), !negated));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public final class IsTypeNode extends BooleanNode implements Canonicalizable, LIRLowerable {
+
+    @Input private ValueNode objectClass;
+    @Data private final RiResolvedType type;
+
+    public ValueNode objectClass() {
+        return objectClass;
+    }
+
+    /**
+     * Constructs a new IsTypeNode.
+     *
+     * @param object the instruction producing the object to check against the given type
+     * @param type the type for this check
+     */
+    public IsTypeNode(ValueNode objectClass, RiResolvedType type) {
+        super(StampFactory.illegal());
+        assert objectClass == null || objectClass.kind() == CiKind.Object;
+        this.type = type;
+        this.objectClass = objectClass;
+    }
+
+    public RiResolvedType type() {
+        return type;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // nothing to do
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("type", type);
+        return properties;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        RiResolvedType exactType = objectClass() instanceof ReadHubNode ? ((ReadHubNode) objectClass()).object().exactType() : null;
+        if (exactType != null) {
+            return ConstantNode.forBoolean(exactType == type(), graph());
+        }
+        // constants return the correct exactType, so they are handled by the code above
+        return this;
+    }
+
+    @Override
+    public BooleanNode negate() {
+        throw new Error("unimplemented");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code LoadFieldNode} represents a read of a static or instance field.
+ */
+public final class LoadFieldNode extends AccessFieldNode implements Canonicalizable, LIRLowerable, Node.IterableNodeType {
+
+    /**
+     * Creates a new LoadFieldNode instance.
+     *
+     * @param object the receiver object
+     * @param field the compiler interface field
+     */
+    public LoadFieldNode(ValueNode object, RiResolvedField field) {
+        super(createStamp(field), object, field);
+    }
+
+    private static Stamp createStamp(RiResolvedField field) {
+        CiKind kind = field.kind(false);
+        if (kind == CiKind.Object && field.type() instanceof RiResolvedType) {
+            RiResolvedType resolvedType = (RiResolvedType) field.type();
+            return StampFactory.declared(resolvedType);
+        } else {
+            return StampFactory.forKind(kind);
+        }
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitLoadField(this);
+    }
+
+    @Override
+    public boolean needsStateAfter() {
+        return false;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        CiConstant constant = null;
+        if (isStatic()) {
+            constant = field().constantValue(null);
+        } else if (object().isConstant() && !object().isNullConstant()) {
+            constant = field().constantValue(object().asConstant());
+        }
+        if (constant != null) {
+            return ConstantNode.forCiConstant(constant, tool.runtime(), graph());
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Thu Mar 08 19:24:17 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.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code LoadIndexedNode} represents a read from an element of an array.
+ */
+public final class LoadIndexedNode extends AccessIndexedNode implements Lowerable, LIRLowerable, Node.IterableNodeType {
+
+    /**
+     * Creates a new LoadIndexedNode.
+     * @param array the instruction producing the array
+     * @param index the instruction producing the index
+     * @param length the instruction producing the length
+     * @param elementKind the element type
+     */
+    public LoadIndexedNode(ValueNode array, ValueNode index, ValueNode length, CiKind elementKind) {
+        super(createStamp(array, elementKind), array, index, length, elementKind);
+    }
+
+    private static Stamp createStamp(ValueNode array, CiKind kind) {
+        if (kind == CiKind.Object && array.declaredType() != null) {
+            return StampFactory.declared(array.declaredType().componentType());
+        } else {
+            return StampFactory.forKind(kind);
+        }
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitLoadIndexed(this);
+    }
+
+    @Override
+    public boolean needsStateAfter() {
+        return false;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class MethodCallTargetNode extends CallTargetNode implements Node.IterableNodeType, Canonicalizable {
+    public enum InvokeKind {
+        Interface,
+        Special,
+        Static,
+        Virtual
+    }
+
+    @Data private final RiType returnType;
+    @Data private RiResolvedMethod targetMethod;
+    @Data private InvokeKind invokeKind;
+    private final Stamp returnStamp;
+
+    /**
+     * @param arguments
+     */
+    public MethodCallTargetNode(InvokeKind invokeKind, RiResolvedMethod targetMethod, ValueNode[] arguments, RiType returnType) {
+        super(arguments);
+        this.invokeKind = invokeKind;
+        this.returnType = returnType;
+        this.targetMethod = targetMethod;
+        CiKind returnKind = targetMethod.signature().returnKind(false);
+        if (returnKind == CiKind.Object && returnType instanceof RiResolvedType) {
+            returnStamp = StampFactory.declared((RiResolvedType) returnType);
+        } else {
+            returnStamp = StampFactory.forKind(returnKind);
+        }
+    }
+
+    @Override
+    public RiType returnType() {
+        return returnType;
+    }
+
+    /**
+     * Gets the target method for this invocation instruction.
+     * @return the target method
+     */
+    public RiResolvedMethod targetMethod() {
+        return targetMethod;
+    }
+
+    public InvokeKind invokeKind() {
+        return invokeKind;
+    }
+
+    public void setInvokeKind(InvokeKind kind) {
+        this.invokeKind = kind;
+    }
+
+    public void setTargetMethod(RiResolvedMethod method) {
+        targetMethod = method;
+    }
+
+    /**
+     * Gets the instruction that produces the receiver object for this invocation, if any.
+     * @return the instruction that produces the receiver object for this invocation if any, {@code null} if this
+     *         invocation does not take a receiver object
+     */
+    public ValueNode receiver() {
+        return isStatic() ? null : arguments().get(0);
+    }
+
+    /**
+     * Checks whether this is an invocation of a static method.
+     * @return {@code true} if the invocation is a static invocation
+     */
+    public boolean isStatic() {
+        return invokeKind() == InvokeKind.Static;
+    }
+
+    @Override
+    public CiKind returnKind() {
+        return targetMethod().signature().returnKind(false);
+    }
+
+    public Invoke invoke() {
+        return (Invoke) this.usages().first();
+    }
+
+
+    @Override
+    public boolean verify() {
+        assert usages().size() <= 1 : "call target may only be used by a single invoke";
+        for (Node n : usages()) {
+            assertTrue(n instanceof Invoke, "call target can only be used from an invoke (%s)", n);
+        }
+        return super.verify();
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Long) {
+            return super.toString(Verbosity.Short) + "(" + targetMethod() + ")";
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (!isStatic()) {
+            ValueNode receiver = receiver();
+            if (receiver != null && receiver.exactType() != null) {
+                if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) {
+                    RiResolvedMethod method = receiver.exactType().resolveMethodImpl(targetMethod);
+                    if (method != null) {
+                        invokeKind = InvokeKind.Special;
+                        targetMethod = method;
+                    }
+                }
+            }
+        }
+        return this;
+    }
+
+    public Stamp returnStamp() {
+        return returnStamp;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+/**
+ * The {@code MonitorEnterNode} represents the acquisition of a monitor.
+ */
+public final class MonitorEnterNode extends AccessMonitorNode implements LIRLowerable {
+
+    /**
+     * Creates a new MonitorEnterNode.
+     *
+     * @param object the instruction producing the object
+     */
+    public MonitorEnterNode(ValueNode object) {
+        super(object);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitMonitorEnter(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.graph.*;
+
+/**
+ * The {@code MonitorEnterNode} represents a monitor release.
+ */
+public final class MonitorExitNode extends AccessMonitorNode implements LIRLowerable, Node.IterableNodeType {
+
+    /**
+     * Creates a new MonitorExitNode.
+     *
+     * @param object the instruction produces the object value
+     */
+    public MonitorExitNode(ValueNode object) {
+        super(object);
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitMonitorExit(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code NewArrayNode} class is the base of all instructions that allocate arrays.
+ */
+public abstract class NewArrayNode extends FixedWithNextNode implements EscapeAnalyzable{
+
+    @Input private ValueNode length;
+
+    public static final int MaximumEscapeAnalysisArrayLength = 32;
+
+    public ValueNode length() {
+        return length;
+    }
+
+    /**
+     * Constructs a new NewArrayNode.
+     * @param length the node that produces the length for this allocation
+     */
+    protected NewArrayNode(Stamp stamp, ValueNode length) {
+        super(stamp);
+        this.length = length;
+    }
+
+    /**
+     * The list of node which produce input for this instruction.
+     */
+    public ValueNode dimension(int index) {
+        assert index == 0;
+        return length();
+    }
+
+    /**
+     * The rank of the array allocated by this node, i.e. how many array dimensions.
+     */
+    public int dimensionCount() {
+        return 1;
+    }
+
+    /**
+     * Gets the element type of the array.
+     * @return the element type of the array
+     */
+    public abstract RiResolvedType elementType();
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("exactType", exactType());
+        return properties;
+    }
+
+    public EscapeOp getEscapeOp() {
+        return ESCAPE;
+    }
+
+    private static final EscapeOp ESCAPE = new EscapeOp() {
+
+        @Override
+        public boolean canAnalyze(Node node) {
+            NewArrayNode x = (NewArrayNode) node;
+            CiConstant length = x.dimension(0).asConstant();
+            return length != null && length.asInt() >= 0 && length.asInt() < MaximumEscapeAnalysisArrayLength;
+        }
+
+        @Override
+        public EscapeField[] fields(Node node) {
+            NewArrayNode x = (NewArrayNode) node;
+            int length = x.dimension(0).asConstant().asInt();
+            EscapeField[] fields = new EscapeField[length];
+            for (int i = 0; i < length; i++) {
+                Integer representation = i;
+                fields[i] = new EscapeField("[" + i + "]", representation, ((NewArrayNode) node).elementType());
+            }
+            return fields;
+        }
+
+        @Override
+        public void beforeUpdate(Node node, Node usage) {
+            if (usage instanceof ArrayLengthNode) {
+                ArrayLengthNode x = (ArrayLengthNode) usage;
+                StructuredGraph graph = (StructuredGraph) node.graph();
+                x.replaceAtUsages(((NewArrayNode) node).dimension(0));
+                graph.removeFixed(x);
+            } else {
+                super.beforeUpdate(node, usage);
+            }
+        }
+
+        @Override
+        public int updateState(Node node, Node current, Map<Object, Integer> fieldIndex, ValueNode[] fieldState) {
+            if (current instanceof AccessIndexedNode) {
+                AccessIndexedNode x = (AccessIndexedNode) current;
+                if (x.array() == node) {
+                    int index = ((AccessIndexedNode) current).index().asConstant().asInt();
+                    if (current instanceof LoadIndexedNode) {
+                        x.replaceAtUsages(fieldState[index]);
+                        ((StructuredGraph) x.graph()).removeFixed(x);
+                    } else if (current instanceof StoreIndexedNode) {
+                        fieldState[index] = ((StoreIndexedNode) x).value();
+                        ((StructuredGraph) x.graph()).removeFixed(x);
+                        return index;
+                    }
+                }
+            }
+            return -1;
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import java.util.*;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code NewInstanceNode} represents the allocation of an instance class object.
+ */
+public final class NewInstanceNode extends FixedWithNextNode implements EscapeAnalyzable, LIRLowerable, Node.IterableNodeType {
+
+    private final RiResolvedType instanceClass;
+
+    /**
+     * Constructs a NewInstanceNode.
+     * @param type the class being allocated
+     */
+    public NewInstanceNode(RiResolvedType type) {
+        super(StampFactory.exactNonNull(type));
+        this.instanceClass = type;
+    }
+
+    /**
+     * Gets the instance class being allocated by this node.
+     * @return the instance class allocated
+     */
+    public RiResolvedType instanceClass() {
+        return instanceClass;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitNewInstance(this);
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("instanceClass", instanceClass);
+        return properties;
+    }
+
+    public EscapeOp getEscapeOp() {
+        return ESCAPE;
+    }
+
+    private static final EscapeOp ESCAPE = new EscapeOp() {
+
+        @Override
+        public boolean canAnalyze(Node node) {
+            return true;
+        }
+
+        private void fillEscapeFields(RiResolvedType type, List<EscapeField> escapeFields) {
+            if (type != null) {
+                fillEscapeFields(type.superType(), escapeFields);
+                RiField[] declaredFields = type.declaredFields();
+                assert declaredFields != null : "the runtime must specify the declared fields of that type";
+                for (RiField field : declaredFields) {
+                    escapeFields.add(new EscapeField(field.name(), field, field.type()));
+                }
+            }
+        }
+
+        @Override
+        public EscapeField[] fields(Node node) {
+            NewInstanceNode x = (NewInstanceNode) node;
+            List<EscapeField> escapeFields = new ArrayList<>();
+            fillEscapeFields(x.instanceClass(), escapeFields);
+            return escapeFields.toArray(new EscapeField[escapeFields.size()]);
+        }
+
+        @Override
+        public void beforeUpdate(Node node, Node usage) {
+            if (usage instanceof RegisterFinalizerNode) {
+                RegisterFinalizerNode x = (RegisterFinalizerNode) usage;
+                ((StructuredGraph) x.graph()).removeFixed(x);
+            } else {
+                super.beforeUpdate(node, usage);
+            }
+        }
+
+        @Override
+        public int updateState(Node node, Node current, Map<Object, Integer> fieldIndex, ValueNode[] fieldState) {
+            if (current instanceof AccessFieldNode) {
+                AccessFieldNode x = (AccessFieldNode) current;
+                if (x.object() == node) {
+                    int field = fieldIndex.get(x.field());
+                    StructuredGraph graph = (StructuredGraph) x.graph();
+                    if (current instanceof LoadFieldNode) {
+                        assert fieldState[field] != null : field + ", " + x.field();
+                        x.replaceAtUsages(fieldState[field]);
+                        graph.removeFixed(x);
+                    } else if (current instanceof StoreFieldNode) {
+                        fieldState[field] = ((StoreFieldNode) x).value();
+                        graph.removeFixed(x);
+                        return field;
+                    }
+                }
+            }
+            return -1;
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java	Thu Mar 08 19:24:17 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.graal.nodes.java;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code NewMultiArrayNode} represents an allocation of a multi-dimensional object
+ * array.
+ */
+public final class NewMultiArrayNode extends FixedWithNextNode implements LIRLowerable {
+
+    @Input private final NodeInputList<ValueNode> dimensions;
+    @Data private final RiResolvedType type;
+
+    public ValueNode dimension(int index) {
+        return dimensions.get(index);
+    }
+
+    public int dimensionCount() {
+        return dimensions.size();
+    }
+
+    /**
+     * Constructs a new NewMultiArrayNode.
+     * @param elementType the element type of the array
+     * @param dimensions the node which produce the dimensions for this array
+     * @param cpi the constant pool index for resolution
+     * @param riConstantPool the constant pool for resolution
+     */
+    public NewMultiArrayNode(RiResolvedType type, ValueNode[] dimensions) {
+        super(StampFactory.exactNonNull(type));
+        this.type = type;
+        this.dimensions = new NodeInputList<>(this, dimensions);
+        assert dimensions.length > 0 && type.isArrayClass();
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitNewMultiArray(this);
+    }
+
+    public RiResolvedType type() {
+        return type;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewObjectArrayNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code NewObjectArrayNode} represents an allocation of an object array.
+ */
+public final class NewObjectArrayNode extends NewArrayNode implements LIRLowerable, Node.IterableNodeType {
+
+    private final RiResolvedType elementClass;
+
+    /**
+     * Constructs a new NewObjectArrayNode.
+     * @param elementClass the class of elements in this array
+     * @param length the node producing the length of the array
+     * @param graph
+     */
+    public NewObjectArrayNode(RiResolvedType elementClass, ValueNode length) {
+        super(StampFactory.exactNonNull(elementClass.arrayOf()), length);
+        this.elementClass = elementClass;
+    }
+
+    @Override
+    public RiResolvedType elementType() {
+        return elementClass;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitNewObjectArray(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewTypeArrayNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code NewTypeArrayNode} class definition.
+ */
+public final class NewTypeArrayNode extends NewArrayNode implements LIRLowerable {
+
+    private final RiResolvedType elementType;
+
+    public NewTypeArrayNode(ValueNode length, RiResolvedType elementType) {
+        super(StampFactory.exactNonNull(elementType.arrayOf()), length);
+        this.elementType = elementType;
+    }
+
+    @Override
+    public RiResolvedType elementType() {
+        return elementType;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitNewTypeArray(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * This node is used to perform the finalizer registration at the end of the java.lang.Object constructor.
+ */
+public final class RegisterFinalizerNode extends AbstractStateSplit implements Canonicalizable, LIRLowerable {
+
+    @Input private ValueNode object;
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public RegisterFinalizerNode(ValueNode object) {
+        super(StampFactory.illegal());
+        this.object = object;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.emitCallToRuntime(CiRuntimeCall.RegisterFinalizer, true, gen.operand(object()));
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        RiResolvedType declaredType = object.declaredType();
+        RiResolvedType exactType = object.exactType();
+        if (exactType == null && declaredType != null) {
+            exactType = declaredType.exactType();
+        }
+
+        boolean needsCheck = true;
+        if (exactType != null) {
+            // we have an exact type
+            needsCheck = exactType.hasFinalizer();
+        } else {
+            // if either the declared type of receiver or the holder can be assumed to have no finalizers
+            if (declaredType != null && !declaredType.hasFinalizableSubclass()) {
+                if (tool.assumptions() != null && tool.assumptions().recordNoFinalizableSubclassAssumption(declaredType)) {
+                    needsCheck = false;
+                }
+            }
+        }
+
+        if (!needsCheck) {
+            return null;
+        }
+
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code StoreFieldNode} represents a write to a static or instance field.
+ */
+public final class StoreFieldNode extends AccessFieldNode implements LIRLowerable {
+
+    @Input private ValueNode value;
+
+    public ValueNode value() {
+        return value;
+    }
+
+    /**
+     * Creates a new StoreFieldNode.
+     * @param object the receiver object
+     * @param field the compiler interface field
+     * @param value the node representing the value to store to the field
+     */
+    public StoreFieldNode(ValueNode object, RiResolvedField field, ValueNode value) {
+        super(StampFactory.illegal(), object, field);
+        this.value = value;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitStoreField(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code StoreIndexedNode} represents a write to an array element.
+ */
+public final class StoreIndexedNode extends AccessIndexedNode implements Lowerable, LIRLowerable {
+
+    @Input private ValueNode value;
+
+    public ValueNode value() {
+        return value;
+    }
+
+    /**
+     * Creates a new StoreIndexedNode.
+     * @param array the node producing the array
+     * @param index the node producing the index
+     * @param length the node producing the length
+     * @param elementKind the element type
+     * @param value the value to store into the array
+     */
+    public StoreIndexedNode(ValueNode array, ValueNode index, ValueNode length, CiKind elementKind, ValueNode value) {
+        super(StampFactory.illegal(), array, index, length, elementKind);
+        this.value = value;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        gen.visitStoreIndexed(this);
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeCheckNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.java;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.type.*;
+
+/**
+ * The {@code TypeCheckNode} is the base class of casts and instanceof tests.
+ */
+public abstract class TypeCheckNode extends BooleanNode {
+
+    protected static final RiResolvedType[] EMPTY_HINTS = new RiResolvedType[0];
+    @Input private ValueNode object;
+    @Input private ValueNode targetClassInstruction;
+    @Data private final RiResolvedType targetClass;
+    @Data private final RiResolvedType[] hints;
+    @Data private final boolean hintsExact;
+
+    /**
+     * Creates a new TypeCheckNode.
+     * @param targetClassInstruction the instruction which produces the class which is being cast to or checked against
+     * @param targetClass the class that is being casted to or checked against
+     * @param object the node which produces the object
+     * @param kind the result type of this node
+     */
+    public TypeCheckNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact, Stamp stamp) {
+        super(stamp);
+        this.targetClassInstruction = targetClassInstruction;
+        this.targetClass = targetClass;
+        this.object = object;
+        this.hints = hints;
+        this.hintsExact = hintsExact;
+    }
+
+    public ValueNode object() {
+        return object;
+    }
+
+    public ValueNode targetClassInstruction() {
+        return targetClassInstruction;
+    }
+
+    /**
+     * Gets the target class, i.e. the class being cast to, or the class being tested against.
+     * @return the target class
+     */
+    public RiResolvedType targetClass() {
+        return targetClass;
+    }
+
+    public RiResolvedType[] hints() {
+        return hints;
+    }
+
+    public boolean hintsExact() {
+        return hintsExact;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Canonicalizable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+import com.oracle.graal.nodes.*;
+
+public interface Canonicalizable {
+
+    ValueNode canonical(CanonicalizerTool tool);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+
+
+public interface CanonicalizerTool {
+    CiTarget target();
+    CiAssumptions assumptions();
+    RiRuntime runtime();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeAnalyzable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+public interface EscapeAnalyzable {
+
+    EscapeOp getEscapeOp();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeField.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+import com.oracle.max.cri.ri.*;
+
+public class EscapeField {
+
+    private String name;
+    private Object representation;
+    private RiType type;
+
+    public EscapeField(String name, Object representation, RiType type) {
+        this.name = name;
+        this.representation = representation;
+        this.type = type;
+    }
+
+    public String name() {
+        return name;
+    }
+
+    public Object representation() {
+        return representation;
+    }
+
+    public RiType type() {
+        return type;
+    }
+
+    @Override
+    public String toString() {
+        return name();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeOp.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.java.*;
+import com.oracle.graal.nodes.virtual.*;
+
+
+public abstract class EscapeOp {
+
+    public abstract boolean canAnalyze(Node node);
+
+    public boolean escape(Node node, Node usage) {
+        if (usage instanceof NullCheckNode) {
+            assert ((NullCheckNode) usage).object() == node;
+            return false;
+        } else if (usage instanceof IsTypeNode) {
+            assert ((IsTypeNode) usage).objectClass() == node;
+            return false;
+        } else if (usage instanceof FrameState) {
+            assert usage.inputs().contains(node);
+            return true;
+        } else if (usage instanceof AccessMonitorNode) {
+            assert ((AccessMonitorNode) usage).object() == node;
+            return false;
+        } else if (usage instanceof LoadFieldNode) {
+            assert ((LoadFieldNode) usage).object() == node;
+            return false;
+        } else if (usage instanceof StoreFieldNode) {
+            StoreFieldNode x = (StoreFieldNode) usage;
+            // self-references do escape
+            return x.value() == node; // TODO (thomaswue) Check if we can add this condition? && x.object() != node;
+        } else if (usage instanceof LoadIndexedNode) {
+            LoadIndexedNode x = (LoadIndexedNode) usage;
+            if (x.index() == node) {
+                return true;
+            } else {
+                assert x.array() == node;
+                return !isValidConstantIndex(x);
+            }
+        } else if (usage instanceof StoreIndexedNode) {
+            StoreIndexedNode x = (StoreIndexedNode) usage;
+            if (x.index() == node) {
+                return true;
+            } else {
+                assert x.array() == node || x.value() == node;
+                // in order to not escape the access needs to have a valid constant index and either a store into node or self-referencing
+                return !isValidConstantIndex(x) || x.value() == node && x.array() != node;
+            }
+        } else if (usage instanceof VirtualObjectFieldNode) {
+            return false;
+        } else if (usage instanceof RegisterFinalizerNode) {
+            assert ((RegisterFinalizerNode) usage).object() == node;
+            return false;
+        } else if (usage instanceof ArrayLengthNode) {
+            assert ((ArrayLengthNode) usage).array() == node;
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    public static boolean isValidConstantIndex(AccessIndexedNode x) {
+        CiConstant index = x.index().asConstant();
+        if (x.array() instanceof NewArrayNode) {
+            CiConstant length = ((NewArrayNode) x.array()).dimension(0).asConstant();
+            return index != null && length != null && index.asInt() >= 0 && index.asInt() < length.asInt();
+        } else {
+            return false;
+        }
+    }
+
+    public abstract EscapeField[] fields(Node node);
+
+    public void beforeUpdate(Node node, Node usage) {
+        // IsNonNullNode and IsTypeNode should have been eliminated by the CanonicalizerPhase, but we can't rely on this
+        if (usage instanceof NullCheckNode) {
+            NullCheckNode x = (NullCheckNode) usage;
+            ((StructuredGraph) x.graph()).replaceFloating(x, ConstantNode.forBoolean(!x.expectedNull, node.graph()));
+        } else if (usage instanceof IsTypeNode) {
+            IsTypeNode x = (IsTypeNode) usage;
+            assert x.type() == ((ValueNode) node).exactType();
+            ((StructuredGraph) x.graph()).replaceFloating(x, ConstantNode.forBoolean(true, node.graph()));
+        } else if (usage instanceof AccessMonitorNode) {
+            ((AccessMonitorNode) usage).eliminate();
+        }
+    }
+
+    public abstract int updateState(Node node, Node current, Map<Object, Integer> fieldIndex, ValueNode[] fieldState);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+
+public abstract class LIRGeneratorTool {
+    public abstract CiTarget target();
+
+    /**
+     * Checks whether the supplied constant can be used without loading it into a register
+     * for most operations, i.e., for commonly used arithmetic, logical, and comparison operations.
+     * @param c The constant to check.
+     * @return True if the constant can be used directly, false if the constant needs to be in a register.
+     */
+    public abstract boolean canInlineConstant(CiConstant c);
+
+    /**
+     * Checks whether the supplied constant can be used without loading it into a register
+     * for store operations, i.e., on the right hand side of a memory access.
+     * @param c The constant to check.
+     * @return True if the constant can be used directly, false if the constant needs to be in a register.
+     */
+    public abstract boolean canStoreConstant(CiConstant c);
+
+    public abstract CiValue operand(ValueNode object);
+    public abstract CiValue newVariable(CiKind kind);
+    public abstract CiValue setResult(ValueNode x, CiValue operand);
+
+    public abstract CiAddress makeAddress(LocationNode location, ValueNode object);
+
+    public abstract CiValue emitMove(CiValue input);
+    public abstract void emitMove(CiValue src, CiValue dst);
+    public abstract CiValue emitLoad(CiValue loadAddress, boolean canTrap);
+    public abstract void emitStore(CiValue storeAddress, CiValue input, boolean canTrap);
+    public abstract CiValue emitLea(CiValue address);
+
+    public abstract CiValue emitNegate(CiValue input);
+    public abstract CiValue emitAdd(CiValue a, CiValue b);
+    public abstract CiValue emitSub(CiValue a, CiValue b);
+    public abstract CiValue emitMul(CiValue a, CiValue b);
+    public abstract CiValue emitDiv(CiValue a, CiValue b);
+    public abstract CiValue emitRem(CiValue a, CiValue b);
+    public abstract CiValue emitUDiv(CiValue a, CiValue b);
+    public abstract CiValue emitURem(CiValue a, CiValue b);
+
+    public abstract CiValue emitAnd(CiValue a, CiValue b);
+    public abstract CiValue emitOr(CiValue a, CiValue b);
+    public abstract CiValue emitXor(CiValue a, CiValue b);
+
+    public abstract CiValue emitShl(CiValue a, CiValue b);
+    public abstract CiValue emitShr(CiValue a, CiValue b);
+    public abstract CiValue emitUShr(CiValue a, CiValue b);
+
+    public abstract CiValue emitConvert(ConvertNode.Op opcode, CiValue inputVal);
+    public abstract void emitMembar(int barriers);
+    public abstract void emitDeoptimizeOn(Condition of, DeoptAction action, Object deoptInfo);
+    public abstract CiValue emitCallToRuntime(CiRuntimeCall runtimeCall, boolean canTrap, CiValue... args);
+
+    public abstract void emitIf(IfNode i);
+    public abstract void emitConditional(ConditionalNode i);
+    public abstract void emitGuardCheck(BooleanNode comp);
+
+    public abstract void emitLookupSwitch(LookupSwitchNode i);
+    public abstract void emitTableSwitch(TableSwitchNode i);
+
+    public abstract void emitInvoke(Invoke i);
+    public abstract void emitRuntimeCall(RuntimeCallNode i);
+
+    // Handling of block-end nodes still needs to be unified in the LIRGenerator.
+    public abstract void visitMerge(MergeNode i);
+    public abstract void visitEndNode(EndNode i);
+    public abstract void visitLoopEnd(LoopEndNode i);
+
+    // The CompareAndSwapNode in its current form needs to be lowered to several Nodes before code generation to separate three parts:
+    // * The write barriers (and possibly read barriers) when accessing an object field
+    // * The distinction of returning a boolean value (semantic similar to a BooleanNode to be used as a condition?) or the old value being read
+    // * The actual compare-and-swap
+    public abstract void visitCompareAndSwap(CompareAndSwapNode i);
+
+    // Functionality that is currently implemented in XIR.
+    // These methods will go away eventually when lowering is done via snippets in the front end.
+    public abstract void visitArrayLength(ArrayLengthNode i);
+    public abstract void visitCheckCast(CheckCastNode i);
+    public abstract void visitMonitorEnter(MonitorEnterNode i);
+    public abstract void visitMonitorExit(MonitorExitNode i);
+    public abstract void visitLoadField(LoadFieldNode i);
+    public abstract void visitStoreField(StoreFieldNode i);
+    public abstract void visitLoadIndexed(LoadIndexedNode i);
+    public abstract void visitStoreIndexed(StoreIndexedNode i);
+    public abstract void visitNewInstance(NewInstanceNode i);
+    public abstract void visitNewTypeArray(NewTypeArrayNode i);
+    public abstract void visitNewObjectArray(NewObjectArrayNode i);
+    public abstract void visitNewMultiArray(NewMultiArrayNode i);
+    public abstract void visitExceptionObject(ExceptionObjectNode i);
+    public abstract void visitReturn(ReturnNode i);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRLowerable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+public interface LIRLowerable {
+
+    void generate(LIRGeneratorTool generator);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Lowerable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+import com.oracle.graal.cri.*;
+
+public interface Lowerable {
+
+    void lower(CiLoweringTool tool);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Simplifiable.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+/**
+ * This interface allows nodes to perform more complicated simplifications, in contrast to {@link Canonicalizable},
+ * which supports only replacing the current node.
+ *
+ * Implementors of this interface need to be aware that they need to call {@link SimplifierTool#addToWorkList(com.oracle.graal.graph.Node)} for each node that might
+ * be influenced (in terms of simplification and canonicalization) by the actions performed in simplify.
+ */
+public interface Simplifiable {
+
+    void simplify(SimplifierTool tool);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/SimplifierTool.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.spi;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+
+public interface SimplifierTool extends CanonicalizerTool {
+    void deleteBranch(FixedNode branch);
+    void addToWorkList(Node node);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.type;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+
+
+public interface Stamp {
+    boolean nonNull();
+    RiResolvedType declaredType();
+    RiResolvedType exactType();
+    CiKind kind();
+    boolean alwaysDistinct(Stamp other);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.type;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+
+
+public class StampFactory {
+
+    private static class BasicValueStamp implements Stamp {
+
+        private final CiKind kind;
+        private final boolean nonNull;
+        private RiResolvedType declaredType;
+        private RiResolvedType exactType;
+
+        public BasicValueStamp(CiKind kind) {
+            this(kind, false, null, null);
+        }
+
+        public BasicValueStamp(CiKind kind, boolean nonNull, RiResolvedType declaredType, RiResolvedType exactType) {
+            this.kind = kind;
+            this.nonNull = nonNull;
+            this.declaredType = declaredType;
+            this.exactType = exactType;
+        }
+
+        @Override
+        public CiKind kind() {
+            return kind;
+        }
+
+        @Override
+        public boolean nonNull() {
+            return nonNull;
+        }
+
+        @Override
+        public RiResolvedType declaredType() {
+            return declaredType;
+        }
+
+        @Override
+        public RiResolvedType exactType() {
+            return exactType;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == this) {
+                return true;
+            }
+            if (obj instanceof Stamp) {
+                Stamp other = (Stamp) obj;
+                return kind == other.kind() && nonNull() == other.nonNull() && declaredType() == other.declaredType() && exactType() == other.exactType();
+            }
+            return false;
+        }
+
+        @Override
+        public int hashCode() {
+            return kind.hashCode();
+        }
+
+        @Override
+        public String toString() {
+            return String.format("%c%s %s %s", kind().typeChar, nonNull ? "!" : "", declaredType == null ? "-" : declaredType.name(), exactType == null ? "-" : exactType.name());
+        }
+
+        @Override
+        public boolean alwaysDistinct(Stamp other) {
+            if (other.kind() != kind()) {
+                return true;
+            } else if (kind() != CiKind.Object) {
+                return false;
+            } else if (other.declaredType() == null || declaredType() == null) {
+                // We have no type information for one of the values.
+                return false;
+            } else if (other.nonNull() || nonNull()) {
+                // One of the two values cannot be null.
+                return !other.declaredType().isInterface() && !declaredType().isInterface() && !other.declaredType().isSubtypeOf(declaredType()) && !declaredType().isSubtypeOf(other.declaredType());
+            } else {
+                // Both values may be null.
+                return false;
+            }
+        }
+    }
+
+    private static final Stamp[] stampCache = new Stamp[CiKind.values().length];
+    static {
+        for (CiKind k : CiKind.values()) {
+            stampCache[k.ordinal()] = new BasicValueStamp(k);
+        }
+    }
+
+    public static Stamp illegal() {
+        return forKind(CiKind.Illegal);
+    }
+
+    public static Stamp intValue() {
+        return forKind(CiKind.Int);
+    }
+
+    public static Stamp forKind(CiKind kind) {
+        return stampCache[kind.stackKind().ordinal()];
+    }
+
+    public static Stamp exactNonNull(final RiResolvedType type) {
+        // (cwimmer) type can be null for certain Maxine-internal objects such as the static hub. Is this a problem here?
+        assert type == null || type.kind(false) == CiKind.Object;
+        return new BasicValueStamp(CiKind.Object, true, type, type);
+    }
+
+    public static Stamp forConstant(CiConstant value, RiRuntime runtime) {
+        if (runtime != null && value.kind == CiKind.Object && !value.isNull()) {
+            return exactNonNull(runtime.getTypeOf(value));
+        } else {
+            return forKind(value.kind.stackKind());
+        }
+    }
+
+    public static Stamp objectNonNull() {
+        return new BasicValueStamp(CiKind.Object, true, null, null);
+    }
+
+    public static Stamp declared(final RiResolvedType type) {
+        assert type != null;
+        assert type.kind(false) == CiKind.Object;
+        return new BasicValueStamp(CiKind.Object, false, type, type.exactType());
+    }
+
+    public static Stamp declaredNonNull(final RiResolvedType type) {
+        assert type != null;
+        assert type.kind(false) == CiKind.Object;
+        return new BasicValueStamp(CiKind.Object, true, type, type.exactType());
+    }
+
+    public static Stamp or(Collection<? extends StampProvider> values) {
+        if (values.size() == 0) {
+            return illegal();
+        } else {
+            Iterator< ? extends StampProvider> iterator = values.iterator();
+            Stamp first = iterator.next().stamp();
+            if (values.size() == 1) {
+                return first;
+            }
+
+            boolean nonNull = first.nonNull();
+            RiResolvedType declaredType = first.declaredType();
+            RiResolvedType exactType = first.exactType();
+            while (iterator.hasNext()) {
+                Stamp current = iterator.next().stamp();
+                assert current.kind() == first.kind() : values + " first=" + first + " current=" + current + " first kind=" + first.kind() + " current kind=" + current.kind();
+                nonNull &= current.nonNull();
+                declaredType = orTypes(declaredType, current.declaredType());
+                if (exactType != current.exactType()) {
+                    exactType = null;
+                }
+            }
+
+            if (nonNull != first.nonNull() || declaredType != first.declaredType() || exactType != first.exactType()) {
+                return new BasicValueStamp(first.kind(), nonNull, declaredType, exactType);
+            } else {
+                return first;
+            }
+        }
+    }
+
+    private static RiResolvedType orTypes(RiResolvedType a, RiResolvedType b) {
+        if (a == b) {
+            return a;
+        } else if (a == null || b == null) {
+            return null;
+        } else {
+            if (a.isSubtypeOf(b)) {
+                return b;
+            } else if (b.isSubtypeOf(a)) {
+                return a;
+            } else {
+                return null;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.type;
+
+
+public interface StampProvider {
+    Stamp stamp();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.util;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+
+public class GraphUtil {
+
+    public static void killCFG(FixedNode node) {
+        assert node.isAlive();
+        if (node instanceof EndNode) {
+            // We reached a control flow end.
+            EndNode end = (EndNode) node;
+            killEnd(end);
+        } else {
+            // Normal control flow node.
+            for (Node successor : node.successors().snapshot()) {
+                killCFG((FixedNode) successor);
+            }
+        }
+        propagateKill(node);
+    }
+
+    private static void killEnd(EndNode end) {
+        MergeNode merge = end.merge();
+        merge.removeEnd(end);
+        if (merge instanceof LoopBeginNode && merge.forwardEndCount() == 0) { //dead loop
+            for (PhiNode phi : merge.phis().snapshot()) {
+                propagateKill(phi);
+            }
+            LoopBeginNode begin = (LoopBeginNode) merge;
+            // disconnect and delete loop ends
+            for (LoopEndNode loopend : begin.loopEnds().snapshot()) {
+                loopend.predecessor().replaceFirstSuccessor(loopend, null);
+                loopend.safeDelete();
+            }
+            FixedNode next = begin.next();
+            begin.safeDelete();
+            killCFG(next);
+        } else if (merge instanceof LoopBeginNode && ((LoopBeginNode) merge).loopEnds().isEmpty()) { // not a loop anymore
+            ((StructuredGraph) end.graph()).reduceDegenerateLoopBegin((LoopBeginNode) merge);
+        } else if (merge.phiPredecessorCount() == 1) { // not a merge anymore
+            ((StructuredGraph) end.graph()).reduceTrivialMerge(merge);
+        }
+    }
+
+    public static void propagateKill(Node node) {
+        if (node != null && node.isAlive()) {
+            List<Node> usagesSnapshot = node.usages().filter(isA(FloatingNode.class).or(CallTargetNode.class).or(FrameState.class)).snapshot();
+
+            // null out remaining usages
+            node.replaceAtUsages(null);
+            node.replaceAtPredecessors(null);
+            killUnusedFloatingInputs(node);
+
+            for (Node usage : usagesSnapshot) {
+                if (!usage.isDeleted()) {
+                    if (usage instanceof PhiNode) {
+                        usage.replaceFirstInput(node, null);
+                    } else {
+                        propagateKill(usage);
+                    }
+                }
+            }
+        }
+    }
+
+    public static void killUnusedFloatingInputs(Node node) {
+        List<Node> floatingInputs = node.inputs().filter(isA(FloatingNode.class).or(CallTargetNode.class).or(FrameState.class)).snapshot();
+        node.safeDelete();
+
+        for (Node in : floatingInputs) {
+            if (in.isAlive() && in.usages().isEmpty()) {
+                killUnusedFloatingInputs(in);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/BoxedVirtualObjectNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.virtual;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+
+
+public class BoxedVirtualObjectNode extends VirtualObjectNode implements LIRLowerable, Node.ValueNumberable {
+
+    @Input ValueNode unboxedValue;
+
+    public BoxedVirtualObjectNode(RiResolvedType type, ValueNode unboxedValue) {
+        super(type, 1);
+        this.unboxedValue = unboxedValue;
+    }
+
+
+    public ValueNode getUnboxedValue() {
+        return unboxedValue;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectFieldNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.virtual;
+
+import java.util.*;
+
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class VirtualObjectFieldNode extends ValueNode implements LIRLowerable {
+
+    @Input private VirtualObjectNode object;
+    @Input private ValueNode lastState;
+    @Input private ValueNode input;
+
+    private int index;
+
+    public VirtualObjectNode object() {
+        return object;
+    }
+
+    public ValueNode lastState() {
+        return lastState;
+    }
+
+    public ValueNode input() {
+        return input;
+    }
+
+    public VirtualObjectFieldNode(VirtualObjectNode object, ValueNode lastState, ValueNode input, int index) {
+        super(StampFactory.illegal());
+        this.index = index;
+        this.object = object;
+        this.lastState = lastState;
+        this.input = input;
+    }
+
+    public int index() {
+        return index;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // nothing to do...
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("index", index);
+        return properties;
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Name && object().fields() != null) {
+            return super.toString(Verbosity.Name) + " " + object().fields()[index].name();
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes.virtual;
+
+import java.util.*;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+
+public class VirtualObjectNode extends ValueNode implements LIRLowerable {
+
+    @Data private RiType type;
+    private EscapeField[] fields;
+    private int fieldsCount;
+
+    public VirtualObjectNode(RiType type, EscapeField[] fields) {
+        super(StampFactory.illegal());
+        this.type = type;
+        this.fields = fields;
+        this.fieldsCount = fields.length;
+    }
+
+    public VirtualObjectNode(RiType type, int fieldCount) {
+        super(StampFactory.illegal());
+        this.type = type;
+        this.fieldsCount = fieldCount;
+    }
+
+    public RiType type() {
+        return type;
+    }
+
+    public EscapeField[] fields() {
+        return fields;
+    }
+
+    @Override
+    public void generate(LIRGeneratorTool gen) {
+        // nothing to do...
+    }
+
+    @Override
+    public Map<Object, Object> getDebugProperties() {
+        Map<Object, Object> properties = super.getDebugProperties();
+        properties.put("type", type);
+        return properties;
+    }
+
+    @Override
+    public String toString(Verbosity verbosity) {
+        if (verbosity == Verbosity.Name) {
+            return super.toString(Verbosity.Name) + " " + type.name();
+        } else {
+            return super.toString(verbosity);
+        }
+    }
+
+    public int fieldsCount() {
+        return fieldsCount;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/util/ComputeImmediateDominator.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.util;
+
+import java.util.*;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+
+public final class ComputeImmediateDominator {
+    private final MergeNode dominated;
+    private final Queue<FixedNode> toExplore;
+    private final Queue<FixedNode> speculativeExplore;
+    private final NodeMap<DominatorInfo> infoMap;
+    private final DominatorInfo fullInfo;
+    private FixedNode dominator;
+    private int nextBit = 1;
+
+    public ComputeImmediateDominator(MergeNode dominated) {
+        this.dominated = dominated;
+        this.toExplore = new LinkedList<>();
+        this.speculativeExplore = new LinkedList<>();
+        this.infoMap = dominated.graph().createNodeMap();
+        fullInfo = new DominatorInfo(dominated, true);
+
+        this.processMerge(dominated, fullInfo);
+        if (toExplore.size() == 1) {
+            dominator = toExplore.remove();
+        }
+    }
+
+    public FixedNode compute() {
+        try {
+            while (dominator == null && (!toExplore.isEmpty() || !speculativeExplore.isEmpty())) {
+                while (!toExplore.isEmpty()) {
+                    exploreUp(toExplore.remove());
+                    if (dominator != null) {
+                        return dominator;
+                    }
+                }
+                exploreUp(speculativeExplore.remove());
+            }
+            return dominator;
+        } catch (Throwable t) {
+            throw new GraalInternalError(t).addContext("Could not find a dominator").addContext(dominated);
+        }
+    }
+
+    private void exploreUp(FixedNode from) {
+        FixedNode p = from;
+        DominatorInfo info = infoMap.get(from);
+        if (info.isExplored()) {
+            return;
+        }
+        //TTY.println("exploreUp(" + from + ") with " + info);
+        info.setExplored();
+        while (p != null) {
+            if (p instanceof MergeNode) {
+                processMerge((MergeNode) p, info);
+                p = null;
+            } else if (p instanceof ControlSplitNode) {
+                processControlSplit((ControlSplitNode) p, info);
+                p = null;
+            } else {
+                p = (FixedNode) p.predecessor();
+            }
+        }
+    }
+
+    private void processControlSplit(ControlSplitNode cs, DominatorInfo info) {
+        //TTY.println("processControlSplit(" + cs + ", " + info + ")");
+        DominatorInfo csInfo = infoMap.get(cs);
+        if (csInfo == null) {
+            csInfo = new DominatorInfo(cs, false);
+            infoMap.set(cs, csInfo);
+        }
+        csInfo.add(info);
+        FixedNode next = (FixedNode) cs.predecessor();
+        if (checkControlSplitInfo(csInfo)) {
+            return;
+        }
+        if (csInfo.isExplored()) {
+            //TTY.println("  Already explored, propagate update");
+            propagateUpdate(csInfo);
+        } else {
+            if (csInfo.parentCount() == cs.blockSuccessorCount()) { // all paths leading to this CS have been explored
+                //TTY.println("  All parents explored, Enqueue");
+                toExplore.add(next);
+                speculativeExplore.remove(next);
+            } else {
+                //TTY.println("  Not all parents explored : Enqueue speculative");
+                speculativeExplore.add(next);
+            }
+        }
+        infoMap.set(next, csInfo);
+    }
+
+    private boolean propagateUpdate(DominatorInfo di) {
+        //TTY.println("   propagateUpdate(" + di + ")");
+        for (DominatorInfo child : di.children()) {
+            //TTY.println("      add to child " + child);
+            if (child.add(di, false)) {
+                if (child.equals(fullInfo)) {
+                    //TTY.println("   Found DOM!");
+                    dominator = child.node();
+                    return true;
+                }
+                if (propagateUpdate(child)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    private boolean checkControlSplitInfo(DominatorInfo di) {
+        //TTY.println("   checkControlSplitInfo(" + di + ")");
+        if (di.equals(fullInfo)) {
+            dominator = di.node();
+            //TTY.println("   Found DOM!");
+            return true;
+        }
+        return false;
+    }
+
+    private void processMerge(MergeNode merge, DominatorInfo info) {
+        //TTY.println("processMerge(" + merge + ", " + info + ")");
+        for (EndNode end : merge.cfgPredecessors()) {
+            toExplore.add(end);
+            infoMap.set(end, info.createChild(end));
+            //TTY.println("  Enqueue end : " + end + " with " + infoMap.get(end));
+        }
+    }
+
+    private class DominatorInfo {
+        private final FixedNode node;
+        private final BitSet bits;
+        private final BitSet ownBits;
+        private final Collection<DominatorInfo> children;
+        private final Collection<DominatorInfo> parents;
+        private boolean explored;
+
+        public DominatorInfo(FixedNode node, boolean full) {
+            this.node = node;
+            this.bits = new BitSet();
+            this.ownBits = new BitSet();
+            this.children = new ArrayList<>(2);
+            this.parents = new ArrayList<>(2);
+            if (full) {
+                addOwnBits(0);
+            }
+        }
+
+        public boolean isExplored() {
+            return explored;
+        }
+
+        public void setExplored() {
+            explored = true;
+        }
+
+        public DominatorInfo createChild(FixedNode childNode) {
+            DominatorInfo di = new DominatorInfo(childNode, false);
+            di.bits.or(bits);
+            di.ownBits.or(ownBits);
+            if (!children.isEmpty() || di.ownBits.isEmpty()) {
+                int newBit = nextBit++;
+                di.bits.xor(ownBits);
+                di.bits.set(newBit);
+                di.ownBits.clear();
+                di.ownBits.set(newBit);
+                addOwnBits(newBit);
+            }
+            children.add(di);
+            di.parents.add(this);
+            return di;
+        }
+
+        private void addOwnBits(int newBit) {
+            if (!bits.get(newBit)) {
+                ownBits.set(newBit);
+                bits.set(newBit);
+                for (DominatorInfo parent : parents) {
+                    parent.addOwnBits(newBit);
+                }
+            }
+        }
+
+        public boolean add(DominatorInfo i) {
+            return add(i, true);
+        }
+
+        public boolean add(DominatorInfo i, boolean addParent) {
+            boolean ret = true;
+            if (addParent) {
+                parents.add(i);
+                i.children.add(this);
+                bits.or(i.bits);
+            } else {
+                BitSet newBits = (BitSet) i.bits.clone();
+                newBits.andNot(bits);
+                newBits.andNot(i.ownBits);
+                ret = !newBits.isEmpty();
+                bits.or(newBits);
+            }
+            return ret;
+        }
+
+        public int parentCount() {
+            return parents.size();
+        }
+
+
+        public FixedNode node() {
+            return node;
+        }
+
+        public Collection<DominatorInfo> children() {
+            return children;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (!(obj instanceof DominatorInfo)) {
+                return false;
+            }
+            return ((DominatorInfo) obj).bits.equals(bits);
+        }
+
+        @Override
+        public String toString() {
+            return bits + " (o" + ownBits + ") " + node;
+        }
+
+        @Override
+        public int hashCode() {
+            return bits.hashCode();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/util/NodeIterators.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.util;
+
+import java.util.*;
+
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.*;
+
+public class NodeIterators {
+
+    public static NodeIterable<FixedNode> dominators(final FixedNode n) {
+        return new NodeIterable<FixedNode>() {
+            @Override
+            public Iterator<FixedNode> iterator() {
+                return new NodeIterator<FixedNode>(){
+                    FixedNode p = n;
+                    @Override
+                    protected void forward() {
+                        if (current == null) {
+                            if (p instanceof MergeNode) {
+                                current = new ComputeImmediateDominator((MergeNode) p).compute();
+                            } else {
+                                current = (FixedNode) p.predecessor();
+                            }
+                            p = current;
+                        }
+                    }
+                };
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/util/TreeIterators.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.util;
+
+import java.util.*;
+
+public class TreeIterators {
+
+    public abstract static class PrefixTreeIterator<T> implements Iterator<T>{
+        private Deque<T> stack = new LinkedList<>();
+
+        public PrefixTreeIterator(T root) {
+            stack.push(root);
+        }
+
+        public PrefixTreeIterator(Iterable<T> roots) {
+            for (T root : roots) {
+                stack.addLast(root);
+            }
+        }
+
+        @Override
+        public boolean hasNext() {
+            return !stack.isEmpty();
+        }
+
+        @Override
+        public T next() {
+            T top = stack.pop();
+            LinkedList<T> list = new LinkedList<>();
+            for (T child : children(top)) {
+                list.addFirst(child);
+            }
+            for (T child : list) {
+                stack.push(child);
+            }
+            return top;
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+
+        protected abstract Iterable<T> children(T node);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/test/test/com/oracle/graal/nodes/Main.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,29 @@
+/*
+ * 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 test.com.oracle.graal.nodes;
+
+
+public class Main {
+    public static void main(String[] args) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BasicIdealGraphPrinter.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.printer;
+
+import java.io.*;
+import java.util.*;
+import java.util.Map.Entry;
+
+/**
+ * Elementary, generic generator of Ideal Graph Visualizer input for use in printers for specific data structures.
+ */
+class BasicIdealGraphPrinter {
+
+    /**
+     * Edge between two nodes.
+     */
+    protected static class Edge {
+        final String from;
+        final int fromIndex;
+        final String to;
+        final int toIndex;
+        final String label;
+
+        public Edge(String from, int fromIndex, String to, int toIndex, String label) {
+            assert (from != null && to != null);
+            this.from = from;
+            this.fromIndex = fromIndex;
+            this.to = to;
+            this.toIndex = toIndex;
+            this.label = label;
+        }
+
+        @Override
+        public int hashCode() {
+            int h = from.hashCode() ^ to.hashCode();
+            h = 3 * h + fromIndex;
+            h = 5 * h + toIndex;
+            if (label != null) {
+                h ^= label.hashCode();
+            }
+            return h;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == this) {
+                return true;
+            }
+            if (obj instanceof Edge) {
+                Edge other = (Edge) obj;
+                return from.equals(other.from)
+                        && fromIndex == other.fromIndex
+                        && to.equals(other.to)
+                        && toIndex == other.toIndex
+                        && (label == other.label || (label != null && label.equals(other.label)));
+            }
+            return false;
+        }
+    }
+
+    private final PrintStream stream;
+
+    /**
+     * Creates a new {@link IdealGraphPrinter} that writes to the specified output stream.
+     */
+    protected BasicIdealGraphPrinter(OutputStream stream) {
+        try {
+            this.stream = new PrintStream(stream, false, "US-ASCII");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Flushes any buffered output.
+     */
+    protected void flush() {
+        stream.flush();
+    }
+
+    /**
+     * Starts a new graph document.
+     */
+    protected void begin() {
+        stream.println("<graphDocument>");
+    }
+
+    protected void beginGroup() {
+        stream.println("<group>");
+    }
+
+    protected void beginMethod(String name, String shortName, int bci) {
+        stream.printf(" <method name='%s' shortName='%s' bci='%d'>%n", escape(name), escape(shortName), bci);
+    }
+
+    protected void beginBytecodes() {
+        stream.println("  <bytecodes>\n<![CDATA[");
+    }
+
+    protected void printBytecode(int bci, String mnemonic, int[] extra) {
+        stream.print(bci);
+        stream.print(' ');
+        stream.print(mnemonic);
+        if (extra != null) {
+            for (int b : extra) {
+                stream.print(' ');
+                stream.print(b);
+            }
+        }
+        stream.println();
+    }
+
+    protected void endBytecodes() {
+        stream.println("  ]]></bytecodes>");
+    }
+
+    protected void endMethod() {
+        stream.println(" </method>");
+    }
+
+    protected void beginGraph(String title) {
+        stream.printf(" <graph name='%s'>%n", escape(title));
+    }
+
+    protected void beginProperties() {
+        stream.print("<properties>");
+    }
+
+    protected void printProperty(String name, String value) {
+        stream.printf("<p name='%s'>%s</p>", escape(name), escape(value));
+    }
+
+    protected void endProperties() {
+        stream.print("</properties>");
+    }
+
+    protected void printProperties(Map<String, String> properties) {
+        beginProperties();
+        for (Entry<String, String> entry : properties.entrySet()) {
+            printProperty(entry.getKey(), entry.getValue());
+        }
+        endProperties();
+    }
+
+    protected void beginNodes() {
+        stream.println("  <nodes>");
+    }
+
+    protected void beginNode(String id) {
+        stream.printf("   <node id='%s'>", escape(id));
+    }
+
+    protected void endNode() {
+        stream.println("   </node>");
+    }
+
+    protected void printNode(String id, Map<String, String> properties) {
+        beginNode(id);
+        if (properties != null) {
+            printProperties(properties);
+        }
+        endNode();
+    }
+
+    protected void endNodes() {
+        stream.println("  </nodes>");
+    }
+
+    protected void beginEdges() {
+        stream.println("  <edges>");
+    }
+
+    protected void printEdge(Edge edge) {
+        stream.printf("   <edge from='%s' fromIndex='%d' to='%s' toIndex='%d' label='%s' />%n", escape(edge.from), edge.fromIndex, escape(edge.to), edge.toIndex, escape(edge.label));
+    }
+
+    protected void endEdges() {
+        stream.println("  </edges>");
+    }
+
+    protected void beginControlFlow() {
+        stream.println("  <controlFlow>");
+    }
+
+    protected void beginBlock(String name) {
+        stream.printf("   <block name='%s'>%n", escape(name));
+    }
+
+    protected void beginSuccessors() {
+        stream.println("    <successors>");
+    }
+
+    protected void printSuccessor(String name) {
+        stream.printf("     <successor name='%s'/>%n", escape(name));
+    }
+
+    protected void endSuccessors() {
+        stream.println("    </successors>");
+    }
+
+    protected void beginBlockNodes() {
+        stream.println("    <nodes>");
+    }
+
+    protected void printBlockNode(String nodeId) {
+        stream.printf("     <node id='%s'/>%n", escape(nodeId));
+    }
+
+    protected void endBlockNodes() {
+        stream.println("    </nodes>");
+    }
+
+    protected void endBlock() {
+        stream.println("   </block>");
+    }
+
+    protected void endControlFlow() {
+        stream.println("  </controlFlow>");
+    }
+
+    protected void endGraph() {
+        stream.println(" </graph>");
+    }
+
+    /**
+     * Ends the current group.
+     */
+    protected void endGroup() {
+        stream.println("</group>");
+    }
+
+    /**
+     * Finishes the graph document and flushes the output stream.
+     */
+    protected void end() {
+        stream.println("</graphDocument>");
+        flush();
+    }
+
+
+    public boolean isValid() {
+        return !stream.checkError();
+    }
+
+
+    private static String escape(String s) {
+        StringBuilder str = null;
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            switch (c) {
+                case '&':
+                case '<':
+                case '>':
+                case '"':
+                case '\'':
+                    if (str == null) {
+                        str = new StringBuilder();
+                        str.append(s, 0, i);
+                    }
+                    switch(c) {
+                        case '&':
+                            str.append("&amp;");
+                            break;
+                        case '<':
+                            str.append("&lt;");
+                            break;
+                        case '>':
+                            str.append("&gt;");
+                            break;
+                        case '"':
+                            str.append("&quot;");
+                            break;
+                        case '\'':
+                            str.append("&apos;");
+                            break;
+                        default:
+                            assert false;
+                    }
+                    break;
+                default:
+                    if (str != null) {
+                        str.append(c);
+                    }
+                    break;
+            }
+        }
+        if (str == null) {
+            return s;
+        } else {
+            return str.toString();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,563 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.printer;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+
+import java.io.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.alloc.util.*;
+import com.oracle.graal.compiler.alloc.*;
+import com.oracle.graal.compiler.alloc.Interval.UsePosList;
+import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.Verbosity;
+import com.oracle.graal.graph.NodeClass.NodeClassIterator;
+import com.oracle.graal.graph.NodeClass.Position;
+import com.oracle.graal.java.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+
+/**
+ * Utility for printing Graal IR at various compilation phases.
+ */
+class CFGPrinter extends CompilationPrinter {
+
+    protected CiTarget target;
+    protected LIR lir;
+    protected LIRGenerator lirGenerator;
+    protected ControlFlowGraph cfg;
+
+    /**
+     * Creates a control flow graph printer.
+     *
+     * @param buffer where the output generated via this printer shown be written
+     */
+    public CFGPrinter(OutputStream out) {
+        super(out);
+    }
+
+    /**
+     * Prints the control flow graph denoted by a given block map.
+     *
+     * @param label A label describing the compilation phase that produced the control flow graph.
+     * @param blockMap A data structure describing the blocks in a method and how they are connected.
+     */
+    public void printCFG(String label, BciBlockMapping blockMap) {
+        begin("cfg");
+        out.print("name \"").print(label).println('"');
+        for (BciBlockMapping.Block block : blockMap.blocks) {
+            begin("block");
+            printBlock(block);
+            end("block");
+        }
+        end("cfg");
+    }
+
+    private void printBlock(BciBlockMapping.Block block) {
+        out.print("name \"B").print(block.startBci).println('"');
+        out.print("from_bci ").println(block.startBci);
+        out.print("to_bci ").println(block.endBci);
+
+        out.println("predecessors ");
+
+        out.print("successors ");
+        for (BciBlockMapping.Block succ : block.successors) {
+            if (!succ.isExceptionEntry) {
+                out.print("\"B").print(succ.startBci).print("\" ");
+            }
+        }
+        out.println();
+
+        out.print("xhandlers");
+        for (BciBlockMapping.Block succ : block.successors) {
+            if (succ.isExceptionEntry) {
+                out.print("\"B").print(succ.startBci).print("\" ");
+            }
+        }
+        out.println();
+
+        out.print("flags ");
+        if (block.isExceptionEntry) {
+            out.print("\"ex\" ");
+        }
+        if (block.isLoopHeader) {
+            out.print("\"plh\" ");
+        }
+        out.println();
+
+        out.print("loop_depth ").println(Long.bitCount(block.loops));
+    }
+
+
+    private NodeMap<Block> latestScheduling;
+    private NodeBitMap printedNodes;
+
+    private boolean inFixedSchedule(Node node) {
+        return lir != null || node.isDeleted() || cfg.getNodeToBlock().get(node) != null;
+    }
+
+    /**
+     * Prints the specified list of blocks.
+     *
+     * @param label A label describing the compilation phase that produced the control flow graph.
+     * @param blocks The list of blocks to be printed.
+     */
+    public void printCFG(String label, List<Block> blocks) {
+        if (lir == null) {
+            latestScheduling = new NodeMap<>(cfg.getNodeToBlock());
+            for (Block block : blocks) {
+                Node cur = block.getBeginNode();
+                while (true) {
+                    assert inFixedSchedule(cur) && latestScheduling.get(cur) == block;
+                    scheduleInputs(cur, block);
+
+                    if (cur == block.getEndNode()) {
+                        break;
+                    }
+                    assert cur.successors().count() == 1;
+                    cur = cur.successors().first();
+                }
+            }
+        }
+        printedNodes = new NodeBitMap(cfg.graph);
+
+        begin("cfg");
+        out.print("name \"").print(label).println('"');
+        for (Block block : blocks) {
+            printBlock(block);
+        }
+        end("cfg");
+
+        latestScheduling = null;
+        printedNodes = null;
+    }
+
+    private void scheduleInputs(Node node, Block nodeBlock) {
+        if (node instanceof PhiNode) {
+            PhiNode phi = (PhiNode) node;
+            assert nodeBlock.getBeginNode() == phi.merge();
+            for (Block pred : nodeBlock.getPredecessors()) {
+                schedule(phi.valueAt((EndNode) pred.getEndNode()), pred);
+            }
+
+        } else {
+            for (Node input : node.inputs()) {
+                schedule(input, nodeBlock);
+            }
+        }
+    }
+
+    private void schedule(Node input, Block block) {
+        if (!inFixedSchedule(input)) {
+            Block inputBlock = block;
+            if (latestScheduling.get(input) != null) {
+                inputBlock = ControlFlowGraph.commonDominator(inputBlock, latestScheduling.get(input));
+            }
+            if (inputBlock != latestScheduling.get(input)) {
+                latestScheduling.set(input, inputBlock);
+                scheduleInputs(input, inputBlock);
+            }
+        }
+    }
+
+    private void printBlock(Block block) {
+        begin("block");
+
+        out.print("name \"").print(blockToString(block)).println('"');
+        out.println("from_bci -1");
+        out.println("to_bci -1");
+
+        out.print("predecessors ");
+        for (Block pred : block.getPredecessors()) {
+            out.print("\"").print(blockToString(pred)).print("\" ");
+        }
+        out.println();
+
+        out.print("successors ");
+        for (Block succ : block.getSuccessors()) {
+            if (!succ.isExceptionEntry()) {
+                out.print("\"").print(blockToString(succ)).print("\" ");
+            }
+        }
+        out.println();
+
+        out.print("xhandlers");
+        for (Block succ : block.getSuccessors()) {
+            if (succ.isExceptionEntry()) {
+                out.print("\"").print(blockToString(succ)).print("\" ");
+            }
+        }
+        out.println();
+
+        out.print("flags ");
+        if (block.isLoopHeader()) {
+            out.print("\"llh\" ");
+        }
+        if (block.isLoopEnd()) {
+            out.print("\"lle\" ");
+        }
+        if (block.isExceptionEntry()) {
+            out.print("\"ex\" ");
+        }
+        out.println();
+
+        if (block.getLoop() != null) {
+            out.print("loop_index ").println(block.getLoop().index);
+            out.print("loop_depth ").println(block.getLoop().depth);
+        }
+
+        printNodes(block);
+        printLIR(block);
+        end("block");
+    }
+
+    private void printNodes(Block block) {
+        begin("IR");
+        out.println("HIR");
+        out.disableIndentation();
+
+        if (block.getPredecessors().size() == 0) {
+            // Currently method parameters are not in the schedule, so print them separately here.
+            for (ValueNode param : block.getBeginNode().graph().getNodes(LocalNode.class)) {
+                printNode(param, false);
+            }
+        }
+        if (block.getBeginNode() instanceof MergeNode) {
+            // Currently phi functions are not in the schedule, so print them separately here.
+            for (ValueNode phi : ((MergeNode) block.getBeginNode()).phis()) {
+                printNode(phi, false);
+            }
+        }
+
+        if (lir != null) {
+            for (Node node : lir.nodesFor(block)) {
+                printNode(node, false);
+            }
+        } else {
+            Node cur = block.getBeginNode();
+            while (true) {
+                printNode(cur, false);
+
+                if (cur == block.getEndNode()) {
+                    for (Map.Entry<Node, Block> entry : latestScheduling.entries()) {
+                        if (entry.getValue() == block && !inFixedSchedule(entry.getKey()) && !printedNodes.isMarked(entry.getKey())) {
+                            printNode(entry.getKey(), true);
+                        }
+                    }
+                    break;
+                }
+                assert cur.successors().count() == 1;
+                cur = cur.successors().first();
+            }
+
+        }
+
+        out.enableIndentation();
+        end("IR");
+    }
+
+    private void printNode(Node node, boolean unscheduled) {
+        assert !printedNodes.isMarked(node);
+        printedNodes.mark(node);
+
+        if (!(node instanceof PhiNode)) {
+            for (Node input : node.inputs()) {
+                if (!inFixedSchedule(input) && !printedNodes.isMarked(input)) {
+                    printNode(input, true);
+                }
+            }
+        }
+
+        if (unscheduled) {
+            assert lir == null : "unscheduled nodes can only be present before LIR generation";
+            out.print("f ").print(HOVER_START).print("u").print(HOVER_SEP).print("unscheduled").print(HOVER_END).println(COLUMN_END);
+        } else if (node instanceof FixedWithNextNode) {
+            out.print("f ").print(HOVER_START).print("#").print(HOVER_SEP).print("fixed with next").print(HOVER_END).println(COLUMN_END);
+        } else if (node instanceof FixedNode) {
+            out.print("f ").print(HOVER_START).print("*").print(HOVER_SEP).print("fixed").print(HOVER_END).println(COLUMN_END);
+        } else if (node instanceof FloatingNode) {
+            out.print("f ").print(HOVER_START).print("~").print(HOVER_SEP).print("floating").print(HOVER_END).println(COLUMN_END);
+        }
+        out.print("tid ").print(nodeToString(node)).println(COLUMN_END);
+
+        if (lirGenerator != null) {
+            CiValue operand = lirGenerator.nodeOperands.get(node);
+            if (operand != null) {
+                out.print("result ").print(operand.toString()).println(COLUMN_END);
+            }
+        }
+
+        if (node instanceof StateSplit) {
+            StateSplit stateSplit = (StateSplit) node;
+            if (stateSplit.stateAfter() != null) {
+                String state = stateToString(stateSplit.stateAfter());
+                out.print("st ").print(HOVER_START).print("st").print(HOVER_SEP).print(state).print(HOVER_END).println(COLUMN_END);
+            }
+        }
+
+        Map<Object, Object> props = new TreeMap<>(node.getDebugProperties());
+        out.print("d ").print(HOVER_START).print("d").print(HOVER_SEP);
+        out.println("=== Debug Properties ===");
+        for (Map.Entry<Object, Object> entry : props.entrySet()) {
+            out.print(entry.getKey().toString()).print(": ").print(entry.getValue() == null ? "[null]" : entry.getValue().toString()).println();
+        }
+        out.println("=== Inputs ===");
+        printNamedNodes(node, node.inputs().iterator(), "", "\n", null);
+        out.println("=== Succesors ===");
+        printNamedNodes(node, node.successors().iterator(), "", "\n", null);
+        out.println("=== Usages ===");
+        if (!node.usages().isEmpty()) {
+            for (Node usage : node.usages()) {
+                out.print(nodeToString(usage)).print(" ");
+            }
+            out.println();
+        }
+        out.println("=== Predecessor ===");
+        out.print(nodeToString(node.predecessor())).print(" ");
+        out.print(HOVER_END).println(COLUMN_END);
+
+        out.print("instruction ");
+        out.print(HOVER_START).print(node.getNodeClass().shortName()).print(HOVER_SEP).print(node.getClass().getName()).print(HOVER_END).print(" ");
+        printNamedNodes(node, node.inputs().iterator(), "", "", "#NDF");
+        printNamedNodes(node, node.successors().iterator(), "#", "", "#NDF");
+        for (Map.Entry<Object, Object> entry : props.entrySet()) {
+            String key = entry.getKey().toString();
+            if (key.startsWith("data.") && !key.equals("data.stamp")) {
+                out.print(key.substring("data.".length())).print(": ").print(entry.getValue() == null ? "[null]" : entry.getValue().toString()).print(" ");
+            }
+        }
+        out.print(COLUMN_END).print(' ').println(COLUMN_END);
+    }
+
+    private void printNamedNodes(Node node, NodeClassIterator iter, String prefix, String suffix, String hideSuffix) {
+        int lastIndex = -1;
+        while (iter.hasNext()) {
+            Position pos = iter.nextPosition();
+            if (hideSuffix != null && node.getNodeClass().getName(pos).endsWith(hideSuffix)) {
+                continue;
+            }
+
+            if (pos.index != lastIndex) {
+                if (lastIndex != -1) {
+                    out.print(suffix);
+                }
+                out.print(prefix).print(node.getNodeClass().getName(pos)).print(": ");
+                lastIndex = pos.index;
+            }
+            out.print(nodeToString(node.getNodeClass().get(node, pos))).print(" ");
+        }
+        if (lastIndex != -1) {
+            out.print(suffix);
+        }
+    }
+
+    private String stateToString(FrameState state) {
+        StringBuilder buf = new StringBuilder();
+        FrameState curState = state;
+        do {
+            buf.append(CiUtil.toLocation(curState.method(), curState.bci)).append('\n');
+
+            if (curState.stackSize() > 0) {
+                buf.append("stack: ");
+                for (int i = 0; i < curState.stackSize(); i++) {
+                    buf.append(stateValueToString(curState.stackAt(i))).append(' ');
+                }
+                buf.append("\n");
+            }
+
+            buf.append("locals: ");
+            for (int i = 0; i < curState.localsSize(); i++) {
+                buf.append(stateValueToString(curState.localAt(i))).append(' ');
+            }
+            buf.append("\n");
+
+            curState = curState.outerFrameState();
+        } while (curState != null);
+
+        return buf.toString();
+    }
+
+    private String stateValueToString(ValueNode value) {
+        String result = nodeToString(value);
+        if (lirGenerator != null && lirGenerator.nodeOperands != null && value != null) {
+            CiValue operand = lirGenerator.nodeOperands.get(value);
+            if (operand != null) {
+                result += ": " + operand;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Prints the LIR for each instruction in a given block.
+     *
+     * @param block the block to print
+     */
+    private void printLIR(Block block) {
+        List<LIRInstruction> lirInstructions = block.lir;
+        if (lirInstructions == null) {
+            return;
+        }
+
+        begin("IR");
+        out.println("LIR");
+
+        for (int i = 0; i < lirInstructions.size(); i++) {
+            LIRInstruction inst = lirInstructions.get(i);
+            out.printf("nr %4d ", inst.id()).print(COLUMN_END);
+
+            if (inst.info != null) {
+                int level = out.indentationLevel();
+                out.adjustIndentation(-level);
+                String state;
+                if (inst.info.hasDebugInfo()) {
+                    state = debugInfoToString(inst.info.debugInfo().codePos, inst.info.debugInfo().registerRefMap, inst.info.debugInfo().frameRefMap, target.arch);
+                } else {
+                    state = debugInfoToString(inst.info.topFrame, null, null, target.arch);
+                }
+                if (state != null) {
+                    out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(state).print(HOVER_END).print(COLUMN_END);
+                }
+                out.adjustIndentation(level);
+            }
+
+            out.print(" instruction ").print(inst.toString()).print(COLUMN_END);
+            out.println(COLUMN_END);
+        }
+        end("IR");
+    }
+
+    private String nodeToString(Node node) {
+        if (node == null) {
+            return "-";
+        }
+        String prefix;
+        if (node instanceof BeginNode && lir == null) {
+            prefix = "B";
+        } else if (node instanceof ValueNode) {
+            ValueNode value = (ValueNode) node;
+            if (value.kind() == CiKind.Illegal) {
+                prefix = "v";
+            } else {
+                prefix = String.valueOf(value.kind().typeChar);
+            }
+        } else {
+            prefix = "?";
+        }
+        return prefix + node.toString(Verbosity.Id);
+    }
+
+    private String blockToString(Block block) {
+        if (lir == null) {
+            // During all the front-end phases, the block schedule is built only for the debug output.
+            // Therefore, the block numbers would be different for every CFG printed -> use the id of the first instruction.
+            return "B" + block.getBeginNode().toString(Verbosity.Id);
+        } else {
+            // LIR instructions contain references to blocks and these blocks are printed as the blockID -> use the blockID.
+            return "B" + block.getId();
+        }
+    }
+
+
+    public void printIntervals(String label, Interval[] intervals) {
+        begin("intervals");
+        out.println(String.format("name \"%s\"", label));
+
+        for (Interval interval : intervals) {
+            if (interval != null) {
+                printInterval(interval);
+            }
+        }
+
+        end("intervals");
+    }
+
+    private void printInterval(Interval interval) {
+        out.printf("%s %s ", interval.operand, (isRegister(interval.operand) ? "fixed" : interval.kind().name()));
+        if (isRegister(interval.operand)) {
+            out.printf("\"[%s|%c]\"", interval.operand, interval.operand.kind.typeChar);
+        } else {
+            if (interval.location() != null) {
+                out.printf("\"[%s|%c]\"", interval.location(), interval.location().kind.typeChar);
+            }
+        }
+
+        Interval hint = interval.locationHint(false);
+        out.printf("%s %s ", interval.splitParent().operand, hint != null ? hint.operand : -1);
+
+        // print ranges
+        Range cur = interval.first();
+        while (cur != Range.EndMarker) {
+            out.printf("[%d, %d[", cur.from, cur.to);
+            cur = cur.next;
+            assert cur != null : "range list not closed with range sentinel";
+        }
+
+        // print use positions
+        int prev = 0;
+        UsePosList usePosList = interval.usePosList();
+        for (int i = usePosList.size() - 1; i >= 0; --i) {
+            assert prev < usePosList.usePos(i) : "use positions not sorted";
+            out.printf("%d %s ", usePosList.usePos(i), usePosList.registerPriority(i));
+            prev = usePosList.usePos(i);
+        }
+
+        out.printf(" \"%s\"", interval.spillState());
+        out.println();
+    }
+
+    public void printIntervals(String label, IntervalPrinter.Interval[] intervals) {
+        begin("intervals");
+        out.println(String.format("name \"%s\"", label));
+
+        for (IntervalPrinter.Interval interval : intervals) {
+            printInterval(interval);
+        }
+
+        end("intervals");
+    }
+
+    private void printInterval(IntervalPrinter.Interval interval) {
+        out.printf("%s %s \"%s\" %s %s ", interval.name, interval.type, interval.description, interval.variable, "no");
+        if (interval.ranges.size() == 0) {
+            // One range is required in the spec, so output a dummy range.
+            out.printf("[0, 0[ ");
+        } else {
+            for (IntervalPrinter.Range range : interval.ranges) {
+                out.printf("[%d, %d[ ", range.from, range.to);
+            }
+        }
+        for (IntervalPrinter.UsePosition usePos : interval.uses) {
+            out.printf("%d %s ", usePos.pos, usePos.kind);
+        }
+        out.printf("\"%s\"", "no");
+        out.println();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.printer;
+
+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.graal.alloc.util.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.alloc.*;
+import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.java.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * Observes compilation events and uses {@link CFGPrinter} to produce a control flow graph for the <a
+ * href="http://java.net/projects/c1visualizer/">C1 Visualizer</a>.
+ */
+public class CFGPrinterObserver implements DebugDumpHandler {
+
+    private CFGPrinter cfgPrinter;
+    private Graph curGraph;
+
+    @Override
+    public void dump(Object object, String message) {
+        try {
+            dumpSandboxed(object, message);
+        } catch (Throwable ex) {
+            TTY.println("CFGPrinter: Exception during output of " + message + ": " + ex);
+        }
+    }
+
+    public void dumpSandboxed(Object object, String message) {
+        GraalCompiler compiler = Debug.contextLookup(GraalCompiler.class);
+        if (compiler == null) {
+            return;
+        }
+
+        if (cfgPrinter == null) {
+            File file = new File("compilations-" + System.currentTimeMillis() + ".cfg");
+            try {
+                OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
+                cfgPrinter = new CFGPrinter(out);
+            } catch (FileNotFoundException e) {
+                throw new GraalInternalError("Could not open " + file.getAbsolutePath());
+            }
+            TTY.println("CFGPrinter: Output to file %s", file);
+        }
+
+        StructuredGraph newGraph = Debug.contextLookup(StructuredGraph.class);
+        if (newGraph != curGraph) {
+            cfgPrinter.printCompilation(newGraph.method());
+            TTY.println("CFGPrinter: Dumping method %s", newGraph.method());
+            curGraph = newGraph;
+        }
+
+        cfgPrinter.target = compiler.target;
+        if (object instanceof LIR) {
+            cfgPrinter.lir = (LIR) object;
+        } else {
+            cfgPrinter.lir = Debug.contextLookup(LIR.class);
+        }
+        cfgPrinter.lirGenerator = Debug.contextLookup(LIRGenerator.class);
+        if (cfgPrinter.lir != null) {
+            cfgPrinter.cfg = cfgPrinter.lir.cfg;
+        }
+
+        RiRuntime runtime = compiler.runtime;
+
+        if (object instanceof BciBlockMapping) {
+            BciBlockMapping blockMap = (BciBlockMapping) object;
+            cfgPrinter.printCFG(message, blockMap);
+            cfgPrinter.printBytecodes(runtime.disassemble(blockMap.method));
+
+        } else if (object instanceof LIR) {
+            cfgPrinter.printCFG(message, cfgPrinter.lir.codeEmittingOrder());
+
+        } else if (object instanceof StructuredGraph) {
+            if (cfgPrinter.cfg == null) {
+                cfgPrinter.cfg = ControlFlowGraph.compute((StructuredGraph) object, true, true, true, false);
+            }
+            cfgPrinter.printCFG(message, Arrays.asList(cfgPrinter.cfg.getBlocks()));
+
+        } else if (object instanceof CiTargetMethod) {
+            cfgPrinter.printMachineCode(runtime.disassemble((CiTargetMethod) object), null);
+
+        } else if (object instanceof Interval[]) {
+            cfgPrinter.printIntervals(message, (Interval[]) object);
+
+        } else if (object instanceof IntervalPrinter.Interval[]) {
+            cfgPrinter.printIntervals(message, (IntervalPrinter.Interval[]) object);
+        }
+
+        cfgPrinter.target = null;
+        cfgPrinter.lir = null;
+        cfgPrinter.lirGenerator = null;
+        cfgPrinter.cfg = null;
+        cfgPrinter.flush();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.printer;
+
+import java.io.*;
+import java.util.*;
+import java.util.Map.Entry;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.schedule.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.Verbosity;
+import com.oracle.graal.graph.NodeClass.NodeClassIterator;
+import com.oracle.graal.graph.NodeClass.Position;
+import com.oracle.graal.java.bytecode.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a
+ * href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>.
+ */
+class IdealGraphPrinter extends BasicIdealGraphPrinter {
+    /**
+     * Creates a new {@link IdealGraphPrinter} that writes to the specified output stream.
+     */
+    public IdealGraphPrinter(OutputStream stream) {
+        super(stream);
+    }
+
+    /**
+     * Starts a new group of graphs with the given name, short name and method byte code index (BCI) as properties.
+     */
+    public void beginGroup(String name, String shortName, RiResolvedMethod method, int bci) {
+        beginGroup();
+        beginProperties();
+        printProperty("name", name);
+        endProperties();
+        beginMethod(name, shortName, bci);
+        if (method != null) {
+            beginBytecodes();
+            BytecodeStream bytecodes = new BytecodeStream(method.code());
+            while (bytecodes.currentBC() != Bytecodes.END) {
+                int startBCI = bytecodes.currentBCI();
+                String mnemonic = Bytecodes.nameOf(bytecodes.currentBC());
+                int[] extra = null;
+                if (bytecodes.nextBCI() > startBCI + 1) {
+                    extra = new int[bytecodes.nextBCI() - (startBCI + 1)];
+                    for (int i = 0; i < extra.length; i++) {
+                        extra[i] = bytecodes.readUByte(startBCI + 1 + i);
+                    }
+                }
+                printBytecode(startBCI, mnemonic, extra);
+                bytecodes.next();
+            }
+            endBytecodes();
+        }
+        endMethod();
+    }
+
+    public void print(Graph graph, String title) {
+        print(graph, title, null);
+    }
+
+    /**
+     * Prints an entire {@link Graph} with the specified title, optionally using short names for nodes.
+     */
+    public void print(Graph graph, String title, SchedulePhase predefinedSchedule) {
+        beginGraph(title);
+        Set<Node> noBlockNodes = new HashSet<>();
+        SchedulePhase schedule = predefinedSchedule;
+        if (schedule == null) {
+            try {
+                schedule = new SchedulePhase();
+                schedule.apply((StructuredGraph) graph);
+            } catch (Throwable t) {
+                schedule = null;
+            }
+        }
+
+        beginNodes();
+        List<Edge> edges = printNodes(graph, schedule == null ? null : schedule.getCFG().getNodeToBlock(), noBlockNodes);
+        endNodes();
+
+        beginEdges();
+        for (Edge edge : edges) {
+            printEdge(edge);
+        }
+        endEdges();
+
+        if (schedule != null) {
+            beginControlFlow();
+            for (Block block : schedule.getCFG().getBlocks()) {
+                printBlock(graph, block, schedule.getCFG().getNodeToBlock());
+            }
+            printNoBlock(noBlockNodes);
+            endControlFlow();
+        }
+
+        endGraph();
+        flush();
+    }
+
+    private List<Edge> printNodes(Graph graph, NodeMap<Block> nodeToBlock, Set<Node> noBlockNodes) {
+        ArrayList<Edge> edges = new ArrayList<>();
+
+        NodeMap<Set<Entry<String, Integer>>> colors = graph.createNodeMap();
+        NodeMap<Set<Entry<String, String>>> colorsToString = graph.createNodeMap();
+        NodeMap<Set<String>> bits = graph.createNodeMap();
+
+        for (Node node : graph.getNodes()) {
+
+            beginNode(node.toString(Verbosity.Id));
+            beginProperties();
+            printProperty("idx", node.toString(Verbosity.Id));
+
+            Map<Object, Object> props = node.getDebugProperties();
+            if (!props.containsKey("name") || props.get("name").toString().trim().length() == 0) {
+                String name = node.toString(Verbosity.Name);
+                printProperty("name", name);
+            }
+            printProperty("class", node.getClass().getSimpleName());
+            Block block = nodeToBlock == null ? null : nodeToBlock.get(node);
+            if (block != null) {
+                printProperty("block", Integer.toString(block.getId()));
+//                if (!(node instanceof PhiNode || node instanceof FrameState || node instanceof LocalNode) && !block.nodes().contains(node)) {
+//                    printProperty("notInOwnBlock", "true");
+//                }
+            } else {
+                printProperty("block", "noBlock");
+                noBlockNodes.add(node);
+            }
+
+            Set<Entry<String, Integer>> nodeColors = colors.get(node);
+            if (nodeColors != null) {
+                for (Entry<String, Integer> color : nodeColors) {
+                    String name = color.getKey();
+                    Integer value = color.getValue();
+                    printProperty(name, Integer.toString(value));
+                }
+            }
+            Set<Entry<String, String>> nodeColorStrings = colorsToString.get(node);
+            if (nodeColorStrings != null) {
+                for (Entry<String, String> color : nodeColorStrings) {
+                    String name = color.getKey();
+                    String value = color.getValue();
+                    printProperty(name, value);
+                }
+            }
+            Set<String> nodeBits = bits.get(node);
+            if (nodeBits != null) {
+                for (String bit : nodeBits) {
+                    printProperty(bit, "true");
+                }
+            }
+
+            for (Entry<Object, Object> entry : props.entrySet()) {
+                String key = entry.getKey().toString();
+                String value = entry.getValue() == null ? "null" : entry.getValue().toString();
+                printProperty(key, value);
+            }
+
+            endProperties();
+            endNode();
+
+            // successors
+            int fromIndex = 0;
+            NodeClassIterator succIter = node.successors().iterator();
+            while (succIter.hasNext()) {
+                Position position = succIter.nextPosition();
+                Node successor = node.getNodeClass().get(node, position);
+                if (successor != null) {
+                    edges.add(new Edge(node.toString(Verbosity.Id), fromIndex, successor.toString(Verbosity.Id), 0, node.getNodeClass().getName(position)));
+                }
+                fromIndex++;
+            }
+
+            // inputs
+            int toIndex = 1;
+            NodeClassIterator inputIter = node.inputs().iterator();
+            while (inputIter.hasNext()) {
+                Position position = inputIter.nextPosition();
+                Node input = node.getNodeClass().get(node, position);
+                if (input != null) {
+                    edges.add(new Edge(input.toString(Verbosity.Id), input.successors().count(), node.toString(Verbosity.Id), toIndex, node.getNodeClass().getName(position)));
+                }
+                toIndex++;
+            }
+        }
+
+        return edges;
+    }
+
+    private void printBlock(Graph graph, Block block, NodeMap<Block> nodeToBlock) {
+        beginBlock(Integer.toString(block.getId()));
+        beginSuccessors();
+        for (Block sux : block.getSuccessors()) {
+            if (sux != null) {
+                printSuccessor(Integer.toString(sux.getId()));
+            }
+        }
+        endSuccessors();
+        beginBlockNodes();
+
+        Set<Node> nodes = new HashSet<>();
+
+        if (nodeToBlock != null) {
+            for (Node n : graph.getNodes()) {
+                Block blk = nodeToBlock.get(n);
+                if (blk == block) {
+                    nodes.add(n);
+                }
+            }
+        }
+
+        if (nodes.size() > 0) {
+            // if this is the first block: add all locals to this block
+            if (block.getBeginNode() == ((StructuredGraph) graph).start()) {
+                for (Node node : graph.getNodes()) {
+                    if (node instanceof LocalNode) {
+                        nodes.add(node);
+                    }
+                }
+            }
+
+            Set<Node> snapshot = new HashSet<>(nodes);
+            // add all framestates and phis to their blocks
+            for (Node node : snapshot) {
+                if (node instanceof StateSplit && ((StateSplit) node).stateAfter() != null) {
+                    nodes.add(((StateSplit) node).stateAfter());
+                }
+                if (node instanceof MergeNode) {
+                    for (PhiNode phi : ((MergeNode) node).phis()) {
+                        nodes.add(phi);
+                    }
+                }
+            }
+
+            for (Node node : nodes) {
+                printBlockNode(node.toString(Verbosity.Id));
+            }
+        }
+        endBlockNodes();
+        endBlock();
+    }
+
+    private void printNoBlock(Set<Node> noBlockNodes) {
+        if (!noBlockNodes.isEmpty()) {
+            beginBlock("noBlock");
+            beginBlockNodes();
+            for (Node node : noBlockNodes) {
+                printBlockNode(node.toString(Verbosity.Id));
+            }
+            endBlockNodes();
+            endBlock();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.printer;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.criutils.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+
+/**
+ * Observes compilation events and uses {@link IdealGraphPrinter} to generate a graph representation that can be
+ * inspected with the <a href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>.
+ */
+public class IdealGraphPrinterDumpHandler implements DebugDumpHandler {
+
+    private static final String DEFAULT_FILE_NAME = "output.igv.xml";
+
+    private IdealGraphPrinter printer;
+    private List<String> previousInlineContext = new ArrayList<>();
+    private String fileName;
+    private String host;
+    private int port;
+    private boolean initialized;
+
+    /**
+     * Creates a new {@link IdealGraphPrinterDumpHandler} that writes output to a file named after the compiled method.
+     */
+    public IdealGraphPrinterDumpHandler() {
+        this.fileName = DEFAULT_FILE_NAME;
+    }
+
+    /**
+     * Creates a new {@link IdealGraphPrinterDumpHandler} that sends output to a remote IdealGraphVisualizer instance.
+     */
+    public IdealGraphPrinterDumpHandler(String host, int port) {
+        this.host = host;
+        this.port = port;
+    }
+
+    private void ensureInitialized() {
+        if (!initialized) {
+            initialized = true;
+            if (fileName != null) {
+                initializeFilePrinter();
+            } else {
+                initializeNetworkPrinter();
+            }
+        }
+    }
+
+    private void initializeFilePrinter() {
+        try {
+            FileOutputStream stream = new FileOutputStream(fileName);
+            printer = new IdealGraphPrinter(stream);
+            printer.begin();
+        } catch (IOException e) {
+            printer = null;
+        }
+    }
+
+    private void initializeNetworkPrinter() {
+        try {
+            Socket socket = new Socket(host, port);
+            BufferedOutputStream stream = new BufferedOutputStream(socket.getOutputStream(), 0x4000);
+            printer = new IdealGraphPrinter(stream);
+            printer.begin();
+            TTY.println("Connected to the IGV on port %d", port);
+        } catch (IOException e) {
+            TTY.println("Could not connect to the IGV on port %d: %s", port, e);
+            printer = null;
+        }
+    }
+
+    @Override
+    public void dump(Object object, final String message) {
+        if (object instanceof Graph) {
+            ensureInitialized();
+            final Graph graph = (Graph) object;
+
+            if (printer != null && printer.isValid()) {
+                // Get all current RiResolvedMethod instances in the context.
+                List<String> inlineContext = getInlineContext();
+                Debug.contextSnapshot(RiResolvedMethod.class);
+
+                // Reverse list such that inner method comes after outer method.
+                Collections.reverse(inlineContext);
+
+                // Check for method scopes that must be closed since the previous dump.
+                for (int i = 0; i < previousInlineContext.size(); ++i) {
+                    if (i >= inlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
+                        for (int j = previousInlineContext.size() - 1; j >= i; --j) {
+                            closeScope();
+                        }
+                        break;
+                    }
+                }
+
+                // Check for method scopes that must be opened since the previous dump.
+                for (int i = 0; i < inlineContext.size(); ++i) {
+                    if (i >= previousInlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
+                        for (int j = i; j < inlineContext.size(); ++j) {
+                            openScope(inlineContext.get(j));
+                        }
+                        break;
+                    }
+                }
+
+                // Save inline context for next dump.
+                previousInlineContext = inlineContext;
+
+                Debug.sandbox("PrintingGraph", new Runnable() {
+
+                    @Override
+                    public void run() {
+                        // Finally, output the graph.
+                        printer.print(graph, message);
+
+                    }
+                });
+            }
+        }
+    }
+
+    private static List<String> getInlineContext() {
+        List<String> result = new ArrayList<>();
+        for (Object o : Debug.context()) {
+            if (o instanceof RiResolvedMethod) {
+                RiResolvedMethod method = (RiResolvedMethod) o;
+                result.add(CiUtil.format("%H::%n(%p)", method));
+            } else if (o instanceof DebugDumpScope) {
+                DebugDumpScope debugDumpScope = (DebugDumpScope) o;
+                result.add(debugDumpScope.getName());
+            }
+        }
+        return result;
+    }
+
+    private void openScope(String name) {
+        printer.beginGroup(name, name, Debug.contextLookup(RiResolvedMethod.class), -1);
+    }
+
+    private void closeScope() {
+        printer.endGroup();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import java.lang.annotation.*;
+
+/**
+ * Denotes a class that substitutes methods of another specified class with snippets.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface ClassSubstitution {
+
+    Class<?> value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/DoubleSnippets.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import com.oracle.max.cri.util.*;
+import com.oracle.graal.nodes.calc.*;
+
+/**
+ * Snippets for {@link java.lang.Double} methods.
+ */
+@ClassSubstitution(java.lang.Double.class)
+public class DoubleSnippets implements SnippetsInterface {
+
+    private static final long NAN_RAW_LONG_BITS = Double.doubleToRawLongBits(Double.NaN);
+
+    public static long doubleToRawLongBits(double value) {
+        @JavacBug(id = 6995200)
+        Long result = ConvertNode.convert(ConvertNode.Op.MOV_D2L, value);
+        return result;
+    }
+
+    // TODO This method is not necessary, since the JDK method does exactly this
+    public static long doubleToLongBits(double value) {
+        if (value != value) {
+            return NAN_RAW_LONG_BITS;
+        } else {
+            return doubleToRawLongBits(value);
+        }
+    }
+
+    public static double longBitsToDouble(long bits) {
+        @JavacBug(id = 6995200)
+        Double result = ConvertNode.convert(ConvertNode.Op.MOV_L2D, bits);
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/FloatSnippets.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import com.oracle.max.cri.util.*;
+import com.oracle.graal.nodes.calc.*;
+
+/**
+ * Snippets for {@link java.lang.Float} methods.
+ */
+@ClassSubstitution(java.lang.Float.class)
+public class FloatSnippets implements SnippetsInterface {
+
+    private static final int NAN_RAW_INT_BITS = Float.floatToRawIntBits(Float.NaN);
+
+    public static int floatToRawIntBits(float value) {
+        @JavacBug(id = 6995200)
+        Integer result = ConvertNode.convert(ConvertNode.Op.MOV_F2I, value);
+        return result;
+    }
+
+    // TODO This method is not necessary, since the JDK method does exactly this
+    public static int floatToIntBits(float value) {
+        if (value != value) {
+            return NAN_RAW_INT_BITS;
+        } else {
+            return floatToRawIntBits(value);
+        }
+    }
+
+    public static float intBitsToFloat(int bits) {
+        @JavacBug(id = 6995200)
+        Float result = ConvertNode.convert(ConvertNode.Op.MOV_I2F, bits);
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.cri.*;
+
+/**
+ * Definition of the snippets that are VM-independent and can be intrinsified by Graal in any VM.
+ */
+public class GraalIntrinsics {
+    public static void installIntrinsics(GraalRuntime runtime, CiTarget target, PhasePlan plan) {
+        if (GraalOptions.Intrinsify) {
+            Snippets.install(runtime, target, new MathSnippetsX86(), plan);
+            Snippets.install(runtime, target, new DoubleSnippets(), plan);
+            Snippets.install(runtime, target, new FloatSnippets(), plan);
+            Snippets.install(runtime, target, new NodeClassSnippets(), plan);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.snippets.nodes.*;
+import com.oracle.graal.snippets.nodes.MathIntrinsicNode.Operation;
+
+/**
+ * Snippets for {@link java.lang.Math} methods.
+ */
+@ClassSubstitution(java.lang.Math.class)
+public class MathSnippetsX86 implements SnippetsInterface {
+
+    private static final double PI_4 = 0.7853981633974483;
+
+    public static double abs(double x) {
+        return MathIntrinsicNode.compute(x, Operation.ABS);
+    }
+
+    public static double sqrt(double x) {
+        return MathIntrinsicNode.compute(x, Operation.SQRT);
+    }
+
+    public static double log(double x) {
+        return MathIntrinsicNode.compute(x, Operation.LOG);
+    }
+
+    public static double log10(double x) {
+        return MathIntrinsicNode.compute(x, Operation.LOG10);
+    }
+
+    // NOTE on snippets below:
+    //   Math.sin(), .cos() and .tan() guarantee a value within 1 ULP of the
+    //   exact result, but x87 trigonometric FPU instructions are only that
+    //   accurate within [-pi/4, pi/4]. Examine the passed value and provide
+    //   a slow path for inputs outside of that interval.
+
+    public static double sin(double x) {
+        if (abs(x) < PI_4) {
+            return MathIntrinsicNode.compute(x, Operation.SIN);
+        } else {
+            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticSin, x);
+        }
+    }
+
+    public static double cos(double x) {
+        if (abs(x) < PI_4) {
+            return MathIntrinsicNode.compute(x, Operation.COS);
+        } else {
+            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticCos, x);
+        }
+    }
+
+    public static double tan(double x) {
+        if (abs(x) < PI_4) {
+            return MathIntrinsicNode.compute(x, Operation.TAN);
+        } else {
+            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticTan, x);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/NodeClassSnippets.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.extended.*;
+
+/**
+ * Snippets for {@link NodeClass} methods.
+ */
+@SuppressWarnings("unused")
+@ClassSubstitution(NodeClass.class)
+public class NodeClassSnippets implements SnippetsInterface {
+
+
+    private static Node getNode(Node node, long offset) {
+        return UnsafeCastNode.cast(UnsafeLoadNode.load(node, offset, CiKind.Object), Node.class);
+    }
+
+    private static NodeList<Node> getNodeList(Node node, long offset) {
+        return UnsafeCastNode.cast(UnsafeLoadNode.load(node, offset, CiKind.Object), NodeList.class);
+    }
+
+    private static void putNode(Node node, long offset, Node value) {
+        UnsafeStoreNode.store(node, offset, value, CiKind.Object);
+    }
+
+    private static void putNodeList(Node node, long offset, NodeList value) {
+        UnsafeStoreNode.store(node, offset, value, CiKind.Object);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippet.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface Snippet {
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+import java.lang.reflect.*;
+import java.util.concurrent.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.util.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.java.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+
+/**
+ * Utilities for snippet installation and management.
+ */
+public class Snippets {
+
+    public static void install(GraalRuntime runtime, CiTarget target, SnippetsInterface obj, PhasePlan plan) {
+        Class<? extends SnippetsInterface> clazz = obj.getClass();
+        BoxingMethodPool pool = new BoxingMethodPool(runtime);
+        if (clazz.isAnnotationPresent(ClassSubstitution.class)) {
+            installSubstitution(runtime, target, plan, clazz, pool, clazz.getAnnotation(ClassSubstitution.class).value());
+        } else {
+            installSnippets(runtime, target, plan, clazz, pool);
+        }
+    }
+
+    private static void installSnippets(GraalRuntime runtime, CiTarget target, PhasePlan plan, Class< ? extends SnippetsInterface> clazz,
+                    BoxingMethodPool pool) {
+        for (Method snippet : clazz.getDeclaredMethods()) {
+            int modifiers = snippet.getModifiers();
+            if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) {
+                throw new RuntimeException("Snippet must not be abstract or native");
+            }
+            RiResolvedMethod snippetRiMethod = runtime.getRiMethod(snippet);
+            if (snippetRiMethod.compilerStorage().get(Graph.class) == null) {
+                buildSnippetGraph(snippetRiMethod, runtime, target, pool, plan);
+            }
+        }
+    }
+
+    private static void installSubstitution(GraalRuntime runtime, CiTarget target, PhasePlan plan, Class< ? extends SnippetsInterface> clazz,
+                    BoxingMethodPool pool, Class<?> original) throws GraalInternalError {
+        for (Method snippet : clazz.getDeclaredMethods()) {
+            try {
+                Method method = original.getDeclaredMethod(snippet.getName(), snippet.getParameterTypes());
+                if (!method.getReturnType().isAssignableFrom(snippet.getReturnType())) {
+                    throw new RuntimeException("Snippet has incompatible return type");
+                }
+                int modifiers = snippet.getModifiers();
+                if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) {
+                    throw new RuntimeException("Snippet must not be abstract or native");
+                }
+                RiResolvedMethod snippetRiMethod = runtime.getRiMethod(snippet);
+                StructuredGraph graph = buildSnippetGraph(snippetRiMethod, runtime, target, pool, plan);
+                runtime.getRiMethod(method).compilerStorage().put(Graph.class, graph);
+            } catch (NoSuchMethodException e) {
+                throw new RuntimeException("Could not resolve method to substitute with: " + snippet.getName(), e);
+            }
+        }
+    }
+
+    private static StructuredGraph buildSnippetGraph(final RiResolvedMethod snippetRiMethod, final GraalRuntime runtime, final CiTarget target, final BoxingMethodPool pool, final PhasePlan plan) {
+        return Debug.scope("BuildSnippetGraph", snippetRiMethod, new Callable<StructuredGraph>() {
+
+            @Override
+            public StructuredGraph call() throws Exception {
+                GraphBuilderConfiguration config = GraphBuilderConfiguration.getSnippetDefault();
+                GraphBuilderPhase graphBuilder = new GraphBuilderPhase(runtime, config);
+                StructuredGraph graph = new StructuredGraph(snippetRiMethod);
+                graphBuilder.apply(graph);
+
+                Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName());
+
+                new SnippetIntrinsificationPhase(runtime, pool).apply(graph);
+
+                for (Invoke invoke : graph.getInvokes()) {
+                    MethodCallTargetNode callTarget = invoke.callTarget();
+                    RiResolvedMethod targetMethod = callTarget.targetMethod();
+                    RiResolvedType holder = targetMethod.holder();
+                    if (holder.isSubtypeOf(runtime.getType(SnippetsInterface.class))) {
+                        StructuredGraph targetGraph = (StructuredGraph) targetMethod.compilerStorage().get(Graph.class);
+                        if (targetGraph == null) {
+                            targetGraph = buildSnippetGraph(targetMethod, runtime, target, pool, plan);
+                        }
+                        InliningUtil.inline(invoke, targetGraph, true);
+                        if (GraalOptions.OptCanonicalizer) {
+                            new CanonicalizerPhase(target, runtime, null).apply(graph);
+                        }
+                    }
+                }
+
+                new SnippetIntrinsificationPhase(runtime, pool).apply(graph);
+
+                Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName());
+                new DeadCodeEliminationPhase().apply(graph);
+                if (GraalOptions.OptCanonicalizer) {
+                    new CanonicalizerPhase(target, runtime, null).apply(graph);
+                }
+
+                // TODO (gdub) remove when we have good safepoint polling elimination
+                for (LoopEndNode end : graph.getNodes(LoopEndNode.class)) {
+                    end.setSafepointPolling(false);
+                }
+                new InsertStateAfterPlaceholderPhase().apply(graph);
+
+                Debug.dump(graph, "%s: Final", snippetRiMethod.name());
+
+                snippetRiMethod.compilerStorage().put(Graph.class, graph);
+
+                return graph;
+            }
+        });
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetsInterface.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets;
+
+/**
+ * Tagging interface for interfaces or classes providing snippets.
+ */
+public interface SnippetsInterface {
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ArrayHeaderSizeNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets.nodes;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+
+public class ArrayHeaderSizeNode extends FloatingNode implements Lowerable {
+    @Data private final CiKind elementKind;
+
+    public ArrayHeaderSizeNode(CiKind elementKind) {
+        super(StampFactory.forKind(CiKind.Long));
+        this.elementKind = elementKind;
+    }
+
+    @Override
+    public void lower(CiLoweringTool tool) {
+        tool.getRuntime().lower(this, tool);
+    }
+
+    public CiKind elementKind() {
+        return elementKind;
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static long sizeFor(@ConstantNodeParameter CiKind kind) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets.nodes;
+
+import static com.oracle.graal.lir.amd64.AMD64Arithmetic.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.compiler.target.amd64.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op2Reg;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.spi.*;
+import com.oracle.graal.nodes.type.*;
+import com.oracle.graal.snippets.target.amd64.*;
+
+public class MathIntrinsicNode extends FloatingNode implements Canonicalizable, AMD64LIRLowerable {
+
+    @Input private ValueNode x;
+    @Data private final Operation operation;
+
+    public enum Operation {
+        ABS, SQRT, LOG, LOG10, SIN, COS, TAN,
+    }
+
+    public ValueNode x() {
+        return x;
+    }
+
+    public Operation operation() {
+        return operation;
+    }
+
+    public MathIntrinsicNode(ValueNode x, Operation op) {
+        super(StampFactory.forKind(x.kind()));
+        assert x.kind() == CiKind.Double;
+        this.x = x;
+        this.operation = op;
+    }
+
+    @Override
+    public void generateAmd64(AMD64LIRGenerator gen) {
+        Variable input = gen.load(gen.operand(x()));
+        Variable result = gen.newVariable(kind());
+        switch (operation()) {
+            case ABS:   gen.append(new Op2Reg(DAND, result, input, CiConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)))); break;
+            case SQRT:  gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.SQRT, result, input)); break;
+            case LOG:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.LOG, result, input)); break;
+            case LOG10: gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.LOG10, result, input)); break;
+            case SIN:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.SIN, result, input)); break;
+            case COS:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.COS, result, input)); break;
+            case TAN:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.TAN, result, input)); break;
+            default:    throw GraalInternalError.shouldNotReachHere();
+        }
+        gen.setResult(this, result);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (x().isConstant()) {
+            double value = x().asConstant().asDouble();
+            switch (operation()) {
+                case ABS:   return ConstantNode.forDouble(Math.abs(value), graph());
+                case SQRT:  return ConstantNode.forDouble(Math.sqrt(value), graph());
+                case LOG:   return ConstantNode.forDouble(Math.log(value), graph());
+                case LOG10: return ConstantNode.forDouble(Math.log10(value), graph());
+                case SIN:   return ConstantNode.forDouble(Math.sin(value), graph());
+                case COS:   return ConstantNode.forDouble(Math.cos(value), graph());
+                case TAN:   return ConstantNode.forDouble(Math.tan(value), graph());
+            }
+        }
+        return this;
+    }
+
+    @SuppressWarnings("unused")
+    @NodeIntrinsic
+    public static double compute(double x, @ConstantNodeParameter Operation op) {
+        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64MathIntrinsicOp.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.snippets.target.amd64;
+
+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.graal.graph.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.amd64.*;
+import com.oracle.graal.lir.asm.*;
+
+public class AMD64MathIntrinsicOp extends AMD64LIRInstruction {
+    public enum Opcode  {
+        SQRT,
+        SIN, COS, TAN,
+        LOG, LOG10;
+    }
+
+    public AMD64MathIntrinsicOp(Opcode opcode, CiValue result, CiValue input) {
+        super(opcode, new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
+    }
+
+    @Override
+    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+        Opcode opcode = (Opcode) code;
+        CiValue result = output(0);
+        CiValue input = input(0);
+
+        switch (opcode) {
+            case SQRT:  masm.sqrtsd(asDoubleReg(result), asDoubleReg(input)); break;
+            case LOG:   masm.flog(asDoubleReg(result), asDoubleReg(input), false); break;
+            case LOG10: masm.flog(asDoubleReg(result), asDoubleReg(input), true); break;
+            case SIN:   masm.fsin(asDoubleReg(result), asDoubleReg(input)); break;
+            case COS:   masm.fcos(asDoubleReg(result), asDoubleReg(input)); break;
+            case TAN:   masm.ftan(asDoubleReg(result), asDoubleReg(input)); break;
+            default:    throw GraalInternalError.shouldNotReachHere();
+        }
+    }
+
+    @Override
+    protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
+        if (mode == OperandMode.Input && index == 0) {
+            return EnumSet.of(OperandFlag.Register);
+        } else if (mode == OperandMode.Output && index == 0) {
+            return EnumSet.of(OperandFlag.Register);
+        }
+        throw GraalInternalError.shouldNotReachHere();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.snippets/test/test/com/oracle/graal/snippets/package-info.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+/**
+ * Test cases for Graal snippets.
+ */
+package test.com.oracle.graal.snippets;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/BoxingEliminationTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+
+/**
+ * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
+ * Then boxing elimination is applied and it is verified that the resulting graph is equal to the
+ * graph of the method that just has a "return 1" statement in it.
+ */
+public class BoxingEliminationTest extends GraphTest {
+    private static final Short s = 2;
+    private static final String REFERENCE_SNIPPET = "referenceSnippet";
+
+    @SuppressWarnings("all")
+    public static short referenceSnippet(short a) {
+        return 1;
+    }
+
+    public static Short boxedShort() {
+        return 1;
+    }
+
+    public static Object boxedObject() {
+        return (short) 1;
+    }
+
+    public static Short constantBoxedShort() {
+        return s;
+    }
+
+    @Test
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static short test1Snippet(short a) {
+        return boxedShort();
+    }
+
+    @Test
+    public void test2() {
+        test("test2Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static short test2Snippet(short a) {
+        return (Short) boxedObject();
+    }
+    @Test
+    public void test3() {
+        test("test3Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static short test3Snippet(short a) {
+        short b = boxedShort();
+        if (b < 0) {
+            b = boxedShort();
+        }
+        return b;
+    }
+
+    @Test
+    public void test4() {
+        test("test4Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static short test4Snippet(short a) {
+        return constantBoxedShort();
+    }
+
+    private void test(final String snippet) {
+        Debug.scope("BoxingEliminationTest", new DebugDumpScope(snippet), new Runnable() {
+            @Override
+            public void run() {
+                StructuredGraph graph = parse(snippet);
+                BoxingMethodPool pool = new BoxingMethodPool(runtime());
+                IdentifyBoxingPhase identifyBoxingPhase = new IdentifyBoxingPhase(pool);
+                PhasePlan phasePlan = getDefaultPhasePlan();
+                phasePlan.addPhase(PhasePosition.AFTER_PARSING, identifyBoxingPhase);
+                identifyBoxingPhase.apply(graph);
+                LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
+                ConstantNode constant = ConstantNode.forShort((short) 0, graph);
+                for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
+                    n.replaceFirstInput(local, constant);
+                }
+                Collection<Invoke> hints = new ArrayList<>();
+                for (Invoke invoke : graph.getInvokes()) {
+                    hints.add(invoke);
+                }
+                new InliningPhase(null, runtime(), hints, null, phasePlan).apply(graph);
+                new CanonicalizerPhase(null, runtime(), null).apply(graph);
+                Debug.dump(graph, "Graph");
+                new BoxingEliminationPhase().apply(graph);
+                Debug.dump(graph, "Graph");
+                new ExpandBoxingNodesPhase(pool).apply(graph);
+                new CanonicalizerPhase(null, runtime(), null).apply(graph);
+                new DeadCodeEliminationPhase().apply(graph);
+                StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
+                assertEquals(referenceGraph, graph);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import java.lang.reflect.*;
+
+import org.junit.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiCompiledMethod.MethodInvalidatedException;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.java.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * In the following tests, the usages of local variable "a" are replaced with the integer constant 0. Then
+ * canonicalization is applied and it is verified that the resulting graph is equal to the graph of the method that just
+ * has a "return 1" statement in it.
+ */
+public class CompiledMethodTest extends GraphTest {
+
+    public static Object testMethod(Object arg1, Object arg2, Object arg3) {
+        return arg1 + " " + arg2 + " " + arg3;
+    }
+
+    @Test
+    public void test1() {
+        Method method = getMethod("testMethod");
+        final StructuredGraph graph = parse(method);
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        new DeadCodeEliminationPhase().apply(graph);
+
+        for (Node node : graph.getNodes()) {
+            if (node instanceof ConstantNode) {
+                ConstantNode constant = (ConstantNode) node;
+                if (constant.kind() == CiKind.Object && " ".equals(constant.value.asObject())) {
+                    graph.replaceFloating(constant, ConstantNode.forObject("-", runtime, graph));
+                }
+            }
+        }
+
+        final RiResolvedMethod riMethod = runtime.getRiMethod(method);
+        CiTargetMethod targetMethod = runtime.compile(riMethod, graph);
+        RiCompiledMethod compiledMethod = runtime.addMethod(riMethod, targetMethod);
+        try {
+            Object result = compiledMethod.execute("1", "2", "3");
+            Assert.assertEquals("1-2-3", result);
+        } catch (MethodInvalidatedException t) {
+            Assert.fail("method invalidated");
+        }
+
+    }
+
+    @Test
+    public void test2() throws NoSuchMethodException, SecurityException {
+        Method method = CompilableObjectImpl.class.getDeclaredMethod("executeHelper", ObjectCompiler.class, String.class);
+        RiResolvedMethod riMethod = runtime.getRiMethod(method);
+        StructuredGraph graph = new StructuredGraph(riMethod);
+        new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault()).apply(graph);
+        new CanonicalizerPhase(null, runtime, null).apply(graph);
+        new DeadCodeEliminationPhase().apply(graph);
+
+        for (Node node : graph.getNodes()) {
+            if (node instanceof ConstantNode) {
+                ConstantNode constant = (ConstantNode) node;
+                if (constant.kind() == CiKind.Object && "1 ".equals(constant.value.asObject())) {
+                    graph.replaceFloating(constant, ConstantNode.forObject("1-", runtime, graph));
+                }
+            }
+        }
+
+        CiTargetMethod targetMethod = runtime.compile(riMethod, graph);
+        final RiCompiledMethod compiledMethod = runtime.addMethod(riMethod, targetMethod);
+
+        final CompilableObject compilableObject = new CompilableObjectImpl(0);
+
+        Object result;
+        result = compilableObject.execute(new ObjectCompilerImpl(compiledMethod), "3");
+        Assert.assertEquals("1-3", result);
+    }
+
+    public abstract class CompilableObject {
+
+        private CompiledObject compiledObject;
+        private final int compileThreshold;
+        private int counter;
+
+        public CompilableObject(int compileThreshold) {
+            this.compileThreshold = compileThreshold;
+        }
+
+        public final Object execute(ObjectCompiler compiler, String args) {
+            if (counter++ < compileThreshold || compiler == null) {
+                return executeHelper(compiler, args);
+            } else {
+                compiledObject = compiler.compile(this);
+                return compiledObject.execute(compiler, args);
+            }
+        }
+
+        protected abstract Object executeHelper(ObjectCompiler context, String args);
+    }
+
+    private final class CompilableObjectImpl extends CompilableObject {
+
+        private CompilableObjectImpl(int compileThreshold) {
+            super(compileThreshold);
+        }
+
+        @Override
+        protected Object executeHelper(ObjectCompiler compiler, String args) {
+            return "1 " + args;
+        }
+    }
+
+    public interface CompiledObject {
+        Object execute(ObjectCompiler context, String args);
+    }
+
+    public interface ObjectCompiler {
+        CompiledObject compile(CompilableObject node);
+    }
+
+    private final class ObjectCompilerImpl implements ObjectCompiler {
+
+        private final RiCompiledMethod compiledMethod;
+
+        private ObjectCompilerImpl(RiCompiledMethod compiledMethod) {
+            this.compiledMethod = compiledMethod;
+        }
+
+        @Override
+        public CompiledObject compile(final CompilableObject node) {
+            return new CompiledObject() {
+                @Override
+                public Object execute(ObjectCompiler compiler, String args) {
+                    return compiledMethod.execute(node, compiler, args);
+                }
+            };
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/ConditionTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import static org.junit.Assert.*;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.nodes.calc.*;
+
+
+public class ConditionTest {
+
+    @Test
+    public void testImplies() {
+        Random rand = new Random(13);
+        for (Condition c1 : Condition.values()) {
+            for (Condition c2 : Condition.values()) {
+                boolean implies = c1.implies(c2);
+                if (implies && c1 != Condition.OF && c2 != Condition.OF && c1 != Condition.NOF && c2 != Condition.NOF) {
+                    for (int i = 0; i < 10000; i++) {
+                        CiConstant a = CiConstant.forInt(rand.nextInt());
+                        CiConstant b = CiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        boolean result1 = c1.foldCondition(a, b, null, false);
+                        boolean result2 = c2.foldCondition(a, b, null, false);
+                        if (result1 && implies) {
+                            assertTrue(result2);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    @Test
+    public void testJoin() {
+        Random rand = new Random(13);
+        for (Condition c1 : Condition.values()) {
+            for (Condition c2 : Condition.values()) {
+                Condition join = c1.join(c2);
+                assertTrue(join == c2.join(c1));
+                if (join != null && c1 != Condition.OF && c2 != Condition.OF && c1 != Condition.NOF && c2 != Condition.NOF) {
+                    for (int i = 0; i < 10000; i++) {
+                        CiConstant a = CiConstant.forInt(rand.nextInt());
+                        CiConstant b = CiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        boolean result1 = c1.foldCondition(a, b, null, false);
+                        boolean result2 = c2.foldCondition(a, b, null, false);
+                        boolean resultJoin = join.foldCondition(a, b, null, false);
+                        if (result1 && result2) {
+                            assertTrue(resultJoin);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    @Test
+    public void testMeet() {
+        Random rand = new Random(13);
+        for (Condition c1 : Condition.values()) {
+            for (Condition c2 : Condition.values()) {
+                Condition meet = c1.meet(c2);
+                assertTrue(meet == c2.meet(c1));
+                if (meet != null && c1 != Condition.OF && c2 != Condition.OF && c1 != Condition.NOF && c2 != Condition.NOF) {
+                    for (int i = 0; i < 10000; i++) {
+                        CiConstant a = CiConstant.forInt(rand.nextInt());
+                        CiConstant b = CiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        boolean result1 = c1.foldCondition(a, b, null, false);
+                        boolean result2 = c2.foldCondition(a, b, null, false);
+                        boolean resultMeet = meet.foldCondition(a, b, null, false);
+                        if (result1 || result2) {
+                            assertTrue(resultMeet);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/DegeneratedLoopsTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
+ * Then canonicalization is applied and it is verified that the resulting graph is equal to the
+ * graph of the method that just has a "return 1" statement in it.
+ */
+public class DegeneratedLoopsTest extends GraphTest {
+
+    private static final String REFERENCE_SNIPPET = "referenceSnippet";
+
+    @SuppressWarnings("all")
+    public static int referenceSnippet(int a) {
+        return 1;
+    }
+
+    @Test
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    private static class UnresolvedException extends RuntimeException {
+        private static final long serialVersionUID = 5215434338750728440L;
+
+        static {
+            if (true) {
+                throw new UnsupportedOperationException("this class may never be initialized");
+            }
+        }
+    }
+
+    @SuppressWarnings("all")
+    public static int test1Snippet(int a) {
+        for (;;) {
+            try {
+                test();
+                break;
+            } catch (UnresolvedException e) {
+            }
+        }
+        return a;
+    }
+
+    private static void test() {
+
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parse(snippet);
+        Debug.dump(graph, "Graph");
+        LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
+        ConstantNode constant = ConstantNode.forInt(0, graph);
+        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
+            n.replaceFirstInput(local, constant);
+        }
+        for (Invoke invoke : graph.getInvokes()) {
+            invoke.intrinsify(null);
+        }
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET); Debug.dump(referenceGraph, "Graph");
+        assertEquals(referenceGraph, graph);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/EscapeAnalysisTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import junit.framework.*;
+
+import org.junit.Test;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
+
+/**
+ * In these test cases the probability of all invokes is set to a high value, such that an InliningPhase should inline them all.
+ * After that, the EscapeAnalysisPhase is expected to remove all allocations and return the correct values.
+ */
+public class EscapeAnalysisTest extends GraphTest {
+
+    @Test
+    public void test1() {
+        test("test1Snippet", CiConstant.forInt(101));
+    }
+
+    @SuppressWarnings("all")
+    public static int test1Snippet(int a) {
+        Integer x = new Integer(101);
+        return x.intValue();
+    }
+
+    @Test
+    public void test2() {
+        test("test2Snippet", CiConstant.forInt(0));
+    }
+
+    @SuppressWarnings("all")
+    public static int test2Snippet(int a) {
+        Integer[] x = new Integer[0];
+        return x.length;
+    }
+
+    @Test
+    public void test3() {
+        test("test3Snippet", CiConstant.forObject(null));
+    }
+
+    @SuppressWarnings("all")
+    public static Object test3Snippet(int a) {
+        Integer[] x = new Integer[1];
+        return x[0];
+    }
+
+    @Test
+    public void testMonitor() {
+        test("testMonitorSnippet", CiConstant.forInt(0));
+    }
+
+    private static native void notInlineable();
+
+    @SuppressWarnings("all")
+    public static int testMonitorSnippet(int a) {
+        Integer x = new Integer(0);
+        Integer[] y = new Integer[0];
+        Integer[] z = new Integer[1];
+        synchronized (x) {
+            synchronized (y) {
+                synchronized (z) {
+                    notInlineable();
+                }
+            }
+        }
+        return x.intValue();
+    }
+
+    public void testMonitor2() {
+        test("testMonitor2Snippet", CiConstant.forInt(0));
+    }
+
+    /**
+     * This test case differs from the last one in that it requires inlining within a synchronized region.
+     */
+    @SuppressWarnings("all")
+    public static int testMonitor2Snippet(int a) {
+        Integer x = new Integer(0);
+        Integer[] y = new Integer[0];
+        Integer[] z = new Integer[1];
+        synchronized (x) {
+            synchronized (y) {
+                synchronized (z) {
+                    notInlineable();
+                    return x.intValue();
+                }
+            }
+        }
+    }
+
+    private void test(String snippet, CiConstant expectedResult) {
+        StructuredGraph graph = parse(snippet);
+        for (Invoke n : graph.getInvokes()) {
+            n.node().setProbability(100000);
+        }
+
+        new InliningPhase(null, runtime(), null, null, getDefaultPhasePlan()).apply(graph);
+        new DeadCodeEliminationPhase().apply(graph);
+        Debug.dump(graph, "Graph");
+        new EscapeAnalysisPhase(null, runtime(), null, getDefaultPhasePlan()).apply(graph);
+        Debug.dump(graph, "Graph");
+        int retCount = 0;
+        for (ReturnNode ret : graph.getNodes(ReturnNode.class)) {
+            Assert.assertTrue(ret.result().isConstant());
+            Assert.assertEquals(ret.result().asConstant(), expectedResult);
+            retCount++;
+        }
+        Assert.assertEquals(1, retCount);
+        int newInstanceCount = 0;
+        for (@SuppressWarnings("unused") NewInstanceNode n : graph.getNodes(NewInstanceNode.class)) {
+            newInstanceCount++;
+        }
+        for (@SuppressWarnings("unused") NewObjectArrayNode n : graph.getNodes(NewObjectArrayNode.class)) {
+            newInstanceCount++;
+        }
+        Assert.assertEquals(0, newInstanceCount);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/FloatingReadTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
+
+public class FloatingReadTest extends GraphScheduleTest {
+
+    public static class Container {
+        public int a;
+    }
+
+    public static void changeField(Container c) {
+        c.a = 0xcafebabe;
+    }
+
+    public static synchronized int test1Snippet() {
+        Container c = new Container();
+        return c.a;
+    }
+
+    @Test
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parse(snippet);
+        new LoweringPhase(runtime()).apply(graph);
+        new FloatingReadPhase().apply(graph);
+
+        ReturnNode returnNode = null;
+        MonitorExitNode monitor = null;
+
+        for (Node n : graph.getNodes()) {
+            if (n instanceof ReturnNode) {
+                returnNode = (ReturnNode) n;
+            } else if (n instanceof MonitorExitNode) {
+                monitor = (MonitorExitNode) n;
+            }
+        }
+
+        Assert.assertNotNull(returnNode);
+        Assert.assertNotNull(monitor);
+        Assert.assertTrue(returnNode.result() instanceof FloatingReadNode);
+
+        FloatingReadNode read = (FloatingReadNode) returnNode.result();
+
+        assertOrderedAfterSchedule(graph, read, monitor);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalRuntimeAccess.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.graal.cri.*;
+
+/**
+ * Utility for getting a {@link GraalRuntime} instance from the current execution environment.
+ */
+class GraalRuntimeAccess {
+
+    /**
+     * The known classes declaring a {@code getGraalRuntime()} method. These class names
+     * have aliases that can be used with the {@code "graal.runtime"} system property to
+     * specify the VM environment to try first when getting a Graal runtime instance.
+     */
+    private static Map<String, String> graalRuntimeFactoryClasses = new LinkedHashMap<>();
+    static {
+        graalRuntimeFactoryClasses.put("HotSpot", "com.oracle.graal.hotspot.CompilerImpl");
+        graalRuntimeFactoryClasses.put("Maxine", "com.oracle.max.vm.ext.maxri.MaxRuntime");
+    }
+
+    /**
+     * Gets a Graal runtime instance from the current execution environment.
+     */
+    static GraalRuntime getGraalRuntime() {
+        String vm = System.getProperty("graal.runtime");
+        if (vm != null) {
+            String cn = graalRuntimeFactoryClasses.get(vm);
+            if (cn != null) {
+                GraalRuntime graal = getGraalRuntime(cn);
+                if (graal != null) {
+                    return graal;
+                }
+            }
+        }
+
+        for (String className : graalRuntimeFactoryClasses.values()) {
+            GraalRuntime graal = getGraalRuntime(className);
+            if (graal != null) {
+                return graal;
+            }
+        }
+        throw new InternalError("Could not create a GraalRuntime instance");
+    }
+
+    /**
+     * Calls {@code getGraalRuntime()} via reflection on a given class.
+     *
+     * @return {@code null} if there was an error invoking the methodor if the method return {@code null} itself
+     */
+    private static GraalRuntime getGraalRuntime(String className) {
+        try {
+            Class<?> c = Class.forName(className);
+            Method m = c.getDeclaredMethod("getGraalRuntime");
+            return (GraalRuntime) m.invoke(null);
+        } catch (Exception e) {
+            //e.printStackTrace();
+            System.err.println(e);
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphScheduleTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.schedule.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+
+public class GraphScheduleTest extends GraphTest {
+    protected void assertOrderedAfterSchedule(StructuredGraph graph, Node a, Node b) {
+        SchedulePhase ibp = new SchedulePhase();
+        ibp.apply(graph);
+        NodeMap<Block> nodeToBlock = ibp.getCFG().getNodeToBlock();
+        Block bBlock = nodeToBlock.get(b);
+        Block aBlock = nodeToBlock.get(a);
+
+        if (bBlock == aBlock) {
+            List<Node> instructions = ibp.nodesFor(bBlock);
+            Assert.assertTrue(instructions.indexOf(b) > instructions.indexOf(a));
+        } else {
+            Block block = bBlock;
+            while (block != null) {
+                if (block == aBlock) {
+                    break;
+                }
+                block = block.getDominator();
+            }
+            Assert.assertTrue(block == aBlock);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import java.lang.reflect.*;
+
+import junit.framework.Assert;
+
+import com.oracle.max.cri.ri.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.phases.PhasePlan.*;
+import com.oracle.graal.cri.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.java.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * Base class for Graal compiler unit tests. These are white box tests
+ * for Graal compiler transformations. The general pattern for a test is:
+ * <ol>
+ * <li>Create a graph by {@linkplain #parse(String) parsing} a method.</li>
+ * <li>Manually modify the graph (e.g. replace a paramter node with a constant).</li>
+ * <li>Apply a transformation to the graph.</li>
+ * <li>Assert that the transformed graph is equal to an expected graph.</li>
+ * </ol>
+ * <p>
+ * See {@link InvokeTest} as an example.
+ * <p>
+ * The tests can be run in Eclipse with the "Compiler Unit Test" Eclipse
+ * launch configuration found in the top level of this project or by
+ * running {@code mx unittest} on the command line.
+ */
+public abstract class GraphTest {
+
+    protected final GraalRuntime runtime;
+
+    public GraphTest() {
+        this.runtime = GraalRuntimeAccess.getGraalRuntime();
+    }
+
+    protected void assertEquals(StructuredGraph expected, StructuredGraph graph) {
+        if (expected.getNodeCount() != graph.getNodeCount()) {
+            Debug.dump(expected, "Node count not matching - expected");
+            Debug.dump(graph, "Node count not matching - actual");
+            Assert.fail("Graphs do not have the same number of nodes");
+        }
+    }
+
+    protected GraalRuntime runtime() {
+        return runtime;
+    }
+
+    /**
+     * Parses a Java method to produce a graph.
+     *
+     * @param methodName the name of the method in {@code this.getClass()} to be parsed
+     */
+    protected StructuredGraph parse(String methodName) {
+        return parse(getMethod(methodName));
+    }
+
+    protected Method getMethod(String methodName) {
+        Method found = null;
+        for (Method m : this.getClass().getMethods()) {
+            if (m.getName().equals(methodName)) {
+                Assert.assertNull(found);
+                found = m;
+            }
+        }
+        if (found != null) {
+            return found;
+        } else {
+            throw new RuntimeException("method not found: " + methodName);
+        }
+    }
+
+    /**
+     * Parses a Java method to produce a graph.
+     *
+     * @param methodName the name of the method in {@code this.getClass()} to be parsed
+     */
+    protected StructuredGraph parseProfiled(String methodName) {
+        return parseProfiled(getMethod(methodName));
+    }
+
+    /**
+     * Parses a Java method to produce a graph.
+     */
+    protected StructuredGraph parse(Method m) {
+        RiResolvedMethod riMethod = runtime.getRiMethod(m);
+        StructuredGraph graph = new StructuredGraph(riMethod);
+        new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault()).apply(graph);
+        return graph;
+    }
+
+    /**
+     * Parses a Java method to produce a graph.
+     */
+    protected StructuredGraph parseProfiled(Method m) {
+        RiResolvedMethod riMethod = runtime.getRiMethod(m);
+        StructuredGraph graph = new StructuredGraph(riMethod);
+        new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault()).apply(graph);
+        return graph;
+    }
+
+    protected PhasePlan getDefaultPhasePlan() {
+        PhasePlan plan = new PhasePlan();
+        plan.addPhase(PhasePosition.AFTER_PARSING, new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault()));
+        return plan;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/IfBoxingEliminationTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+
+public class IfBoxingEliminationTest extends GraphTest {
+
+    private static final String REFERENCE_SNIPPET = "referenceSnippet";
+
+    public static int referenceSnippet(int a) {
+        int result;
+        if (a < 0) {
+            result = 1;
+        } else {
+            result = 2;
+        }
+        return result;
+    }
+
+    public static Integer boxedInteger() {
+        return 1;
+    }
+
+    public static Object boxedObject() {
+        return 2;
+    }
+
+    @Test
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    public static int test1Snippet(int a) {
+        Integer result;
+        if (a < 0) {
+            result = boxedInteger();
+        } else {
+            result = (Integer) boxedObject();
+        }
+        return result;
+    }
+
+    private void test(final String snippet) {
+        Debug.scope("IfBoxingEliminationTest", new DebugDumpScope(snippet), new Runnable() {
+            @Override
+            public void run() {
+                StructuredGraph graph = parse(snippet);
+                BoxingMethodPool pool = new BoxingMethodPool(runtime());
+                IdentifyBoxingPhase identifyBoxingPhase = new IdentifyBoxingPhase(pool);
+                PhasePlan phasePlan = getDefaultPhasePlan();
+                phasePlan.addPhase(PhasePosition.AFTER_PARSING, identifyBoxingPhase);
+                phasePlan.addPhase(PhasePosition.AFTER_PARSING, new PhiStampPhase());
+                identifyBoxingPhase.apply(graph);
+                Collection<Invoke> hints = new ArrayList<>();
+                for (Invoke invoke : graph.getInvokes()) {
+                    hints.add(invoke);
+                }
+                new InliningPhase(null, runtime(), hints, null, phasePlan).apply(graph);
+                new CanonicalizerPhase(null, runtime(), null).apply(graph);
+                new PhiStampPhase().apply(graph);
+                new CanonicalizerPhase(null, runtime(), null).apply(graph);
+                Debug.dump(graph, "Graph");
+                new BoxingEliminationPhase().apply(graph);
+                Debug.dump(graph, "Graph");
+                new ExpandBoxingNodesPhase(pool).apply(graph);
+                new CanonicalizerPhase(null, runtime(), null).apply(graph);
+                new DeadCodeEliminationPhase().apply(graph);
+                StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
+                new CanonicalizerPhase(null, runtime(), null).apply(referenceGraph);
+                new DeadCodeEliminationPhase().apply(referenceGraph);
+
+                assertEquals(referenceGraph, graph);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/IfCanonicalizerTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
+ * Then canonicalization is applied and it is verified that the resulting graph is equal to the
+ * graph of the method that just has a "return 1" statement in it.
+ */
+public class IfCanonicalizerTest extends GraphTest {
+
+    private static final String REFERENCE_SNIPPET = "referenceSnippet";
+
+    @SuppressWarnings("all")
+    public static int referenceSnippet(int a) {
+        return 1;
+    }
+
+    @Test
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static int test1Snippet(int a) {
+        if (a == 0) {
+            return 1;
+        } else {
+            return 2;
+        }
+    }
+
+    @Test
+    public void test2() {
+        test("test2Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static int test2Snippet(int a) {
+        if (a == 0) {
+            if (a == 0) {
+                if (a == 0) {
+                    return 1;
+                }
+            }
+        } else {
+            return 2;
+        }
+        return 3;
+    }
+
+    @Test
+    public void test3() {
+        test("test3Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static int test3Snippet(int a) {
+        if (a == 0) {
+            if (a != 1) {
+                if (a == 1) {
+                    return 3;
+                } else {
+                    if (a >= 0) {
+                        if (a <= 0) {
+                            if (a > -1) {
+                                if (a < 1) {
+                                    return 1;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } else {
+            return 2;
+        }
+        return 3;
+    }
+
+    @Test
+    public void test4() {
+        test("test4Snippet");
+    }
+
+    public static int test4Snippet(int a) {
+        if (a == 0) {
+            return 1;
+        }
+        return 1;
+    }
+
+    @Test
+    public void test5() {
+        test("test5Snippet");
+    }
+
+    public static int test5Snippet(int a) {
+        int val = 2;
+        if (a == 0) {
+            val = 1;
+        }
+        if (a * (3 + val) == 0) {
+            return 1;
+        }
+        return 1;
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parse(snippet);
+        LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
+        ConstantNode constant = ConstantNode.forInt(0, graph);
+        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
+            n.replaceFirstInput(local, constant);
+        }
+        Debug.dump(graph, "Graph");
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
+        assertEquals(referenceGraph, graph);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeExceptionTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.nodes.*;
+
+public class InvokeExceptionTest extends GraphTest {
+
+    public static synchronized void throwException(int i) {
+        if (i == 1) {
+            throw new RuntimeException();
+        }
+    }
+
+    @Test
+    public void test1() {
+        // fill the profiling data...
+        for (int i = 0; i < 10000; i++) {
+            try {
+                throwException(i & 1);
+                test1Snippet(0);
+            } catch (Throwable t) {
+                // nothing to do...
+            }
+        }
+        test("test1Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static void test1Snippet(int a) {
+        throwException(a);
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parseProfiled(snippet);
+        Collection<Invoke> hints = new ArrayList<>();
+        for (Invoke invoke : graph.getInvokes()) {
+            hints.add(invoke);
+        }
+        new InliningPhase(null, runtime(), hints, null, getDefaultPhasePlan()).apply(graph);
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        new DeadCodeEliminationPhase().apply(graph);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
+ * Then canonicalization is applied and it is verified that the resulting graph is equal to the
+ * graph of the method that just has a "return 1" statement in it.
+ */
+public class InvokeTest extends GraphTest {
+
+    private static final String REFERENCE_SNIPPET = "referenceSnippet";
+
+    @SuppressWarnings("all")
+    public static int referenceSnippet(int a) {
+        return 1;
+    }
+
+    public static int const1() {
+        return 1;
+    }
+
+    @Test
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static int test1Snippet(int a) {
+        return const1();
+    }
+
+    @Test
+    public void test2() {
+        test("test2Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static int test2Snippet(int a) {
+        return const1() + const1() + const1() + const1() + const1() + const1() + const1();
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parse(snippet);
+        LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
+        ConstantNode constant = ConstantNode.forInt(0, graph);
+        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
+            n.replaceFirstInput(local, constant);
+        }
+        Collection<Invoke> hints = new ArrayList<>();
+        for (Invoke invoke : graph.getInvokes()) {
+            hints.add(invoke);
+        }
+        new InliningPhase(null, runtime(), hints, null, getDefaultPhasePlan()).apply(graph);
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        new DeadCodeEliminationPhase().apply(graph);
+        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
+        assertEquals(referenceGraph, graph);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/MonitorTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import static com.oracle.graal.graph.iterators.NodePredicates.*;
+
+import java.util.*;
+
+import junit.framework.*;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.iterators.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
+
+/**
+ * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
+ * Then canonicalization is applied and it is verified that the resulting graph is equal to the
+ * graph of the method that just has a "return 1" statement in it.
+ */
+public class MonitorTest extends GraphTest {
+
+    private static final String REFERENCE_SNIPPET = "referenceSnippet";
+
+    @SuppressWarnings("all")
+    public static synchronized int referenceSnippet(int a) {
+        return 1;
+    }
+
+    public static int const1() {
+        return 1;
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static synchronized int test1Snippet(int a) {
+        return const1();
+    }
+
+    @Test
+    public void test2() {
+        StructuredGraph graph = parseAndProcess("test2Snippet");
+        NodeIterable<MonitorExitNode> monitors = graph.getNodes(MonitorExitNode.class);
+        Assert.assertEquals(1, monitors.count());
+        Assert.assertEquals(monitors.first().stateAfter().bci, 3);
+    }
+
+    @SuppressWarnings("all")
+    public static int test2Snippet(int a) {
+        return const2();
+    }
+
+    public static synchronized int const2() {
+        return 1;
+    }
+
+    private StructuredGraph parseAndProcess(String snippet) {
+        StructuredGraph graph = parse(snippet);
+        LocalNode local = graph.getNodes(LocalNode.class).first();
+        ConstantNode constant = ConstantNode.forInt(0, graph);
+        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
+            n.replaceFirstInput(local, constant);
+        }
+        Collection<Invoke> hints = new ArrayList<>();
+        for (Invoke invoke : graph.getInvokes()) {
+            hints.add(invoke);
+        }
+        new InliningPhase(null, runtime(), hints, null, getDefaultPhasePlan()).apply(graph);
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        new DeadCodeEliminationPhase().apply(graph);
+        return graph;
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parseAndProcess(snippet);
+        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
+        assertEquals(referenceGraph, graph);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/NestedLoopTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import org.junit.*;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.lir.cfg.*;
+import com.oracle.graal.nodes.*;
+
+public class NestedLoopTest extends GraphTest {
+
+    @Test
+    public void test1() {
+        test("test1Snippet", 1, 2, 2);
+    }
+
+    @Test
+    public void test2() {
+        test("test2Snippet", 1, 2, 2);
+    }
+
+    @Test
+    public void test3() {
+        test("test3Snippet", 1, 2, 2);
+    }
+
+    @Test
+    public void test4() {
+        test("test4Snippet", 1, 3, 2);
+    }
+
+    @SuppressWarnings("all")
+    public static void test1Snippet(int a) {
+        while (a()) { // a() exits root, while() exits root
+            m1: while (b()) { // b() exits nested & root, while() exits nested
+                while (c()) { // c() exits innermost & nested & root, while() exits innermost
+                    if (d()) { // d() exits innermost & nested & root
+                        break m1; // break exits innermost & nested
+                    }
+                }
+            }
+        }
+    }// total : root = 5 exits, nested = 5, innermost = 4
+
+    @SuppressWarnings("all")
+    public static void test2Snippet(int a) {
+        while (a()) { // a() exits root, while() exits root
+            try {
+                m1: while (b()) { // b() exits nested, while() exits nested
+                    while (c()) { // c() exits innermost & nested, while() exits innermost
+                        if (d()) { // d() exits innermost & nested
+                            break m1; // break exits innermost & nested
+                        }
+                    }
+                }
+            } catch (Throwable t) {
+            }
+        }
+    }// total : root = 2 exits, nested = 5, innermost = 4
+
+    @SuppressWarnings("all")
+    public static void test3Snippet(int a) {
+        while (a == 0) { // while() exits root
+            try {
+                m1: while (b()) { // b() exits nested, while() exits nested
+                    while (c()) { // c() exits innermost & nested, while() exits innermost
+                        if (d()) { // d() exits innermost & nested
+                            a(); // a() exits nothing (already outside innermost & nested)
+                            break m1; // break exits innermost & nested
+                        }
+                    }
+                }
+            } catch (Throwable t) {
+            }
+        }
+    }// total : root = 1 exit, nested = 5, innermost = 4
+
+    public static void test4Snippet(int a) {
+        while (a != 0) { // while() exits root
+            try {
+                m1: while (a != 0) { // while() exits nested
+                    b(); // b() exits nested
+                    while (c()) { // c() exits innermost & nested, while() exits innermost
+                        if (d()) { // d() exits innermost & nested
+                            break m1; // break exits innermost & nested
+                        }
+                    }
+                    if (a != 2) {
+                        a(); // a() exits nothing (already outside innermost & nested)
+                        throw new Exception(); // throw exits nested
+                    }
+                }
+            } catch (Throwable t) {
+            }
+        }
+    } // total : root = 1 exit, nested = 6, innermost = 4
+
+    private static boolean a() {
+        return false;
+    }
+
+    private static boolean b() {
+        return false;
+    }
+
+    private static boolean c() {
+        return false;
+    }
+
+    private static boolean d() {
+        return false;
+    }
+
+    private static Invoke getInvoke(String name, StructuredGraph graph) {
+        for (Invoke invoke : graph.getInvokes()) {
+            if (invoke.callTarget().targetMethod().name().equals(name)) {
+                return invoke;
+            }
+        }
+        return null;
+    }
+
+    private void test(String snippet, int rootExits, int nestedExits, int innerExits) {
+        StructuredGraph graph = parse(snippet);
+        Debug.dump(graph, "Graph");
+        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, true, true);
+
+        Assert.assertTrue(cfg.getLoops().length == 3);
+        Loop rootLoop = cfg.getLoops()[0];
+        Loop nestedLoop = cfg.getLoops()[1];
+        Loop innerMostLoop = cfg.getLoops()[2];
+        Invoke a = getInvoke("a", graph);
+        Invoke b = getInvoke("b", graph);
+        Invoke c = getInvoke("c", graph);
+        Invoke d = getInvoke("d", graph);
+        Assert.assertTrue(containsDirect(rootLoop, a, cfg));
+        Assert.assertTrue(containsDirect(nestedLoop, b, cfg));
+        Assert.assertTrue(containsDirect(innerMostLoop, c, cfg));
+        Assert.assertTrue(containsDirect(innerMostLoop, d, cfg));
+        Assert.assertTrue(contains(rootLoop, d, cfg));
+        Assert.assertTrue(contains(nestedLoop, d, cfg));
+        Assert.assertEquals(rootExits, rootLoop.exits.size());
+        Assert.assertEquals(nestedExits, nestedLoop.exits.size());
+        Assert.assertEquals(innerExits, innerMostLoop.exits.size());
+        Debug.dump(graph, "Graph");
+    }
+
+    private static boolean contains(Loop loop, Invoke node, ControlFlowGraph cfg) {
+        Block block = cfg.blockFor((Node) node);
+        Assert.assertNotNull(block);
+        return loop.blocks.contains(block);
+    }
+
+    private static boolean containsDirect(Loop loop, Invoke node, ControlFlowGraph cfg) {
+        for (Loop child : loop.children) {
+            if (contains(child, node, cfg)) {
+                return false;
+            }
+        }
+        return contains(loop, node, cfg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/PhiCreationTests.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import org.junit.*;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * In the following tests, the correct removal of redundant phis during graph building is tested.
+ */
+public class PhiCreationTests extends GraphTest {
+
+    /**
+     * Dummy method to avoid javac dead code elimination.
+     */
+    private static void test() {
+    }
+
+    @Test
+    public void test1() {
+        StructuredGraph graph = parse("test1Snippet");
+        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
+    }
+
+    public static int test1Snippet(int a) {
+        if (a > 1) {
+            test();
+        }
+        return a;
+    }
+
+    @Test
+    public void test2() {
+        StructuredGraph graph = parse("test2Snippet");
+        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
+    }
+
+    public static int test2Snippet(int a) {
+        while (a > 1) {
+            test();
+        }
+        return a;
+    }
+
+    @Test
+    public void test3() {
+        StructuredGraph graph = parse("test3Snippet");
+        Debug.dump(graph, "Graph");
+        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
+    }
+
+    public static int test3Snippet(int a) {
+        while (a > 1) {
+            while (a > 1) {
+                test();
+            }
+        }
+        return a;
+    }
+
+    @Test
+    public void test4() {
+        StructuredGraph graph = parse("test4Snippet");
+        Debug.dump(graph, "Graph");
+        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
+    }
+
+    public static int test4Snippet(int a) {
+        int b = 5;
+        while (a > 1) {
+            while (a > 1) {
+                while (a > 1) {
+                    try {
+                        test();
+                    } catch (Throwable t) {
+
+                    }
+                }
+            }
+            while (a > 1) {
+                while (a > 1) {
+                    try {
+                        test();
+                    } catch (Throwable t) {
+
+                    }
+                }
+            }
+        }
+        return a + b;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/ScalarTypeSystemTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import junit.framework.AssertionFailedError;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.nodes.*;
+
+/**
+ * In the following tests, the scalar type system of the compiler should be complete enough to see the relation between the different conditions.
+ */
+public class ScalarTypeSystemTest extends GraphTest {
+
+    public static int referenceSnippet1(int a) {
+        if (a > 0) {
+            return 1;
+        } else {
+            return 2;
+        }
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test1() {
+        test("test1Snippet", "referenceSnippet1");
+    }
+
+    public static int test1Snippet(int a) {
+        if (a > 0) {
+            if (a > -1) {
+                return 1;
+            } else {
+                return 3;
+            }
+        } else {
+            return 2;
+        }
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test2() {
+        test("test2Snippet", "referenceSnippet1");
+    }
+
+    public static int test2Snippet(int a) {
+        if (a > 0) {
+            if (a == -15) {
+                return 3;
+            } else {
+                return 1;
+            }
+        } else {
+            return 2;
+        }
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test3() {
+        test("test3Snippet", "referenceSnippet2");
+    }
+
+    public static int referenceSnippet2(int a, int b) {
+        if (a > b) {
+            return 1;
+        } else {
+            return 2;
+        }
+    }
+
+    public static int test3Snippet(int a, int b) {
+        if (a > b) {
+            if (a == b) {
+                return 3;
+            } else {
+                return 1;
+            }
+        } else {
+            return 2;
+        }
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test4() {
+        test("test4Snippet", "referenceSnippet2");
+    }
+
+    public static int test4Snippet(int a, int b) {
+        if (a > b) {
+            if (a <= b) {
+                return 3;
+            } else {
+                return 1;
+            }
+        } else {
+            return 2;
+        }
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test5() {
+        test("test5Snippet", "referenceSnippet3");
+    }
+
+    public static int referenceSnippet3(int a, int b) {
+        if (a == b) {
+            return 1;
+        } else {
+            return 2;
+        }
+    }
+
+    public static int test5Snippet(int a, int b) {
+        if (a == b) {
+            if (a != b) {
+                return 3;
+            } else {
+                return 1;
+            }
+        } else {
+            return 2;
+        }
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test6() {
+        test("test6Snippet", "referenceSnippet3");
+    }
+
+    public static int test6Snippet(int a, int b) {
+        if (a == b) {
+            if (a == b + 1) {
+                return 3;
+            } else {
+                return 1;
+            }
+        } else {
+            return 2;
+        }
+    }
+
+    private void test(String snippet, String referenceSnippet) {
+        StructuredGraph graph = parse(snippet);
+        Debug.dump(graph, "Graph");
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        StructuredGraph referenceGraph = parse(referenceSnippet);
+        assertEquals(referenceGraph, graph);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/StraighteningTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import junit.framework.AssertionFailedError;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.nodes.*;
+
+public class StraighteningTest extends GraphTest {
+
+    private static final String REFERENCE_SNIPPET = "ref";
+
+    public static boolean ref(int a, int b) {
+        return a == b;
+    }
+
+    public static boolean test1Snippet(int a, int b) {
+        int c = a;
+        if (c == b) {
+            c = 0x55;
+        }
+        if (c != 0x55) {
+            return false;
+        }
+        return true;
+    }
+
+    public static boolean test3Snippet(int a, int b) {
+        int val = (int) System.currentTimeMillis();
+        int c = val + 1;
+        if (a == b) {
+            c = val;
+        }
+        if (c != val) {
+            return false;
+        }
+        return true;
+    }
+
+    public static boolean test2Snippet(int a, int b) {
+        int c;
+        if (a == b) {
+            c = 1;
+        } else {
+            c = 0;
+        }
+        return c == 1;
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test2() {
+        test("test2Snippet");
+    }
+
+    @Test(expected = AssertionFailedError.class)
+    public void test3() {
+        test("test3Snippet");
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parse(snippet);
+        Debug.dump(graph, "Graph");
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
+        assertEquals(referenceGraph, graph);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeSystemTest.java	Thu Mar 08 19:24:17 2012 +0100
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.compiler.types.*;
+import com.oracle.graal.debug.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.java.*;
+
+/**
+ * In the following tests, the scalar type system of the compiler should be complete enough to see the relation between the different conditions.
+ */
+public class TypeSystemTest extends GraphTest {
+
+    @Test
+    public void test1() {
+        test("test1Snippet", CheckCastNode.class);
+    }
+
+    public static int test1Snippet(Object a) {
+        if (a instanceof Boolean) {
+            return ((Boolean) a).booleanValue() ? 0 : 1;
+        }
+        return 1;
+    }
+
+    @Test
+    public void test2() {
+        test("test2Snippet", CheckCastNode.class);
+    }
+
+    public static int test2Snippet(Object a) {
+        if (a instanceof Integer) {
+            return ((Number) a).intValue();
+        }
+        return 1;
+    }
+
+    private <T extends Node & Node.IterableNodeType> void test(String snippet, Class<T> clazz) {
+        StructuredGraph graph = parse(snippet);
+        Debug.dump(graph, "Graph");
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        new PropagateTypesPhase(null, null, null).apply(graph);
+        Debug.dump(graph, "Graph");
+        Assert.assertFalse("shouldn't have nodes of type " + clazz, graph.getNodes(clazz).iterator().hasNext());
+    }
+}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/AssignRegisters.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.simple;
-
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.alloc.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-public abstract class AssignRegisters {
-    public final LIR lir;
-    public final FrameMap frameMap;
-
-    public AssignRegisters(LIR lir, FrameMap frameMap) {
-        this.lir = lir;
-        this.frameMap = frameMap;
-    }
-
-    private CiBitMap curRegisterRefMap;
-    private CiBitMap curFrameRefMap;
-
-    public void execute() {
-        ValueProcedure useProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return use(value); } };
-        ValueProcedure defProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return def(value); } };
-        ValueProcedure setReferenceProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return setReference(value); } };
-
-        Debug.log("==== start assign registers ====");
-        for (int i = lir.linearScanOrder().size() - 1; i >= 0; i--) {
-            Block block = lir.linearScanOrder().get(i);
-            Debug.log("start block %s", block);
-
-            curRegisterRefMap = frameMap.initRegisterRefMap();
-            curFrameRefMap = frameMap.initFrameRefMap();
-
-            // Put all values live at the end of the block into the reference map.
-            locationsForBlockEnd(block).forEachLocation(setReferenceProc);
-
-            for (int j = block.lir.size() - 1; j >= 0; j--) {
-                LIRInstruction op = block.lir.get(j);
-                Debug.log("  op %d %s", op.id(), op);
-
-                op.forEachOutput(defProc);
-                op.forEachTemp(defProc);
-                op.forEachState(useProc);
-                op.forEachAlive(useProc);
-
-                if (op.info != null) {
-                    Debug.log("    registerRefMap: %s  frameRefMap: %s", curRegisterRefMap, curFrameRefMap);
-                    op.info.finish(new CiBitMap(curRegisterRefMap), new CiBitMap(curFrameRefMap), frameMap);
-
-                    if (op instanceof LIRXirInstruction) {
-                        LIRXirInstruction xir = (LIRXirInstruction) op;
-                        if (xir.infoAfter != null) {
-                            xir.infoAfter.finish(new CiBitMap(curRegisterRefMap), new CiBitMap(curFrameRefMap), frameMap);
-                        }
-                    }
-                }
-
-                // Process input operands after assigning the reference map, so that input operands that are used
-                // for the last time at this instruction are not part of the reference map.
-                op.forEachInput(useProc);
-            }
-            Debug.log("end block %s", block);
-        }
-        Debug.log("==== end assign registers ====");
-    }
-
-    private CiValue use(CiValue value) {
-        Debug.log("    use %s", value);
-        if (isLocation(value)) {
-            CiValue location = asLocation(value).location;
-            frameMap.setReference(location, curRegisterRefMap, curFrameRefMap);
-            return location;
-        } else {
-            frameMap.setReference(value, curRegisterRefMap, curFrameRefMap);
-            return value;
-        }
-    }
-
-    private CiValue def(CiValue value) {
-        Debug.log("    def %s", value);
-        if (isLocation(value)) {
-            CiValue location = asLocation(value).location;
-            frameMap.clearReference(location, curRegisterRefMap, curFrameRefMap);
-            return location;
-        } else {
-            frameMap.clearReference(value, curRegisterRefMap, curFrameRefMap);
-            return value;
-        }
-    }
-
-    private CiValue setReference(CiValue value) {
-        Debug.log("    setReference %s", value);
-        frameMap.setReference(asLocation(value).location, curRegisterRefMap, curFrameRefMap);
-        return value;
-    }
-
-    protected abstract LocationMap locationsForBlockEnd(Block block);
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.simple;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.lir.ValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-public class DataFlowAnalysis {
-    private final LIR lir;
-    private final RiRegisterConfig registerConfig;
-
-    public DataFlowAnalysis(LIR lir, RiRegisterConfig registerConfig) {
-        this.lir = lir;
-        this.registerConfig = registerConfig;
-    }
-
-    public void execute() {
-        numberInstructions();
-        backwardDataFlow();
-    }
-
-
-    private List<Block> blocks() {
-        return lir.linearScanOrder();
-    }
-
-    private int numVariables() {
-        return lir.numVariables();
-    }
-
-    private boolean isAllocatableRegister(CiValue value) {
-        return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
-    }
-
-
-    private int[] definitions;
-    private BitSet[] blockLiveIn;
-    private Block[] opIdBlock;
-    private Object[] opIdKilledValues;
-
-
-    public BitSet liveIn(Block block) {
-        return blockLiveIn[block.getId()];
-    }
-    private void setLiveIn(Block block, BitSet liveIn) {
-        blockLiveIn[block.getId()] = liveIn;
-    }
-
-    private Block blockOf(int opId) {
-        return opIdBlock[opId >> 1];
-    }
-    private void setBlockOf(int opId, Block block) {
-        opIdBlock[opId >> 1] = block;
-    }
-
-    private Object killedValues(int opId) {
-        return opIdKilledValues[opId];
-    }
-    private void setKilledValues(int opId, Object killedValues) {
-        opIdKilledValues[opId] = killedValues;
-    }
-
-    public void forEachKilled(LIRInstruction op, boolean end, ValueProcedure proc) {
-        Object entry = killedValues(op.id() + (end ? 1 : 0));
-        if (entry == null) {
-            // Nothing to do
-        } else if (entry instanceof CiValue) {
-            CiValue newValue = proc.doValue((CiValue) entry, null, null);
-            assert newValue == entry : "procedure does not allow to change values";
-        } else {
-            CiValue[] values = (CiValue[]) entry;
-            for (int i = 0; i < values.length; i++) {
-                if (values[i] != null) {
-                    CiValue newValue = proc.doValue(values[i], null, null);
-                    assert newValue == values[i] : "procedure does not allow to change values";
-                }
-            }
-        }
-    }
-
-    public int definition(Variable value) {
-        return definitions[value.index];
-    }
-
-    /**
-     * Numbers all instructions in all blocks. The numbering follows the {@linkplain ComputeLinearScanOrder linear scan order}.
-     */
-    private void numberInstructions() {
-        ValueProcedure defProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return setDef(value); } };
-
-        int numInstructions = 0;
-        for (Block block : blocks()) {
-            numInstructions += block.lir.size();
-        }
-        opIdBlock = new Block[numInstructions];
-        opIdKilledValues = new Object[numInstructions << 1];
-        definitions = new int[numVariables()];
-
-        curOpId = 0;
-        for (Block block : blocks()) {
-            for (LIRInstruction op : block.lir) {
-                op.setId(curOpId);
-                setBlockOf(curOpId, block);
-
-                op.forEachTemp(defProc);
-                op.forEachOutput(defProc);
-
-                curOpId += 2; // numbering of lirOps by two
-            }
-        }
-        assert curOpId == numInstructions << 1;
-    }
-
-    private CiValue setDef(CiValue value) {
-        if (isVariable(value)) {
-            assert definitions[asVariable(value).index] == 0 : "Variable defined twice";
-            definitions[asVariable(value).index] = curOpId;
-        }
-        return value;
-    }
-
-
-    private BitSet variableLive;
-    private BitSet registerLive;
-    private int curOpId;
-
-    private void backwardDataFlow() {
-        ValueProcedure inputProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return use(value, curOpId); } };
-        ValueProcedure aliveProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return use(value, curOpId + 1); } };
-        ValueProcedure tempProc =     new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return def(value, true); } };
-        ValueProcedure outputProc =   new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return def(value, false); } };
-
-        blockLiveIn = new BitSet[blocks().size()];
-        registerLive = new BitSet();
-
-        Debug.log("==== start backward data flow analysis ====");
-        for (int i = blocks().size() - 1; i >= 0; i--) {
-            Block block = blocks().get(i);
-            Debug.log("start block %s  loop %s", block, block.getLoop());
-
-            variableLive = new BitSet();
-            for (Block sux : block.getSuccessors()) {
-                BitSet suxLive = liveIn(sux);
-                if (suxLive != null) {
-                    Debug.log("  sux %s  suxLive: %s", sux, suxLive);
-                    variableLive.or(suxLive);
-                }
-            }
-
-            assert registerLive.isEmpty() : "no fixed register must be alive before processing a block";
-
-            for (int j = block.lir.size() - 1; j >= 0; j--) {
-                LIRInstruction op = block.lir.get(j);
-                curOpId = op.id();
-                Debug.log("  op %d %s  variableLive: %s  registerLive: %s", curOpId, op, variableLive, registerLive);
-
-                op.forEachOutput(outputProc);
-                op.forEachTemp(tempProc);
-                op.forEachState(aliveProc);
-                op.forEachAlive(aliveProc);
-                op.forEachInput(inputProc);
-            }
-
-            assert registerLive.isEmpty() : "no fixed register must be alive after processing a block";
-            assert liveIn(block) == null;
-            setLiveIn(block, variableLive);
-
-            if (block.isLoopHeader()) {
-                Debug.log("  loop header, propagating live set to loop blocks  variableLive: %s", variableLive);
-                // All variables that are live at the beginning of a loop are also live the whole loop.
-                // This is guaranteed by the SSA form.
-                for (Block loop : block.getLoop().blocks) {
-                    BitSet loopLiveIn = liveIn(loop);
-                    assert loopLiveIn != null : "All loop blocks must have been processed before the loop header";
-                    loopLiveIn.or(variableLive);
-                    Debug.log("    block %s  loopLiveIn %s", loop, loopLiveIn);
-                }
-            }
-
-            Debug.log("end block %s  variableLive: %s", block, variableLive);
-        }
-        Debug.log("==== end backward data flow analysis ====");
-    }
-
-    private CiValue use(CiValue value, int killOpId) {
-        Debug.log("    use %s", value);
-        if (isVariable(value)) {
-            int variableIdx = asVariable(value).index;
-            assert definitions[variableIdx] < curOpId;
-            if (!variableLive.get(variableIdx)) {
-                Debug.log("      set live variable %d", variableIdx);
-                variableLive.set(variableIdx);
-                kill(value, killOpId);
-            }
-
-        } else if (isAllocatableRegister(value)) {
-            int regNum = asRegister(value).number;
-            if (!registerLive.get(regNum)) {
-                Debug.log("      set live register %d", regNum);
-                registerLive.set(regNum);
-                kill(value, killOpId);
-            }
-        }
-        return value;
-    }
-
-    private CiValue def(CiValue value, boolean isTemp) {
-        Debug.log("    def %s", value);
-        if (isVariable(value)) {
-            int variableIdx = asVariable(value).index;
-            assert definitions[variableIdx] == curOpId;
-            if (variableLive.get(variableIdx)) {
-                Debug.log("      clear live variable %d", variableIdx);
-                assert !isTemp : "temp variable cannot be used after the operation";
-                variableLive.clear(variableIdx);
-            } else {
-                // Variable has never been used, so kill it immediately after the definition.
-                kill(value, curOpId + 1);
-            }
-
-        } else if (isAllocatableRegister(value)) {
-            int regNum = asRegister(value).number;
-            if (registerLive.get(regNum)) {
-                Debug.log("      clear live register %d", regNum);
-                assert !isTemp : "temp variable cannot be used after the operation";
-                registerLive.clear(regNum);
-            } else {
-                // Register has never been used, so kill it immediately after the definition.
-                kill(value, curOpId + 1);
-            }
-        }
-        return value;
-    }
-
-    private void kill(CiValue value, int opId) {
-        if (opId < 0) {
-            return;
-        }
-        if (isVariable(value)) {
-            int defOpId = definitions[asVariable(value).index];
-            assert defOpId > 0 && defOpId <= opId;
-
-            Block defBlock = blockOf(defOpId);
-            Block useBlock = blockOf(opId);
-
-            if (useBlock.getLoop() != null && useBlock.getLoop() != defBlock.getLoop()) {
-                // This is a value defined outside of the loop it is currently used in.  Therefore, it is live the whole loop
-                // and is not killed by the current instruction.
-                Debug.log("      no kill because use in %s, definition in %s", useBlock.getLoop(), defBlock.getLoop());
-                return;
-            }
-        }
-        Debug.log("      kill %s at %d", value, opId);
-
-        Object entry = killedValues(opId);
-        if (entry == null) {
-            setKilledValues(opId, value);
-        } else if (entry instanceof CiValue) {
-            setKilledValues(opId, new CiValue[] {(CiValue) entry, value});
-        } else {
-            CiValue[] killed = (CiValue[]) entry;
-            for (int i = 0; i < killed.length; i++) {
-                if (killed[i] == null) {
-                    killed[i] = value;
-                    return;
-                }
-            }
-            int oldLen = killed.length;
-            killed = Arrays.copyOf(killed, oldLen * 2);
-            setKilledValues(opId, killed);
-            killed[oldLen] = value;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,614 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.simple;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
-import com.oracle.graal.alloc.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-public class LinearScanAllocator {
-    private final LIR lir;
-    private final FrameMap frameMap;
-
-    private final DataFlowAnalysis dataFlow;
-
-    public LinearScanAllocator(LIR lir, FrameMap frameMap) {
-        this.lir = lir;
-        this.frameMap = frameMap;
-
-        this.dataFlow = new DataFlowAnalysis(lir, frameMap.registerConfig);
-        this.blockBeginLocations = new LocationMap[lir.linearScanOrder().size()];
-        this.blockEndLocations = new LocationMap[lir.linearScanOrder().size()];
-        this.moveResolver = new MoveResolverImpl(lir, frameMap);
-
-        this.variableLastUse = new int[lir.numVariables()];
-    }
-
-    private class MoveResolverImpl extends MoveResolver {
-        public MoveResolverImpl(LIR lir, FrameMap frameMap) {
-            super(lir, frameMap);
-        }
-
-        @Override
-        protected CiValue scratchRegister(Variable spilled) {
-            GraalInternalError.shouldNotReachHere("needs working implementation");
-
-            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-            CiRegister[] availableRegs = categorizedRegs.get(spilled.flag);
-            for (CiRegister reg : availableRegs) {
-                if (curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null) {
-                    return reg.asValue(spilled.kind);
-                }
-            }
-            throw new CiBailout("No register found");
-        }
-    }
-
-    private class ResolveDataFlowImpl extends ResolveDataFlow {
-        public ResolveDataFlowImpl(LIR lir, MoveResolver moveResolver, DataFlowAnalysis dataFlow) {
-            super(lir, moveResolver, dataFlow);
-        }
-
-        @Override
-        protected LocationMap locationsForBlockBegin(Block block) {
-            return beginLocationsFor(block);
-        }
-
-        @Override
-        protected LocationMap locationsForBlockEnd(Block block) {
-            return endLocationsFor(block);
-        }
-    }
-
-    private class AssignRegistersImpl extends AssignRegisters {
-        public AssignRegistersImpl(LIR lir, FrameMap frameMap) {
-            super(lir, frameMap);
-        }
-
-        @Override
-        protected LocationMap locationsForBlockEnd(Block block) {
-            return endLocationsFor(block);
-        }
-    }
-
-
-    private int maxRegisterNum() {
-        return frameMap.target.arch.registers.length;
-    }
-
-    private boolean isAllocatableRegister(CiValue value) {
-        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
-    }
-
-
-    private final LocationMap[] blockBeginLocations;
-
-    private LocationMap beginLocationsFor(Block block) {
-        return blockBeginLocations[block.getId()];
-    }
-    private void setBeginLocationsFor(Block block, LocationMap locations) {
-        blockBeginLocations[block.getId()] = locations;
-    }
-
-    private final LocationMap[] blockEndLocations;
-
-    private LocationMap endLocationsFor(Block block) {
-        return blockEndLocations[block.getId()];
-    }
-    private void setEndLocationsFor(Block block, LocationMap locations) {
-        blockEndLocations[block.getId()] = locations;
-    }
-
-    private final int[] variableLastUse;
-
-    private int lastUseFor(Variable variable) {
-        return variableLastUse[variable.index];
-    }
-
-    private void setLastUseFor(Variable variable, int lastUse) {
-        variableLastUse[variable.index] = lastUse;
-    }
-
-    private MoveResolver moveResolver;
-    private LocationMap curLocations;
-    private CiValue[] curInRegisterState;
-    private CiValue[] curOutRegisterState;
-    private BitSet curLiveIn;
-    private LIRInstruction curOp;
-
-    /**
-     * The spill slot for a variable, if the variable has ever been spilled.
-     */
-    private LocationMap canonicalSpillLocations;
-
-    /**
-     * The register that a variable got assigned at its definition, and so it should get that register when reloading after spilling.
-     */
-    private LocationMap hintRegisterLocations;
-
-    public void execute() {
-        assert LIRVerifier.verify(true, lir, frameMap);
-
-        dataFlow.execute();
-        IntervalPrinter.printBeforeAllocation("Before register allocation", lir, frameMap.registerConfig, dataFlow);
-
-        allocate();
-
-        IntervalPrinter.printAfterAllocation("After linear scan allocation", lir, frameMap.registerConfig, dataFlow, blockEndLocations);
-
-        ResolveDataFlow resolveDataFlow = new ResolveDataFlowImpl(lir, moveResolver, dataFlow);
-        resolveDataFlow.execute();
-        frameMap.finish();
-
-        IntervalPrinter.printAfterAllocation("After resolve data flow", lir, frameMap.registerConfig, dataFlow, blockEndLocations);
-        assert RegisterVerifier.verify(lir, frameMap);
-
-        AssignRegisters assignRegisters = new AssignRegistersImpl(lir, frameMap);
-        assignRegisters.execute();
-
-        Debug.dump(lir, "After register asignment");
-        assert LIRVerifier.verify(false, lir, frameMap);
-    }
-
-    private void allocate() {
-        ValueProcedure recordUseProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return recordUse(value); } };
-        ValueProcedure killNonLiveProc =  new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return killNonLive(value); } };
-        ValueProcedure unblockProc =      new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return unblock(value); } };
-        ValueProcedure killProc =         new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return kill(value); } };
-        ValueProcedure blockProc =        new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return block(value); } };
-        ValueProcedure useProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, mode, flags); } };
-        ValueProcedure defProc =          new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return def(value, mode, flags); } };
-
-        Debug.log("==== start linear scan allocation ====");
-        canonicalSpillLocations = new LocationMap(lir.numVariables());
-        hintRegisterLocations = new LocationMap(lir.numVariables());
-        curInRegisterState = new CiValue[maxRegisterNum()];
-        curOutRegisterState = new CiValue[maxRegisterNum()];
-        for (Block block : lir.linearScanOrder()) {
-            Debug.log("start block %s %s", block, block.getLoop());
-
-            Arrays.fill(curOutRegisterState, null);
-            if (block.getDominator() != null) {
-                LocationMap dominatorState = endLocationsFor(block.getDominator());
-                curLocations = new LocationMap(dominatorState);
-                // Clear out all variables that are not live at the begin of this block
-                curLiveIn = dataFlow.liveIn(block);
-                curLocations.forEachLocation(killNonLiveProc);
-                assert checkInputState(block);
-            } else {
-                curLocations = new LocationMap(lir.numVariables());
-            }
-            Debug.log(logCurrentState());
-
-            for (int opIdx = 0; opIdx < block.lir.size(); opIdx++) {
-                LIRInstruction op = block.lir.get(opIdx);
-                curOp = op;
-
-                Debug.log("  op %d %s", op.id(), op);
-
-                System.arraycopy(curOutRegisterState, 0, curInRegisterState, 0, curOutRegisterState.length);
-
-                // Unblock fixed registers that are only used for inputs in curOutRegisterState.
-                dataFlow.forEachKilled(op, false, unblockProc);
-                // Block fixed registers defined by this instruction in curOutRegisterState.
-                op.forEachTemp(blockProc);
-                op.forEachOutput(blockProc);
-
-                op.forEachInput(recordUseProc);
-                op.forEachAlive(recordUseProc);
-
-                moveResolver.init(block.lir, opIdx);
-                // Process Alive before Input because they are more restricted and the same variable can be Alive and Input.
-                op.forEachAlive(useProc);
-                op.forEachInput(useProc);
-
-                dataFlow.forEachKilled(op, false, killProc);
-
-                if (op.hasCall()) {
-                    spillCallerSaveRegisters();
-                }
-                if (op instanceof StandardOp.PhiLabelOp) {
-                    assert opIdx == 0;
-                    phiRegisterHints(block);
-                }
-
-                op.forEachOutput(defProc);
-                op.forEachTemp(defProc);
-
-                // Fixed temp and output registers can evict variables from their assigned register, allocate new location for them.
-                fixupEvicted();
-                // State values are the least critical and can get the leftover registers (or stack slots if no more register available).
-                op.forEachState(useProc);
-
-                if (opIdx == 0) {
-                    assert !moveResolver.hasMappings() : "cannot insert spill moves before label";
-                    setBeginLocationsFor(block, new LocationMap(curLocations));
-                }
-                moveResolver.resolve();
-
-                dataFlow.forEachKilled(op, true, unblockProc);
-                dataFlow.forEachKilled(op, true, killProc);
-
-                curOp = null;
-            }
-
-            assert endLocationsFor(block) == null;
-            setEndLocationsFor(block, curLocations);
-
-            logCurrentState();
-            Debug.log("end block %s", block);
-        }
-
-        moveResolver.finish();
-        Debug.log("==== end linear scan allocation ====");
-    }
-
-    private CiValue killNonLive(CiValue value) {
-        assert isLocation(value);
-        if (!curLiveIn.get(asLocation(value).variable.index)) {
-            return null;
-
-        } else if (isAllocatableRegister(asLocation(value).location)) {
-            int regNum = asRegister(asLocation(value).location).number;
-            assert curOutRegisterState[regNum] == null;
-            curOutRegisterState[regNum] = value;
-        }
-        return value;
-    }
-
-    private CiValue unblock(CiValue value) {
-        if (isAllocatableRegister(value)) {
-            Debug.log("    unblock register %s", value);
-            int regNum = asRegister(value).number;
-            assert curOutRegisterState[regNum] == value;
-            curOutRegisterState[regNum] = null;
-        }
-        return value;
-    }
-
-    private CiValue kill(CiValue value) {
-        if (isVariable(value)) {
-            Location location = curLocations.get(asVariable(value));
-            Debug.log("    kill location %s", location);
-            if (isRegister(location.location)) {
-                int regNum = asRegister(location.location).number;
-                if (curOutRegisterState[regNum] == location) {
-                    curOutRegisterState[regNum] = null;
-                }
-            }
-            curLocations.clear(asVariable(value));
-        }
-        return value;
-    }
-
-
-    private CiValue block(CiValue value) {
-        if (isAllocatableRegister(value)) {
-            Debug.log("    block %s", value);
-            int regNum = asRegister(value).number;
-            assert curOutRegisterState[regNum] == null || curOutRegisterState[regNum] instanceof Location;
-            curOutRegisterState[regNum] = value;
-        }
-        return value;
-    }
-
-    private void spillCallerSaveRegisters() {
-        Debug.log("    spill caller save registers in curInRegisterState %s", Arrays.toString(curInRegisterState));
-        for (CiRegister reg : frameMap.registerConfig.getCallerSaveRegisters()) {
-            CiValue in = curInRegisterState[reg.number];
-            if (in != null && isLocation(in)) {
-                spill(asLocation(in));
-            }
-        }
-    }
-
-    private CiValue recordUse(CiValue value) {
-        if (isVariable(value)) {
-            assert lastUseFor(asVariable(value)) <= curOp.id();
-            setLastUseFor(asVariable(value), curOp.id());
-
-        }
-        return value;
-    }
-
-    private CiValue use(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        assert mode == OperandMode.Input || mode == OperandMode.Alive;
-        if (isVariable(value)) {
-            // State values are not recorded beforehand because it does not matter if they are spilled. Still, it is necessary to record them as used now.
-            recordUse(value);
-
-            Location curLoc = curLocations.get(asVariable(value));
-            if (isStackSlot(curLoc.location) && flags.contains(OperandFlag.Stack)) {
-                Debug.log("    use %s %s: use current stack slot %s", mode, value, curLoc.location);
-                return curLoc;
-            }
-            if (isRegister(curLoc.location)) {
-                int regNum = asRegister(curLoc.location).number;
-                assert curInRegisterState[regNum] == curLoc;
-                if (mode == OperandMode.Input || curOutRegisterState[regNum] == curLoc) {
-                    Debug.log("    use %s %s: use current register %s", mode, value, curLoc.location);
-                    return curLoc;
-                }
-            }
-
-            Debug.log("    use %s %s", mode, value);
-
-            Location newLoc = allocateRegister(asVariable(value), mode, flags);
-            if (newLoc != curLoc) {
-                moveResolver.add(curLoc, newLoc);
-            }
-            return newLoc;
-        } else {
-            assert !isAllocatableRegister(value) || curInRegisterState[asRegister(value).number] == value;
-        }
-        return value;
-    }
-
-    private static final EnumSet<OperandFlag> SPILL_FLAGS = EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-
-    private CiValue def(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        assert mode == OperandMode.Temp || mode == OperandMode.Output;
-        if (isVariable(value)) {
-            Debug.log("    def %s %s", mode, value);
-            assert curLocations.get(asVariable(value)) == null;
-
-            Location newLoc = allocateRegister(asVariable(value), mode, flags);
-            return newLoc;
-        }
-        return value;
-    }
-
-
-    private void fixupEvicted() {
-        for (int i = 0; i < curInRegisterState.length; i++) {
-            CiValue in = curInRegisterState[i];
-            CiValue out = curOutRegisterState[i];
-
-            if (in != null && in != out && isLocation(in) && curLocations.get(asLocation(in).variable) == in) {
-                Debug.log("    %s was evicted by %s, need to allocate new location", in, out);
-                Location oldLoc = asLocation(in);
-                Location newLoc = allocateRegister(oldLoc.variable, OperandMode.Alive, SPILL_FLAGS);
-                assert oldLoc != newLoc;
-                moveResolver.add(oldLoc, newLoc);
-            }
-
-
-        }
-    }
-
-
-    private void phiRegisterHints(Block block) {
-        Debug.log("    phi register hints for %s", block);
-        CiValue[] phiDefinitions = ((StandardOp.PhiLabelOp) block.lir.get(0)).getPhiDefinitions();
-        for (Block pred : block.getPredecessors()) {
-            CiValue[] phiInputs = ((StandardOp.PhiJumpOp) pred.lir.get(pred.lir.size() - 1)).getPhiInputs();
-
-            for (int i = 0; i < phiDefinitions.length; i++) {
-                CiValue phiDefinition = phiDefinitions[i];
-                CiValue phiInput = phiInputs[i];
-
-                if (isVariable(phiDefinition)) {
-                    Location hintResult = processRegisterHint(asVariable(phiDefinition), OperandMode.Output, phiInput);
-                    if (hintResult != null) {
-                        phiDefinitions[i] = hintResult;
-                    }
-                }
-            }
-        }
-    }
-
-    private Location processRegisterHint(Variable variable, OperandMode mode, CiValue registerHint) {
-        if (registerHint == null) {
-            return null;
-        }
-        Debug.log("      try registerHint for %s %s: %s", mode, variable, registerHint);
-        CiRegister hint = null;
-        if (isRegister(registerHint)) {
-            hint = asRegister(registerHint);
-        } else if (isLocation(registerHint) && isRegister(asLocation(registerHint).location)) {
-            hint = asRegister(asLocation(registerHint).location);
-        }
-        if (hint != null && hint.isSet(variable.flag) && isFree(hint, mode)) {
-            return selectRegister(hint, variable, mode);
-        }
-        return null;
-    }
-
-    private Location allocateRegister(final Variable variable, final OperandMode mode, EnumSet<OperandFlag> flags) {
-        if (flags.contains(OperandFlag.RegisterHint)) {
-            CiValue hintResult = curOp.forEachRegisterHint(variable, mode, new ValueProcedure() {
-                @Override
-                public CiValue doValue(CiValue registerHint) {
-                    return processRegisterHint(variable, mode, registerHint);
-                }
-            });
-            if (hintResult != null) {
-                return asLocation(hintResult);
-            }
-        }
-
-        CiValue hintResult = processRegisterHint(variable, mode, hintRegisterLocations.get(variable));
-        if (hintResult != null) {
-            return asLocation(hintResult);
-        }
-
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-        CiRegister[] availableRegs = categorizedRegs.get(variable.flag);
-
-        Location bestSpillCandidate = null;
-        for (CiRegister reg : availableRegs) {
-            if (isFree(reg, mode)) {
-                return selectRegister(reg, variable, mode);
-            } else {
-                Location spillCandidate = spillCandidate(reg);
-                if (betterSpillCandidate(spillCandidate, bestSpillCandidate)) {
-                    bestSpillCandidate = spillCandidate;
-                }
-            }
-        }
-
-        if (flags.contains(OperandFlag.Stack) && betterSpillCandidate(curLocations.get(variable), bestSpillCandidate)) {
-            return selectSpillSlot(variable);
-        }
-
-        if (bestSpillCandidate == null) {
-            // This should not happen as long as all LIR instructions have fulfillable register constraints. But be safe in product mode and bail out.
-            assert false;
-            throw new GraalInternalError("No register available");
-        }
-
-        spill(bestSpillCandidate);
-
-        return selectRegister(asRegister(bestSpillCandidate.location), variable, mode);
-    }
-
-    private void spill(Location value) {
-        Location newLoc = spillLocation(value.variable);
-        Debug.log("      spill %s to %s", value, newLoc);
-        if (!(curOp instanceof StandardOp.PhiLabelOp)) {
-            moveResolver.add(value, newLoc);
-        }
-        curLocations.put(newLoc);
-
-        CiRegister reg = asRegister(value.location);
-        assert curInRegisterState[reg.number] == value;
-        curInRegisterState[reg.number] = null;
-        if (curOutRegisterState[reg.number] == value) {
-            curOutRegisterState[reg.number] = null;
-        }
-    }
-
-    private boolean isFree(CiRegister reg, OperandMode mode) {
-        switch (mode) {
-            case Input:  return curInRegisterState[reg.number] == null;
-            case Alive:  return curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null;
-            case Temp:   return curOutRegisterState[reg.number] == null;
-            case Output: return curOutRegisterState[reg.number] == null;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private Location spillCandidate(CiRegister reg) {
-        CiValue in = curInRegisterState[reg.number];
-        CiValue out = curOutRegisterState[reg.number];
-        if (in == out && in != null && isLocation(in) && lastUseFor(asLocation(in).variable) < curOp.id()) {
-            return asLocation(in);
-        }
-        return null;
-    }
-
-    private boolean betterSpillCandidate(Location loc, Location compare) {
-        if (loc == null) {
-            return false;
-        }
-        if (compare == null) {
-            return true;
-        }
-        if (canonicalSpillLocations.get(loc.variable) != null && canonicalSpillLocations.get(compare.variable) == null) {
-            return true;
-        }
-        return dataFlow.definition(loc.variable) < dataFlow.definition(compare.variable);
-    }
-
-    private Location spillLocation(Variable variable) {
-        Location result = canonicalSpillLocations.get(variable);
-        if (result == null) {
-            result = new Location(variable, frameMap.allocateSpillSlot(variable.kind));
-            canonicalSpillLocations.put(result);
-        }
-        return result;
-    }
-
-    private Location selectRegister(CiRegister reg, Variable variable, OperandMode mode) {
-        assert isFree(reg, mode);
-
-        Location loc = new Location(variable, reg.asValue(variable.kind));
-        if (mode == OperandMode.Input || mode == OperandMode.Alive) {
-            curInRegisterState[reg.number] = loc;
-        }
-        curOutRegisterState[reg.number] = loc;
-        curLocations.put(loc);
-        recordUse(variable);
-        if (hintRegisterLocations.get(variable) == null) {
-            hintRegisterLocations.put(loc);
-        }
-
-        Debug.log("      selected register %s", loc);
-        return loc;
-    }
-
-    private Location selectSpillSlot(Variable variable) {
-        Location loc = spillLocation(variable);
-        curLocations.put(loc);
-        recordUse(variable);
-
-        Debug.log("      selected spill slot %s", loc);
-        return loc;
-    }
-
-    private boolean checkInputState(final Block block) {
-        final BitSet liveState = new BitSet();
-        curLocations.forEachLocation(new ValueProcedure() {
-            @Override
-            public CiValue doValue(CiValue value) {
-                liveState.set(asLocation(value).variable.index);
-
-                for (Block pred : block.getPredecessors()) {
-                    LocationMap predState = endLocationsFor(pred);
-                    if (predState != null) {
-                        assert predState.get(asLocation(value).variable) != null;
-                    } else {
-                        assert block.isLoopHeader();
-                    }
-                }
-                return value;
-            }
-        });
-        assert liveState.equals(curLiveIn);
-        return true;
-    }
-
-
-    private String logCurrentState() {
-        final StringBuilder sb = new StringBuilder();
-        sb.append("  current lcoations: ");
-        curLocations.forEachLocation(new ValueProcedure() {
-            @Override
-            public CiValue doValue(CiValue value) {
-                sb.append(value).append(" ");
-                return value;
-            }
-        });
-        return sb.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/ResolveDataFlow.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.simple;
-
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.alloc.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.StandardOp.*;
-import com.oracle.graal.lir.cfg.*;
-
-public abstract class ResolveDataFlow {
-    public final LIR lir;
-    public final MoveResolver moveResolver;
-    public final DataFlowAnalysis dataFlow;
-
-    public ResolveDataFlow(LIR lir, MoveResolver moveResolver, DataFlowAnalysis dataFlow) {
-        this.lir = lir;
-        this.moveResolver = moveResolver;
-        this.dataFlow = dataFlow;
-    }
-
-    private LocationMap curFromLocations;
-
-    public void execute() {
-        ValueProcedure locMappingProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return locMapping(value); } };
-
-        Debug.log("==== start resolve data flow ====");
-        for (Block toBlock : lir.linearScanOrder()) {
-            PhiLabelOp phiDefs = null;
-            if (toBlock.lir.get(0) instanceof PhiLabelOp) {
-                phiDefs = (PhiLabelOp) toBlock.lir.get(0);
-            }
-
-            for (Block fromBlock : toBlock.getPredecessors()) {
-                Debug.log("start edge %s -> %s", fromBlock, toBlock);
-                findInsertPos(fromBlock, toBlock);
-
-                LocationMap toLocations = locationsForBlockBegin(toBlock);
-                curFromLocations = locationsForBlockEnd(fromBlock);
-                if (toLocations != curFromLocations) {
-                    toLocations.forEachLocation(locMappingProc);
-                }
-
-                if (phiDefs != null) {
-                    PhiJumpOp phiInputs = (PhiJumpOp) fromBlock.lir.get(fromBlock.lir.size() - 1);
-                    phiMapping(phiInputs.getPhiInputs(), phiDefs.getPhiDefinitions());
-                    phiInputs.markResolved();
-                }
-
-                moveResolver.resolve();
-                Debug.log("end edge %s -> %s", fromBlock, toBlock);
-            }
-
-            if (phiDefs != null) {
-                // Phi functions are resolved with moves now, so delete them.
-                phiDefs.markResolved();
-            }
-        }
-        moveResolver.finish();
-        Debug.log("==== end resolve data flow ====");
-    }
-
-    private CiValue locMapping(CiValue value) {
-        Location to = asLocation(value);
-        Location from = curFromLocations.get(to.variable);
-        if (value != from && from != null) {
-            moveResolver.add(from, to);
-        }
-        return value;
-    }
-
-    private void phiMapping(CiValue[] inputs, CiValue[] outputs) {
-        assert inputs.length == outputs.length;
-        for (int i = 0; i < inputs.length; i++) {
-            if (inputs[i] != outputs[i]) {
-                moveResolver.add(inputs[i], asLocation(outputs[i]));
-            }
-        }
-    }
-
-    private void findInsertPos(Block fromBlock, Block toBlock) {
-        assert fromBlock.getSuccessors().contains(toBlock) && toBlock.getPredecessors().contains(fromBlock);
-
-        if (fromBlock.numberOfSux() == 1) {
-            List<LIRInstruction> instructions = fromBlock.lir;
-            LIRInstruction instr = instructions.get(instructions.size() - 1);
-            assert instr instanceof StandardOp.JumpOp : "block does not end with an unconditional jump";
-            moveResolver.init(instructions, instructions.size() - 1);
-            Debug.log("  insert at end of %s before %d", fromBlock, instructions.size() - 1);
-
-        } else if (toBlock.numberOfPreds() == 1) {
-            moveResolver.init(toBlock.lir, 1);
-            Debug.log("  insert at beginning of %s before %d", toBlock, 1);
-
-        } else {
-            GraalInternalError.shouldNotReachHere("Critical edge not split");
-        }
-    }
-
-    protected abstract LocationMap locationsForBlockBegin(Block block);
-    protected abstract LocationMap locationsForBlockEnd(Block block);
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,466 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.simple;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
-import com.oracle.graal.alloc.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-public class SpillAllAllocator {
-    private final LIR lir;
-    private final FrameMap frameMap;
-
-    private final DataFlowAnalysis dataFlow;
-
-    public SpillAllAllocator(LIR lir, FrameMap frameMap) {
-        this.lir = lir;
-        this.frameMap = frameMap;
-
-        this.dataFlow = new DataFlowAnalysis(lir, frameMap.registerConfig);
-        this.blockLocations = new LocationMap[lir.linearScanOrder().size()];
-        this.moveResolver = new MoveResolverImpl(lir, frameMap);
-    }
-
-    private class MoveResolverImpl extends MoveResolver {
-        public MoveResolverImpl(LIR lir, FrameMap frameMap) {
-            super(lir, frameMap);
-        }
-
-        @Override
-        protected CiValue scratchRegister(Variable spilled) {
-            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-            CiRegister[] availableRegs = categorizedRegs.get(spilled.flag);
-            for (CiRegister reg : availableRegs) {
-                if (curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null) {
-                    return reg.asValue(spilled.kind);
-                }
-            }
-            throw new CiBailout("No register found");
-        }
-    }
-
-    private class ResolveDataFlowImpl extends ResolveDataFlow {
-        public ResolveDataFlowImpl(LIR lir, MoveResolver moveResolver, DataFlowAnalysis dataFlow) {
-            super(lir, moveResolver, dataFlow);
-        }
-
-        @Override
-        protected LocationMap locationsForBlockBegin(Block block) {
-            assert block.numberOfPreds() > 0 && block.getDominator() != null;
-            return locationsFor(block.getDominator());
-        }
-
-        @Override
-        protected LocationMap locationsForBlockEnd(Block block) {
-            return locationsFor(block);
-        }
-    }
-
-    private class AssignRegistersImpl extends AssignRegisters {
-        public AssignRegistersImpl(LIR lir, FrameMap frameMap) {
-            super(lir, frameMap);
-        }
-
-        @Override
-        protected LocationMap locationsForBlockEnd(Block block) {
-            return locationsFor(block);
-        }
-    }
-
-
-    private int maxRegisterNum() {
-        return frameMap.target.arch.registers.length;
-    }
-
-    private boolean isAllocatableRegister(CiValue value) {
-        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
-    }
-
-
-    private final LocationMap[] blockLocations;
-
-    private LocationMap locationsFor(Block block) {
-        return blockLocations[block.getId()];
-    }
-    private void setLocationsFor(Block block, LocationMap locations) {
-        blockLocations[block.getId()] = locations;
-    }
-
-    private MoveResolver moveResolver;
-    private LocationMap curStackLocations;
-    private LocationMap curRegisterLocations;
-    private Object[] curInRegisterState;
-    private Object[] curOutRegisterState;
-    private BitSet curLiveIn;
-    private LIRInstruction curInstruction;
-
-    public void execute() {
-        assert LIRVerifier.verify(true, lir, frameMap);
-
-        dataFlow.execute();
-        IntervalPrinter.printBeforeAllocation("Before register allocation", lir, frameMap.registerConfig, dataFlow);
-
-        allocate();
-
-        IntervalPrinter.printAfterAllocation("After spill all allocation", lir, frameMap.registerConfig, dataFlow, blockLocations);
-
-        ResolveDataFlow resolveDataFlow = new ResolveDataFlowImpl(lir, moveResolver, dataFlow);
-        resolveDataFlow.execute();
-        frameMap.finish();
-
-        IntervalPrinter.printAfterAllocation("After resolve data flow", lir, frameMap.registerConfig, dataFlow, blockLocations);
-        assert RegisterVerifier.verify(lir, frameMap);
-
-        AssignRegisters assignRegisters = new AssignRegistersImpl(lir, frameMap);
-        assignRegisters.execute();
-
-        Debug.dump(lir, "After register asignment");
-        assert LIRVerifier.verify(false, lir, frameMap);
-    }
-
-    private void allocate() {
-        ValueProcedure killNonLiveProc =  new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return killNonLive(value); } };
-        ValueProcedure killBeginProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return kill(value, false); } };
-        ValueProcedure killEndProc =      new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return kill(value, true); } };
-        ValueProcedure killLocationProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return killLocation(value); } };
-        ValueProcedure blockProc =        new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return block(value); } };
-        ValueProcedure loadProc =         new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return load(value, mode, flags); } };
-        ValueProcedure spillProc =        new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return spill(value, mode, flags); } };
-        ValueProcedure useSlotProc =      new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return useSlot(value); } };
-
-        Debug.log("==== start spill all allocation ====");
-        curInRegisterState = new Object[maxRegisterNum()];
-        curOutRegisterState = new Object[maxRegisterNum()];
-        curRegisterLocations = new LocationMap(lir.numVariables());
-        for (Block block : lir.linearScanOrder()) {
-            Debug.log("start block %s %s", block, block.getLoop());
-            assert checkEmpty(curOutRegisterState);
-
-            if (block.getDominator() != null) {
-                LocationMap dominatorState = locationsFor(block.getDominator());
-                curStackLocations = new LocationMap(dominatorState);
-                // Clear out all variables that are not live at the begin of this block
-                curLiveIn = dataFlow.liveIn(block);
-                curStackLocations.forEachLocation(killNonLiveProc);
-                assert checkInputState(block);
-            } else {
-                curStackLocations = new LocationMap(lir.numVariables());
-            }
-            Debug.log(logCurrentState());
-
-            for (int opIdx = 0; opIdx < block.lir.size(); opIdx++) {
-                LIRInstruction op = block.lir.get(opIdx);
-                curInstruction = op;
-                Debug.log("  op %d %s", op.id(), op);
-
-                assert curRegisterLocations.checkEmpty();
-
-                System.arraycopy(curOutRegisterState, 0, curInRegisterState, 0, curOutRegisterState.length);
-
-                // Block fixed registers that are defined by this instruction, so that they are no longer available for normal allocation.
-                op.forEachTemp(blockProc);
-                op.forEachOutput(blockProc);
-
-                moveResolver.init(block.lir, opIdx);
-                // Process Alive before Input because they are more restricted and the same variable can be Alive and Input.
-                op.forEachAlive(loadProc);
-                op.forEachInput(loadProc);
-                moveResolver.resolve();
-                op.forEachState(useSlotProc);
-
-                dataFlow.forEachKilled(op, false, killBeginProc);
-                assert !op.hasCall() || checkNoCallerSavedRegister() : "caller saved register in use accross call site";
-
-                moveResolver.init(block.lir, opIdx + 1);
-                op.forEachTemp(spillProc);
-                op.forEachOutput(spillProc);
-                moveResolver.resolve();
-
-                dataFlow.forEachKilled(op, true, killEndProc);
-                curRegisterLocations.forEachLocation(killLocationProc);
-
-                assert curRegisterLocations.checkEmpty();
-                curInstruction = null;
-            }
-            assert checkEmpty(curOutRegisterState);
-            assert locationsFor(block) == null;
-            setLocationsFor(block, curStackLocations);
-
-            logCurrentState();
-            Debug.log("end block %s", block);
-        }
-
-        moveResolver.finish();
-        Debug.log("==== end spill all allocation ====");
-    }
-
-    private CiValue killNonLive(CiValue value) {
-        assert isLocation(value);
-        if (!curLiveIn.get(asLocation(value).variable.index)) {
-            return null;
-        }
-        return value;
-    }
-
-    private CiValue kill(CiValue value, boolean end) {
-        if (isVariable(value)) {
-            Debug.log("    kill variable %s", value);
-
-            Variable variable = asVariable(value);
-            curStackLocations.clear(variable);
-
-            Location loc = curRegisterLocations.get(variable);
-            if (loc != null) {
-                killLocation(loc);
-                curRegisterLocations.clear(variable);
-
-                Debug.log("      location %s", loc);
-                assert isAllocatableRegister(loc.location);
-
-                int regNum = asRegister(loc.location).number;
-                if (curOutRegisterState[regNum] == loc) {
-                    curOutRegisterState[regNum] = null;
-                }
-            }
-
-        } else if (isAllocatableRegister(value)) {
-            Debug.log("    kill register %s", value);
-            int regNum = asRegister(value).number;
-            assert curOutRegisterState[regNum] == null || curOutRegisterState[regNum] instanceof LIRInstruction && curInstruction != null;
-
-            if (end || curOutRegisterState[regNum] != curInstruction) {
-                curOutRegisterState[regNum] = null;
-            }
-
-        } else {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-        return value;
-    }
-
-    private CiValue killLocation(CiValue value) {
-        Debug.log("    kill location %s", value);
-        assert isAllocatableRegister(asLocation(value).location);
-
-        int regNum = asRegister(asLocation(value).location).number;
-        if (curOutRegisterState[regNum] == value) {
-            curOutRegisterState[regNum] = null;
-        }
-        return null;
-    }
-
-    private CiValue block(CiValue value) {
-        if (isAllocatableRegister(value)) {
-            Debug.log("    block %s", value);
-            int regNum = asRegister(value).number;
-            assert curInstruction != null;
-            assert curOutRegisterState[regNum] == null || curOutRegisterState[regNum] instanceof LIRInstruction;
-            curOutRegisterState[regNum] = curInstruction;
-        }
-        return value;
-    }
-
-    private CiValue load(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        assert mode == OperandMode.Input || mode == OperandMode.Alive;
-        if (flags.contains(OperandFlag.Stack)) {
-            return useSlot(value);
-        }
-        if (isVariable(value)) {
-            Debug.log("    load %s", value);
-            Location regLoc = curRegisterLocations.get(asVariable(value));
-            if (regLoc != null) {
-                // This variable has already been processed before.
-                Debug.log("      found location %s", regLoc);
-            } else {
-                regLoc = allocateRegister(asVariable(value), curInRegisterState, mode == OperandMode.Alive ? curOutRegisterState : null, mode, flags);
-                Location stackLoc = curStackLocations.get(asVariable(value));
-                assert stackLoc != null;
-                moveResolver.add(stackLoc, regLoc);
-            }
-            return regLoc;
-        } else {
-            assert !isAllocatableRegister(value) || curInRegisterState[asRegister(value).number] instanceof LIRInstruction;
-            return value;
-        }
-    }
-
-    private CiValue spill(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        assert mode == OperandMode.Temp || mode == OperandMode.Output;
-        if (flags.contains(OperandFlag.Stack)) {
-            return defSlot(value);
-        }
-        if (isVariable(value)) {
-            Debug.log("    spill %s", value);
-            assert curStackLocations.get(asVariable(value)) == null;
-            Location regLoc = allocateRegister(asVariable(value), null, curOutRegisterState, mode, flags);
-            if (mode == OperandMode.Output) {
-                Location stackLoc = new Location(asVariable(value), frameMap.allocateSpillSlot(value.kind));
-                curStackLocations.put(stackLoc);
-                moveResolver.add(regLoc, stackLoc);
-            }
-            return regLoc;
-        } else {
-            assert !isAllocatableRegister(value) || curOutRegisterState[asRegister(value).number] == curInstruction && curInstruction != null;
-            return value;
-        }
-    }
-
-    private CiValue useSlot(CiValue value) {
-        if (isVariable(value)) {
-            Debug.log("    useSlot %s", value);
-            Location stackLoc = curStackLocations.get(asVariable(value));
-            assert stackLoc != null;
-            Debug.log("      slot %s", stackLoc);
-            return stackLoc;
-        } else {
-            return value;
-        }
-    }
-
-    private CiValue defSlot(CiValue value) {
-        if (isVariable(value)) {
-            Debug.log("    assignSlot %s", value);
-            Location stackLoc = new Location(asVariable(value), frameMap.allocateSpillSlot(value.kind));
-            assert curStackLocations.get(asVariable(value)) == null;
-            curStackLocations.put(stackLoc);
-            Debug.log("      slot %s", stackLoc);
-            return stackLoc;
-        } else {
-            return value;
-        }
-    }
-
-    private Location allocateRegister(final Variable variable, final Object[] inRegisterState, final Object[] outRegisterState, OperandMode mode, EnumSet<OperandFlag> flags) {
-        if (flags.contains(OperandFlag.RegisterHint)) {
-            CiValue result = curInstruction.forEachRegisterHint(variable, mode, new ValueProcedure() {
-                @Override
-                public CiValue doValue(CiValue registerHint) {
-                    Debug.log("      registerHint %s", registerHint);
-                    CiRegister hint = null;
-                    if (isRegister(registerHint)) {
-                        hint = asRegister(registerHint);
-                    } else if (isLocation(registerHint) && isRegister(asLocation(registerHint).location)) {
-                        hint = asRegister(asLocation(registerHint).location);
-                    }
-                    if (hint != null && hint.isSet(variable.flag) && isFree(hint, inRegisterState, outRegisterState)) {
-                        return selectRegister(hint, variable, inRegisterState, outRegisterState);
-                    }
-                    return null;
-                }
-            });
-
-            if (result != null) {
-                return asLocation(result);
-            }
-        }
-
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-        CiRegister[] availableRegs = categorizedRegs.get(variable.flag);
-
-        for (CiRegister reg : availableRegs) {
-            if (isFree(reg, inRegisterState, outRegisterState)) {
-                return selectRegister(reg, variable, inRegisterState, outRegisterState);
-            }
-
-        }
-        throw new CiBailout("No register found");
-    }
-
-    private static boolean isFree(CiRegister reg, Object[] inRegisterState, Object[] outRegisterState) {
-        return (inRegisterState == null || inRegisterState[reg.number] == null) && (outRegisterState == null || outRegisterState[reg.number] == null);
-    }
-
-    private Location selectRegister(CiRegister reg, Variable variable, Object[] inRegisterState, Object[] outRegisterState) {
-        Location loc = new Location(variable, reg.asValue(variable.kind));
-        if (inRegisterState != null) {
-            inRegisterState[reg.number] = loc;
-        }
-        if (outRegisterState != null) {
-            outRegisterState[reg.number] = loc;
-        }
-        assert curRegisterLocations.get(variable) == null;
-        curRegisterLocations.put(loc);
-        Debug.log("      selected register %s", loc);
-        return loc;
-    }
-
-    private boolean checkInputState(final Block block) {
-        final BitSet liveState = new BitSet();
-        curStackLocations.forEachLocation(new ValueProcedure() {
-            @Override
-            public CiValue doValue(CiValue value) {
-                liveState.set(asLocation(value).variable.index);
-
-                for (Block pred : block.getPredecessors()) {
-                    LocationMap predState = locationsFor(pred);
-                    if (predState != null) {
-                        assert predState.get(asLocation(value).variable) == value;
-                    } else {
-                        assert block.isLoopHeader();
-                    }
-                }
-                return value;
-            }
-        });
-        assert liveState.equals(curLiveIn);
-        return true;
-    }
-
-    private boolean checkNoCallerSavedRegister() {
-        for (CiRegister reg : frameMap.registerConfig.getCallerSaveRegisters()) {
-            assert curOutRegisterState[reg.number] == null || curOutRegisterState[reg.number] == curInstruction : "caller saved register in use accross call site";
-        }
-        return true;
-    }
-
-    private static boolean checkEmpty(Object[] array) {
-        for (Object o : array) {
-            assert o == null;
-        }
-        return true;
-    }
-
-
-    private String logCurrentState() {
-        final StringBuilder sb = new StringBuilder();
-        sb.append("  curVariableLocations: ");
-        curStackLocations.forEachLocation(new ValueProcedure() {
-            @Override
-            public CiValue doValue(CiValue value) {
-                sb.append(value).append(" ");
-                return value;
-            }
-        });
-        return sb.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,274 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.util;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.alloc.simple.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-public final class IntervalPrinter {
-
-    public static void printBeforeAllocation(String label, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow) {
-        if (Debug.isDumpEnabled()) {
-            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, null);
-            Debug.dump(lir, label);
-            Debug.dump(printer.execute(), label);
-        }
-    }
-
-    public static void printAfterAllocation(String label, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
-        if (Debug.isDumpEnabled()) {
-            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, blockEndLocations);
-            Debug.dump(lir, label);
-            Debug.dump(printer.execute(), label);
-        }
-    }
-
-
-    public static class Range {
-        public final int from;
-        public final int to;
-
-        public Range(int from, int to) {
-            this.from = from;
-            this.to = to;
-        }
-    }
-
-    public static class UsePosition {
-        public final int pos;
-        public final String kind;
-
-        public UsePosition(int pos, String kind) {
-            this.pos = pos;
-            this.kind = kind;
-        }
-    }
-
-    public static class Interval {
-        public final String name;
-        public final String description;
-        public final String variable;
-        public final String type;
-        public final List<Range> ranges;
-        public final List<UsePosition> uses;
-
-        protected final int orderNum;
-        protected int lastTo;
-
-        public Interval(int orderNum, String name, String description, String variable, String type) {
-            this.orderNum = orderNum;
-            this.name = name;
-            this.description = description;
-            this.variable = variable;
-            this.type = type;
-            this.ranges = new ArrayList<>();
-            this.uses = new ArrayList<>();
-        }
-    }
-
-
-    private final LIR lir;
-    private final RiRegisterConfig registerConfig;
-    private final DataFlowAnalysis dataFlow;
-    private final LocationMap[] blockEndLocations;
-    private final Variable[] variables;
-    private final Map<String, Interval> intervals;
-
-    private IntervalPrinter(LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
-        this.lir = lir;
-        this.registerConfig = registerConfig;
-        this.dataFlow = dataFlow;
-        this.blockEndLocations = blockEndLocations;
-        this.variables = new Variable[lir.numVariables()];
-        this.intervals = new HashMap<>();
-    }
-
-    private boolean isAllocatableRegister(CiValue value) {
-        return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
-    }
-
-    private int curOpId;
-    private String curUseKind;
-
-    public Interval[] execute() {
-        ValueProcedure varProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return var(value); } };
-
-        for (Block block : lir.linearScanOrder()) {
-            for (LIRInstruction op : block.lir) {
-                op.forEachOutput(varProc);
-            }
-        }
-
-        ValueProcedure useProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, mode, flags); } };
-        ValueProcedure defProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return def(value, flags); } };
-
-        intervals.put("call", new Interval(-2, "call", "", "call", "hasCall"));
-        intervals.put("st", new Interval(-1, "st", "", "st", "hasState"));
-
-        for (int i = lir.linearScanOrder().size() - 1; i >= 0; i--) {
-            Block block = lir.linearScanOrder().get(i);
-
-            curOpId = block.getLastLirInstructionId() + 2;
-            for (Block sux : block.getSuccessors()) {
-                BitSet suxIn = dataFlow.liveIn(sux);
-                for (int idx = suxIn.nextSetBit(0); idx >= 0; idx = suxIn.nextSetBit(idx + 1)) {
-                    if (blockEndLocations != null) {
-                        out(blockEndLocations[block.getId()].get(variables[idx]));
-                    } else {
-                        out(variables[idx]);
-                    }
-                }
-            }
-
-            for (int j = block.lir.size() - 1; j >= 0; j--) {
-                LIRInstruction op = block.lir.get(j);
-                if (op.id() >= 0) {
-                    curOpId = op.id();
-                } else {
-                    curOpId = (curOpId - 1) | 1;
-                }
-
-                op.forEachOutput(defProc);
-                op.forEachTemp(defProc);
-                op.forEachInput(useProc);
-                op.forEachAlive(useProc);
-                curUseKind = "L";
-                op.forEachState(useProc);
-                curUseKind = null;
-
-                if (op.hasCall()) {
-                    intervals.get("call").ranges.add(new Range(curOpId, curOpId + 1));
-                }
-                if (op.info != null) {
-                    intervals.get("st").ranges.add(new Range(curOpId, curOpId + 1));
-                }
-            }
-
-            for (Interval interval : intervals.values()) {
-                if (interval.lastTo != 0) {
-                    interval.ranges.add(new Range(block.getFirstLirInstructionId(), interval.lastTo));
-                    interval.lastTo = 0;
-                }
-            }
-        }
-
-        Interval[] intervalsArray = intervals.values().toArray(new Interval[0]);
-        Arrays.sort(intervalsArray, new Comparator<Interval>() {
-            @Override
-            public int compare(Interval o1, Interval o2) {
-                return o1.orderNum - o2.orderNum;
-            }
-        });
-        return intervalsArray;
-    }
-
-    public CiValue var(CiValue value) {
-        if (isLocation(value)) {
-            variables[asLocation(value).variable.index] = asLocation(value).variable;
-        } else if (isVariable(value)) {
-            variables[asVariable(value).index] = asVariable(value);
-        }
-        return value;
-    }
-
-    private Interval findInterval(CiValue value) {
-        Interval interval;
-        if (isLocation(value)) {
-            Interval parent = findInterval(asLocation(value).variable);
-            String name = "v" + asLocation(value).variable.index + ":" + asLocation(value).location;
-            String description = isStackSlot(asLocation(value).location) ? "stack" : "";
-            interval = new Interval(asLocation(value).variable.index * 2 + 1001, name, description, parent.name, value.kind.javaName);
-
-        } else if (isVariable(value)) {
-            interval = new Interval(asVariable(value).index * 2 + 1000, value.toString(), "", value.toString(), value.kind.javaName);
-
-        } else if (isAllocatableRegister(value)) {
-            interval = new Interval(asRegister(value).number, asRegister(value).toString(), "", asRegister(value).toString(), "fixed");
-
-        } else {
-            return null;
-        }
-
-        Interval existing = intervals.get(interval.name);
-        if (existing != null) {
-            return existing;
-        }
-        intervals.put(interval.name, interval);
-        return interval;
-    }
-
-    private String useKind(EnumSet<OperandFlag> flags) {
-        if (curUseKind != null) {
-            return curUseKind;
-        } else if (flags.contains(OperandFlag.Stack)) {
-            return "S";
-        } else {
-            return "M";
-        }
-    }
-
-    private CiValue use(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        Interval interval = findInterval(value);
-        if (interval != null) {
-            if (interval.uses.size() == 0 || interval.uses.get(interval.uses.size() - 1).pos != curOpId) {
-                interval.uses.add(new UsePosition(curOpId, useKind(flags)));
-            }
-            if (interval.lastTo == 0) {
-                interval.lastTo = curOpId + (mode == OperandMode.Alive ? 1 : 0);
-            }
-        }
-        return value;
-    }
-
-    private CiValue def(CiValue value, EnumSet<OperandFlag> flags) {
-        Interval interval = findInterval(value);
-        if (interval != null) {
-            interval.uses.add(new UsePosition(curOpId, useKind(flags)));
-            if (interval.lastTo == 0) {
-                interval.ranges.add(new Range(curOpId, curOpId + 1));
-            } else {
-                interval.ranges.add(new Range(curOpId, interval.lastTo));
-            }
-            interval.lastTo = 0;
-        }
-        return value;
-    }
-
-    private CiValue out(CiValue value) {
-        Interval interval = findInterval(value);
-        if (interval != null) {
-            interval.lastTo = curOpId;
-        }
-        return value;
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/Location.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.util;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.lir.*;
-
-public class Location extends CiValue {
-    private static final long serialVersionUID = -1786677729152726126L;
-
-    public final Variable variable;
-    public final CiValue location;
-
-    public Location(Variable variable, CiValue location) {
-        super(variable.kind);
-        this.variable = variable;
-        this.location = location;
-
-        assert variable.kind == location.kind;
-    }
-
-    @Override
-    public String toString() {
-        return variable + "[" + location + "]";
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/LocationMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.util;
-
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-
-public class LocationMap {
-    private final Location[] locations;
-
-    public LocationMap(int numVariables) {
-        locations = new Location[numVariables];
-    }
-
-    public LocationMap(LocationMap template) {
-        locations = Arrays.copyOf(template.locations, template.locations.length);
-    }
-
-    public Location get(Variable variable) {
-        assert locations[variable.index] == null || locations[variable.index].variable == variable;
-        return locations[variable.index];
-    }
-
-    public void put(Location location) {
-        locations[location.variable.index] = location;
-    }
-
-    public void clear(Variable variable) {
-        locations[variable.index] = null;
-    }
-
-    public void forEachLocation(ValueProcedure proc) {
-        for (int i = 0; i < locations.length; i++) {
-            if (locations[i] != null) {
-                CiValue newValue = proc.doValue(locations[i], null, null);
-                assert newValue == null || asLocation(newValue).variable == locations[i].variable;
-                locations[i] = (Location) newValue;
-            }
-        }
-    }
-
-    public boolean checkEmpty() {
-        for (int i = 0; i < locations.length; i++) {
-            assert locations[i] == null;
-        }
-        return true;
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/LocationUtil.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.util;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.lir.*;
-
-public class LocationUtil extends ValueUtil {
-
-    public static boolean isLocation(CiValue value) {
-        assert value != null;
-        return value instanceof Location;
-    }
-
-    public static Location asLocation(CiValue value) {
-        assert value != null;
-        return (Location) value;
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/MoveResolver.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.util;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-
-public abstract class MoveResolver {
-    private final LIR lir;
-    private final FrameMap frameMap;
-    private final int[] registersBlocked;
-    private final Map<CiValue, Integer> valuesBlocked;
-    private final List<CiValue> mappingFrom;
-    private final List<Location> mappingTo;
-    private final LIRInsertionBuffer insertionBuffer;
-    private int insertPos;
-
-    public MoveResolver(LIR lir, FrameMap frameMap) {
-        this.lir = lir;
-        this.frameMap = frameMap;
-
-        registersBlocked = new int[frameMap.target.arch.registers.length];
-        valuesBlocked = new HashMap<>();
-
-        mappingFrom = new ArrayList<>();
-        mappingTo = new ArrayList<>();
-        insertionBuffer = new LIRInsertionBuffer();
-        insertPos = -1;
-
-        assert checkEmpty();
-    }
-
-    public void init(List<LIRInstruction> newInsertList, int newInsertPos) {
-        assert checkEmpty();
-
-        if (insertionBuffer.lirList() != newInsertList) {
-            // Block changed, so append insertionBuffer because it is bound to a specific block
-            finish();
-            insertionBuffer.init(newInsertList);
-        }
-        insertPos = newInsertPos;
-
-        assert checkValid();
-    }
-
-    public void add(CiValue from, Location to) {
-        assert checkValid();
-        assert isLocation(from) || isConstant(from);
-        assert from != to;
-
-        Debug.log("mr    add mapping from %s to %s", from, to);
-        mappingFrom.add(from);
-        mappingTo.add(to);
-
-        assert checkValid();
-    }
-
-    public boolean hasMappings() {
-        return mappingFrom.size() > 0;
-    }
-
-    public void resolve() {
-        assert checkValid();
-
-        if (mappingFrom.size() == 1) {
-            // If there is only one mapping, it is trivial that this mapping is safe to resolve.
-            Debug.log("mr    resolve  mappings: %d", mappingFrom.size());
-            insertMove(mappingFrom.get(0), mappingTo.get(0));
-            mappingFrom.remove(0);
-            mappingTo.remove(0);
-        } else if (mappingFrom.size() > 1) {
-            Debug.log("mr    resolve  mappings: %d", mappingFrom.size());
-            doResolve();
-        }
-        insertPos = -1;
-
-        assert checkEmpty();
-    }
-
-    public void finish() {
-        assert checkEmpty();
-
-        if (insertionBuffer.initialized()) {
-            insertionBuffer.finish();
-        }
-
-        assert !insertionBuffer.initialized() : "must be uninitialized now";
-        assert checkEmpty();
-    }
-
-
-    private void doResolve() {
-        // Block all registers and stack slots that are used as inputs of a move.
-        // When a register is blocked, no move to this register is emitted.
-        // This is necessary for detecting cycles in moves.
-        for (CiValue from : mappingFrom) {
-            block(from);
-        }
-
-        while (mappingFrom.size() > 0) {
-            boolean processed = false;
-            for (int i = mappingFrom.size() - 1; i >= 0; i--) {
-                CiValue from = mappingFrom.get(i);
-                Location to = mappingTo.get(i);
-
-                if (safeToProcessMove(from, to)) {
-                    insertMove(from, to);
-                    unblock(from);
-                    mappingFrom.remove(i);
-                    mappingTo.remove(i);
-                    processed = true;
-                }
-            }
-
-            if (!processed) {
-                // No move could be processed because there is a cycle in the move list
-                // (e.g., r1 -> r2, r2 -> r1), so one location must be spilled.
-                spill();
-            }
-        }
-    }
-
-    private void spill() {
-        Location spillCandidate = null;
-        int exchangeCandidate = -1;
-        int exchangeOther = -1;
-
-        for (int i = mappingFrom.size() - 1; i >= 0; i--) {
-            CiValue from = mappingFrom.get(i);
-            Location to = mappingTo.get(i);
-            assert !safeToProcessMove(from, to) : "would not be in this code otherwise";
-
-            if (isConstant(from)) {
-                continue;
-            }
-            CiValue fromLoc = asLocation(from).location;
-
-            // Check if we can insert an exchange to save us from spilling.
-            if (isRegister(fromLoc) && isRegister(to) && asRegister(fromLoc) != asRegister(to) && blockedCount(to) == 1) {
-                for (int j = mappingFrom.size() - 1; j >= 0; j--) {
-                    CiValue possibleOther = mappingFrom.get(j);
-                    if (isLocation(possibleOther)) {
-                        if (asLocation(possibleOther).location == to.location) {
-                            assert exchangeCandidate == -1 : "must not find twice because of blocked check above";
-                            exchangeCandidate = i;
-                            exchangeOther = j;
-                        } else if (i != j && asLocation(possibleOther).location == fromLoc) {
-                            // From is read multiple times, so exchange would be too complicated.
-                            exchangeCandidate = -1;
-                            break;
-                        }
-                    }
-                }
-            }
-
-            if (exchangeCandidate != -1) {
-                // Already found a result, no need to search further
-                break;
-            }
-            if (spillCandidate == null || isStackSlot(spillCandidate.location)) {
-                // this interval cannot be processed now because target is not free
-                spillCandidate = asLocation(from);
-            }
-        }
-
-        if (exchangeCandidate != -1) {
-            Location from = asLocation(mappingFrom.get(exchangeCandidate));
-            Location to = mappingTo.get(exchangeCandidate);
-            Location other = asLocation(mappingFrom.get(exchangeOther));
-
-            Location newOther = new Location(other.variable, from.variable);
-            mappingFrom.set(exchangeOther, newOther);
-
-            insertExchange(newOther, to);
-            unblock(to);
-            mappingFrom.remove(exchangeCandidate);
-            mappingTo.remove(exchangeCandidate);
-
-        } else {
-            assert spillCandidate != null : "no location for spilling found";
-
-            Location spillLocation = new Location(spillCandidate.variable, frameMap.allocateSpillSlot(spillCandidate.kind));
-            insertMove(spillCandidate, spillLocation);
-
-            for (int i = mappingFrom.size() - 1; i >= 0; i--) {
-                if (mappingFrom.get(i) == spillCandidate) {
-                    mappingFrom.set(i, spillLocation);
-                    unblock(spillCandidate);
-                    block(spillLocation);
-                }
-            }
-            assert blockedCount(spillCandidate) == 0 : "register must be unblocked after spilling";
-        }
-    }
-
-    private void block(CiValue value) {
-        if (isLocation(value)) {
-            CiValue location = asLocation(value).location;
-            if (isRegister(location)) {
-                registersBlocked[asRegister(location).number]++;
-            } else {
-                Integer count = valuesBlocked.get(location);
-                valuesBlocked.put(location, count == null ? 1 : count + 1);
-            }
-        }
-    }
-
-    private void unblock(CiValue value) {
-        if (isLocation(value)) {
-            assert blockedCount(asLocation(value)) > 0;
-            CiValue location = asLocation(value).location;
-            if (isRegister(location)) {
-                registersBlocked[asRegister(location).number]--;
-            } else {
-                Integer count = valuesBlocked.remove(location);
-                if (count > 1) {
-                    valuesBlocked.put(location, count - 1);
-                }
-            }
-        }
-    }
-
-    private int blockedCount(Location value) {
-        CiValue location = asLocation(value).location;
-        if (isRegister(location)) {
-            return registersBlocked[asRegister(location).number];
-        } else {
-            Integer count = valuesBlocked.get(location);
-            return count == null ? 0 : count;
-        }
-    }
-
-    private boolean safeToProcessMove(CiValue from, Location to) {
-        int count = blockedCount(to);
-        return count == 0 || (count == 1 && isLocation(from) && asLocation(from).location == to.location);
-    }
-
-    private void insertExchange(Location from, Location to) {
-        Debug.log("mr      XCHG %s, %s", from, to);
-        // TODO (cwimmer) create XCHG instruction and use it here
-        insertionBuffer.append(insertPos, null);
-        throw GraalInternalError.unimplemented();
-    }
-
-    private void insertMove(CiValue src, Location dst) {
-        if (isStackSlot(dst.location) && isLocation(src) && isStackSlot(asLocation(src).location)) {
-            // Move between two stack slots. We need a temporary registers. If the allocator can give
-            // us a free register, we need two moves: src->scratch, scratch->dst
-            // If the allocator cannot give us a free register (it returns a Location in this case),
-            // we need to spill the scratch register first, so we need four moves in total.
-
-            CiValue scratch = scratchRegister(dst.variable);
-
-            Location scratchSaved = null;
-            CiValue scratchRegister = scratch;
-            if (isLocation(scratch)) {
-                scratchSaved = new Location(asLocation(scratch).variable, frameMap.allocateSpillSlot(scratch.kind));
-                insertMove(scratch, scratchSaved);
-                scratchRegister = asLocation(scratch).location;
-            }
-            assert isRegister(scratchRegister);
-
-            Location scratchLocation = new Location(dst.variable, scratchRegister);
-            insertMove(src, scratchLocation);
-            insertMove(scratchLocation, dst);
-
-            if (scratchSaved != null) {
-                insertMove(scratchSaved, asLocation(scratch));
-            }
-
-        } else {
-            Debug.log("mr      MOV %s -> %s", src, dst);
-            insertionBuffer.append(insertPos, lir.spillMoveFactory.createMove(dst,  src));
-        }
-    }
-
-    /**
-     * Provides a register that can be used by the move resolver. If the returned value is a
-     * {@link CiRegisterValue}, the register can be overwritten without precautions. If the
-     * returned value is a {@link Location}, it needs to be spilled and rescued itself.
-     */
-    protected abstract CiValue scratchRegister(Variable spilled);
-
-    private boolean checkEmpty() {
-        assert insertPos == -1;
-        assert mappingFrom.size() == 0 && mappingTo.size() == 0;
-        for (int registerBlocked : registersBlocked) {
-            assert registerBlocked == 0;
-        }
-        assert valuesBlocked.size() == 0;
-        return true;
-    }
-
-    private boolean checkValid() {
-        assert insertPos != -1;
-        for (int registerBlocked : registersBlocked) {
-            assert registerBlocked == 0;
-        }
-        assert mappingFrom.size() == mappingTo.size();
-        assert insertionBuffer.initialized() && insertPos != -1;
-
-        for (int i = 0; i < mappingTo.size(); i++) {
-            CiValue from = mappingFrom.get(i);
-            Location to = mappingTo.get(i);
-
-            assert from.kind.stackKind() == to.kind;
-
-            for (int j = i + 1; j < mappingTo.size(); j++) {
-                Location otherTo = mappingTo.get(j);
-                assert to != otherTo && to.variable != otherTo.variable && to.location != otherTo.location : "Cannot write to same location twice";
-            }
-        }
-        return true;
-    }
-}
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.alloc.util;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-public final class RegisterVerifier {
-    private final FrameMap frameMap;
-
-    /**
-     * All blocks that must be processed.
-     */
-    private final List<Block> workList;
-
-    /**
-     * Saved information of previous check.
-     * <br>
-     * State mapping: mapping from registers and stack slots ({@link CiRegister} and {@link Integer} stack slot offsets) to the
-     * value that is currently contained in there ({@link Location} for operands that were variables; {@link CiRegisterValue} or
-     * {@link CiStackSlot} for operands that used fixed registers or stack slots).
-     */
-    private final Map<Object, CiValue>[] blockStates;
-
-    private void addToWorkList(Block block) {
-        if (!workList.contains(block)) {
-            workList.add(block);
-        }
-    }
-
-    private Map<Object, CiValue> stateFor(Block block) {
-        return blockStates[block.getId()];
-    }
-
-    private void setStateFor(Block block, Map<Object, CiValue> savedState) {
-        blockStates[block.getId()] = savedState;
-    }
-
-    private static Map<Object, CiValue> copy(Map<Object, CiValue> inputState) {
-        return new HashMap<>(inputState);
-    }
-
-    public static boolean verify(LIR lir, FrameMap frameMap) {
-        RegisterVerifier verifier = new RegisterVerifier(lir, frameMap);
-        verifier.verify(lir.cfg.getStartBlock());
-        return true;
-    }
-
-    @SuppressWarnings("unchecked")
-    private RegisterVerifier(LIR lir, FrameMap frameMap) {
-        this.frameMap = frameMap;
-        this.workList = new LinkedList<>();
-        this.blockStates = new Map[lir.linearScanOrder().size()];
-    }
-
-    private Map<Object, CiValue> curInputState;
-
-    private void verify(Block startBlock) {
-        ValueProcedure useProc =    new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, flags); } };
-        ValueProcedure tempProc =   new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return temp(value); } };
-        ValueProcedure outputProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value) { return output(value); } };
-
-        curInputState = new HashMap<>();
-        setStateFor(startBlock, curInputState);
-        addToWorkList(startBlock);
-
-        Debug.log("==== start verify register allocation ====");
-        do {
-            Block block = workList.remove(0);
-
-            // Must copy state because it is modified.
-            curInputState = copy(stateFor(block));
-            Debug.log("start block %s %s", block, block.getLoop());
-            Debug.log(logCurrentState());
-
-            for (LIRInstruction op : block.lir) {
-                Debug.log("  op %d %s", op.id(), op);
-
-                op.forEachInput(useProc);
-                if (op.hasCall()) {
-                    invalidateRegisters();
-                }
-                op.forEachAlive(useProc);
-                op.forEachState(useProc);
-                op.forEachTemp(tempProc);
-                op.forEachOutput(outputProc);
-            }
-
-            for (Block succ : block.getSuccessors()) {
-                processSuccessor(succ);
-            }
-
-            Debug.log("end block %s", block);
-        } while (!workList.isEmpty());
-        Debug.log("==== end verify register allocation ====");
-    }
-
-    private void processSuccessor(Block succ) {
-        Map<Object, CiValue> savedState = stateFor(succ);
-        if (savedState == null) {
-            // Block was not processed before, so set initial inputState.
-            Debug.log("  successor %s: initial visit", succ);
-            setStateFor(succ, copy(curInputState));
-            addToWorkList(succ);
-
-        } else {
-            // This block was already processed before.
-            // Check if new inputState is consistent with savedState.
-            Debug.log("  successor %s: state present", succ);
-            Iterator<Map.Entry<Object, CiValue>> iter = savedState.entrySet().iterator();
-            while (iter.hasNext()) {
-                Map.Entry<Object, CiValue> entry = iter.next();
-                CiValue savedValue = entry.getValue();
-                CiValue inputValue = curInputState.get(entry.getKey());
-
-                if (savedValue != inputValue) {
-                    // Current inputState and previous savedState assume a different value in this register.
-                    // Assume that this register is invalid and remove it from the saved state.
-                    Debug.log("    invalidating %s because it is inconsistent with %s", savedValue, inputValue);
-                    iter.remove();
-                    // Must re-visit this block.
-                    addToWorkList(succ);
-                }
-            }
-        }
-    }
-
-    private void invalidateRegisters() {
-        // Invalidate all caller save registers at calls.
-        Iterator<Object> iter = curInputState.keySet().iterator();
-        while (iter.hasNext()) {
-            Object value1 = iter.next();
-            if (value1 instanceof CiRegister && frameMap.registerConfig.getAttributesMap()[((CiRegister) value1).number].isCallerSave) {
-                Debug.log("    remove caller save register %s", value1);
-                iter.remove();
-            }
-        }
-    }
-
-    /**
-     * Gets the mapping key for a value. The key should be as narrow as possible, e.g., it should not
-     * include the kind of the value because we do not want to distinguish between the same register with
-     * different kinds.
-     */
-    private Object key(CiValue value) {
-        if (isLocation(value)) {
-            return key(asLocation(value).location);
-        } else if (isRegister(value)) {
-            return asRegister(value);
-        } else if (isStackSlot(value)) {
-            return Integer.valueOf(frameMap.offsetForStackSlot(asStackSlot(value)));
-        } else {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private boolean isIgnoredRegister(CiValue value) {
-        return isRegister(value) && !frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
-    }
-
-    private CiValue use(CiValue value, EnumSet<OperandFlag> flags) {
-        if (!isConstant(value) && value != CiValue.IllegalValue && !isIgnoredRegister(value)) {
-            CiValue actual = curInputState.get(key(value));
-            if (actual == null && flags.contains(OperandFlag.Uninitialized)) {
-                // OK, since uninitialized values are allowed explicitly.
-            } else if (value != actual) {
-                Debug.log("Error in register allocation: %s != %s for key %s", value, actual, key(value));
-                Debug.log(logCurrentState());
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        }
-        return value;
-    }
-
-    private CiValue temp(CiValue value) {
-        if (!isConstant(value) && value != CiValue.IllegalValue && !isIgnoredRegister(value)) {
-            Debug.log("    temp %s -> remove key %s", value, key(value));
-            curInputState.remove(key(value));
-        }
-        return value;
-    }
-
-    private CiValue output(CiValue value) {
-        if (value != CiValue.IllegalValue && !isIgnoredRegister(value)) {
-            Debug.log("    output %s -> set key %s", value, key(value));
-            curInputState.put(key(value), value);
-        }
-        return value;
-    }
-
-
-    private String logCurrentState() {
-        ArrayList<Object> keys = new ArrayList<>(curInputState.keySet());
-        Collections.sort(keys, new Comparator<Object>() {
-            @Override
-            public int compare(Object o1, Object o2) {
-                if (o1 instanceof CiRegister) {
-                    if (o2 instanceof CiRegister) {
-                        return ((CiRegister) o1).number - ((CiRegister) o2).number;
-                    } else {
-                        return -1;
-                    }
-                } else {
-                    if (o2 instanceof CiRegister) {
-                        return 1;
-                    } else {
-                        return ((Integer) o1).intValue() - ((Integer) o2).intValue();
-                    }
-                }
-            }
-        });
-
-        StringBuilder sb = new StringBuilder("    state: ");
-        for (Object key : keys) {
-            sb.append(key).append("=").append(curInputState.get(key)).append(" ");
-        }
-        return sb.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,283 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler;
-
-import java.util.*;
-import java.util.concurrent.*;
-
-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.graal.alloc.simple.*;
-import com.oracle.graal.compiler.alloc.*;
-import com.oracle.graal.compiler.gen.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
-import com.oracle.graal.compiler.schedule.*;
-import com.oracle.graal.compiler.target.*;
-import com.oracle.graal.compiler.types.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.asm.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-
-public class GraalCompiler {
-
-    /**
-     * The target that this compiler has been configured for.
-     */
-    public final CiTarget target;
-
-    /**
-     * The runtime that this compiler has been configured for.
-     */
-    public final GraalRuntime runtime;
-
-    /**
-     * The XIR generator that lowers Java operations to machine operations.
-     */
-    public final RiXirGenerator xir;
-
-    /**
-     * The backend that this compiler has been configured for.
-     */
-    public final Backend backend;
-
-    public GraalCompiler(GraalRuntime runtime, CiTarget target, Backend backend, RiXirGenerator xirGen) {
-        this.runtime = runtime;
-        this.target = target;
-        this.xir = xirGen;
-        this.backend = backend;
-    }
-
-    public CiTargetMethod compileMethod(RiResolvedMethod method, int osrBCI, PhasePlan plan) {
-        return compileMethod(method, new StructuredGraph(method), osrBCI, plan);
-    }
-
-    public CiTargetMethod compileMethod(final RiResolvedMethod method, final StructuredGraph graph, int osrBCI, final PhasePlan plan) {
-        if (osrBCI != -1) {
-            throw new CiBailout("No OSR supported");
-        }
-
-        return Debug.scope(createScopeName(method), new Object[] {graph, method, this}, new Callable<CiTargetMethod>() {
-            public CiTargetMethod call() {
-                final CiAssumptions assumptions = GraalOptions.OptAssumptions ? new CiAssumptions() : null;
-                final LIR lir = Debug.scope("FrontEnd", new Callable<LIR>() {
-                    public LIR call() {
-                        return emitHIR(graph, assumptions, plan);
-                    }
-                });
-                final FrameMap frameMap = Debug.scope("BackEnd", lir, new Callable<FrameMap>() {
-                    public FrameMap call() {
-                        return emitLIR(lir, graph, method);
-                    }
-                });
-                return Debug.scope("CodeGen", frameMap, new Callable<CiTargetMethod>() {
-                    public CiTargetMethod call() {
-                        return emitCode(assumptions, method, lir, frameMap);
-                    }
-                });
-            }
-        });
-    }
-
-    private static String createScopeName(RiResolvedMethod method) {
-        if (Debug.isEnabled()) {
-            return String.format("[%s::%s]", createSimpleName(method.holder()), method.name());
-        } else {
-            return null;
-        }
-    }
-
-    private static String createSimpleName(RiResolvedType holder) {
-        String base = holder.name();
-        int slashIndex = base.lastIndexOf('/');
-        if (slashIndex == -1) {
-            slashIndex = 0;
-        }
-        return base.substring(slashIndex + 1, base.length() - 1);
-    }
-
-    /**
-     * Builds the graph, optimizes it.
-     */
-    public LIR emitHIR(StructuredGraph graph, CiAssumptions assumptions, PhasePlan plan) {
-
-        if (graph.start().next() == null) {
-            plan.runPhases(PhasePosition.AFTER_PARSING, graph);
-            new DeadCodeEliminationPhase().apply(graph);
-        } else {
-            Debug.dump(graph, "initial state");
-        }
-
-        new PhiStampPhase().apply(graph);
-
-        if (GraalOptions.ProbabilityAnalysis && graph.start().probability() == 0) {
-            new ComputeProbabilityPhase().apply(graph);
-        }
-
-        if (GraalOptions.Intrinsify) {
-            new IntrinsificationPhase(runtime).apply(graph);
-        }
-
-        if (GraalOptions.PropagateTypes) {
-            if (GraalOptions.OptCanonicalizer) {
-                new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
-            }
-
-            new PropagateTypesPhase(target, runtime, assumptions).apply(graph);
-        }
-
-        if (GraalOptions.Inline && !plan.isPhaseDisabled(InliningPhase.class)) {
-            new InliningPhase(target, runtime, null, assumptions, plan).apply(graph);
-            new DeadCodeEliminationPhase().apply(graph);
-            new PhiStampPhase().apply(graph);
-        }
-
-        if (GraalOptions.OptCanonicalizer) {
-            new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
-        }
-
-        if (GraalOptions.PropagateTypes) {
-            new PropagateTypesPhase(target, runtime, assumptions).apply(graph);
-        }
-
-        plan.runPhases(PhasePosition.HIGH_LEVEL, graph);
-
-        if (GraalOptions.OptLoops) {
-            new SafepointPollingEliminationPhase().apply(graph);
-        }
-
-        if (GraalOptions.EscapeAnalysis && !plan.isPhaseDisabled(EscapeAnalysisPhase.class)) {
-            new EscapeAnalysisPhase(target, runtime, assumptions, plan).apply(graph);
-            new PhiStampPhase().apply(graph);
-            if (GraalOptions.OptCanonicalizer) {
-                new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
-            }
-        }
-
-        if (GraalOptions.OptGVN) {
-            new GlobalValueNumberingPhase().apply(graph);
-        }
-
-        graph.mark();
-        new LoweringPhase(runtime).apply(graph);
-        new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph);
-
-        if (GraalOptions.Lower) {
-            new FloatingReadPhase().apply(graph);
-            if (GraalOptions.OptGVN) {
-                new GlobalValueNumberingPhase().apply(graph);
-            }
-            if (GraalOptions.OptReadElimination) {
-                new ReadEliminationPhase().apply(graph);
-            }
-        }
-        new DeadCodeEliminationPhase().apply(graph);
-
-        plan.runPhases(PhasePosition.MID_LEVEL, graph);
-
-        plan.runPhases(PhasePosition.LOW_LEVEL, graph);
-
-        final SchedulePhase schedule = new SchedulePhase();
-        schedule.apply(graph);
-        Debug.dump(schedule, "final schedule");
-
-        final Block[] blocks = schedule.getCFG().getBlocks();
-        final Block startBlock = schedule.getCFG().getStartBlock();
-        assert startBlock != null;
-        assert startBlock.numberOfPreds() == 0;
-
-        return Debug.scope("ComputeLinearScanOrder", new Callable<LIR>() {
-
-            @Override
-            public LIR call() {
-                ComputeLinearScanOrder clso = new ComputeLinearScanOrder(blocks.length, schedule.getCFG().getLoops().length, startBlock);
-                List<Block> linearScanOrder = clso.linearScanOrder();
-                List<Block> codeEmittingOrder = clso.codeEmittingOrder();
-
-                int z = 0;
-                for (Block b : linearScanOrder) {
-                    b.linearScanNumber = z++;
-                }
-
-                LIR lir = new LIR(schedule.getCFG(), schedule.getNodesFor(), linearScanOrder, codeEmittingOrder);
-                Debug.dump(lir, "After linear scan order");
-                return lir;
-
-            }
-        });
-    }
-
-    public FrameMap emitLIR(final LIR lir, StructuredGraph graph, final RiResolvedMethod method) {
-        final FrameMap frameMap = backend.newFrameMap(runtime.getRegisterConfig(method));
-        final LIRGenerator lirGenerator = backend.newLIRGenerator(graph, frameMap, method, lir, xir);
-
-        Debug.scope("LIRGen", lirGenerator, new Runnable() {
-            public void run() {
-                for (Block b : lir.linearScanOrder()) {
-                    lirGenerator.doBlock(b);
-                }
-
-                Debug.dump(lir, "After LIR generation");
-            }
-        });
-
-        Debug.scope("Allocator", new Runnable() {
-            public void run() {
-                if (GraalOptions.AllocSSA) {
-                    new LinearScanAllocator(lir, frameMap).execute();
-                    // new SpillAllAllocator(context, lir, frameMap).execute();
-                } else {
-                    new LinearScan(target, method, lir, lirGenerator, frameMap).allocate();
-                }
-            }
-        });
-        return frameMap;
-    }
-
-    private TargetMethodAssembler createAssembler(FrameMap frameMap, LIR lir) {
-        AbstractAssembler masm = backend.newAssembler(frameMap.registerConfig);
-        TargetMethodAssembler tasm = new TargetMethodAssembler(target, runtime, frameMap, lir.slowPaths, masm);
-        tasm.setFrameSize(frameMap.frameSize());
-        tasm.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea());
-        return tasm;
-    }
-
-    public CiTargetMethod emitCode(CiAssumptions assumptions, RiResolvedMethod method, LIR lir, FrameMap frameMap) {
-        TargetMethodAssembler tasm = createAssembler(frameMap, lir);
-        lir.emitCode(tasm);
-
-        CiTargetMethod targetMethod = tasm.finishTargetMethod(method, false);
-        if (assumptions != null && !assumptions.isEmpty()) {
-            targetMethod.setAssumptions(assumptions);
-        }
-
-        Debug.dump(lir, "After code generation");
-        Debug.dump(targetMethod, "After code generation");
-        return targetMethod;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler;
-
-/**
- * This class encapsulates options that control the behavior of the Graal compiler.
- * The help message for each option is specified by a {@linkplain #helpMap help map}.
- *
- * (thomaswue) WARNING: Fields of this class are treated as final by Graal.
- */
-public final class GraalOptions {
-
-    // Checkstyle: stop
-    private static final boolean ____ = false;
-    // Checkstyle: resume
-
-
-
-
-    public static int     Threads                            = 4;
-    public static boolean Lower                              = true;
-
-    // inlining settings
-    public static boolean Inline                             = true;
-    public static boolean Intrinsify                         = true;
-    public static boolean CacheGraphs                        = ____;
-    public static boolean InlineMonomorphicCalls             = true;
-    public static boolean InlinePolymorphicCalls             = true;
-    public static boolean InlineMegamorphicCalls             = ____;
-    public static int     InliningPolicy                     = 4;
-    public static int     WeightComputationPolicy            = 2;
-    public static int     MaximumTrivialSize                 = 10;
-    public static int     MaximumInlineLevel                 = 30;
-    public static int     MaximumDesiredSize                 = 3000;
-    public static int     MaximumRecursiveInlining           = 1;
-    public static int     SmallCompiledCodeSize              = 2000;
-    public static boolean LimitInlinedProbability            = ____;
-    // WeightBasedInliningPolicy (0)
-    public static boolean ParseBeforeInlining                = ____;
-    public static float   InliningSizePenaltyExp             = 20;
-    public static float   MaximumInlineWeight                = 1.25f;
-    public static float   InliningSizePenalty                = 1;
-    // StaticSizeBasedInliningPolicy (1), MinimumCodeSizeBasedInlining (2),
-    // DynamicSizeBasedInliningPolicy (3)
-    public static int     MaximumInlineSize                  = 35;
-    // GreedySizeBasedInlining (4)
-    public static int     MaximumGreedyInlineSize            = 100;
-    public static int     InliningBonusPerTransferredValue   = 10;
-    // Common options for inlining policies 1 to 4
-    public static float   NestedInliningSizeRatio            = 1f;
-    public static float   BoostInliningForEscapeAnalysis     = 2f;
-    public static float   ProbabilityCapForInlining          = 1f;
-
-    // escape analysis settings
-    public static boolean EscapeAnalysis                     = true;
-    public static int     ForcedInlineEscapeWeight           = 10;
-    public static boolean PrintEscapeAnalysis                = ____;
-
-    // absolute probability analysis
-    public static boolean ProbabilityAnalysis                = true;
-    public static int     LoopFrequencyPropagationPolicy     = -2;
-
-    // profiling information
-    public static int     MatureExecutionsBranch             = 1;
-    public static int     MatureExecutionsPerSwitchCase      = 1;
-    public static int     MatureExecutionsTypeProfile        = 1;
-
-    //rematerialize settings
-    public static float   MinimumUsageProbability            = 0.95f;
-
-    // debugging settings
-    public static int     MethodEndBreakpointGuards          = 0;
-    public static boolean ZapStackOnMethodEntry              = ____;
-    public static boolean StressLinearScan                   = ____;
-    public static boolean DeoptALot                          = ____;
-    public static boolean VerifyPhases                       = true;
-    public static boolean CreateDeoptInfo                    = ____;
-
-    /**
-     * See {@link Filter#Filter(String, Object)}.
-     */
-    public static String  PrintFilter                        = null;
-
-    // printing settings
-    public static boolean PrintLIR                           = ____;
-    public static boolean PrintCFGToFile                     = ____;
-
-    // statistics independent from debug mode
-    public static boolean PrintCompilationStatistics         = ____;
-
-    // Debug settings:
-    public static boolean Debug                              = true;
-    public static boolean SummarizeDebugValues               = ____;
-    public static String Dump                                = null;
-    public static String Meter                               = null;
-    public static String Time                                = null;
-    public static String Log                                 = null;
-    public static String MethodFilter                        = null;
-
-    // Ideal graph visualizer output settings
-    public static boolean PlotOnError                        = ____;
-    public static int     PlotLevel                          = 3;
-    public static boolean PlotSnippets                       = ____;
-    public static int     PrintIdealGraphLevel               = 0;
-    public static boolean PrintIdealGraphFile                = ____;
-    public static String  PrintIdealGraphAddress             = "127.0.0.1";
-    public static int     PrintIdealGraphPort                = 4444;
-
-    // Other printing settings
-    public static boolean PrintQueue                         = ____;
-    public static boolean PrintCompilation                   = ____;
-    public static boolean PrintProfilingInformation          = ____;
-    public static boolean PrintXirTemplates                  = ____;
-    public static boolean PrintIRWithLIR                     = ____;
-    public static boolean PrintAssembly                      = ____;
-    public static boolean PrintCodeBytes                     = ____;
-    public static int     PrintAssemblyBytesPerLine          = 16;
-    public static int     TraceLinearScanLevel               = 0;
-    public static boolean TraceRegisterAllocation            = false;
-    public static int     TraceLIRGeneratorLevel             = 0;
-    public static boolean TraceEscapeAnalysis                = ____;
-    public static int     TraceBytecodeParserLevel           = 0;
-    public static boolean ExitVMOnBailout                    = ____;
-    public static boolean ExitVMOnException                  = true;
-
-    // state merging settings
-    public static boolean AssumeVerifiedBytecode             = true;
-
-    // Code generator settings
-    public static boolean PropagateTypes                     = ____;
-    public static boolean UseBranchPrediction                = true;
-    public static boolean UseExceptionProbability            = true;
-    public static boolean AllowExplicitExceptionChecks       = true;
-    public static boolean OmitHotExceptionStacktrace         = ____;
-    public static boolean GenSafepoints                      = true;
-    public static boolean GenLoopSafepoints                  = true;
-    public static boolean UseTypeCheckHints                  = true;
-    public static boolean InlineVTableStubs                  = ____;
-    public static boolean AlwaysInlineVTableStubs            = ____;
-
-    public static boolean GenAssertionCode                   = ____;
-    public static boolean AlignCallsForPatching              = true;
-    public static boolean ResolveClassBeforeStaticInvoke     = true;
-
-    // Translating tableswitch instructions
-    public static int     SequentialSwitchLimit              = 4;
-    public static int     RangeTestsSwitchDensity            = 5;
-
-    public static boolean DetailedAsserts                    = ____;
-
-    // Runtime settings
-    public static int     ReadPrefetchInstr                  = 0;
-    public static int     StackShadowPages                   = 2;
-
-    // Assembler settings
-    public static boolean CommentedAssembly                  = ____;
-    public static boolean PrintLIRWithAssembly               = ____;
-
-    public static boolean SupportJsrBytecodes                = true;
-
-    public static boolean OptAssumptions                     = true;
-    public static boolean OptReadElimination                 = true;
-    public static boolean OptGVN                             = true;
-    public static boolean OptCanonicalizer                   = true;
-    public static boolean OptLoops                           = ____;
-    public static boolean ScheduleOutOfLoops                 = true;
-    public static boolean OptReorderLoops                    = true;
-    public static boolean OptEliminateGuards                 = true;
-    public static boolean OptImplicitNullChecks              = true;
-    public static boolean OptLivenessAnalysis                = true;
-
-    /**
-     * Flag to turn on SSA-based register allocation, which is currently under development.
-     */
-    public static boolean AllocSSA                           = false;
-
-    static {
-        // turn detailed assertions on when the general assertions are on (misusing the assert keyword for this)
-        assert (DetailedAsserts = true) == true;
-        assert (CommentedAssembly = true) == true;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/ComputeLinearScanOrder.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,322 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.compiler.alloc;
-
-import java.util.*;
-
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-
-public final class ComputeLinearScanOrder {
-
-    private int numBlocks; // total number of blocks (smaller than maxBlockId)
-
-    List<Block> linearScanOrder; // the resulting list of blocks in correct order
-    List<Block> codeEmittingOrder;
-
-    final BitMap visitedBlocks; // used for recursive processing of blocks
-    final BitMap activeBlocks; // used for recursive processing of blocks
-    final BitMap dominatorBlocks; // temporary BitMap used for computation of dominator
-    final int[] forwardBranches; // number of incoming forward branches for each block
-    final List<Block> workList; // temporary list (used in markLoops and computeOrder)
-    final Block[] loopHeaders;
-
-    // accessors for visitedBlocks and activeBlocks
-    void initVisited() {
-        activeBlocks.clearAll();
-        visitedBlocks.clearAll();
-    }
-
-    boolean isVisited(Block b) {
-        return visitedBlocks.get(b.getId());
-    }
-
-    boolean isActive(Block b) {
-        return activeBlocks.get(b.getId());
-    }
-
-    void setVisited(Block b) {
-        assert !isVisited(b) : "already set";
-        visitedBlocks.set(b.getId());
-    }
-
-    void setActive(Block b) {
-        assert !isActive(b) : "already set";
-        activeBlocks.set(b.getId());
-    }
-
-    void clearActive(Block b) {
-        assert isActive(b) : "not already";
-        activeBlocks.clear(b.getId());
-    }
-
-    // accessors for forwardBranches
-    void incForwardBranches(Block b) {
-        forwardBranches[b.getId()]++;
-    }
-
-    int decForwardBranches(Block b) {
-        return --forwardBranches[b.getId()];
-    }
-
-    // accessors for final result
-    public List<Block> linearScanOrder() {
-        return linearScanOrder;
-    }
-
-    public ComputeLinearScanOrder(int maxBlockId, int loopCount, Block startBlock) {
-        loopHeaders = new Block[loopCount];
-
-        visitedBlocks = new BitMap(maxBlockId);
-        activeBlocks = new BitMap(maxBlockId);
-        dominatorBlocks = new BitMap(maxBlockId);
-        forwardBranches = new int[maxBlockId];
-        workList = new ArrayList<>(8);
-
-        countEdges(startBlock, null);
-        computeOrder(startBlock);
-    }
-
-    /**
-     * Traverses the CFG to analyze block and edge info. The analysis performed is:
-     *
-     * 1. Count of total number of blocks.
-     * 2. Count of all incoming edges and backward incoming edges.
-     * 3. Number loop header blocks.
-     * 4. Create a list with all loop end blocks.
-     */
-    void countEdges(Block cur, Block parent) {
-        if (GraalOptions.TraceLinearScanLevel >= 3) {
-            TTY.println("Counting edges for block B%d%s", cur.getId(), parent == null ? "" : " coming from B" + parent.getId());
-        }
-
-        if (isActive(cur)) {
-            return;
-        }
-
-        // increment number of incoming forward branches
-        incForwardBranches(cur);
-
-        if (isVisited(cur)) {
-            if (GraalOptions.TraceLinearScanLevel >= 3) {
-                TTY.println("block already visited");
-            }
-            return;
-        }
-
-        numBlocks++;
-        setVisited(cur);
-        setActive(cur);
-
-        // recursive call for all successors
-        int i;
-        for (i = cur.numberOfSux() - 1; i >= 0; i--) {
-            countEdges(cur.suxAt(i), cur);
-        }
-
-        clearActive(cur);
-
-        if (GraalOptions.TraceLinearScanLevel >= 3) {
-            TTY.println("Finished counting edges for block B%d", cur.getId());
-        }
-    }
-
-    static int computeWeight(Block cur) {
-
-        // limit loop-depth to 15 bit (only for security reason, it will never be so big)
-        int weight = (cur.getLoopDepth() & 0x7FFF) << 16;
-
-        int curBit = 15;
-
-        // this is necessary for the (very rare) case that two successive blocks have
-        // the same loop depth, but a different loop index (can happen for endless loops
-        // with exception handlers)
-//        if (!cur.isLinearScanLoopHeader()) {
-//            weight |= 1 << curBit;
-//        }
-//        curBit--;
-
-        // loop end blocks (blocks that end with a backward branch) are added
-        // after all other blocks of the loop.
-        if (!cur.isLoopEnd()) {
-            weight |= 1 << curBit;
-        }
-        curBit--;
-
-        // critical edge split blocks are preferred because then they have a greater
-        // probability to be completely empty
-        //if (cur.isCriticalEdgeSplit()) {
-        //    weight |= 1 << curBit;
-        //}
-        //curBit--;
-
-        // exceptions should not be thrown in normal control flow, so these blocks
-        // are added as late as possible
-//        if (!(cur.end() instanceof Throw) && (singleSux == null || !(singleSux.end() instanceof Throw))) {
-//            weight |= 1 << curBit;
-//        }
-//        curBit--;
-//        if (!(cur.end() instanceof Return) && (singleSux == null || !(singleSux.end() instanceof Return))) {
-//            weight |= 1 << curBit;
-//        }
-//        curBit--;
-
-        // exceptions handlers are added as late as possible
-        if (!cur.isExceptionEntry()) {
-            weight |= 1 << curBit;
-        }
-        curBit--;
-
-        // guarantee that weight is > 0
-        weight |= 1;
-
-        assert curBit >= 0 : "too many flags";
-        assert weight > 0 : "weight cannot become negative";
-
-        return weight;
-    }
-
-    private boolean readyForProcessing(Block cur) {
-        // Discount the edge just traveled.
-        // When the number drops to zero, all forward branches were processed
-        if (decForwardBranches(cur) != 0) {
-            return false;
-        }
-
-        assert !linearScanOrder.contains(cur) : "block already processed (block can be ready only once)";
-        assert !workList.contains(cur) : "block already in work-list (block can be ready only once)";
-        return true;
-    }
-
-    private void sortIntoWorkList(Block cur) {
-        assert !workList.contains(cur) : "block already in work list";
-
-        int curWeight = computeWeight(cur);
-
-        // the linearScanNumber is used to cache the weight of a block
-        cur.linearScanNumber = curWeight;
-
-        if (GraalOptions.StressLinearScan) {
-            workList.add(0, cur);
-            return;
-        }
-
-        workList.add(null); // provide space for new element
-
-        int insertIdx = workList.size() - 1;
-        while (insertIdx > 0 && workList.get(insertIdx - 1).linearScanNumber > curWeight) {
-            workList.set(insertIdx, workList.get(insertIdx - 1));
-            insertIdx--;
-        }
-        workList.set(insertIdx, cur);
-
-        if (GraalOptions.TraceLinearScanLevel >= 3) {
-            TTY.println("Sorted B%d into worklist. new worklist:", cur.getId());
-            for (int i = 0; i < workList.size(); i++) {
-                TTY.println(String.format("%8d B%02d  weight:%6x", i, workList.get(i).getId(), workList.get(i).linearScanNumber));
-            }
-        }
-
-        for (int i = 0; i < workList.size(); i++) {
-            assert workList.get(i).linearScanNumber > 0 : "weight not set";
-            assert i == 0 || workList.get(i - 1).linearScanNumber <= workList.get(i).linearScanNumber : "incorrect order in worklist";
-        }
-    }
-
-    private void appendBlock(Block cur) {
-        if (GraalOptions.TraceLinearScanLevel >= 3) {
-            TTY.println("appending block B%d (weight 0x%06x) to linear-scan order", cur.getId(), cur.linearScanNumber);
-        }
-        assert !linearScanOrder.contains(cur) : "cannot add the same block twice";
-
-        // currently, the linear scan order and code emit order are equal.
-        // therefore the linearScanNumber and the weight of a block must also
-        // be equal.
-        cur.linearScanNumber = linearScanOrder.size();
-        linearScanOrder.add(cur);
-
-        if (cur.isLoopEnd() && cur.isLoopHeader()) {
-            codeEmittingOrder.add(cur);
-        } else {
-            if (!cur.isLoopHeader() || ((LoopBeginNode) cur.getBeginNode()).loopEnds().count() > 1 || !GraalOptions.OptReorderLoops) {
-                codeEmittingOrder.add(cur);
-
-                if (cur.isLoopEnd() && GraalOptions.OptReorderLoops) {
-                    Block loopHeader = loopHeaders[cur.getLoop().index];
-                    if (loopHeader != null) {
-                        codeEmittingOrder.add(loopHeader);
-
-                        for (int i = 0; i < loopHeader.numberOfSux(); i++) {
-                            Block succ = loopHeader.suxAt(i);
-                            if (succ.getLoopDepth() == loopHeader.getLoopDepth()) {
-                                succ.align = true;
-                            }
-                        }
-                    }
-                }
-            } else {
-                loopHeaders[cur.getLoop().index] = cur;
-            }
-        }
-    }
-
-    private void computeOrder(Block startBlock) {
-        if (GraalOptions.TraceLinearScanLevel >= 3) {
-            TTY.println("----- computing final block order");
-        }
-
-        // the start block is always the first block in the linear scan order
-        linearScanOrder = new ArrayList<>(numBlocks);
-
-        codeEmittingOrder = new ArrayList<>(numBlocks);
-
-        // start processing with standard entry block
-        assert workList.isEmpty() : "list must be empty before processing";
-
-        assert readyForProcessing(startBlock);
-        sortIntoWorkList(startBlock);
-
-        do {
-            Block cur = workList.remove(workList.size() - 1);
-            appendBlock(cur);
-
-            int i;
-            int numSux = cur.numberOfSux();
-            // changed loop order to get "intuitive" order of if- and else-blocks
-            for (i = 0; i < numSux; i++) {
-                Block sux = cur.suxAt(i);
-                if (readyForProcessing(sux)) {
-                    sortIntoWorkList(sux);
-                }
-            }
-        } while (workList.size() > 0);
-    }
-
-    public List<Block> codeEmittingOrder() {
-        return codeEmittingOrder;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/ControlFlowOptimizer.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-import java.util.*;
-
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.cfg.*;
-
-/**
- * This class performs basic optimizations on the control flow graph after LIR generation.
- */
-final class ControlFlowOptimizer {
-
-    /**
-     * Performs control flow optimizations on the given LIR graph.
-     * @param ir the LIR graph that should be optimized
-     */
-    public static void optimize(LIR ir) {
-        ControlFlowOptimizer optimizer = new ControlFlowOptimizer(ir);
-        List<Block> code = ir.codeEmittingOrder();
-        //optimizer.reorderShortLoops(code);
-        optimizer.deleteEmptyBlocks(code);
-        ControlFlowOptimizer.deleteUnnecessaryJumps(code);
-        //ControlFlowOptimizer.deleteJumpsToReturn(code);
-    }
-
-    private final LIR ir;
-
-    private ControlFlowOptimizer(LIR ir) {
-        this.ir = ir;
-    }
-/*
-    private void reorderShortLoop(List<LIRBlock> code, LIRBlock headerBlock, int headerIdx) {
-        int i = headerIdx + 1;
-        int maxEnd = Math.min(headerIdx + GraalOptions.MaximumShortLoopSize, code.size());
-        while (i < maxEnd && code.get(i).loopDepth() >= headerBlock.loopDepth()) {
-            i++;
-        }
-
-        if (i == code.size() || code.get(i).loopDepth() < headerBlock.loopDepth()) {
-            int endIdx = i - 1;
-            LIRBlock endBlock = code.get(endIdx);
-
-            if (endBlock.numberOfSux() == 1 && endBlock.suxAt(0) == headerBlock) {
-                // short loop from headerIdx to endIdx found . reorder blocks such that
-                // the headerBlock is the last block instead of the first block of the loop
-
-                for (int j = headerIdx; j < endIdx; j++) {
-                    code.set(j, code.get(j + 1));
-                }
-                code.set(endIdx, headerBlock);
-            }
-        }
-    }*/
-/*
-    private void reorderShortLoops(List<LIRBlock> code) {
-        for (int i = code.size() - 1; i >= 0; i--) {
-            LIRBlock block = code.get(i);
-
-            if (block.isLinearScanLoopHeader()) {
-                reorderShortLoop(code, block, i);
-            }
-        }
-
-        assert verify(code);
-    }*/
-
-    // only blocks with exactly one successor can be deleted. Such blocks
-    // must always end with an unconditional branch to its successor
-    private boolean canDeleteBlock(Block block) {
-        if (block.numberOfSux() != 1 ||
-            block == ir.cfg.getStartBlock() ||
-            block.suxAt(0) == block) {
-            return false;
-        }
-
-        List<LIRInstruction> instructions = block.lir;
-
-        assert instructions.size() >= 2 : "block must have label and branch";
-        assert instructions.get(0) instanceof StandardOp.LabelOp : "first instruction must always be a label";
-        assert instructions.get(instructions.size() - 1) instanceof StandardOp.JumpOp : "last instruction must always be a branch";
-        assert ((StandardOp.JumpOp) instructions.get(instructions.size() - 1)).destination().label() == ((StandardOp.LabelOp) block.suxAt(0).lir.get(0)).getLabel() : "branch target must be the successor";
-
-        // block must have exactly one successor
-
-        return instructions.size() == 2 && instructions.get(instructions.size() - 1).info == null;
-    }
-
-    private void deleteEmptyBlocks(List<Block> code) {
-        int oldPos = 0;
-        int newPos = 0;
-        int numBlocks = code.size();
-
-        assert verify(code);
-        while (oldPos < numBlocks) {
-            Block block = code.get(oldPos);
-
-            if (canDeleteBlock(block)) {
-                // adjust successor and predecessor lists
-                Block other = block.suxAt(0);
-                for (Block pred : block.getPredecessors()) {
-                    Util.replaceAllInList(block, other, pred.getSuccessors());
-                }
-                for (int i = 0; i < other.getPredecessors().size(); i++) {
-                    if (other.getPredecessors().get(i) == block) {
-                        other.getPredecessors().remove(i);
-                        other.getPredecessors().addAll(i, block.getPredecessors());
-                    }
-                }
-                block.getSuccessors().clear();
-                block.getPredecessors().clear();
-                Debug.metric("BlocksDeleted").increment();
-            } else {
-                // adjust position of this block in the block list if blocks before
-                // have been deleted
-                if (newPos != oldPos) {
-                    code.set(newPos, code.get(oldPos));
-                }
-                newPos++;
-            }
-            oldPos++;
-        }
-        assert verify(code);
-        Util.truncate(code, newPos);
-
-        assert verify(code);
-    }
-
-    private static void deleteUnnecessaryJumps(List<Block> code) {
-        // skip the last block because there a branch is always necessary
-        for (int i = code.size() - 2; i >= 0; i--) {
-            Block block = code.get(i);
-            List<LIRInstruction> instructions = block.lir;
-
-            LIRInstruction lastOp = instructions.get(instructions.size() - 1);
-            if (lastOp instanceof StandardOp.JumpOp) {
-                StandardOp.JumpOp lastJump = (StandardOp.JumpOp) lastOp;
-
-                if (lastOp.info == null) {
-                    if (lastJump.destination().label() == ((StandardOp.LabelOp) code.get(i + 1).lir.get(0)).getLabel()) {
-                        // delete last branch instruction
-                        Util.truncate(instructions, instructions.size() - 1);
-
-                    } else {
-                        LIRInstruction prevOp = instructions.get(instructions.size() - 2);
-                        if (prevOp instanceof StandardOp.BranchOp) {
-                            StandardOp.BranchOp prevBranch = (StandardOp.BranchOp) prevOp;
-
-                            if (prevBranch.destination().label() == ((StandardOp.LabelOp) code.get(i + 1).lir.get(0)).getLabel() && prevOp.info == null) {
-                                // eliminate a conditional branch to the immediate successor
-                                prevBranch.negate(lastJump.destination());
-                                Util.truncate(instructions, instructions.size() - 1);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        assert verify(code);
-    }
-
-/*
-    private static void deleteJumpsToReturn(List<LIRBlock> code) {
-        for (int i = code.size() - 1; i >= 0; i--) {
-            LIRBlock block = code.get(i);
-            List<LIRInstruction> curInstructions = block.lir();
-            LIRInstruction curLastOp = curInstructions.get(curInstructions.size() - 1);
-
-            assert curInstructions.get(0).code == StandardOpcode.LABEL : "first instruction must always be a label";
-            if (curInstructions.size() == 2 && curLastOp.code == StandardOpcode.RETURN) {
-                // the block contains only a label and a return
-                // if a predecessor ends with an unconditional jump to this block, then the jump
-                // can be replaced with a return instruction
-                //
-                // Note: the original block with only a return statement cannot be deleted completely
-                // because the predecessors might have other (conditional) jumps to this block.
-                // this may lead to unnecesary return instructions in the final code
-
-                assert curLastOp.info == null : "return instructions do not have debug information";
-                CiValue returnOpr = curLastOp.input(0);
-
-                for (int j = block.numberOfPreds() - 1; j >= 0; j--) {
-                    LIRBlock pred = block.predAt(j);
-                    List<LIRInstruction> predInstructions = pred.lir();
-                    LIRInstruction predLastOp = predInstructions.get(predInstructions.size() - 1);
-
-                    if (predLastOp instanceof LIRBranch) {
-                        LIRBranch predLastBranch = (LIRBranch) predLastOp;
-
-                        if (predLastBranch.destination().label() == block.label() && predLastBranch.code == StandardOpcode.JUMP && predLastBranch.info == null) {
-                            // replace the jump to a return with a direct return
-                            // Note: currently the edge between the blocks is not deleted
-                            predInstructions.set(predInstructions.size() - 1, StandardOpcode.RETURN.create(returnOpr));
-                        }
-                    }
-                }
-            }
-        }
-    }
-*/
-
-    private static boolean verify(List<Block> code) {
-        for (Block block : code) {
-            for (Block sux : block.getSuccessors()) {
-                assert code.contains(sux) : "missing successor from: " + block + "to: " + sux;
-            }
-
-            for (Block pred : block.getPredecessors()) {
-                assert code.contains(pred) : "missing predecessor from: " + block + "to: " + pred;
-            }
-        }
-
-        return true;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/EdgeMoveOptimizer.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,290 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-import java.util.*;
-
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.StandardOp.*;
-import com.oracle.graal.lir.cfg.*;
-
-/**
- * This class optimizes moves, particularly those that result from eliminating SSA form.
- *
- * When a block has more than one predecessor, and all predecessors end with
- * the {@linkplain #same(LIRInstruction, LIRInstruction) same} sequence of
- * {@linkplain LIROpcode#Move move} instructions, then these sequences
- * can be replaced with a single copy of the sequence at the beginning of the block.
- *
- * Similarly, when a block has more than one successor, then same sequences of
- * moves at the beginning of the successors can be placed once at the end of
- * the block. But because the moves must be inserted before all branch
- * instructions, this works only when there is exactly one conditional branch
- * at the end of the block (because the moves must be inserted before all
- * branches, but after all compares).
- *
- * This optimization affects all kind of moves (reg->reg, reg->stack and
- * stack->reg). Because this optimization works best when a block contains only
- * a few moves, it has a huge impact on the number of blocks that are totally
- * empty.
- */
-final class EdgeMoveOptimizer {
-
-    /**
-     * Optimizes moves on block edges.
-     *
-     * @param blockList a list of blocks whose moves should be optimized
-     */
-    public static void optimize(List<Block> blockList) {
-        EdgeMoveOptimizer optimizer = new EdgeMoveOptimizer();
-
-        // ignore the first block in the list (index 0 is not processed)
-        for (int i = blockList.size() - 1; i >= 1; i--) {
-            Block block = blockList.get(i);
-
-            if (block.numberOfPreds() > 1) {
-                optimizer.optimizeMovesAtBlockEnd(block);
-            }
-            if (block.numberOfSux() == 2) {
-                optimizer.optimizeMovesAtBlockBegin(block);
-            }
-        }
-    }
-
-    private final List<List<LIRInstruction>> edgeInstructionSeqences;
-
-    private EdgeMoveOptimizer() {
-        edgeInstructionSeqences = new ArrayList<>(4);
-    }
-
-    /**
-     * Determines if two operations are both {@linkplain LIROpcode#Move moves}
-     * that have the same {@linkplain LIRInstruction#operand() source} and {@linkplain LIRInstruction#result() destination}
-     * operands and they have the same {@linkplain LIRInstruction#info debug info}.
-     *
-     * @param op1 the first instruction to compare
-     * @param op2 the second instruction to compare
-     * @return {@code true} if {@code op1} and {@code op2} are the same by the above algorithm
-     */
-    private static boolean same(LIRInstruction op1, LIRInstruction op2) {
-        assert op1 != null;
-        assert op2 != null;
-
-        if (op1 instanceof MoveOp && op2 instanceof MoveOp) {
-            MoveOp move1 = (MoveOp) op1;
-            MoveOp move2 = (MoveOp) op2;
-            if (move1.getInput() == move2.getInput() && move1.getResult() == move2.getResult()) {
-                // these moves are exactly equal and can be optimized
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Moves the longest {@linkplain #same common} subsequence at the end all
-     * predecessors of {@code block} to the start of {@code block}.
-     */
-    private void optimizeMovesAtBlockEnd(Block block) {
-        for (Block pred : block.getPredecessors()) {
-            if (pred == block) {
-                // currently we can't handle this correctly.
-                return;
-            }
-        }
-
-        // clear all internal data structures
-        edgeInstructionSeqences.clear();
-
-        int numPreds = block.numberOfPreds();
-        assert numPreds > 1 : "do not call otherwise";
-
-        // setup a list with the LIR instructions of all predecessors
-        for (Block pred : block.getPredecessors()) {
-            assert pred != null;
-            assert pred.lir != null;
-            List<LIRInstruction> predInstructions = pred.lir;
-
-            if (pred.numberOfSux() != 1) {
-                // this can happen with switch-statements where multiple edges are between
-                // the same blocks.
-                return;
-            }
-
-            if (predInstructions.get(predInstructions.size() - 1) instanceof LIRXirInstruction) {
-                return;
-            }
-
-            assert pred.suxAt(0) == block : "invalid control flow";
-            assert predInstructions.get(predInstructions.size() - 1) instanceof StandardOp.JumpOp : "block must end with unconditional jump";
-
-            if (predInstructions.get(predInstructions.size() - 1).info != null) {
-                // can not optimize instructions that have debug info
-                return;
-            }
-
-            // ignore the unconditional branch at the end of the block
-            List<LIRInstruction> seq = predInstructions.subList(0, predInstructions.size() - 1);
-            edgeInstructionSeqences.add(seq);
-        }
-
-        // process lir-instructions while all predecessors end with the same instruction
-        while (true) {
-            List<LIRInstruction> seq = edgeInstructionSeqences.get(0);
-            if (seq.isEmpty()) {
-                return;
-            }
-
-            LIRInstruction op = last(seq);
-            for (int i = 1; i < numPreds; ++i) {
-                List<LIRInstruction> otherSeq = edgeInstructionSeqences.get(i);
-                if (otherSeq.isEmpty() || !same(op, last(otherSeq))) {
-                    return;
-                }
-            }
-
-            // insert the instruction at the beginning of the current block
-            block.lir.add(1, op);
-
-            // delete the instruction at the end of all predecessors
-            for (int i = 0; i < numPreds; i++) {
-                seq = edgeInstructionSeqences.get(i);
-                removeLast(seq);
-            }
-        }
-    }
-
-    /**
-     * Moves the longest {@linkplain #same common} subsequence at the start of all
-     * successors of {@code block} to the end of {@code block} just prior to the
-     * branch instruction ending {@code block}.
-     */
-    private void optimizeMovesAtBlockBegin(Block block) {
-
-        edgeInstructionSeqences.clear();
-        int numSux = block.numberOfSux();
-
-        List<LIRInstruction> instructions = block.lir;
-
-        assert numSux == 2 : "method should not be called otherwise";
-
-        if (instructions.get(instructions.size() - 1) instanceof LIRXirInstruction) {
-            // cannot optimize when last instruction is Xir.
-            return;
-        }
-
-        assert instructions.get(instructions.size() - 1) instanceof StandardOp.JumpOp : "block must end with unconditional jump";
-
-        if (instructions.get(instructions.size() - 1).info != null) {
-            // cannot optimize instructions when debug info is needed
-            return;
-        }
-
-        LIRInstruction branch = instructions.get(instructions.size() - 2);
-        if (!(branch instanceof StandardOp.BranchOp) || branch.info != null) {
-            // not a valid case for optimization
-            // currently, only blocks that end with two branches (conditional branch followed
-            // by unconditional branch) are optimized
-            return;
-        }
-
-        // now it is guaranteed that the block ends with two branch instructions.
-        // the instructions are inserted at the end of the block before these two branches
-        int insertIdx = instructions.size() - 2;
-
-        // setup a list with the lir-instructions of all successors
-        for (int i = 0; i < numSux; i++) {
-            Block sux = block.suxAt(i);
-            List<LIRInstruction> suxInstructions = sux.lir;
-
-            assert suxInstructions.get(0) instanceof StandardOp.LabelOp : "block must start with label";
-
-            if (sux.numberOfPreds() != 1) {
-                // this can happen with switch-statements where multiple edges are between
-                // the same blocks.
-                return;
-            }
-            assert sux.predAt(0) == block : "invalid control flow";
-
-            // ignore the label at the beginning of the block
-            List<LIRInstruction> seq = suxInstructions.subList(1, suxInstructions.size());
-            edgeInstructionSeqences.add(seq);
-        }
-
-        // process LIR instructions while all successors begin with the same instruction
-        while (true) {
-            List<LIRInstruction> seq = edgeInstructionSeqences.get(0);
-            if (seq.isEmpty()) {
-                return;
-            }
-
-            LIRInstruction op = first(seq);
-            for (int i = 1; i < numSux; i++) {
-                List<LIRInstruction> otherSeq = edgeInstructionSeqences.get(i);
-                if (otherSeq.isEmpty() || !same(op, first(otherSeq))) {
-                    // these instructions are different and cannot be optimized .
-                    // no further optimization possible
-                    return;
-                }
-            }
-
-            // insert instruction at end of current block
-            block.lir.add(insertIdx, op);
-            insertIdx++;
-
-            // delete the instructions at the beginning of all successors
-            for (int i = 0; i < numSux; i++) {
-                seq = edgeInstructionSeqences.get(i);
-                removeFirst(seq);
-            }
-        }
-    }
-
-    /**
-     * Gets the first element from a LIR instruction sequence.
-     */
-    private static LIRInstruction first(List<LIRInstruction> seq) {
-        return seq.get(0);
-    }
-
-    /**
-     * Gets the last element from a LIR instruction sequence.
-     */
-    private static LIRInstruction last(List<LIRInstruction> seq) {
-        return seq.get(seq.size() - 1);
-    }
-
-    /**
-     * Removes the first element from a LIR instruction sequence.
-     */
-    private static void removeFirst(List<LIRInstruction> seq) {
-        seq.remove(0);
-    }
-
-    /**
-     * Removes the last element from a LIR instruction sequence.
-     */
-    private static void removeLast(List<LIRInstruction> seq) {
-        seq.remove(seq.size() - 1);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1172 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-
-/**
- * Represents an interval in the {@linkplain LinearScan linear scan register allocator}.
- */
-public final class Interval {
-
-    /**
-     * A pair of intervals.
-     */
-    static final class Pair {
-        public final Interval first;
-        public final Interval second;
-        public Pair(Interval first, Interval second) {
-            this.first = first;
-            this.second = second;
-        }
-    }
-
-    /**
-     * A set of interval lists, one per {@linkplain RegisterBinding binding} type.
-     */
-    static final class RegisterBindingLists {
-
-        /**
-         * List of intervals whose binding is currently {@link RegisterBinding#Fixed}.
-         */
-        public Interval fixed;
-
-        /**
-         * List of intervals whose binding is currently {@link RegisterBinding#Any}.
-         */
-        public Interval any;
-
-        public RegisterBindingLists(Interval fixed, Interval any) {
-            this.fixed = fixed;
-            this.any = any;
-        }
-
-        /**
-         * Gets the list for a specified binding.
-         *
-         * @param binding specifies the list to be returned
-         * @return the list of intervals whose binding is {@code binding}
-         */
-        public Interval get(RegisterBinding binding) {
-            if (binding == RegisterBinding.Any) {
-                return any;
-            }
-            assert binding == RegisterBinding.Fixed;
-            return fixed;
-        }
-
-        /**
-         * Sets the list for a specified binding.
-         *
-         * @param binding specifies the list to be replaced
-         * @param a list of intervals whose binding is {@code binding}
-         */
-        public void set(RegisterBinding binding, Interval list) {
-            assert list != null;
-            if (binding == RegisterBinding.Any) {
-                any = list;
-            } else {
-                assert binding == RegisterBinding.Fixed;
-                fixed = list;
-            }
-        }
-
-        /**
-         * Adds an interval to a list sorted by {@linkplain Interval#currentFrom() current from} positions.
-         *
-         * @param binding specifies the list to be updated
-         * @param interval the interval to add
-         */
-        public void addToListSortedByCurrentFromPositions(RegisterBinding binding, Interval interval) {
-            Interval list = get(binding);
-            Interval prev = null;
-            Interval cur = list;
-            while (cur.currentFrom() < interval.currentFrom()) {
-                prev = cur;
-                cur = cur.next;
-            }
-            Interval result = list;
-            if (prev == null) {
-                // add to head of list
-                result = interval;
-            } else {
-                // add before 'cur'
-                prev.next = interval;
-            }
-            interval.next = cur;
-            set(binding, result);
-        }
-
-        /**
-         * Adds an interval to a list sorted by {@linkplain Interval#from() start} positions and
-         * {@linkplain Interval#firstUsage(RegisterPriority) first usage} positions.
-         *
-         * @param binding specifies the list to be updated
-         * @param interval the interval to add
-         */
-        public void addToListSortedByStartAndUsePositions(RegisterBinding binding, Interval interval) {
-            Interval list = get(binding);
-            Interval prev = null;
-            Interval cur = list;
-            while (cur.from() < interval.from() || (cur.from() == interval.from() && cur.firstUsage(RegisterPriority.None) < interval.firstUsage(RegisterPriority.None))) {
-                prev = cur;
-                cur = cur.next;
-            }
-            if (prev == null) {
-                list = interval;
-            } else {
-                prev.next = interval;
-            }
-            interval.next = cur;
-            set(binding, list);
-        }
-
-        /**
-         * Removes an interval from a list.
-         *
-         * @param binding specifies the list to be updated
-         * @param interval the interval to remove
-         */
-        public void remove(RegisterBinding binding, Interval i) {
-            Interval list = get(binding);
-            Interval prev = null;
-            Interval cur = list;
-            while (cur != i) {
-                assert cur != null && cur != Interval.EndMarker : "interval has not been found in list: " + i;
-                prev = cur;
-                cur = cur.next;
-            }
-            if (prev == null) {
-                set(binding, cur.next);
-            } else {
-                prev.next = cur.next;
-            }
-        }
-    }
-
-    /**
-     * Constants denoting the register usage priority for an interval.
-     * The constants are declared in increasing order of priority are
-     * are used to optimize spilling when multiple overlapping intervals
-     * compete for limited registers.
-     */
-    enum RegisterPriority {
-        /**
-         * No special reason for an interval to be allocated a register.
-         */
-        None,
-
-        /**
-         * Priority level for intervals live at the end of a loop.
-         */
-        LiveAtLoopEnd,
-
-        /**
-         * Priority level for intervals that should be allocated to a register.
-         */
-        ShouldHaveRegister,
-
-        /**
-         * Priority level for intervals that must be allocated to a register.
-         */
-        MustHaveRegister;
-
-        public static final RegisterPriority[] VALUES = values();
-
-        /**
-         * Determines if this priority is higher than or equal to a given priority.
-         */
-        public boolean greaterEqual(RegisterPriority other) {
-            return ordinal() >= other.ordinal();
-        }
-
-        /**
-         * Determines if this priority is lower than a given priority.
-         */
-        public boolean lessThan(RegisterPriority other) {
-            return ordinal() < other.ordinal();
-        }
-    }
-
-    /**
-     * Constants denoting whether an interval is bound to a specific register. This models
-     * platform dependencies on register usage for certain instructions.
-     */
-    enum RegisterBinding {
-        /**
-         * Interval is bound to a specific register as required by the platform.
-         */
-        Fixed,
-
-        /**
-         * Interval has no specific register requirements.
-         */
-        Any;
-
-        public static final RegisterBinding[] VALUES = values();
-    }
-
-    /**
-     * Constants denoting the linear-scan states an interval may be in with respect to the
-     * {@linkplain Interval#from() start} {@code position} of the interval being processed.
-     */
-    enum State {
-        /**
-         * An interval that starts after {@code position}.
-         */
-        Unhandled,
-
-        /**
-         * An interval that {@linkplain Interval#covers covers} {@code position} and has an assigned register.
-         */
-        Active,
-
-        /**
-         * An interval that starts before and ends after {@code position} but does not
-         * {@linkplain Interval#covers cover} it due to a lifetime hole.
-         */
-        Inactive,
-
-        /**
-         * An interval that ends before {@code position} or is spilled to memory.
-         */
-        Handled;
-    }
-
-    /**
-     * Constants used in optimization of spilling of an interval.
-     */
-    enum SpillState {
-        /**
-         * Starting state of calculation: no definition found yet.
-         */
-        NoDefinitionFound,
-
-        /**
-         * One definition has already been found. Two consecutive definitions are treated as one
-         * (e.g. a consecutive move and add because of two-operand LIR form).
-         * The position of this definition is given by {@link Interval#spillDefinitionPos()}.
-         */
-        NoSpillStore,
-
-        /**
-         * One spill move has already been inserted.
-         */
-        OneSpillStore,
-
-        /**
-         * The interval should be stored immediately after its definition to prevent
-         * multiple redundant stores.
-         */
-        StoreAtDefinition,
-
-        /**
-         * The interval starts in memory (e.g. method parameter), so a store is never necessary.
-         */
-        StartInMemory,
-
-        /**
-         * The interval has more than one definition (e.g. resulting from phi moves), so stores
-         * to memory are not optimized.
-         */
-        NoOptimization
-    }
-
-    /**
-     * List of use positions. Each entry in the list records the use position and register
-     * priority associated with the use position. The entries in the list are in descending
-     * order of use position.
-     *
-     */
-    public static final class UsePosList {
-        private IntList list;
-
-        /**
-         * Creates a use list.
-         *
-         * @param initialCapacity the initial capacity of the list in terms of entries
-         */
-        public UsePosList(int initialCapacity) {
-            list = new IntList(initialCapacity * 2);
-        }
-
-        private UsePosList(IntList list) {
-            this.list = list;
-        }
-
-        /**
-         * Splits this list around a given position. All entries in this list with a use position greater or equal than
-         * {@code splitPos} are removed from this list and added to the returned list.
-         *
-         * @param splitPos the position for the split
-         * @return a use position list containing all entries removed from this list that have a use position greater or equal
-         *         than {@code splitPos}
-         */
-        public UsePosList splitAt(int splitPos) {
-            int i = size() - 1;
-            int len = 0;
-            while (i >= 0 && usePos(i) < splitPos) {
-                --i;
-                len += 2;
-            }
-            int listSplitIndex = (i + 1) * 2;
-            IntList childList = list;
-            list = IntList.copy(this.list, listSplitIndex, len);
-            childList.setSize(listSplitIndex);
-            UsePosList child = new UsePosList(childList);
-            return child;
-        }
-
-        /**
-         * Gets the use position at a specified index in this list.
-         *
-         * @param index the index of the entry for which the use position is returned
-         * @return the use position of entry {@code index} in this list
-         */
-        public int usePos(int index) {
-            return list.get(index << 1);
-        }
-
-        /**
-         * Gets the register priority for the use position at a specified index in this list.
-         *
-         * @param index the index of the entry for which the register priority is returned
-         * @return the register priority of entry {@code index} in this list
-         */
-        public RegisterPriority registerPriority(int index) {
-            return RegisterPriority.VALUES[list.get((index << 1) + 1)];
-        }
-
-        public void add(int usePos, RegisterPriority registerPriority) {
-            assert list.size() == 0 || usePos(size() - 1) > usePos;
-            list.add(usePos);
-            list.add(registerPriority.ordinal());
-        }
-
-        public int size() {
-            return list.size() >> 1;
-        }
-
-        public void removeLowestUsePos() {
-            list.setSize(list.size() - 2);
-        }
-
-        public void setRegisterPriority(int index, RegisterPriority registerPriority) {
-            list.set(index * 2, registerPriority.ordinal());
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder buf = new StringBuilder("[");
-            for (int i = size() - 1; i >= 0; --i) {
-                if (buf.length() != 1) {
-                    buf.append(", ");
-                }
-                RegisterPriority prio = registerPriority(i);
-                buf.append(usePos(i)).append(" -> ").append(prio.ordinal()).append(':').append(prio);
-            }
-            return buf.append("]").toString();
-        }
-    }
-
-    /**
-     * The {@linkplain CiRegisterValue register} or {@linkplain Variable variable} for this interval prior to register allocation.
-     */
-    public final CiValue operand;
-
-    /**
-     * The {@linkplain OperandPool#operandNumber(CiValue) operand number} for this interval's {@linkplain #operand operand}.
-     */
-    public final int operandNumber;
-
-    /**
-     * The {@linkplain CiRegisterValue register}, {@linkplain CiStackSlot spill slot} or {@linkplain CiAddress address} assigned to this interval.
-     */
-    private CiValue location;
-
-    /**
-     * The stack slot to which all splits of this interval are spilled if necessary.
-     */
-    private CiStackSlot spillSlot;
-
-    /**
-     * The kind of this interval.
-     * Only valid if this is a {@linkplain #xxisVariable() variable}.
-     */
-    private CiKind kind;
-
-    /**
-     * The head of the list of ranges describing this interval. This list is sorted by {@linkplain LIRInstruction#id instruction ids}.
-     */
-    private Range first;
-
-    /**
-     * List of (use-positions, register-priorities) pairs, sorted by use-positions.
-     */
-    private UsePosList usePosList;
-
-    /**
-     * Iterator used to traverse the ranges of an interval.
-     */
-    private Range current;
-
-    /**
-     * Link to next interval in a sorted list of intervals that ends with {@link #EndMarker}.
-     */
-    Interval next;
-
-    /**
-     * The linear-scan state of this interval.
-     */
-    State state;
-
-    private int cachedTo; // cached value: to of last range (-1: not cached)
-
-    /**
-     * The interval from which this one is derived. If this is a {@linkplain #isSplitParent() split parent}, it points to itself.
-     */
-    private Interval splitParent;
-
-    /**
-     * List of all intervals that are split off from this interval. This is only used if this is a {@linkplain #isSplitParent() split parent}.
-     */
-    private List<Interval> splitChildren = Collections.emptyList();
-
-    /**
-     * Current split child that has been active or inactive last (always stored in split parents).
-     */
-    private Interval currentSplitChild;
-
-    /**
-     * Specifies if move is inserted between currentSplitChild and this interval when interval gets active the first time.
-     */
-    private boolean insertMoveWhenActivated;
-
-    /**
-     * For spill move optimization.
-     */
-    private SpillState spillState;
-
-    /**
-     * Position where this interval is defined (if defined only once).
-     */
-    private int spillDefinitionPos;
-
-    /**
-     * This interval should be assigned the same location as the hint interval.
-     */
-    private Interval locationHint;
-
-    void assignLocation(CiValue newLocation) {
-        if (isRegister(newLocation)) {
-            assert this.location == null : "cannot re-assign location for " + this;
-            if (newLocation.kind == CiKind.Illegal && kind != CiKind.Illegal) {
-                this.location = asRegister(newLocation).asValue(kind);
-                return;
-            }
-        } else {
-            assert this.location == null || isRegister(this.location) : "cannot re-assign location for " + this;
-            assert isStackSlot(newLocation);
-            assert newLocation.kind != CiKind.Illegal;
-            assert newLocation.kind == this.kind;
-        }
-        this.location = newLocation;
-    }
-
-    /**
-     * Gets the {@linkplain CiRegisterValue register}, {@linkplain CiStackSlot spill slot} or {@linkplain CiAddress address} assigned to this interval.
-     */
-    public CiValue location() {
-        return location;
-    }
-
-    public CiKind kind() {
-        assert !isRegister(operand) : "cannot access type for fixed interval";
-        return kind;
-    }
-
-    void setKind(CiKind kind) {
-        assert isRegister(operand) || this.kind() == CiKind.Illegal || this.kind() == kind : "overwriting existing type";
-        assert kind == kind.stackKind() || kind == CiKind.Short : "these kinds should have int type registers";
-        this.kind = kind;
-    }
-
-    public Range first() {
-        return first;
-    }
-
-    int from() {
-        return first.from;
-    }
-
-    int to() {
-        if (cachedTo == -1) {
-            cachedTo = calcTo();
-        }
-        assert cachedTo == calcTo() : "invalid cached value";
-        return cachedTo;
-    }
-
-    int numUsePositions() {
-        return usePosList.size();
-    }
-
-    void setLocationHint(Interval interval) {
-        locationHint = interval;
-    }
-
-    boolean isSplitParent() {
-        return splitParent == this;
-    }
-
-    boolean isSplitChild() {
-        return splitParent != this;
-    }
-
-    /**
-     * Gets the split parent for this interval.
-     */
-    public Interval splitParent() {
-        assert splitParent.isSplitParent() : "not a split parent: " + this;
-        return splitParent;
-    }
-
-    /**
-     * Gets the canonical spill slot for this interval.
-     */
-    CiStackSlot spillSlot() {
-        return splitParent().spillSlot;
-    }
-
-    void setSpillSlot(CiStackSlot slot) {
-        assert splitParent().spillSlot == null : "connot overwrite existing spill slot";
-        splitParent().spillSlot = slot;
-    }
-
-    Interval currentSplitChild() {
-        return splitParent().currentSplitChild;
-    }
-
-    void makeCurrentSplitChild() {
-        splitParent().currentSplitChild = this;
-    }
-
-    boolean insertMoveWhenActivated() {
-        return insertMoveWhenActivated;
-    }
-
-    void setInsertMoveWhenActivated(boolean b) {
-        insertMoveWhenActivated = b;
-    }
-
-    // for spill optimization
-    public SpillState spillState() {
-        return splitParent().spillState;
-    }
-
-    int spillDefinitionPos() {
-        return splitParent().spillDefinitionPos;
-    }
-
-    void setSpillState(SpillState state) {
-        assert state.ordinal() >= spillState().ordinal() : "state cannot decrease";
-        splitParent().spillState = state;
-    }
-
-    void setSpillDefinitionPos(int pos) {
-        assert spillDefinitionPos() == -1 : "cannot set the position twice";
-        splitParent().spillDefinitionPos = pos;
-    }
-
-    // returns true if this interval has a shadow copy on the stack that is always correct
-    boolean alwaysInMemory() {
-        return splitParent().spillState == SpillState.StoreAtDefinition || splitParent().spillState == SpillState.StartInMemory;
-    }
-
-    void removeFirstUsePos() {
-        usePosList.removeLowestUsePos();
-    }
-
-    // test intersection
-    boolean intersects(Interval i) {
-        return first.intersects(i.first);
-    }
-
-    int intersectsAt(Interval i) {
-        return first.intersectsAt(i.first);
-    }
-
-    // range iteration
-    void rewindRange() {
-        current = first;
-    }
-
-    void nextRange() {
-        assert this != EndMarker : "not allowed on sentinel";
-        current = current.next;
-    }
-
-    int currentFrom() {
-        return current.from;
-    }
-
-    int currentTo() {
-        return current.to;
-    }
-
-    boolean currentAtEnd() {
-        return current == Range.EndMarker;
-    }
-
-    boolean currentIntersects(Interval it) {
-        return current.intersects(it.current);
-    }
-
-    int currentIntersectsAt(Interval it) {
-        return current.intersectsAt(it.current);
-    }
-
-    /**
-     * Sentinel interval to denote the end of an interval list.
-     */
-    static final Interval EndMarker = new Interval(CiValue.IllegalValue, -1);
-
-    Interval(CiValue operand, int operandNumber) {
-        assert operand != null;
-        this.operand = operand;
-        this.operandNumber = operandNumber;
-        if (isRegister(operand)) {
-            location = operand;
-        } else {
-            assert isIllegal(operand) || isVariable(operand);
-        }
-        this.kind = CiKind.Illegal;
-        this.first = Range.EndMarker;
-        this.usePosList = new UsePosList(4);
-        this.current = Range.EndMarker;
-        this.next = EndMarker;
-        this.cachedTo = -1;
-        this.spillState = SpillState.NoDefinitionFound;
-        this.spillDefinitionPos = -1;
-        splitParent = this;
-        currentSplitChild = this;
-    }
-
-    int calcTo() {
-        assert first != Range.EndMarker : "interval has no range";
-
-        Range r = first;
-        while (r.next != Range.EndMarker) {
-            r = r.next;
-        }
-        return r.to;
-    }
-
-    // consistency check of split-children
-    boolean checkSplitChildren() {
-        if (!splitChildren.isEmpty()) {
-            assert isSplitParent() : "only split parents can have children";
-
-            for (int i = 0; i < splitChildren.size(); i++) {
-                Interval i1 = splitChildren.get(i);
-
-                assert i1.splitParent() == this : "not a split child of this interval";
-                assert i1.kind()  == kind() : "must be equal for all split children";
-                assert i1.spillSlot() == spillSlot() : "must be equal for all split children";
-
-                for (int j = i + 1; j < splitChildren.size(); j++) {
-                    Interval i2 = splitChildren.get(j);
-
-                    assert i1.operand != i2.operand : "same register number";
-
-                    if (i1.from() < i2.from()) {
-                        assert i1.to() <= i2.from() && i1.to() < i2.to() : "intervals overlapping";
-                    } else {
-                        assert i2.from() < i1.from() : "intervals start at same opId";
-                        assert i2.to() <= i1.from() && i2.to() < i1.to() : "intervals overlapping";
-                    }
-                }
-            }
-        }
-
-        return true;
-    }
-
-    public Interval locationHint(boolean searchSplitChild) {
-        if (!searchSplitChild) {
-            return locationHint;
-        }
-
-        if (locationHint != null) {
-            assert locationHint.isSplitParent() : "ony split parents are valid hint registers";
-
-            if (locationHint.location != null && isRegister(locationHint.location)) {
-                return locationHint;
-            } else if (!locationHint.splitChildren.isEmpty()) {
-                // search the first split child that has a register assigned
-                int len = locationHint.splitChildren.size();
-                for (int i = 0; i < len; i++) {
-                    Interval interval = locationHint.splitChildren.get(i);
-                    if (interval.location != null && isRegister(interval.location)) {
-                        return interval;
-                    }
-                }
-            }
-        }
-
-        // no hint interval found that has a register assigned
-        return null;
-    }
-
-    Interval getSplitChildAtOpId(int opId, LIRInstruction.OperandMode mode, LinearScan allocator) {
-        assert isSplitParent() : "can only be called for split parents";
-        assert opId >= 0 : "invalid opId (method cannot be called for spill moves)";
-
-        if (splitChildren.isEmpty()) {
-            assert this.covers(opId, mode) : this + " does not cover " + opId;
-            return this;
-        } else {
-            Interval result = null;
-            int len = splitChildren.size();
-
-            // in outputMode, the end of the interval (opId == cur.to()) is not valid
-            int toOffset = (mode == LIRInstruction.OperandMode.Output ? 0 : 1);
-
-            int i;
-            for (i = 0; i < len; i++) {
-                Interval cur = splitChildren.get(i);
-                if (cur.from() <= opId && opId < cur.to() + toOffset) {
-                    if (i > 0) {
-                        // exchange current split child to start of list (faster access for next call)
-                        Util.atPutGrow(splitChildren, i, splitChildren.get(0), null);
-                        Util.atPutGrow(splitChildren, 0, cur, null);
-                    }
-
-                    // interval found
-                    result = cur;
-                    break;
-                }
-            }
-
-            assert checkSplitChild(result, opId, allocator, toOffset, mode);
-            return result;
-        }
-    }
-
-    private boolean checkSplitChild(Interval result, int opId, LinearScan allocator, int toOffset, LIRInstruction.OperandMode mode) {
-        if (result == null) {
-            // this is an error
-            StringBuilder msg = new StringBuilder(this.toString()).append(" has no child at ").append(opId);
-            if (!splitChildren.isEmpty()) {
-                Interval firstChild = splitChildren.get(0);
-                Interval lastChild = splitChildren.get(splitChildren.size() - 1);
-                msg.append(" (first = ").append(firstChild).append(", last = ").append(lastChild).append(")");
-            }
-            throw new GraalInternalError("Linear Scan Error: %s", msg);
-        }
-
-        if (!splitChildren.isEmpty()) {
-            for (Interval interval : splitChildren) {
-                if (interval != result && interval.from() <= opId && opId < interval.to() + toOffset) {
-                    TTY.println(String.format("two valid result intervals found for opId %d: %d and %d", opId, result.operandNumber, interval.operandNumber));
-                    TTY.println(result.logString(allocator));
-                    TTY.println(interval.logString(allocator));
-                    throw new CiBailout("two valid result intervals found");
-                }
-            }
-        }
-        assert result.covers(opId, mode) : "opId not covered by interval";
-        return true;
-    }
-
-    // returns the last split child that ends before the given opId
-    Interval getSplitChildBeforeOpId(int opId) {
-        assert opId >= 0 : "invalid opId";
-
-        Interval parent = splitParent();
-        Interval result = null;
-
-        assert !parent.splitChildren.isEmpty() : "no split children available";
-        int len = parent.splitChildren.size();
-
-        for (int i = len - 1; i >= 0; i--) {
-            Interval cur = parent.splitChildren.get(i);
-            if (cur.to() <= opId && (result == null || result.to() < cur.to())) {
-                result = cur;
-            }
-        }
-
-        assert result != null : "no split child found";
-        return result;
-    }
-
-    // checks if opId is covered by any split child
-    boolean splitChildCovers(int opId, LIRInstruction.OperandMode mode) {
-        assert isSplitParent() : "can only be called for split parents";
-        assert opId >= 0 : "invalid opId (method can not be called for spill moves)";
-
-        if (splitChildren.isEmpty()) {
-            // simple case if interval was not split
-            return covers(opId, mode);
-
-        } else {
-            // extended case: check all split children
-            int len = splitChildren.size();
-            for (int i = 0; i < len; i++) {
-                Interval cur = splitChildren.get(i);
-                if (cur.covers(opId, mode)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-    }
-
-    // Note: use positions are sorted descending . first use has highest index
-    int firstUsage(RegisterPriority minRegisterPriority) {
-        assert isVariable(operand) : "cannot access use positions for fixed intervals";
-
-        for (int i = usePosList.size() - 1; i >= 0; --i) {
-            RegisterPriority registerPriority = usePosList.registerPriority(i);
-            if (registerPriority.greaterEqual(minRegisterPriority)) {
-                return usePosList.usePos(i);
-            }
-        }
-        return Integer.MAX_VALUE;
-    }
-
-    int nextUsage(RegisterPriority minRegisterPriority, int from) {
-        assert isVariable(operand) : "cannot access use positions for fixed intervals";
-
-        for (int i = usePosList.size() - 1; i >= 0; --i) {
-            int usePos = usePosList.usePos(i);
-            if (usePos >= from && usePosList.registerPriority(i).greaterEqual(minRegisterPriority)) {
-                return usePos;
-            }
-        }
-        return Integer.MAX_VALUE;
-    }
-
-    int nextUsageExact(RegisterPriority exactRegisterPriority, int from) {
-        assert isVariable(operand) : "cannot access use positions for fixed intervals";
-
-        for (int i = usePosList.size() - 1; i >= 0; --i) {
-            int usePos = usePosList.usePos(i);
-            if (usePos >= from && usePosList.registerPriority(i) == exactRegisterPriority) {
-                return usePos;
-            }
-        }
-        return Integer.MAX_VALUE;
-    }
-
-    int previousUsage(RegisterPriority minRegisterPriority, int from) {
-        assert isVariable(operand) : "cannot access use positions for fixed intervals";
-
-        int prev = 0;
-        for (int i = usePosList.size() - 1; i >= 0; --i) {
-            int usePos = usePosList.usePos(i);
-            if (usePos > from) {
-                return prev;
-            }
-            if (usePosList.registerPriority(i).greaterEqual(minRegisterPriority)) {
-                prev = usePos;
-            }
-        }
-        return prev;
-    }
-
-    void addUsePos(int pos, RegisterPriority registerPriority) {
-        assert covers(pos, LIRInstruction.OperandMode.Input) : "use position not covered by live range";
-
-        // do not add use positions for precolored intervals because they are never used
-        if (registerPriority != RegisterPriority.None && isVariable(operand)) {
-            if (GraalOptions.DetailedAsserts) {
-                for (int i = 0; i < usePosList.size(); i++) {
-                    assert pos <= usePosList.usePos(i) : "already added a use-position with lower position";
-                    if (i > 0) {
-                        assert usePosList.usePos(i) < usePosList.usePos(i - 1) : "not sorted descending";
-                    }
-                }
-            }
-
-            // Note: addUse is called in descending order, so list gets sorted
-            // automatically by just appending new use positions
-            int len = usePosList.size();
-            if (len == 0 || usePosList.usePos(len - 1) > pos) {
-                usePosList.add(pos, registerPriority);
-            } else if (usePosList.registerPriority(len - 1).lessThan(registerPriority)) {
-                assert usePosList.usePos(len - 1) == pos : "list not sorted correctly";
-                usePosList.setRegisterPriority(len - 1, registerPriority);
-            }
-        }
-    }
-
-    void addRange(int from, int to) {
-        assert from < to : "invalid range";
-        assert first() == Range.EndMarker || to < first().next.from : "not inserting at begin of interval";
-        assert from <= first().to : "not inserting at begin of interval";
-
-        if (first.from <= to) {
-            assert first != Range.EndMarker;
-            // join intersecting ranges
-            first.from = Math.min(from, first().from);
-            first.to = Math.max(to, first().to);
-        } else {
-            // insert new range
-            first = new Range(from, to, first());
-        }
-    }
-
-    Interval newSplitChild(LinearScan allocator) {
-        // allocate new interval
-        Interval parent = splitParent();
-        Interval result = allocator.createDerivedInterval(parent);
-        result.setKind(kind());
-
-        result.splitParent = parent;
-        result.setLocationHint(parent);
-
-        // insert new interval in children-list of parent
-        if (parent.splitChildren.isEmpty()) {
-            assert isSplitParent() : "list must be initialized at first split";
-
-            // Create new non-shared list
-            parent.splitChildren = new ArrayList<>(4);
-            parent.splitChildren.add(this);
-        }
-        parent.splitChildren.add(result);
-
-        return result;
-    }
-
-    /**
-     * Splits this interval at a specified position and returns the remainder as a new <i>child</i> interval
-     * of this interval's {@linkplain #splitParent() parent} interval.
-     * <p>
-     * When an interval is split, a bi-directional link is established between the original <i>parent</i>
-     * interval and the <i>children</i> intervals that are split off this interval.
-     * When a split child is split again, the new created interval is a direct child
-     * of the original parent. That is, there is no tree of split children stored, just a flat list.
-     * All split children are spilled to the same {@linkplain #spillSlot spill slot}.
-     *
-     * @param splitPos the position at which to split this interval
-     * @param allocator the register allocator context
-     * @return the child interval split off from this interval
-     */
-    Interval split(int splitPos, LinearScan allocator) {
-        assert isVariable(operand) : "cannot split fixed intervals";
-
-        // allocate new interval
-        Interval result = newSplitChild(allocator);
-
-        // split the ranges
-        Range prev = null;
-        Range cur = first;
-        while (cur != Range.EndMarker && cur.to <= splitPos) {
-            prev = cur;
-            cur = cur.next;
-        }
-        assert cur != Range.EndMarker : "split interval after end of last range";
-
-        if (cur.from < splitPos) {
-            result.first = new Range(splitPos, cur.to, cur.next);
-            cur.to = splitPos;
-            cur.next = Range.EndMarker;
-
-        } else {
-            assert prev != null : "split before start of first range";
-            result.first = cur;
-            prev.next = Range.EndMarker;
-        }
-        result.current = result.first;
-        cachedTo = -1; // clear cached value
-
-        // split list of use positions
-        result.usePosList = usePosList.splitAt(splitPos);
-
-        if (GraalOptions.DetailedAsserts) {
-            for (int i = 0; i < usePosList.size(); i++) {
-                assert usePosList.usePos(i) < splitPos;
-            }
-            for (int i = 0; i < result.usePosList.size(); i++) {
-                assert result.usePosList.usePos(i) >= splitPos;
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Splits this interval at a specified position and returns
-     * the head as a new interval (this interval is the tail).
-     *
-     * Currently, only the first range can be split, and the new interval must not have split positions
-     */
-    Interval splitFromStart(int splitPos, LinearScan allocator) {
-        assert isVariable(operand) : "cannot split fixed intervals";
-        assert splitPos > from() && splitPos < to() : "can only split inside interval";
-        assert splitPos > first.from && splitPos <= first.to : "can only split inside first range";
-        assert firstUsage(RegisterPriority.None) > splitPos : "can not split when use positions are present";
-
-        // allocate new interval
-        Interval result = newSplitChild(allocator);
-
-        // the new interval has only one range (checked by assertion above,
-        // so the splitting of the ranges is very simple
-        result.addRange(first.from, splitPos);
-
-        if (splitPos == first.to) {
-            assert first.next != Range.EndMarker : "must not be at end";
-            first = first.next;
-        } else {
-            first.from = splitPos;
-        }
-
-        return result;
-    }
-
-    // returns true if the opId is inside the interval
-    boolean covers(int opId, LIRInstruction.OperandMode mode) {
-        Range cur = first;
-
-        while (cur != Range.EndMarker && cur.to < opId) {
-            cur = cur.next;
-        }
-        if (cur != Range.EndMarker) {
-            assert cur.to != cur.next.from : "ranges not separated";
-
-            if (mode == LIRInstruction.OperandMode.Output) {
-                return cur.from <= opId && opId < cur.to;
-            } else {
-                return cur.from <= opId && opId <= cur.to;
-            }
-        }
-        return false;
-    }
-
-    // returns true if the interval has any hole between holeFrom and holeTo
-    // (even if the hole has only the length 1)
-    boolean hasHoleBetween(int holeFrom, int holeTo) {
-        assert holeFrom < holeTo : "check";
-        assert from() <= holeFrom && holeTo <= to() : "index out of interval";
-
-        Range cur = first;
-        while (cur != Range.EndMarker) {
-            assert cur.to < cur.next.from : "no space between ranges";
-
-            // hole-range starts before this range . hole
-            if (holeFrom < cur.from) {
-                return true;
-
-                // hole-range completely inside this range . no hole
-            } else {
-                if (holeTo <= cur.to) {
-                    return false;
-
-                    // overlapping of hole-range with this range . hole
-                } else {
-                    if (holeFrom <= cur.to) {
-                        return true;
-                    }
-                }
-            }
-
-            cur = cur.next;
-        }
-
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        String from = "?";
-        String to = "?";
-        if (first != null && first != Range.EndMarker) {
-            from = String.valueOf(from());
-            to = String.valueOf(to());
-        }
-        String locationString = this.location == null ? "" : "@" + this.location;
-        return operandNumber + ":" + operand + (isRegister(operand) ? "" : locationString) + "[" + from + "," + to + "]";
-    }
-
-    /**
-     * Gets the use position information for this interval.
-     */
-    public UsePosList usePosList() {
-        return usePosList;
-    }
-
-    /**
-     * Gets a single line string for logging the details of this interval to a log stream.
-     *
-     * @param allocator the register allocator context
-     */
-    public String logString(LinearScan allocator) {
-        StringBuilder buf = new StringBuilder(100);
-        buf.append(operandNumber).append(':').append(operand).append(' ');
-        if (!isRegister(operand)) {
-            if (location != null) {
-                buf.append("location{").append(location).append("} ");
-            }
-        }
-
-        buf.append("hints{").append(splitParent.operandNumber);
-        Interval hint = locationHint(false);
-        if (hint != null && hint.operandNumber != splitParent.operandNumber) {
-            buf.append(", ").append(hint.operandNumber);
-        }
-        buf.append("} ranges{");
-
-        // print ranges
-        Range cur = first;
-        while (cur != Range.EndMarker) {
-            if (cur != first) {
-                buf.append(", ");
-            }
-            buf.append(cur);
-            cur = cur.next;
-            assert cur != null : "range list not closed with range sentinel";
-        }
-        buf.append("} uses{");
-
-        // print use positions
-        int prev = 0;
-        for (int i = usePosList.size() - 1; i >= 0; --i) {
-            assert prev < usePosList.usePos(i) : "use positions not sorted";
-            if (i != usePosList.size() - 1) {
-                buf.append(", ");
-            }
-            buf.append(usePosList.usePos(i)).append(':').append(usePosList.registerPriority(i));
-            prev = usePosList.usePos(i);
-        }
-        return buf.append("} spill-state{").append(spillState()).append("}").toString();
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.alloc.Interval.RegisterBinding;
-import com.oracle.graal.compiler.alloc.Interval.RegisterBindingLists;
-import com.oracle.graal.compiler.alloc.Interval.State;
-
-/**
- */
-public class IntervalWalker {
-
-    protected final LinearScan allocator;
-
-    /**
-     * Sorted list of intervals, not live before the current position.
-     */
-    RegisterBindingLists unhandledLists;
-
-    /**
-     * Sorted list of intervals, live at the current position.
-     */
-    RegisterBindingLists activeLists;
-
-    /**
-     * Sorted list of intervals in a life time hole at the current position.
-     */
-    RegisterBindingLists inactiveLists;
-
-    /**
-     * The current interval (taken from the unhandled list) being processed.
-     */
-    protected Interval currentInterval;
-
-    /**
-     * The current position (intercept point through the intervals).
-     */
-    protected int currentPosition;
-
-    /**
-     * The binding of the current interval being processed.
-     */
-    protected RegisterBinding currentBinding;
-
-    /**
-     * Processes the {@linkplain #currentInterval} interval in an attempt to allocate a physical
-     * register to it and thus allow it to be moved to a list of {@linkplain #activeLists active} intervals.
-     *
-     * @return {@code true} if a register was allocated to the {@linkplain #currentInterval} interval
-     */
-    boolean activateCurrent() {
-        return true;
-    }
-
-    void walkBefore(int lirOpId) {
-        walkTo(lirOpId - 1);
-    }
-
-    void walk() {
-        walkTo(Integer.MAX_VALUE);
-    }
-
-    /**
-     * Creates a new interval walker.
-     *
-     * @param allocator the register allocator context
-     * @param unhandledFixed the list of unhandled {@linkplain RegisterBinding#Fixed fixed} intervals
-     * @param unhandledAny the list of unhandled {@linkplain RegisterBinding#Any non-fixed} intervals
-     */
-    IntervalWalker(LinearScan allocator, Interval unhandledFixed, Interval unhandledAny) {
-        this.allocator = allocator;
-
-        unhandledLists = new RegisterBindingLists(unhandledFixed, unhandledAny);
-        activeLists = new RegisterBindingLists(Interval.EndMarker, Interval.EndMarker);
-        inactiveLists = new RegisterBindingLists(Interval.EndMarker, Interval.EndMarker);
-        currentPosition = -1;
-        currentInterval = null;
-        nextInterval();
-    }
-
-    void removeFromList(Interval interval) {
-        if (interval.state == State.Active) {
-            activeLists.remove(RegisterBinding.Any, interval);
-        } else {
-            assert interval.state == State.Inactive : "invalid state";
-            inactiveLists.remove(RegisterBinding.Any, interval);
-        }
-    }
-
-    void walkTo(State state, int from) {
-        assert state == State.Active || state == State.Inactive : "wrong state";
-        for (RegisterBinding binding : RegisterBinding.VALUES) {
-            Interval prevprev = null;
-            Interval prev = (state == State.Active) ? activeLists.get(binding) : inactiveLists.get(binding);
-            Interval next = prev;
-            while (next.currentFrom() <= from) {
-                Interval cur = next;
-                next = cur.next;
-
-                boolean rangeHasChanged = false;
-                while (cur.currentTo() <= from) {
-                    cur.nextRange();
-                    rangeHasChanged = true;
-                }
-
-                // also handle move from inactive list to active list
-                rangeHasChanged = rangeHasChanged || (state == State.Inactive && cur.currentFrom() <= from);
-
-                if (rangeHasChanged) {
-                    // remove cur from list
-                    if (prevprev == null) {
-                        if (state == State.Active) {
-                            activeLists.set(binding, next);
-                        } else {
-                            inactiveLists.set(binding, next);
-                        }
-                    } else {
-                        prevprev.next = next;
-                    }
-                    prev = next;
-                    if (cur.currentAtEnd()) {
-                        // move to handled state (not maintained as a list)
-                        cur.state = State.Handled;
-                        intervalMoved(cur, state, State.Handled);
-                    } else if (cur.currentFrom() <= from) {
-                        // sort into active list
-                        activeLists.addToListSortedByCurrentFromPositions(binding, cur);
-                        cur.state = State.Active;
-                        if (prev == cur) {
-                            assert state == State.Active : "check";
-                            prevprev = prev;
-                            prev = cur.next;
-                        }
-                        intervalMoved(cur, state, State.Active);
-                    } else {
-                        // sort into inactive list
-                        inactiveLists.addToListSortedByCurrentFromPositions(binding, cur);
-                        cur.state = State.Inactive;
-                        if (prev == cur) {
-                            assert state == State.Inactive : "check";
-                            prevprev = prev;
-                            prev = cur.next;
-                        }
-                        intervalMoved(cur, state, State.Inactive);
-                    }
-                } else {
-                    prevprev = prev;
-                    prev = cur.next;
-                }
-            }
-        }
-    }
-
-    void nextInterval() {
-        RegisterBinding binding;
-        Interval any = unhandledLists.any;
-        Interval fixed = unhandledLists.fixed;
-
-        if (any != Interval.EndMarker) {
-            // intervals may start at same position . prefer fixed interval
-            binding = fixed != Interval.EndMarker && fixed.from() <= any.from() ? RegisterBinding.Fixed : RegisterBinding.Any;
-
-            assert binding == RegisterBinding.Fixed && fixed.from() <= any.from() || binding == RegisterBinding.Any && any.from() <= fixed.from() : "wrong interval!!!";
-            assert any == Interval.EndMarker || fixed == Interval.EndMarker || any.from() != fixed.from() || binding == RegisterBinding.Fixed : "if fixed and any-Interval start at same position, fixed must be processed first";
-
-        } else if (fixed != Interval.EndMarker) {
-            binding = RegisterBinding.Fixed;
-        } else {
-            currentInterval = null;
-            return;
-        }
-        currentBinding = binding;
-        currentInterval = unhandledLists.get(binding);
-        unhandledLists.set(binding, currentInterval.next);
-        currentInterval.next = Interval.EndMarker;
-        currentInterval.rewindRange();
-    }
-
-    void walkTo(int toOpId) {
-        assert currentPosition <= toOpId : "can not walk backwards";
-        while (currentInterval != null) {
-            boolean isActive = currentInterval.from() <= toOpId;
-            int opId = isActive ? currentInterval.from() : toOpId;
-
-            if (GraalOptions.TraceLinearScanLevel >= 2 && !TTY.isSuppressed()) {
-                if (currentPosition < opId) {
-                    TTY.println();
-                    TTY.println("walkTo(%d) *", opId);
-                }
-            }
-
-            // set currentPosition prior to call of walkTo
-            currentPosition = opId;
-
-            // call walkTo even if currentPosition == id
-            walkTo(State.Active, opId);
-            walkTo(State.Inactive, opId);
-
-            if (isActive) {
-                currentInterval.state = State.Active;
-                if (activateCurrent()) {
-                    activeLists.addToListSortedByCurrentFromPositions(currentBinding, currentInterval);
-                    intervalMoved(currentInterval, State.Unhandled, State.Active);
-                }
-
-                nextInterval();
-            } else {
-                return;
-            }
-        }
-    }
-
-    private void intervalMoved(Interval interval, State from, State to) {
-        // intervalMoved() is called whenever an interval moves from one interval list to another.
-        // In the implementation of this method it is prohibited to move the interval to any list.
-        if (GraalOptions.TraceLinearScanLevel >= 4 && !TTY.isSuppressed()) {
-            TTY.print(from.toString() + " to " + to.toString());
-            TTY.fillTo(23);
-            TTY.out().println(interval.logString(allocator));
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2100 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-import static com.oracle.max.cri.ci.CiUtil.*;
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.alloc.Interval.RegisterBinding;
-import com.oracle.graal.compiler.alloc.Interval.RegisterPriority;
-import com.oracle.graal.compiler.alloc.Interval.SpillState;
-import com.oracle.graal.compiler.gen.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.StandardOp.*;
-import com.oracle.graal.lir.cfg.*;
-
-/**
- * An implementation of the linear scan register allocator algorithm described
- * in <a href="http://doi.acm.org/10.1145/1064979.1064998">"Optimized Interval Splitting in a Linear Scan Register Allocator"</a>
- * by Christian Wimmer and Hanspeter Moessenboeck.
- */
-public final class LinearScan {
-
-    final CiTarget target;
-    final RiMethod method;
-    final LIR ir;
-    final LIRGenerator gen;
-    final FrameMap frameMap;
-    final RiRegisterAttributes[] registerAttributes;
-    final CiRegister[] registers;
-
-    private static final int INITIAL_SPLIT_INTERVALS_CAPACITY = 32;
-
-    public static class BlockData {
-        /**
-         * Bit map specifying which {@linkplain OperandPool operands} are live upon entry to this block.
-         * These are values used in this block or any of its successors where such value are not defined
-         * in this block.
-         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
-         */
-        public BitMap liveIn;
-
-        /**
-         * Bit map specifying which {@linkplain OperandPool operands} are live upon exit from this block.
-         * These are values used in a successor block that are either defined in this block or were live
-         * upon entry to this block.
-         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
-         */
-        public BitMap liveOut;
-
-        /**
-         * Bit map specifying which {@linkplain OperandPool operands} are used (before being defined) in this block.
-         * That is, these are the values that are live upon entry to the block.
-         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
-         */
-        public BitMap liveGen;
-
-        /**
-         * Bit map specifying which {@linkplain OperandPool operands} are defined/overwritten in this block.
-         * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.sun.cri.ci.CiValue) operand number}.
-         */
-        public BitMap liveKill;
-    }
-
-    public final BlockMap<BlockData> blockData;
-
-    /**
-     * List of blocks in linear-scan order. This is only correct as long as the CFG does not change.
-     */
-    final Block[] sortedBlocks;
-
-    /**
-     * Map from {@linkplain #operandNumber(CiValue) operand numbers} to intervals.
-     */
-    Interval[] intervals;
-
-    /**
-     * The number of valid entries in {@link #intervals}.
-     */
-    int intervalsSize;
-
-    /**
-     * The index of the first entry in {@link #intervals} for a {@linkplain #createDerivedInterval(Interval) derived interval}.
-     */
-    int firstDerivedIntervalIndex = -1;
-
-    /**
-     * Intervals sorted by {@link Interval#from()}.
-     */
-    Interval[] sortedIntervals;
-
-    /**
-     * Map from an instruction {@linkplain LIRInstruction#id id} to the instruction.
-     * Entries should be retrieved with {@link #instructionForId(int)} as the id is
-     * not simply an index into this array.
-     */
-    LIRInstruction[] opIdToInstructionMap;
-
-    /**
-     * Map from an instruction {@linkplain LIRInstruction#id id} to the {@linkplain
-     * Block block} containing the instruction. Entries should be retrieved with
-     * {@link #blockForId(int)} as the id is not simply an index into this array.
-     */
-    Block[] opIdToBlockMap;
-
-    /**
-     * Bit set for each variable that is contained in each loop.
-     */
-    BitMap2D intervalInLoop;
-
-    /**
-     * The variable operands allocated from this pool. The {@linkplain #operandNumber(CiValue) number}
-     * of the first variable operand in this pool is one greater than the number of the last
-     * register operand in the pool.
-     */
-    private final ArrayList<Variable> variables;
-
-    /**
-     * The {@linkplain #operandNumber(CiValue) number} of the first variable operand
-     * {@linkplain #newVariable(CiKind) allocated} from this pool.
-     */
-    private final int firstVariableNumber;
-
-
-    public LinearScan(CiTarget target, RiResolvedMethod method, LIR ir, LIRGenerator gen, FrameMap frameMap) {
-        this.target = target;
-        this.method = method;
-        this.ir = ir;
-        this.gen = gen;
-        this.frameMap = frameMap;
-        this.sortedBlocks = ir.linearScanOrder().toArray(new Block[ir.linearScanOrder().size()]);
-        this.registerAttributes = frameMap.registerConfig.getAttributesMap();
-
-        this.registers = target.arch.registers;
-        this.firstVariableNumber = registers.length;
-        this.variables = new ArrayList<>(ir.numVariables() * 3 / 2);
-        this.blockData = new BlockMap<>(ir.cfg);
-    }
-
-    public static boolean isVariableOrRegister(CiValue value) {
-        return isVariable(value) || isRegister(value);
-    }
-
-
-    /**
-     * Converts an operand (variable or register) to an index in a flat address space covering all the
-     * {@linkplain Variable variables} and {@linkplain CiRegisterValue registers} being processed by this
-     * allocator.
-     */
-    private int operandNumber(CiValue operand) {
-        if (isRegister(operand)) {
-            int number = asRegister(operand).number;
-            assert number < firstVariableNumber;
-            return number;
-        }
-        assert isVariable(operand) : operand;
-        return firstVariableNumber + ((Variable) operand).index;
-    }
-
-    /**
-     * Gets the operand denoted by a given operand number.
-     */
-    private CiValue operandFor(int operandNumber) {
-        if (operandNumber < firstVariableNumber) {
-            assert operandNumber >= 0;
-            return registers[operandNumber].asValue();
-        }
-        int index = operandNumber - firstVariableNumber;
-        Variable variable = variables.get(index);
-        assert variable.index == index;
-        return variable;
-    }
-
-    /**
-     * Gets the number of operands. This value will increase by 1 for new variable.
-     */
-    private int operandSize() {
-        return firstVariableNumber + ir.numVariables();
-    }
-
-    /**
-     * Gets the highest operand number for a register operand. This value will never change.
-     */
-    public int maxRegisterNumber() {
-        return firstVariableNumber - 1;
-    }
-
-
-    static final IntervalPredicate IS_PRECOLORED_INTERVAL = new IntervalPredicate() {
-        @Override
-        public boolean apply(Interval i) {
-            return isRegister(i.operand);
-        }
-    };
-
-    static final IntervalPredicate IS_VARIABLE_INTERVAL = new IntervalPredicate() {
-        @Override
-        public boolean apply(Interval i) {
-            return isVariable(i.operand);
-        }
-    };
-
-    static final IntervalPredicate IS_OOP_INTERVAL = new IntervalPredicate() {
-        @Override
-        public boolean apply(Interval i) {
-            return !isRegister(i.operand) && i.kind()  == CiKind.Object;
-        }
-    };
-
-    /**
-     * Gets an object describing the attributes of a given register according to this register configuration.
-     */
-    RiRegisterAttributes attributes(CiRegister reg) {
-        return registerAttributes[reg.number];
-    }
-
-    void assignSpillSlot(Interval interval) {
-        // assign the canonical spill slot of the parent (if a part of the interval
-        // is already spilled) or allocate a new spill slot
-        if (interval.spillSlot() != null) {
-            interval.assignLocation(interval.spillSlot());
-        } else {
-            CiStackSlot slot = frameMap.allocateSpillSlot(interval.kind());
-            interval.setSpillSlot(slot);
-            interval.assignLocation(slot);
-        }
-    }
-
-    /**
-     * Creates a new interval.
-     *
-     * @param operand the operand for the interval
-     * @return the created interval
-     */
-    Interval createInterval(CiValue operand) {
-        assert isProcessed(operand);
-        assert isLegal(operand);
-        int operandNumber = operandNumber(operand);
-        Interval interval = new Interval(operand, operandNumber);
-        assert operandNumber < intervalsSize;
-        assert intervals[operandNumber] == null;
-        intervals[operandNumber] = interval;
-        return interval;
-    }
-
-    /**
-     * Creates an interval as a result of splitting or spilling another interval.
-     *
-     * @param source an interval being split of spilled
-     * @return a new interval derived from {@code source}
-     */
-    Interval createDerivedInterval(Interval source) {
-        if (firstDerivedIntervalIndex == -1) {
-            firstDerivedIntervalIndex = intervalsSize;
-        }
-        if (intervalsSize == intervals.length) {
-            intervals = Arrays.copyOf(intervals, intervals.length * 2);
-        }
-        intervalsSize++;
-        Variable variable = new Variable(source.kind(), ir.nextVariable(), asVariable(source.operand).flag);
-        assert variables.size() == variable.index;
-        variables.add(variable);
-
-        Interval interval = createInterval(variable);
-        assert intervals[intervalsSize - 1] == interval;
-        return interval;
-    }
-
-    // access to block list (sorted in linear scan order)
-    int blockCount() {
-        assert sortedBlocks.length == ir.linearScanOrder().size() : "invalid cached block list";
-        return sortedBlocks.length;
-    }
-
-    Block blockAt(int index) {
-        assert sortedBlocks[index] == ir.linearScanOrder().get(index) : "invalid cached block list";
-        return sortedBlocks[index];
-    }
-
-    /**
-     * Gets the size of the {@link Block#liveIn} and {@link Block#liveOut} sets for a basic block. These sets do
-     * not include any operands allocated as a result of creating {@linkplain #createDerivedInterval(Interval) derived
-     * intervals}.
-     */
-    int liveSetSize() {
-        return firstDerivedIntervalIndex == -1 ? operandSize() : firstDerivedIntervalIndex;
-    }
-
-    int numLoops() {
-        return ir.cfg.getLoops().length;
-    }
-
-    boolean isIntervalInLoop(int interval, int loop) {
-        return intervalInLoop.at(interval, loop);
-    }
-
-    Interval intervalFor(CiValue operand) {
-        int operandNumber = operandNumber(operand);
-        assert operandNumber < intervalsSize;
-        return intervals[operandNumber];
-    }
-
-    /**
-     * Gets the highest instruction id allocated by this object.
-     */
-    int maxOpId() {
-        assert opIdToInstructionMap.length > 0 : "no operations";
-        return (opIdToInstructionMap.length - 1) << 1;
-    }
-
-    /**
-     * Converts an {@linkplain LIRInstruction#id instruction id} to an instruction index.
-     * All LIR instructions in a method have an index one greater than their linear-scan order predecesor
-     * with the first instruction having an index of 0.
-     */
-    static int opIdToIndex(int opId) {
-        return opId >> 1;
-    }
-
-    /**
-     * Retrieves the {@link LIRInstruction} based on its {@linkplain LIRInstruction#id id}.
-     *
-     * @param opId an instruction {@linkplain LIRInstruction#id id}
-     * @return the instruction whose {@linkplain LIRInstruction#id} {@code == id}
-     */
-    LIRInstruction instructionForId(int opId) {
-        assert isEven(opId) : "opId not even";
-        LIRInstruction instr = opIdToInstructionMap[opIdToIndex(opId)];
-        assert instr.id() == opId;
-        return instr;
-    }
-
-    /**
-     * Gets the block containing a given instruction.
-     *
-     * @param opId an instruction {@linkplain LIRInstruction#id id}
-     * @return the block containing the instruction denoted by {@code opId}
-     */
-    Block blockForId(int opId) {
-        assert opIdToBlockMap.length > 0 && opId >= 0 && opId <= maxOpId() + 1 : "opId out of range";
-        return opIdToBlockMap[opIdToIndex(opId)];
-    }
-
-    boolean isBlockBegin(int opId) {
-        return opId == 0 || blockForId(opId) != blockForId(opId - 1);
-    }
-
-    boolean coversBlockBegin(int opId1, int opId2) {
-        return blockForId(opId1) != blockForId(opId2);
-    }
-
-    /**
-     * Determines if an {@link LIRInstruction} destroys all caller saved registers.
-     *
-     * @param opId an instruction {@linkplain LIRInstruction#id id}
-     * @return {@code true} if the instruction denoted by {@code id} destroys all caller saved registers.
-     */
-    boolean hasCall(int opId) {
-        assert isEven(opId) : "opId not even";
-        return instructionForId(opId).hasCall();
-    }
-
-    /**
-     * Eliminates moves from register to stack if the stack slot is known to be correct.
-     */
-    void changeSpillDefinitionPos(Interval interval, int defPos) {
-        assert interval.isSplitParent() : "can only be called for split parents";
-
-        switch (interval.spillState()) {
-            case NoDefinitionFound:
-                assert interval.spillDefinitionPos() == -1 : "must no be set before";
-                interval.setSpillDefinitionPos(defPos);
-                interval.setSpillState(SpillState.NoSpillStore);
-                break;
-
-            case NoSpillStore:
-                assert defPos <= interval.spillDefinitionPos() : "positions are processed in reverse order when intervals are created";
-                if (defPos < interval.spillDefinitionPos() - 2 || instructionForId(interval.spillDefinitionPos()) instanceof LIRXirInstruction) {
-                    // second definition found, so no spill optimization possible for this interval
-                    interval.setSpillState(SpillState.NoOptimization);
-                } else {
-                    // two consecutive definitions (because of two-operand LIR form)
-                    assert blockForId(defPos) == blockForId(interval.spillDefinitionPos()) : "block must be equal";
-                }
-                break;
-
-            case NoOptimization:
-                // nothing to do
-                break;
-
-            default:
-                throw new CiBailout("other states not allowed at this time");
-        }
-    }
-
-    // called during register allocation
-    void changeSpillState(Interval interval, int spillPos) {
-        switch (interval.spillState()) {
-            case NoSpillStore: {
-                int defLoopDepth = blockForId(interval.spillDefinitionPos()).getLoopDepth();
-                int spillLoopDepth = blockForId(spillPos).getLoopDepth();
-
-                if (defLoopDepth < spillLoopDepth) {
-                    // the loop depth of the spilling position is higher then the loop depth
-                    // at the definition of the interval . move write to memory out of loop
-                    // by storing at definitin of the interval
-                    interval.setSpillState(SpillState.StoreAtDefinition);
-                } else {
-                    // the interval is currently spilled only once, so for now there is no
-                    // reason to store the interval at the definition
-                    interval.setSpillState(SpillState.OneSpillStore);
-                }
-                break;
-            }
-
-            case OneSpillStore: {
-                // the interval is spilled more then once, so it is better to store it to
-                // memory at the definition
-                interval.setSpillState(SpillState.StoreAtDefinition);
-                break;
-            }
-
-            case StoreAtDefinition:
-            case StartInMemory:
-            case NoOptimization:
-            case NoDefinitionFound:
-                // nothing to do
-                break;
-
-            default:
-                throw new CiBailout("other states not allowed at this time");
-        }
-    }
-
-    abstract static class IntervalPredicate {
-        abstract boolean apply(Interval i);
-    }
-
-    private static final IntervalPredicate mustStoreAtDefinition = new IntervalPredicate() {
-        @Override
-        public boolean apply(Interval i) {
-            return i.isSplitParent() && i.spillState() == SpillState.StoreAtDefinition;
-        }
-    };
-
-    // called once before assignment of register numbers
-    void eliminateSpillMoves() {
-        if (GraalOptions.TraceLinearScanLevel >= 3) {
-            TTY.println(" Eliminating unnecessary spill moves");
-        }
-
-        // collect all intervals that must be stored after their definition.
-        // the list is sorted by Interval.spillDefinitionPos
-        Interval interval;
-        interval = createUnhandledLists(mustStoreAtDefinition, null).first;
-        if (GraalOptions.DetailedAsserts) {
-            checkIntervals(interval);
-        }
-
-        LIRInsertionBuffer insertionBuffer = new LIRInsertionBuffer();
-        int numBlocks = blockCount();
-        for (int i = 0; i < numBlocks; i++) {
-            Block block = blockAt(i);
-            List<LIRInstruction> instructions = block.lir;
-            int numInst = instructions.size();
-
-            // iterate all instructions of the block. skip the first because it is always a label
-            for (int j = 1; j < numInst; j++) {
-                LIRInstruction op = instructions.get(j);
-                int opId = op.id();
-
-                if (opId == -1) {
-                    MoveOp move = (MoveOp) op;
-                    // remove move from register to stack if the stack slot is guaranteed to be correct.
-                    // only moves that have been inserted by LinearScan can be removed.
-                    assert isVariable(move.getResult()) : "LinearScan inserts only moves to variables";
-
-                    Interval curInterval = intervalFor(move.getResult());
-
-                    if (!isRegister(curInterval.location()) && curInterval.alwaysInMemory()) {
-                        // move target is a stack slot that is always correct, so eliminate instruction
-                        if (GraalOptions.TraceLinearScanLevel >= 4) {
-                            TTY.println("eliminating move from interval %d to %d", operandNumber(move.getInput()), operandNumber(move.getResult()));
-                        }
-                        instructions.set(j, null); // null-instructions are deleted by assignRegNum
-                    }
-
-                } else {
-                    // insert move from register to stack just after the beginning of the interval
-                    assert interval == Interval.EndMarker || interval.spillDefinitionPos() >= opId : "invalid order";
-                    assert interval == Interval.EndMarker || (interval.isSplitParent() && interval.spillState() == SpillState.StoreAtDefinition) : "invalid interval";
-
-                    while (interval != Interval.EndMarker && interval.spillDefinitionPos() == opId) {
-                        if (!insertionBuffer.initialized()) {
-                            // prepare insertion buffer (appended when all instructions of the block are processed)
-                            insertionBuffer.init(block.lir);
-                        }
-
-                        CiValue fromLocation = interval.location();
-                        CiValue toLocation = canonicalSpillOpr(interval);
-
-                        assert isRegister(fromLocation) : "from operand must be a register but is: " + fromLocation + " toLocation=" + toLocation + " spillState=" + interval.spillState();
-                        assert isStackSlot(toLocation) : "to operand must be a stack slot";
-
-                        insertionBuffer.append(j + 1, ir.spillMoveFactory.createMove(toLocation, fromLocation));
-
-                        if (GraalOptions.TraceLinearScanLevel >= 4) {
-                            CiStackSlot slot = interval.spillSlot();
-                            TTY.println("inserting move after definition of interval %d to stack slot %s at opId %d",
-                                            interval.operandNumber, slot, opId);
-                        }
-
-                        interval = interval.next;
-                    }
-                }
-            } // end of instruction iteration
-
-            if (insertionBuffer.initialized()) {
-                insertionBuffer.finish();
-            }
-        } // end of block iteration
-
-        assert interval == Interval.EndMarker : "missed an interval";
-    }
-
-    private static void checkIntervals(Interval interval) {
-        Interval prev = null;
-        Interval temp = interval;
-        while (temp != Interval.EndMarker) {
-            assert temp.spillDefinitionPos() > 0 : "invalid spill definition pos";
-            if (prev != null) {
-                assert temp.from() >= prev.from() : "intervals not sorted";
-                assert temp.spillDefinitionPos() >= prev.spillDefinitionPos() : "when intervals are sorted by from :  then they must also be sorted by spillDefinitionPos";
-            }
-
-            assert temp.spillSlot() != null : "interval has no spill slot assigned";
-            assert temp.spillDefinitionPos() >= temp.from() : "invalid order";
-            assert temp.spillDefinitionPos() <= temp.from() + 2 : "only intervals defined once at their start-pos can be optimized";
-
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("interval %d (from %d to %d) must be stored at %d", temp.operandNumber, temp.from(), temp.to(), temp.spillDefinitionPos());
-            }
-
-            prev = temp;
-            temp = temp.next;
-        }
-    }
-
-    /**
-     * Numbers all instructions in all blocks. The numbering follows the {@linkplain ComputeLinearScanOrder linear scan order}.
-     */
-    void numberInstructions() {
-        ValueProcedure setVariableProc = new ValueProcedure() {
-            @Override
-            public CiValue doValue(CiValue value) {
-                if (isVariable(value)) {
-                    int variableIdx = asVariable(value).index;
-                    while (variables.size() <= variableIdx) {
-                        variables.add(null);
-                    }
-                    variables.set(variableIdx, asVariable(value));
-                }
-                return value;
-            }
-        };
-
-        // Assign IDs to LIR nodes and build a mapping, lirOps, from ID to LIRInstruction node.
-        int numBlocks = blockCount();
-        int numInstructions = 0;
-        for (int i = 0; i < numBlocks; i++) {
-            numInstructions += blockAt(i).lir.size();
-        }
-
-        // initialize with correct length
-        opIdToInstructionMap = new LIRInstruction[numInstructions];
-        opIdToBlockMap = new Block[numInstructions];
-
-        int opId = 0;
-        int index = 0;
-
-        for (int i = 0; i < numBlocks; i++) {
-            Block block = blockAt(i);
-            blockData.put(block, new BlockData());
-
-            List<LIRInstruction> instructions = block.lir;
-
-            int numInst = instructions.size();
-            for (int j = 0; j < numInst; j++) {
-                LIRInstruction op = instructions.get(j);
-                op.setId(opId);
-
-                opIdToInstructionMap[index] = op;
-                opIdToBlockMap[index] = block;
-                assert instructionForId(opId) == op : "must match";
-
-                op.forEachTemp(setVariableProc);
-                op.forEachOutput(setVariableProc);
-
-                index++;
-                opId += 2; // numbering of lirOps by two
-            }
-        }
-        assert index == numInstructions : "must match";
-        assert (index << 1) == opId : "must match: " + (index << 1);
-
-        if (GraalOptions.DetailedAsserts) {
-            for (int i = 0; i < variables.size(); i++) {
-                assert variables.get(i) != null && variables.get(i).index == i;
-            }
-            assert variables.size() == ir.numVariables();
-        }
-    }
-
-    /**
-     * Computes local live sets (i.e. {@link Block#liveGen} and {@link Block#liveKill}) separately for each block.
-     */
-    void computeLocalLiveSets() {
-        int numBlocks = blockCount();
-        int liveSize = liveSetSize();
-
-        intervalInLoop = new BitMap2D(operandSize(), numLoops());
-
-        // iterate all blocks
-        for (int i = 0; i < numBlocks; i++) {
-            final Block block = blockAt(i);
-            final BitMap liveGen = new BitMap(liveSize);
-            final BitMap liveKill = new BitMap(liveSize);
-
-            List<LIRInstruction> instructions = block.lir;
-            int numInst = instructions.size();
-
-            // iterate all instructions of the block. skip the first because it is always a label
-            assert !instructions.get(0).hasOperands() : "first operation must always be a label";
-            for (int j = 1; j < numInst; j++) {
-                final LIRInstruction op = instructions.get(j);
-
-                ValueProcedure useProc = new ValueProcedure() {
-                    @Override
-                    protected CiValue doValue(CiValue operand) {
-                        if (isVariable(operand)) {
-                            int operandNum = operandNumber(operand);
-                            if (!liveKill.get(operandNum)) {
-                                liveGen.set(operandNum);
-                                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                                    TTY.println("  Setting liveGen for operand %d at instruction %d", operandNum, op.id());
-                                }
-                            }
-                            if (block.getLoop() != null) {
-                                intervalInLoop.setBit(operandNum, block.getLoop().index);
-                            }
-                        }
-
-                        if (GraalOptions.DetailedAsserts) {
-                            verifyInput(block, liveKill, operand);
-                        }
-                        return operand;
-                    }
-                };
-                ValueProcedure stateProc = new ValueProcedure() {
-                    @Override
-                    public CiValue doValue(CiValue operand) {
-                        int operandNum = operandNumber(operand);
-                        if (!liveKill.get(operandNum)) {
-                            liveGen.set(operandNum);
-                            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                                TTY.println("  Setting liveGen for LIR opId %d, operand %d because of state for %s", op.id(), operandNum, op);
-                            }
-                        }
-                        return operand;
-                    }
-                };
-                ValueProcedure defProc = new ValueProcedure() {
-                    @Override
-                    public CiValue doValue(CiValue operand) {
-                        if (isVariable(operand)) {
-                            int varNum = operandNumber(operand);
-                            liveKill.set(varNum);
-                            if (block.getLoop() != null) {
-                                intervalInLoop.setBit(varNum, block.getLoop().index);
-                            }
-                        }
-
-                        if (GraalOptions.DetailedAsserts) {
-                            // fixed intervals are never live at block boundaries, so
-                            // they need not be processed in live sets
-                            // process them only in debug mode so that this can be checked
-                            verifyTemp(liveKill, operand);
-                        }
-                        return operand;
-                    }
-                };
-
-                op.forEachInput(useProc);
-                op.forEachAlive(useProc);
-                // Add uses of live locals from interpreter's point of view for proper debug information generation
-                op.forEachState(stateProc);
-                op.forEachTemp(defProc);
-                op.forEachOutput(defProc);
-            } // end of instruction iteration
-
-            blockData.get(block).liveGen = liveGen;
-            blockData.get(block).liveKill = liveKill;
-            blockData.get(block).liveIn = new BitMap(liveSize);
-            blockData.get(block).liveOut = new BitMap(liveSize);
-
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("liveGen  B%d %s", block.getId(), blockData.get(block).liveGen);
-                TTY.println("liveKill B%d %s", block.getId(), blockData.get(block).liveKill);
-            }
-        } // end of block iteration
-    }
-
-    private void verifyTemp(BitMap liveKill, CiValue operand) {
-        // fixed intervals are never live at block boundaries, so
-        // they need not be processed in live sets
-        // process them only in debug mode so that this can be checked
-        if (isRegister(operand)) {
-            if (isProcessed(operand)) {
-                liveKill.set(operandNumber(operand));
-            }
-        }
-    }
-
-    private void verifyInput(Block block, BitMap liveKill, CiValue operand) {
-        // fixed intervals are never live at block boundaries, so
-        // they need not be processed in live sets.
-        // this is checked by these assertions to be sure about it.
-        // the entry block may have incoming
-        // values in registers, which is ok.
-        if (isRegister(operand) && block != ir.cfg.getStartBlock()) {
-            if (isProcessed(operand)) {
-                assert liveKill.get(operandNumber(operand)) : "using fixed register that is not defined in this block";
-            }
-        }
-    }
-
-    /**
-     * Performs a backward dataflow analysis to compute global live sets (i.e. {@link Block#liveIn} and
-     * {@link Block#liveOut}) for each block.
-     */
-    void computeGlobalLiveSets() {
-        int numBlocks = blockCount();
-        boolean changeOccurred;
-        boolean changeOccurredInBlock;
-        int iterationCount = 0;
-        BitMap liveOut = new BitMap(liveSetSize()); // scratch set for calculations
-
-        // Perform a backward dataflow analysis to compute liveOut and liveIn for each block.
-        // The loop is executed until a fixpoint is reached (no changes in an iteration)
-        do {
-            changeOccurred = false;
-
-            // iterate all blocks in reverse order
-            for (int i = numBlocks - 1; i >= 0; i--) {
-                Block block = blockAt(i);
-
-                changeOccurredInBlock = false;
-
-                // liveOut(block) is the union of liveIn(sux), for successors sux of block
-                int n = block.numberOfSux();
-                if (n > 0) {
-                    // block has successors
-                    if (n > 0) {
-                        liveOut.setFrom(blockData.get(block.suxAt(0)).liveIn);
-                        for (int j = 1; j < n; j++) {
-                            liveOut.setUnion(blockData.get(block.suxAt(j)).liveIn);
-                        }
-                    } else {
-                        liveOut.clearAll();
-                    }
-
-                    if (!blockData.get(block).liveOut.isSame(liveOut)) {
-                        // A change occurred. Swap the old and new live out sets to avoid copying.
-                        BitMap temp = blockData.get(block).liveOut;
-                        blockData.get(block).liveOut = liveOut;
-                        liveOut = temp;
-
-                        changeOccurred = true;
-                        changeOccurredInBlock = true;
-                    }
-                }
-
-                if (iterationCount == 0 || changeOccurredInBlock) {
-                    // liveIn(block) is the union of liveGen(block) with (liveOut(block) & !liveKill(block))
-                    // note: liveIn has to be computed only in first iteration or if liveOut has changed!
-                    BitMap liveIn = blockData.get(block).liveIn;
-                    liveIn.setFrom(blockData.get(block).liveOut);
-                    liveIn.setDifference(blockData.get(block).liveKill);
-                    liveIn.setUnion(blockData.get(block).liveGen);
-                }
-
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    traceLiveness(changeOccurredInBlock, iterationCount, block);
-                }
-            }
-            iterationCount++;
-
-            if (changeOccurred && iterationCount > 50) {
-                throw new CiBailout("too many iterations in computeGlobalLiveSets");
-            }
-        } while (changeOccurred);
-
-        if (GraalOptions.DetailedAsserts) {
-            verifyLiveness(numBlocks);
-        }
-
-        // check that the liveIn set of the first block is empty
-        Block startBlock = ir.cfg.getStartBlock();
-        BitMap liveInArgs = new BitMap(blockData.get(startBlock).liveIn.size());
-        if (!blockData.get(startBlock).liveIn.isSame(liveInArgs)) {
-            if (GraalOptions.DetailedAsserts) {
-                reportFailure(numBlocks);
-            }
-
-            TTY.println("preds=" + startBlock.getPredecessors().size() + ", succs=" + startBlock.getSuccessors().size());
-            TTY.println("startBlock-ID: " + startBlock.getId());
-
-            // bailout of if this occurs in product mode.
-            throw new CiBailout("liveIn set of first block must be empty");
-        }
-    }
-
-    private void reportFailure(int numBlocks) {
-        TTY.println(method.toString());
-        TTY.println("Error: liveIn set of first block must be empty (when this fails, variables are used before they are defined)");
-        TTY.print("affected registers:");
-        TTY.println(blockData.get(ir.cfg.getStartBlock()).liveIn.toString());
-
-        // print some additional information to simplify debugging
-        for (int operandNum = 0; operandNum < blockData.get(ir.cfg.getStartBlock()).liveIn.size(); operandNum++) {
-            if (blockData.get(ir.cfg.getStartBlock()).liveIn.get(operandNum)) {
-                CiValue operand = operandFor(operandNum);
-                TTY.println(" var %d; operand=%s", operandNum, operand.toString());
-
-                for (int j = 0; j < numBlocks; j++) {
-                    Block block = blockAt(j);
-                    if (blockData.get(block).liveGen.get(operandNum)) {
-                        TTY.println("  used in block B%d", block.getId());
-                        for (LIRInstruction ins : block.lir) {
-                            TTY.println(ins.id() + ": " + ins.toString());
-                            LIRDebugInfo info = ins.info;
-                            if (info != null) {
-                                info.forEachState(new ValueProcedure() {
-                                    @Override
-                                    public CiValue doValue(CiValue liveStateOperand) {
-                                        TTY.println("   operand=" + liveStateOperand);
-                                        return liveStateOperand;
-                                    }
-                                });
-                            }
-                        }
-                    }
-                    if (blockData.get(block).liveKill.get(operandNum)) {
-                        TTY.println("  defined in block B%d", block.getId());
-                        for (LIRInstruction ins : block.lir) {
-                            TTY.println(ins.id() + ": " + ins.toString());
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    private void verifyLiveness(int numBlocks) {
-        // check that fixed intervals are not live at block boundaries
-        // (live set must be empty at fixed intervals)
-        for (int i = 0; i < numBlocks; i++) {
-            Block block = blockAt(i);
-            for (int j = 0; j <= maxRegisterNumber(); j++) {
-                assert !blockData.get(block).liveIn.get(j) : "liveIn  set of fixed register must be empty";
-                assert !blockData.get(block).liveOut.get(j) : "liveOut set of fixed register must be empty";
-                assert !blockData.get(block).liveGen.get(j) : "liveGen set of fixed register must be empty";
-            }
-        }
-    }
-
-    private void traceLiveness(boolean changeOccurredInBlock, int iterationCount, Block block) {
-        char c = iterationCount == 0 || changeOccurredInBlock ? '*' : ' ';
-        TTY.print("(%d) liveIn%c  B%d ", iterationCount, c, block.getId());
-        TTY.println(blockData.get(block).liveIn.toString());
-        TTY.print("(%d) liveOut%c B%d ", iterationCount, c, block.getId());
-        TTY.println(blockData.get(block).liveOut.toString());
-    }
-
-    void addUse(CiValue operand, int from, int to, RegisterPriority registerPriority, CiKind kind) {
-        if (!isProcessed(operand)) {
-            return;
-        }
-        if (GraalOptions.TraceLinearScanLevel >= 2 && kind == null) {
-            TTY.println(" use %s from %d to %d (%s)", operand, from, to, registerPriority.name());
-        }
-
-        Interval interval = intervalFor(operand);
-        if (interval == null) {
-            interval = createInterval(operand);
-        }
-
-        if (kind != CiKind.Illegal) {
-            interval.setKind(kind);
-        }
-
-        interval.addRange(from, to);
-
-        // Register use position at even instruction id.
-        interval.addUsePos(to & ~1, registerPriority);
-    }
-
-    void addTemp(CiValue operand, int tempPos, RegisterPriority registerPriority, CiKind kind) {
-        if (!isProcessed(operand)) {
-            return;
-        }
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println(" temp %s tempPos %d (%s)", operand, tempPos, RegisterPriority.MustHaveRegister.name());
-        }
-        Interval interval = intervalFor(operand);
-        if (interval == null) {
-            interval = createInterval(operand);
-        }
-
-        if (kind != CiKind.Illegal) {
-            interval.setKind(kind);
-        }
-
-        interval.addRange(tempPos, tempPos + 1);
-        interval.addUsePos(tempPos, registerPriority);
-    }
-
-    boolean isProcessed(CiValue operand) {
-        return !isRegister(operand) || attributes(asRegister(operand)).isAllocatable;
-    }
-
-    void addDef(CiValue operand, int defPos, RegisterPriority registerPriority, CiKind kind) {
-        if (!isProcessed(operand)) {
-            return;
-        }
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println(" def %s defPos %d (%s)", operand, defPos, registerPriority.name());
-        }
-        Interval interval = intervalFor(operand);
-        if (interval != null) {
-
-            if (kind != CiKind.Illegal) {
-                interval.setKind(kind);
-            }
-
-            Range r = interval.first();
-            if (r.from <= defPos) {
-                // Update the starting point (when a range is first created for a use, its
-                // start is the beginning of the current block until a def is encountered.)
-                r.from = defPos;
-                interval.addUsePos(defPos, registerPriority);
-
-            } else {
-                // Dead value - make vacuous interval
-                // also add register priority for dead intervals
-                interval.addRange(defPos, defPos + 1);
-                interval.addUsePos(defPos, registerPriority);
-                if (GraalOptions.TraceLinearScanLevel >= 2) {
-                    TTY.println("Warning: def of operand %s at %d occurs without use", operand, defPos);
-                }
-            }
-
-        } else {
-            // Dead value - make vacuous interval
-            // also add register priority for dead intervals
-            interval = createInterval(operand);
-            if (kind != CiKind.Illegal) {
-                interval.setKind(kind);
-            }
-
-            interval.addRange(defPos, defPos + 1);
-            interval.addUsePos(defPos, registerPriority);
-            if (GraalOptions.TraceLinearScanLevel >= 2) {
-                TTY.println("Warning: dead value %s at %d in live intervals", operand, defPos);
-            }
-        }
-
-        changeSpillDefinitionPos(interval, defPos);
-        if (registerPriority == RegisterPriority.None && interval.spillState().ordinal() <= SpillState.StartInMemory.ordinal()) {
-            // detection of method-parameters and roundfp-results
-            // TODO: move this directly to position where use-kind is computed
-            interval.setSpillState(SpillState.StartInMemory);
-        }
-    }
-
-    /**
-     * Determines the register priority for an instruction's output/result operand.
-     */
-    static RegisterPriority registerPriorityOfOutputOperand(LIRInstruction op) {
-        if (op instanceof MoveOp) {
-            MoveOp move = (MoveOp) op;
-            if (isStackSlot(move.getInput()) && move.getInput().kind != CiKind.Object) {
-                // method argument (condition must be equal to handleMethodArguments)
-                return RegisterPriority.None;
-            }
-        }
-
-        // all other operands require a register
-        return RegisterPriority.MustHaveRegister;
-    }
-
-    /**
-     * Determines the priority which with an instruction's input operand will be allocated a register.
-     */
-    static RegisterPriority registerPriorityOfInputOperand(EnumSet<OperandFlag> flags) {
-        if (flags.contains(OperandFlag.Stack)) {
-            return RegisterPriority.ShouldHaveRegister;
-        }
-        // all other operands require a register
-        return RegisterPriority.MustHaveRegister;
-    }
-
-    /**
-     * Optimizes moves related to incoming stack based arguments.
-     * The interval for the destination of such moves is assigned
-     * the stack slot (which is in the caller's frame) as its
-     * spill slot.
-     */
-    void handleMethodArguments(LIRInstruction op) {
-        if (op instanceof MoveOp) {
-            MoveOp move = (MoveOp) op;
-            if (isStackSlot(move.getInput()) && move.getInput().kind != CiKind.Object) {
-                CiStackSlot slot = (CiStackSlot) move.getInput();
-                if (GraalOptions.DetailedAsserts) {
-                    assert op.id() > 0 : "invalid id";
-                    assert blockForId(op.id()).numberOfPreds() == 0 : "move from stack must be in first block";
-                    assert isVariable(move.getResult()) : "result of move must be a variable";
-
-                    if (GraalOptions.TraceLinearScanLevel >= 4) {
-                        TTY.println("found move from stack slot %s to %s", slot, move.getResult());
-                    }
-                }
-
-                Interval interval = intervalFor(move.getResult());
-                interval.setSpillSlot(slot);
-                interval.assignLocation(slot);
-            }
-        }
-    }
-
-    void addRegisterHint(final LIRInstruction op, final CiValue targetValue, OperandMode mode, EnumSet<OperandFlag> flags) {
-        if (flags.contains(OperandFlag.RegisterHint) && isVariableOrRegister(targetValue)) {
-
-            op.forEachRegisterHint(targetValue, mode, new ValueProcedure() {
-                @Override
-                protected CiValue doValue(CiValue registerHint) {
-                    if (isVariableOrRegister(registerHint)) {
-                        Interval from = intervalFor(registerHint);
-                        Interval to = intervalFor(targetValue);
-                        if (from != null && to != null) {
-                            to.setLocationHint(from);
-                            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                                TTY.println("operation at opId %d: added hint from interval %d to %d", op.id(), from.operandNumber, to.operandNumber);
-                            }
-                            return registerHint;
-                        }
-                    }
-                    return null;
-                }
-            });
-        }
-    }
-
-    void buildIntervals() {
-        intervalsSize = operandSize();
-        intervals = new Interval[intervalsSize + INITIAL_SPLIT_INTERVALS_CAPACITY];
-
-        // create a list with all caller-save registers (cpu, fpu, xmm)
-        CiRegister[] callerSaveRegs = frameMap.registerConfig.getCallerSaveRegisters();
-
-        // iterate all blocks in reverse order
-        for (int i = blockCount() - 1; i >= 0; i--) {
-            Block block = blockAt(i);
-            List<LIRInstruction> instructions = block.lir;
-            final int blockFrom = block.getFirstLirInstructionId();
-            int blockTo = block.getLastLirInstructionId();
-
-            assert blockFrom == instructions.get(0).id();
-            assert blockTo == instructions.get(instructions.size() - 1).id();
-
-            // Update intervals for operands live at the end of this block;
-            BitMap live = blockData.get(block).liveOut;
-            for (int operandNum = live.nextSetBit(0); operandNum >= 0; operandNum = live.nextSetBit(operandNum + 1)) {
-                assert live.get(operandNum) : "should not stop here otherwise";
-                CiValue operand = operandFor(operandNum);
-                if (GraalOptions.TraceLinearScanLevel >= 2) {
-                    TTY.println("live in %s to %d", operand, blockTo + 2);
-                }
-
-                addUse(operand, blockFrom, blockTo + 2, RegisterPriority.None, CiKind.Illegal);
-
-                // add special use positions for loop-end blocks when the
-                // interval is used anywhere inside this loop. It's possible
-                // that the block was part of a non-natural loop, so it might
-                // have an invalid loop index.
-                if (block.isLoopEnd() && block.getLoop() != null && isIntervalInLoop(operandNum, block.getLoop().index)) {
-                    intervalFor(operand).addUsePos(blockTo + 1, RegisterPriority.LiveAtLoopEnd);
-                }
-            }
-
-            // iterate all instructions of the block in reverse order.
-            // skip the first instruction because it is always a label
-            // definitions of intervals are processed before uses
-            assert !instructions.get(0).hasOperands() : "first operation must always be a label";
-            for (int j = instructions.size() - 1; j >= 1; j--) {
-                final LIRInstruction op = instructions.get(j);
-                final int opId = op.id();
-
-                // add a temp range for each register if operation destroys caller-save registers
-                if (op.hasCall()) {
-                    for (CiRegister r : callerSaveRegs) {
-                        if (attributes(r).isAllocatable) {
-                            addTemp(r.asValue(), opId, RegisterPriority.None, CiKind.Illegal);
-                        }
-                    }
-                    if (GraalOptions.TraceLinearScanLevel >= 4) {
-                        TTY.println("operation destroys all caller-save registers");
-                    }
-                }
-
-                op.forEachOutput(new ValueProcedure() {
-                    @Override
-                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
-                        if (isVariableOrRegister(operand)) {
-                            addDef(operand, opId, registerPriorityOfOutputOperand(op), operand.kind.stackKind());
-                            addRegisterHint(op, operand, mode, flags);
-                        }
-                        return operand;
-                    }
-                });
-                op.forEachTemp(new ValueProcedure() {
-                    @Override
-                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
-                        if (isVariableOrRegister(operand)) {
-                            addTemp(operand, opId, RegisterPriority.MustHaveRegister, operand.kind.stackKind());
-                            addRegisterHint(op, operand, mode, flags);
-                        }
-                        return operand;
-                    }
-                });
-                op.forEachAlive(new ValueProcedure() {
-                    @Override
-                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
-                        if (isVariableOrRegister(operand)) {
-                            RegisterPriority p = registerPriorityOfInputOperand(flags);
-                            addUse(operand, blockFrom, opId + 1, p, operand.kind.stackKind());
-                            addRegisterHint(op, operand, mode, flags);
-                        }
-                        return operand;
-                    }
-                });
-                op.forEachInput(new ValueProcedure() {
-                    @Override
-                    public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
-                        if (isVariableOrRegister(operand)) {
-                            RegisterPriority p = registerPriorityOfInputOperand(flags);
-                            addUse(operand, blockFrom, opId, p, operand.kind.stackKind());
-                            addRegisterHint(op, operand, mode, flags);
-                        }
-                        return operand;
-                    }
-                });
-
-                // Add uses of live locals from interpreter's point of view for proper
-                // debug information generation
-                // Treat these operands as temp values (if the live range is extended
-                // to a call site, the value would be in a register at the call otherwise)
-                op.forEachState(new ValueProcedure() {
-                    @Override
-                    public CiValue doValue(CiValue operand) {
-                        addUse(operand, blockFrom, opId + 1, RegisterPriority.None, operand.kind.stackKind());
-                        return operand;
-                    }
-                });
-
-                // special steps for some instructions (especially moves)
-                handleMethodArguments(op);
-
-            } // end of instruction iteration
-        } // end of block iteration
-
-        // add the range [0, 1] to all fixed intervals.
-        // the register allocator need not handle unhandled fixed intervals
-        for (Interval interval : intervals) {
-            if (interval != null && isRegister(interval.operand)) {
-                interval.addRange(0, 1);
-            }
-        }
-    }
-
-    // * Phase 5: actual register allocation
-
-    private static boolean isSorted(Interval[] intervals) {
-        int from = -1;
-        for (Interval interval : intervals) {
-            assert interval != null;
-            assert from <= interval.from();
-            from = interval.from();
-        }
-        return true;
-    }
-
-    static Interval addToList(Interval first, Interval prev, Interval interval) {
-        Interval newFirst = first;
-        if (prev != null) {
-            prev.next = interval;
-        } else {
-            newFirst = interval;
-        }
-        return newFirst;
-    }
-
-    Interval.Pair createUnhandledLists(IntervalPredicate isList1, IntervalPredicate isList2) {
-        assert isSorted(sortedIntervals) : "interval list is not sorted";
-
-        Interval list1 = Interval.EndMarker;
-        Interval list2 = Interval.EndMarker;
-
-        Interval list1Prev = null;
-        Interval list2Prev = null;
-        Interval v;
-
-        int n = sortedIntervals.length;
-        for (int i = 0; i < n; i++) {
-            v = sortedIntervals[i];
-            if (v == null) {
-                continue;
-            }
-
-            if (isList1.apply(v)) {
-                list1 = addToList(list1, list1Prev, v);
-                list1Prev = v;
-            } else if (isList2 == null || isList2.apply(v)) {
-                list2 = addToList(list2, list2Prev, v);
-                list2Prev = v;
-            }
-        }
-
-        if (list1Prev != null) {
-            list1Prev.next = Interval.EndMarker;
-        }
-        if (list2Prev != null) {
-            list2Prev.next = Interval.EndMarker;
-        }
-
-        assert list1Prev == null || list1Prev.next == Interval.EndMarker : "linear list ends not with sentinel";
-        assert list2Prev == null || list2Prev.next == Interval.EndMarker : "linear list ends not with sentinel";
-
-        return new Interval.Pair(list1, list2);
-    }
-
-    void sortIntervalsBeforeAllocation() {
-        int sortedLen = 0;
-        for (Interval interval : intervals) {
-            if (interval != null) {
-                sortedLen++;
-            }
-        }
-
-        Interval[] sortedList = new Interval[sortedLen];
-        int sortedIdx = 0;
-        int sortedFromMax = -1;
-
-        // special sorting algorithm: the original interval-list is almost sorted,
-        // only some intervals are swapped. So this is much faster than a complete QuickSort
-        for (Interval interval : intervals) {
-            if (interval != null) {
-                int from = interval.from();
-
-                if (sortedFromMax <= from) {
-                    sortedList[sortedIdx++] = interval;
-                    sortedFromMax = interval.from();
-                } else {
-                    // the assumption that the intervals are already sorted failed,
-                    // so this interval must be sorted in manually
-                    int j;
-                    for (j = sortedIdx - 1; j >= 0 && from < sortedList[j].from(); j--) {
-                        sortedList[j + 1] = sortedList[j];
-                    }
-                    sortedList[j + 1] = interval;
-                    sortedIdx++;
-                }
-            }
-        }
-        sortedIntervals = sortedList;
-    }
-
-    void sortIntervalsAfterAllocation() {
-        if (firstDerivedIntervalIndex == -1) {
-            // no intervals have been added during allocation, so sorted list is already up to date
-            return;
-        }
-
-        Interval[] oldList = sortedIntervals;
-        Interval[] newList = Arrays.copyOfRange(intervals, firstDerivedIntervalIndex, intervalsSize);
-        int oldLen = oldList.length;
-        int newLen = newList.length;
-
-        // conventional sort-algorithm for new intervals
-        Arrays.sort(newList, INTERVAL_COMPARATOR);
-
-        // merge old and new list (both already sorted) into one combined list
-        Interval[] combinedList = new Interval[oldLen + newLen];
-        int oldIdx = 0;
-        int newIdx = 0;
-
-        while (oldIdx + newIdx < combinedList.length) {
-            if (newIdx >= newLen || (oldIdx < oldLen && oldList[oldIdx].from() <= newList[newIdx].from())) {
-                combinedList[oldIdx + newIdx] = oldList[oldIdx];
-                oldIdx++;
-            } else {
-                combinedList[oldIdx + newIdx] = newList[newIdx];
-                newIdx++;
-            }
-        }
-
-        sortedIntervals = combinedList;
-    }
-
-    private static final Comparator<Interval> INTERVAL_COMPARATOR = new Comparator<Interval>() {
-
-        public int compare(Interval a, Interval b) {
-            if (a != null) {
-                if (b != null) {
-                    return a.from() - b.from();
-                } else {
-                    return -1;
-                }
-            } else {
-                if (b != null) {
-                    return 1;
-                } else {
-                    return 0;
-                }
-            }
-        }
-    };
-
-    public void allocateRegisters() {
-        Interval precoloredIntervals;
-        Interval notPrecoloredIntervals;
-
-        Interval.Pair result = createUnhandledLists(IS_PRECOLORED_INTERVAL, IS_VARIABLE_INTERVAL);
-        precoloredIntervals = result.first;
-        notPrecoloredIntervals = result.second;
-
-        // allocate cpu registers
-        LinearScanWalker lsw = new LinearScanWalker(this, precoloredIntervals, notPrecoloredIntervals, !target.arch.isX86());
-        lsw.walk();
-        lsw.finishAllocation();
-    }
-
-    // * Phase 6: resolve data flow
-    // (insert moves at edges between blocks if intervals have been split)
-
-    // wrapper for Interval.splitChildAtOpId that performs a bailout in product mode
-    // instead of returning null
-    Interval splitChildAtOpId(Interval interval, int opId, LIRInstruction.OperandMode mode) {
-        Interval result = interval.getSplitChildAtOpId(opId, mode, this);
-
-        if (result != null) {
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("Split child at pos " + opId + " of interval " + interval.toString() + " is " + result.toString());
-            }
-            return result;
-        }
-
-        throw new CiBailout("LinearScan: interval is null");
-    }
-
-    Interval intervalAtBlockBegin(Block block, CiValue operand) {
-        assert isVariable(operand) : "register number out of bounds";
-        assert intervalFor(operand) != null : "no interval found";
-
-        return splitChildAtOpId(intervalFor(operand), block.getFirstLirInstructionId(), LIRInstruction.OperandMode.Output);
-    }
-
-    Interval intervalAtBlockEnd(Block block, CiValue operand) {
-        assert isVariable(operand) : "register number out of bounds";
-        assert intervalFor(operand) != null : "no interval found";
-
-        return splitChildAtOpId(intervalFor(operand), block.getLastLirInstructionId() + 1, LIRInstruction.OperandMode.Output);
-    }
-
-    Interval intervalAtOpId(CiValue operand, int opId) {
-        assert isVariable(operand) : "register number out of bounds";
-        assert intervalFor(operand) != null : "no interval found";
-
-        return splitChildAtOpId(intervalFor(operand), opId, LIRInstruction.OperandMode.Input);
-    }
-
-    void resolveCollectMappings(Block fromBlock, Block toBlock, MoveResolver moveResolver) {
-        assert moveResolver.checkEmpty();
-
-        int numOperands = operandSize();
-        BitMap liveAtEdge = blockData.get(toBlock).liveIn;
-
-        // visit all variables for which the liveAtEdge bit is set
-        for (int operandNum = liveAtEdge.nextSetBit(0); operandNum >= 0; operandNum = liveAtEdge.nextSetBit(operandNum + 1)) {
-            assert operandNum < numOperands : "live information set for not exisiting interval";
-            assert blockData.get(fromBlock).liveOut.get(operandNum) && blockData.get(toBlock).liveIn.get(operandNum) : "interval not live at this edge";
-
-            CiValue liveOperand = operandFor(operandNum);
-            Interval fromInterval = intervalAtBlockEnd(fromBlock, liveOperand);
-            Interval toInterval = intervalAtBlockBegin(toBlock, liveOperand);
-
-            if (fromInterval != toInterval && (fromInterval.location() != toInterval.location())) {
-                // need to insert move instruction
-                moveResolver.addMapping(fromInterval, toInterval);
-            }
-        }
-    }
-
-    static void resolveFindInsertPos(Block fromBlock, Block toBlock, MoveResolver moveResolver) {
-        if (fromBlock.numberOfSux() <= 1) {
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("inserting moves at end of fromBlock B%d", fromBlock.getId());
-            }
-
-            List<LIRInstruction> instructions = fromBlock.lir;
-            LIRInstruction instr = instructions.get(instructions.size() - 1);
-            if (instr instanceof StandardOp.JumpOp) {
-                // insert moves before branch
-                moveResolver.setInsertPosition(fromBlock.lir, instructions.size() - 1);
-            } else {
-                moveResolver.setInsertPosition(fromBlock.lir, instructions.size());
-            }
-
-        } else {
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("inserting moves at beginning of toBlock B%d", toBlock.getId());
-            }
-
-            if (GraalOptions.DetailedAsserts) {
-                assert fromBlock.lir.get(0) instanceof StandardOp.LabelOp : "block does not start with a label";
-
-                // because the number of predecessor edges matches the number of
-                // successor edges, blocks which are reached by switch statements
-                // may have be more than one predecessor but it will be guaranteed
-                // that all predecessors will be the same.
-                for (int i = 0; i < toBlock.numberOfPreds(); i++) {
-                    assert fromBlock == toBlock.predAt(i) : "all critical edges must be broken";
-                }
-            }
-
-            moveResolver.setInsertPosition(toBlock.lir, 1);
-        }
-    }
-
-    /**
-     * Inserts necessary moves (spilling or reloading) at edges between blocks for intervals that
-     * have been split.
-     */
-    void resolveDataFlow() {
-        int numBlocks = blockCount();
-        MoveResolver moveResolver = new MoveResolver(this);
-        BitMap blockCompleted = new BitMap(numBlocks);
-        BitMap alreadyResolved = new BitMap(numBlocks);
-
-        int i;
-        for (i = 0; i < numBlocks; i++) {
-            Block block = blockAt(i);
-
-            // check if block has only one predecessor and only one successor
-            if (block.numberOfPreds() == 1 && block.numberOfSux() == 1) {
-                List<LIRInstruction> instructions = block.lir;
-                assert instructions.get(0) instanceof StandardOp.LabelOp : "block must start with label";
-                assert instructions.get(instructions.size() - 1) instanceof StandardOp.JumpOp : "block with successor must end with unconditional jump";
-
-                // check if block is empty (only label and branch)
-                if (instructions.size() == 2) {
-                    Block pred = block.predAt(0);
-                    Block sux = block.suxAt(0);
-
-                    // prevent optimization of two consecutive blocks
-                    if (!blockCompleted.get(pred.linearScanNumber) && !blockCompleted.get(sux.linearScanNumber)) {
-                        if (GraalOptions.TraceLinearScanLevel >= 3) {
-                            TTY.println(" optimizing empty block B%d (pred: B%d, sux: B%d)", block.getId(), pred.getId(), sux.getId());
-                        }
-                        blockCompleted.set(block.linearScanNumber);
-
-                        // directly resolve between pred and sux (without looking at the empty block between)
-                        resolveCollectMappings(pred, sux, moveResolver);
-                        if (moveResolver.hasMappings()) {
-                            moveResolver.setInsertPosition(block.lir, 1);
-                            moveResolver.resolveAndAppendMoves();
-                        }
-                    }
-                }
-            }
-        }
-
-        for (i = 0; i < numBlocks; i++) {
-            if (!blockCompleted.get(i)) {
-                Block fromBlock = blockAt(i);
-                alreadyResolved.setFrom(blockCompleted);
-
-                int numSux = fromBlock.numberOfSux();
-                for (int s = 0; s < numSux; s++) {
-                    Block toBlock = fromBlock.suxAt(s);
-
-                    // check for duplicate edges between the same blocks (can happen with switch blocks)
-                    if (!alreadyResolved.get(toBlock.linearScanNumber)) {
-                        if (GraalOptions.TraceLinearScanLevel >= 3) {
-                            TTY.println(" processing edge between B%d and B%d", fromBlock.getId(), toBlock.getId());
-                        }
-                        alreadyResolved.set(toBlock.linearScanNumber);
-
-                        // collect all intervals that have been split between fromBlock and toBlock
-                        resolveCollectMappings(fromBlock, toBlock, moveResolver);
-                        if (moveResolver.hasMappings()) {
-                            resolveFindInsertPos(fromBlock, toBlock, moveResolver);
-                            moveResolver.resolveAndAppendMoves();
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    // * Phase 7: assign register numbers back to LIR
-    // (includes computation of debug information and oop maps)
-
-    boolean verifyAssignedLocation(Interval interval, CiValue location) {
-        CiKind kind = interval.kind();
-
-        assert isRegister(location) || isStackSlot(location);
-
-        if (isRegister(location)) {
-            CiRegister reg = asRegister(location);
-
-            // register
-            switch (kind) {
-                case Byte:
-                case Char:
-                case Short:
-                case Jsr:
-                case Object:
-                case Int: {
-                    assert reg.isCpu() : "not cpu register";
-                    break;
-                }
-
-                case Long: {
-                    assert reg.isCpu() : "not cpu register";
-                    break;
-                }
-
-                case Float: {
-                    assert !target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
-                    break;
-                }
-
-                case Double: {
-                    assert !target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
-                    break;
-                }
-
-                default: {
-                    throw GraalInternalError.shouldNotReachHere();
-                }
-            }
-        }
-        return true;
-    }
-
-    static CiStackSlot canonicalSpillOpr(Interval interval) {
-        assert interval.spillSlot() != null : "canonical spill slot not set";
-        return interval.spillSlot();
-    }
-
-    /**
-     * Assigns the allocated location for an LIR instruction operand back into the instruction.
-     *
-     * @param operand an LIR instruction operand
-     * @param opId the id of the LIR instruction using {@code operand}
-     * @param mode the usage mode for {@code operand} by the instruction
-     * @return the location assigned for the operand
-     */
-    private CiValue colorLirOperand(Variable operand, int opId, OperandMode mode) {
-        Interval interval = intervalFor(operand);
-        assert interval != null : "interval must exist";
-
-        if (opId != -1) {
-            if (GraalOptions.DetailedAsserts) {
-                Block block = blockForId(opId);
-                if (block.numberOfSux() <= 1 && opId == block.getLastLirInstructionId()) {
-                    // check if spill moves could have been appended at the end of this block, but
-                    // before the branch instruction. So the split child information for this branch would
-                    // be incorrect.
-                    LIRInstruction instr = block.lir.get(block.lir.size() - 1);
-                    if (instr instanceof StandardOp.JumpOp) {
-                        if (blockData.get(block).liveOut.get(operandNumber(operand))) {
-                            assert false : "can't get split child for the last branch of a block because the information would be incorrect (moves are inserted before the branch in resolveDataFlow)";
-                        }
-                    }
-                }
-            }
-
-            // operands are not changed when an interval is split during allocation,
-            // so search the right interval here
-            interval = splitChildAtOpId(interval, opId, mode);
-        }
-
-        return interval.location();
-    }
-
-    IntervalWalker initComputeOopMaps() {
-        // setup lists of potential oops for walking
-        Interval oopIntervals;
-        Interval nonOopIntervals;
-
-        oopIntervals = createUnhandledLists(IS_OOP_INTERVAL, null).first;
-
-        // intervals that have no oops inside need not to be processed.
-        // to ensure a walking until the last instruction id, add a dummy interval
-        // with a high operation id
-        nonOopIntervals = new Interval(CiValue.IllegalValue, -1);
-        nonOopIntervals.addRange(Integer.MAX_VALUE - 2, Integer.MAX_VALUE - 1);
-
-        return new IntervalWalker(this, oopIntervals, nonOopIntervals);
-    }
-
-    void computeOopMap(IntervalWalker iw, LIRInstruction op, CiBitMap registerRefMap, CiBitMap frameRefMap) {
-        if (GraalOptions.TraceLinearScanLevel >= 3) {
-            TTY.println("creating oop map at opId %d", op.id());
-        }
-
-        // walk before the current operation . intervals that start at
-        // the operation (i.e. output operands of the operation) are not
-        // included in the oop map
-        iw.walkBefore(op.id());
-
-        // Iterate through active intervals
-        for (Interval interval = iw.activeLists.get(RegisterBinding.Fixed); interval != Interval.EndMarker; interval = interval.next) {
-            CiValue operand = interval.operand;
-
-            assert interval.currentFrom() <= op.id() && op.id() <= interval.currentTo() : "interval should not be active otherwise";
-            assert isVariable(interval.operand) : "fixed interval found";
-
-            // Check if this range covers the instruction. Intervals that
-            // start or end at the current operation are not included in the
-            // oop map, except in the case of patching moves. For patching
-            // moves, any intervals which end at this instruction are included
-            // in the oop map since we may safepoint while doing the patch
-            // before we've consumed the inputs.
-            if (op.id() < interval.currentTo()) {
-                // caller-save registers must not be included into oop-maps at calls
-                assert !op.hasCall() || !isRegister(operand) || !isCallerSave(operand) : "interval is in a caller-save register at a call . register will be overwritten";
-
-                frameMap.setReference(interval.location(), registerRefMap, frameRefMap);
-
-                // Spill optimization: when the stack value is guaranteed to be always correct,
-                // then it must be added to the oop map even if the interval is currently in a register
-                if (interval.alwaysInMemory() && op.id() > interval.spillDefinitionPos() && !interval.location().equals(interval.spillSlot())) {
-                    assert interval.spillDefinitionPos() > 0 : "position not set correctly";
-                    assert interval.spillSlot() != null : "no spill slot assigned";
-                    assert !isRegister(interval.operand) : "interval is on stack :  so stack slot is registered twice";
-                    frameMap.setReference(interval.spillSlot(), registerRefMap, frameRefMap);
-                }
-            }
-        }
-    }
-
-    private boolean isCallerSave(CiValue operand) {
-        return attributes(asRegister(operand)).isCallerSave;
-    }
-
-
-    private void computeDebugInfo(IntervalWalker iw, LIRInstruction op) {
-        assert iw != null : "interval walker needed for debug information";
-        computeDebugInfo(iw, op, op.info);
-
-        if (op instanceof LIRXirInstruction) {
-            LIRXirInstruction xir = (LIRXirInstruction) op;
-            if (xir.infoAfter != null) {
-                computeDebugInfo(iw, op, xir.infoAfter);
-            }
-        }
-    }
-
-
-    private void computeDebugInfo(IntervalWalker iw, final LIRInstruction op, LIRDebugInfo info) {
-        CiBitMap registerRefMap = op.hasCall() ? null : frameMap.initRegisterRefMap();
-        CiBitMap frameRefMap = frameMap.initFrameRefMap();
-        computeOopMap(iw, op, registerRefMap, frameRefMap);
-
-        info.forEachState(new ValueProcedure() {
-            @Override
-            public CiValue doValue(CiValue operand) {
-                int tempOpId = op.id();
-                OperandMode mode = OperandMode.Input;
-                Block block = blockForId(tempOpId);
-                if (block.numberOfSux() == 1 && tempOpId == block.getLastLirInstructionId()) {
-                    // generating debug information for the last instruction of a block.
-                    // if this instruction is a branch, spill moves are inserted before this branch
-                    // and so the wrong operand would be returned (spill moves at block boundaries are not
-                    // considered in the live ranges of intervals)
-                    // Solution: use the first opId of the branch target block instead.
-                    final LIRInstruction instr = block.lir.get(block.lir.size() - 1);
-                    if (instr instanceof StandardOp.JumpOp) {
-                        if (blockData.get(block).liveOut.get(operandNumber(operand))) {
-                            tempOpId = block.suxAt(0).getFirstLirInstructionId();
-                            mode = OperandMode.Output;
-                        }
-                    }
-                }
-
-                // Get current location of operand
-                // The operand must be live because debug information is considered when building the intervals
-                // if the interval is not live, colorLirOperand will cause an assert on failure
-                CiValue result = colorLirOperand((Variable) operand, tempOpId, mode);
-                assert !hasCall(tempOpId) || isStackSlot(result) || !isCallerSave(result) : "cannot have caller-save register operands at calls";
-                return result;
-            }
-        });
-
-        info.finish(registerRefMap, frameRefMap, frameMap);
-    }
-
-    private void assignLocations(List<LIRInstruction> instructions, IntervalWalker iw) {
-        int numInst = instructions.size();
-        boolean hasDead = false;
-
-        for (int j = 0; j < numInst; j++) {
-            final LIRInstruction op = instructions.get(j);
-            if (op == null) { // this can happen when spill-moves are removed in eliminateSpillMoves
-                hasDead = true;
-                continue;
-            }
-
-            ValueProcedure assignProc = new ValueProcedure() {
-                @Override
-                public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
-                    if (isVariable(operand)) {
-                        return colorLirOperand((Variable) operand, op.id(), mode);
-                    }
-                    return operand;
-                }
-            };
-
-            op.forEachInput(assignProc);
-            op.forEachAlive(assignProc);
-            op.forEachTemp(assignProc);
-            op.forEachOutput(assignProc);
-
-            if (op.info != null) {
-                // compute reference map and debug information
-                computeDebugInfo(iw, op);
-            }
-
-            // remove useless moves
-            if (op instanceof MoveOp) {
-                MoveOp move = (MoveOp) op;
-                if (move.getInput() == move.getResult()) {
-                    instructions.set(j, null);
-                    hasDead = true;
-                }
-            }
-        }
-
-        if (hasDead) {
-            // iterate all instructions of the block and remove all null-values.
-            int insertPoint = 0;
-            for (int j = 0; j < numInst; j++) {
-                LIRInstruction op = instructions.get(j);
-                if (op != null) {
-                    if (insertPoint != j) {
-                        instructions.set(insertPoint, op);
-                    }
-                    insertPoint++;
-                }
-            }
-            Util.truncate(instructions, insertPoint);
-        }
-    }
-
-    private void assignLocations() {
-        IntervalWalker iw = initComputeOopMaps();
-        for (Block block : sortedBlocks) {
-            assignLocations(block.lir, iw);
-        }
-    }
-
-    public void allocate() {
-
-        Debug.scope("LifetimeAnalysis", new Runnable() {
-
-            public void run() {
-                numberInstructions();
-                printLir("Before register allocation", true);
-                computeLocalLiveSets();
-                computeGlobalLiveSets();
-                buildIntervals();
-                sortIntervalsBeforeAllocation();
-            }
-        });
-
-        Debug.scope("RegisterAllocation", new Runnable() {
-
-            public void run() {
-                printIntervals("Before register allocation");
-                allocateRegisters();
-            }
-        });
-
-        Debug.scope("ResolveDataFlow", new Runnable() {
-            public void run() {
-                resolveDataFlow();
-            }
-        });
-
-        Debug.scope("DebugInfo", new Runnable() {
-
-            public void run() {
-                frameMap.finish();
-
-                printIntervals("After register allocation");
-                printLir("After register allocation", true);
-
-                sortIntervalsAfterAllocation();
-
-                if (GraalOptions.DetailedAsserts) {
-                    verify();
-                }
-
-                eliminateSpillMoves();
-                assignLocations();
-
-                if (GraalOptions.DetailedAsserts) {
-                    verifyIntervals();
-                }
-            }
-        });
-
-        Debug.scope("ControlFlowOptimizations", new Runnable() {
-
-            public void run() {
-                printLir("After register number assignment", true);
-                EdgeMoveOptimizer.optimize(ir.linearScanOrder());
-                ControlFlowOptimizer.optimize(ir);
-                printLir("After control flow optimization", false);
-            }
-        });
-    }
-
-    void printIntervals(String label) {
-        if (GraalOptions.TraceLinearScanLevel >= 1) {
-            int i;
-            TTY.println();
-            TTY.println(label);
-
-            for (Interval interval : intervals) {
-                if (interval != null) {
-                    TTY.out().println(interval.logString(this));
-                }
-            }
-
-            TTY.println();
-            TTY.println("--- Basic Blocks ---");
-            for (i = 0; i < blockCount(); i++) {
-                Block block = blockAt(i);
-                TTY.print("B%d [%d, %d, %s] ", block.getId(), block.getFirstLirInstructionId(), block.getLastLirInstructionId(), block.getLoop());
-            }
-            TTY.println();
-            TTY.println();
-        }
-
-        Debug.dump(Arrays.copyOf(intervals, intervalsSize), label);
-    }
-
-    void printLir(String label, @SuppressWarnings("unused") boolean hirValid) {
-        Debug.dump(ir, label);
-    }
-
-    boolean verify() {
-        // (check that all intervals have a correct register and that no registers are overwritten)
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println(" verifying intervals *");
-        }
-        verifyIntervals();
-
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println(" verifying that no oops are in fixed intervals *");
-        }
-        //verifyNoOopsInFixedIntervals();
-
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println(" verifying that unpinned constants are not alive across block boundaries");
-        }
-        verifyConstants();
-
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println(" verifying register allocation *");
-        }
-        verifyRegisters();
-
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println(" no errors found *");
-        }
-
-        return true;
-    }
-
-    private void verifyRegisters() {
-        RegisterVerifier verifier = new RegisterVerifier(this);
-        verifier.verify(blockAt(0));
-    }
-
-    void verifyIntervals() {
-        int len = intervalsSize;
-
-        for (int i = 0; i < len; i++) {
-            Interval i1 = intervals[i];
-            if (i1 == null) {
-                continue;
-            }
-
-            i1.checkSplitChildren();
-
-            if (i1.operandNumber != i) {
-                TTY.println("Interval %d is on position %d in list", i1.operandNumber, i);
-                TTY.println(i1.logString(this));
-                throw new GraalInternalError("");
-            }
-
-            if (isVariable(i1.operand) && i1.kind()  == CiKind.Illegal) {
-                TTY.println("Interval %d has no type assigned", i1.operandNumber);
-                TTY.println(i1.logString(this));
-                throw new GraalInternalError("");
-            }
-
-            if (i1.location() == null) {
-                TTY.println("Interval %d has no register assigned", i1.operandNumber);
-                TTY.println(i1.logString(this));
-                throw new GraalInternalError("");
-            }
-
-            if (!isProcessed(i1.location())) {
-                TTY.println("Can not have an Interval for an ignored register " + i1.location());
-                TTY.println(i1.logString(this));
-                throw new GraalInternalError("");
-            }
-
-            if (i1.first() == Range.EndMarker) {
-                TTY.println("Interval %d has no Range", i1.operandNumber);
-                TTY.println(i1.logString(this));
-                throw new GraalInternalError("");
-            }
-
-            for (Range r = i1.first(); r != Range.EndMarker; r = r.next) {
-                if (r.from >= r.to) {
-                    TTY.println("Interval %d has zero length range", i1.operandNumber);
-                    TTY.println(i1.logString(this));
-                    throw new GraalInternalError("");
-                }
-            }
-
-            for (int j = i + 1; j < len; j++) {
-                Interval i2 = intervals[j];
-                if (i2 == null) {
-                    continue;
-                }
-
-                // special intervals that are created in MoveResolver
-                // . ignore them because the range information has no meaning there
-                if (i1.from() == 1 && i1.to() == 2) {
-                    continue;
-                }
-                if (i2.from() == 1 && i2.to() == 2) {
-                    continue;
-                }
-                CiValue l1 = i1.location();
-                CiValue l2 = i2.location();
-                if (i1.intersects(i2) && (l1.equals(l2))) {
-                    if (GraalOptions.DetailedAsserts) {
-                        TTY.println("Intervals %d and %d overlap and have the same register assigned", i1.operandNumber, i2.operandNumber);
-                        TTY.println(i1.logString(this));
-                        TTY.println(i2.logString(this));
-                    }
-                    throw new CiBailout("");
-                }
-            }
-        }
-    }
-
-    class CheckProcedure extends ValueProcedure {
-        boolean ok;
-        Interval curInterval;
-
-        @Override
-        protected CiValue doValue(CiValue operand) {
-            if (isRegister(operand)) {
-                if (intervalFor(operand) == curInterval) {
-                    ok = true;
-                }
-            }
-            return operand;
-        }
-    }
-
-    void verifyNoOopsInFixedIntervals() {
-        CheckProcedure checkProc = new CheckProcedure();
-
-        Interval fixedIntervals;
-        Interval otherIntervals;
-        fixedIntervals = createUnhandledLists(IS_PRECOLORED_INTERVAL, null).first;
-        // to ensure a walking until the last instruction id, add a dummy interval
-        // with a high operation id
-        otherIntervals = new Interval(CiValue.IllegalValue, -1);
-        otherIntervals.addRange(Integer.MAX_VALUE - 2, Integer.MAX_VALUE - 1);
-        IntervalWalker iw = new IntervalWalker(this, fixedIntervals, otherIntervals);
-
-        for (int i = 0; i < blockCount(); i++) {
-            Block block = blockAt(i);
-
-            List<LIRInstruction> instructions = block.lir;
-
-            for (int j = 0; j < instructions.size(); j++) {
-                LIRInstruction op = instructions.get(j);
-
-                if (op.info != null) {
-                    iw.walkBefore(op.id());
-                    boolean checkLive = true;
-
-                    // Make sure none of the fixed registers is live across an
-                    // oopmap since we can't handle that correctly.
-                    if (checkLive) {
-                        for (Interval interval = iw.activeLists.get(RegisterBinding.Fixed); interval != Interval.EndMarker; interval = interval.next) {
-                            if (interval.currentTo() > op.id() + 1) {
-                                // This interval is live out of this op so make sure
-                                // that this interval represents some value that's
-                                // referenced by this op either as an input or output.
-                                checkProc.curInterval = interval;
-                                checkProc.ok = false;
-
-                                op.forEachInput(checkProc);
-                                op.forEachAlive(checkProc);
-                                op.forEachTemp(checkProc);
-                                op.forEachOutput(checkProc);
-
-                                assert checkProc.ok : "fixed intervals should never be live across an oopmap point";
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    void verifyConstants() {
-        int numBlocks = blockCount();
-
-        for (int i = 0; i < numBlocks; i++) {
-            Block block = blockAt(i);
-            BitMap liveAtEdge = blockData.get(block).liveIn;
-
-            // visit all operands where the liveAtEdge bit is set
-            for (int operandNum = liveAtEdge.nextSetBit(0); operandNum >= 0; operandNum = liveAtEdge.nextSetBit(operandNum + 1)) {
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    TTY.println("checking interval %d of block B%d", operandNum, block.getId());
-                }
-                CiValue operand = operandFor(operandNum);
-                assert isVariable(operand) : "value must have variable operand";
-                // TKR assert value.asConstant() == null || value.isPinned() :
-                // "only pinned constants can be alive accross block boundaries";
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,963 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-import static com.oracle.max.cri.ci.CiUtil.*;
-import static com.oracle.graal.alloc.util.LocationUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.alloc.Interval.RegisterBinding;
-import com.oracle.graal.compiler.alloc.Interval.RegisterPriority;
-import com.oracle.graal.compiler.alloc.Interval.SpillState;
-import com.oracle.graal.compiler.alloc.Interval.State;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.StandardOp.*;
-import com.oracle.graal.lir.cfg.*;
-
-/**
- */
-final class LinearScanWalker extends IntervalWalker {
-
-    private final boolean hasCalleeSavedRegisters;
-
-    private CiRegister[] availableRegs;
-
-    private final int[] usePos;
-    private final int[] blockPos;
-
-    private List<Interval>[] spillIntervals;
-
-    private MoveResolver moveResolver; // for ordering spill moves
-
-
-    // accessors mapped to same functions in class LinearScan
-    int blockCount() {
-        return allocator.blockCount();
-    }
-
-    Block blockAt(int idx) {
-        return allocator.blockAt(idx);
-    }
-
-    Block blockOfOpWithId(int opId) {
-        return allocator.blockForId(opId);
-    }
-
-    LinearScanWalker(LinearScan allocator, Interval unhandledFixedFirst, Interval unhandledAnyFirst, boolean hasCalleeSavedRegisters) {
-        super(allocator, unhandledFixedFirst, unhandledAnyFirst);
-        this.hasCalleeSavedRegisters = hasCalleeSavedRegisters;
-        moveResolver = new MoveResolver(allocator);
-        spillIntervals = Util.uncheckedCast(new List[allocator.registers.length]);
-        for (int i = 0; i < allocator.registers.length; i++) {
-            spillIntervals[i] = new ArrayList<>(2);
-        }
-        usePos = new int[allocator.registers.length];
-        blockPos = new int[allocator.registers.length];
-    }
-
-    void initUseLists(boolean onlyProcessUsePos) {
-        for (CiRegister register : availableRegs) {
-            int i = register.number;
-            usePos[i] = Integer.MAX_VALUE;
-
-            if (!onlyProcessUsePos) {
-                blockPos[i] = Integer.MAX_VALUE;
-                spillIntervals[i].clear();
-            }
-        }
-    }
-
-    void excludeFromUse(Interval i) {
-        CiValue location = i.location();
-        int i1 = asRegister(location).number;
-        if (i1 >= availableRegs[0].number && i1 <= availableRegs[availableRegs.length - 1].number) {
-            usePos[i1] = 0;
-        }
-    }
-
-    void setUsePos(Interval interval, int usePos, boolean onlyProcessUsePos) {
-        if (usePos != -1) {
-            assert usePos != 0 : "must use excludeFromUse to set usePos to 0";
-            int i = asRegister(interval.location()).number;
-            if (i >= availableRegs[0].number && i <= availableRegs[availableRegs.length - 1].number) {
-                if (this.usePos[i] > usePos) {
-                    this.usePos[i] = usePos;
-                }
-                if (!onlyProcessUsePos) {
-                    spillIntervals[i].add(interval);
-                }
-            }
-        }
-    }
-
-    void setBlockPos(Interval i, int blockPos) {
-        if (blockPos != -1) {
-            int reg = asRegister(i.location()).number;
-            if (reg >= availableRegs[0].number && reg <= availableRegs[availableRegs.length - 1].number) {
-                if (this.blockPos[reg] > blockPos) {
-                    this.blockPos[reg] = blockPos;
-                }
-                if (usePos[reg] > blockPos) {
-                    usePos[reg] = blockPos;
-                }
-            }
-        }
-    }
-
-    void freeExcludeActiveFixed() {
-        Interval interval = activeLists.get(RegisterBinding.Fixed);
-        while (interval != Interval.EndMarker) {
-            assert isRegister(interval.location()) : "active interval must have a register assigned";
-            excludeFromUse(interval);
-            interval = interval.next;
-        }
-    }
-
-    void freeExcludeActiveAny() {
-        Interval interval = activeLists.get(RegisterBinding.Any);
-        while (interval != Interval.EndMarker) {
-            assert isRegister(interval.location()) : "active interval must have a register assigned";
-            excludeFromUse(interval);
-            interval = interval.next;
-        }
-    }
-
-    void freeCollectInactiveFixed(Interval current) {
-        Interval interval = inactiveLists.get(RegisterBinding.Fixed);
-        while (interval != Interval.EndMarker) {
-            if (current.to() <= interval.currentFrom()) {
-                assert interval.currentIntersectsAt(current) == -1 : "must not intersect";
-                setUsePos(interval, interval.currentFrom(), true);
-            } else {
-                setUsePos(interval, interval.currentIntersectsAt(current), true);
-            }
-            interval = interval.next;
-        }
-    }
-
-    void freeCollectInactiveAny(Interval current) {
-        Interval interval = inactiveLists.get(RegisterBinding.Any);
-        while (interval != Interval.EndMarker) {
-            setUsePos(interval, interval.currentIntersectsAt(current), true);
-            interval = interval.next;
-        }
-    }
-
-    void freeCollectUnhandled(RegisterBinding kind, Interval current) {
-        Interval interval = unhandledLists.get(kind);
-        while (interval != Interval.EndMarker) {
-            setUsePos(interval, interval.intersectsAt(current), true);
-            if (kind == RegisterBinding.Fixed && current.to() <= interval.from()) {
-                setUsePos(interval, interval.from(), true);
-            }
-            interval = interval.next;
-        }
-    }
-
-    void spillExcludeActiveFixed() {
-        Interval interval = activeLists.get(RegisterBinding.Fixed);
-        while (interval != Interval.EndMarker) {
-            excludeFromUse(interval);
-            interval = interval.next;
-        }
-    }
-
-    void spillBlockUnhandledFixed(Interval current) {
-        Interval interval = unhandledLists.get(RegisterBinding.Fixed);
-        while (interval != Interval.EndMarker) {
-            setBlockPos(interval, interval.intersectsAt(current));
-            interval = interval.next;
-        }
-    }
-
-    void spillBlockInactiveFixed(Interval current) {
-        Interval interval = inactiveLists.get(RegisterBinding.Fixed);
-        while (interval != Interval.EndMarker) {
-            if (current.to() > interval.currentFrom()) {
-                setBlockPos(interval, interval.currentIntersectsAt(current));
-            } else {
-                assert interval.currentIntersectsAt(current) == -1 : "invalid optimization: intervals intersect";
-            }
-
-            interval = interval.next;
-        }
-    }
-
-    void spillCollectActiveAny() {
-        Interval interval = activeLists.get(RegisterBinding.Any);
-        while (interval != Interval.EndMarker) {
-            setUsePos(interval, Math.min(interval.nextUsage(RegisterPriority.LiveAtLoopEnd, currentPosition), interval.to()), false);
-            interval = interval.next;
-        }
-    }
-
-    void spillCollectInactiveAny(Interval current) {
-        Interval interval = inactiveLists.get(RegisterBinding.Any);
-        while (interval != Interval.EndMarker) {
-            if (interval.currentIntersects(current)) {
-                setUsePos(interval, Math.min(interval.nextUsage(RegisterPriority.LiveAtLoopEnd, currentPosition), interval.to()), false);
-            }
-            interval = interval.next;
-        }
-    }
-
-    void insertMove(int operandId, Interval srcIt, Interval dstIt) {
-        // output all moves here. When source and target are equal, the move is
-        // optimized away later in assignRegNums
-
-        int opId = (operandId + 1) & ~1;
-        Block opBlock = allocator.blockForId(opId);
-        assert opId > 0 && allocator.blockForId(opId - 2) == opBlock : "cannot insert move at block boundary";
-
-        // calculate index of instruction inside instruction list of current block
-        // the minimal index (for a block with no spill moves) can be calculated because the
-        // numbering of instructions is known.
-        // When the block already contains spill moves, the index must be increased until the
-        // correct index is reached.
-        List<LIRInstruction> list = opBlock.lir;
-        int index = (opId - list.get(0).id()) >> 1;
-        assert list.get(index).id() <= opId : "error in calculation";
-
-        while (list.get(index).id() != opId) {
-            index++;
-            assert 0 <= index && index < list.size() : "index out of bounds";
-        }
-        assert 1 <= index && index < list.size() : "index out of bounds";
-        assert list.get(index).id() == opId : "error in calculation";
-
-        // insert new instruction before instruction at position index
-        moveResolver.moveInsertPosition(opBlock.lir, index);
-        moveResolver.addMapping(srcIt, dstIt);
-    }
-
-    int findOptimalSplitPos(Block minBlock, Block maxBlock, int maxSplitPos) {
-        int fromBlockNr = minBlock.linearScanNumber;
-        int toBlockNr = maxBlock.linearScanNumber;
-
-        assert 0 <= fromBlockNr && fromBlockNr < blockCount() : "out of range";
-        assert 0 <= toBlockNr && toBlockNr < blockCount() : "out of range";
-        assert fromBlockNr < toBlockNr : "must cross block boundary";
-
-        // Try to split at end of maxBlock. If this would be after
-        // maxSplitPos, then use the begin of maxBlock
-        int optimalSplitPos = maxBlock.getLastLirInstructionId() + 2;
-        if (optimalSplitPos > maxSplitPos) {
-            optimalSplitPos = maxBlock.getFirstLirInstructionId();
-        }
-
-        int minLoopDepth = maxBlock.getLoopDepth();
-        for (int i = toBlockNr - 1; i >= fromBlockNr; i--) {
-            Block cur = blockAt(i);
-
-            if (cur.getLoopDepth() < minLoopDepth) {
-                // block with lower loop-depth found . split at the end of this block
-                minLoopDepth = cur.getLoopDepth();
-                optimalSplitPos = cur.getLastLirInstructionId() + 2;
-            }
-        }
-        assert optimalSplitPos > allocator.maxOpId() || allocator.isBlockBegin(optimalSplitPos) : "algorithm must move split pos to block boundary";
-
-        return optimalSplitPos;
-    }
-
-    int findOptimalSplitPos(Interval interval, int minSplitPos, int maxSplitPos, boolean doLoopOptimization) {
-        int optimalSplitPos = -1;
-        if (minSplitPos == maxSplitPos) {
-            // trivial case, no optimization of split position possible
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("      min-pos and max-pos are equal, no optimization possible");
-            }
-            optimalSplitPos = minSplitPos;
-
-        } else {
-            assert minSplitPos < maxSplitPos : "must be true then";
-            assert minSplitPos > 0 : "cannot access minSplitPos - 1 otherwise";
-
-            // reason for using minSplitPos - 1: when the minimal split pos is exactly at the
-            // beginning of a block, then minSplitPos is also a possible split position.
-            // Use the block before as minBlock, because then minBlock.lastLirInstructionId() + 2 == minSplitPos
-            Block minBlock = allocator.blockForId(minSplitPos - 1);
-
-            // reason for using maxSplitPos - 1: otherwise there would be an assert on failure
-            // when an interval ends at the end of the last block of the method
-            // (in this case, maxSplitPos == allocator().maxLirOpId() + 2, and there is no
-            // block at this opId)
-            Block maxBlock = allocator.blockForId(maxSplitPos - 1);
-
-            assert minBlock.linearScanNumber <= maxBlock.linearScanNumber : "invalid order";
-            if (minBlock == maxBlock) {
-                // split position cannot be moved to block boundary : so split as late as possible
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    TTY.println("      cannot move split pos to block boundary because minPos and maxPos are in same block");
-                }
-                optimalSplitPos = maxSplitPos;
-
-            } else {
-                if (interval.hasHoleBetween(maxSplitPos - 1, maxSplitPos) && !allocator.isBlockBegin(maxSplitPos)) {
-                    // Do not move split position if the interval has a hole before maxSplitPos.
-                    // Intervals resulting from Phi-Functions have more than one definition (marked
-                    // as mustHaveRegister) with a hole before each definition. When the register is needed
-                    // for the second definition : an earlier reloading is unnecessary.
-                    if (GraalOptions.TraceLinearScanLevel >= 4) {
-                        TTY.println("      interval has hole just before maxSplitPos, so splitting at maxSplitPos");
-                    }
-                    optimalSplitPos = maxSplitPos;
-
-                } else {
-                    // seach optimal block boundary between minSplitPos and maxSplitPos
-                    if (GraalOptions.TraceLinearScanLevel >= 4) {
-                        TTY.println("      moving split pos to optimal block boundary between block B%d and B%d", minBlock.getId(), maxBlock.getId());
-                    }
-
-                    if (doLoopOptimization) {
-                        // Loop optimization: if a loop-end marker is found between min- and max-position :
-                        // then split before this loop
-                        int loopEndPos = interval.nextUsageExact(RegisterPriority.LiveAtLoopEnd, minBlock.getLastLirInstructionId() + 2);
-                        if (GraalOptions.TraceLinearScanLevel >= 4) {
-                            TTY.println("      loop optimization: loop end found at pos %d", loopEndPos);
-                        }
-
-                        assert loopEndPos > minSplitPos : "invalid order";
-                        if (loopEndPos < maxSplitPos) {
-                            // loop-end marker found between min- and max-position
-                            // if it is not the end marker for the same loop as the min-position : then move
-                            // the max-position to this loop block.
-                            // Desired result: uses tagged as shouldHaveRegister inside a loop cause a reloading
-                            // of the interval (normally, only mustHaveRegister causes a reloading)
-                            Block loopBlock = allocator.blockForId(loopEndPos);
-
-                            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                                TTY.println("      interval is used in loop that ends in block B%d, so trying to move maxBlock back from B%d to B%d", loopBlock.getId(), maxBlock.getId(), loopBlock.getId());
-                            }
-                            assert loopBlock != minBlock : "loopBlock and minBlock must be different because block boundary is needed between";
-
-                            optimalSplitPos = findOptimalSplitPos(minBlock, loopBlock, loopBlock.getLastLirInstructionId() + 2);
-                            if (optimalSplitPos == loopBlock.getLastLirInstructionId() + 2) {
-                                optimalSplitPos = -1;
-                                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                                    TTY.println("      loop optimization not necessary");
-                                }
-                            } else {
-                                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                                    TTY.println("      loop optimization successful");
-                                }
-                            }
-                        }
-                    }
-
-                    if (optimalSplitPos == -1) {
-                        // not calculated by loop optimization
-                        optimalSplitPos = findOptimalSplitPos(minBlock, maxBlock, maxSplitPos);
-                    }
-                }
-            }
-        }
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("      optimal split position: %d", optimalSplitPos);
-        }
-
-        return optimalSplitPos;
-    }
-
-    // split an interval at the optimal position between minSplitPos and
-    // maxSplitPos in two parts:
-    // 1) the left part has already a location assigned
-    // 2) the right part is sorted into to the unhandled-list
-    void splitBeforeUsage(Interval interval, int minSplitPos, int maxSplitPos) {
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("----- splitting interval: ");
-        }
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println(interval.logString(allocator));
-        }
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("      between %d and %d", minSplitPos, maxSplitPos);
-        }
-
-        assert interval.from() < minSplitPos : "cannot split at start of interval";
-        assert currentPosition < minSplitPos : "cannot split before current position";
-        assert minSplitPos <= maxSplitPos : "invalid order";
-        assert maxSplitPos <= interval.to() : "cannot split after end of interval";
-
-        int optimalSplitPos = findOptimalSplitPos(interval, minSplitPos, maxSplitPos, true);
-
-        assert minSplitPos <= optimalSplitPos && optimalSplitPos <= maxSplitPos : "out of range";
-        assert optimalSplitPos <= interval.to() : "cannot split after end of interval";
-        assert optimalSplitPos > interval.from() : "cannot split at start of interval";
-
-        if (optimalSplitPos == interval.to() && interval.nextUsage(RegisterPriority.MustHaveRegister, minSplitPos) == Integer.MAX_VALUE) {
-            // the split position would be just before the end of the interval
-            // . no split at all necessary
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("      no split necessary because optimal split position is at end of interval");
-            }
-            return;
-        }
-
-        // must calculate this before the actual split is performed and before split position is moved to odd opId
-        boolean moveNecessary = !allocator.isBlockBegin(optimalSplitPos) && !interval.hasHoleBetween(optimalSplitPos - 1, optimalSplitPos);
-
-        if (!allocator.isBlockBegin(optimalSplitPos)) {
-            // move position before actual instruction (odd opId)
-            optimalSplitPos = (optimalSplitPos - 1) | 1;
-        }
-
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("      splitting at position %d", optimalSplitPos);
-        }
-        assert allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 1) : "split pos must be odd when not on block boundary";
-        assert !allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 0) : "split pos must be even on block boundary";
-
-        Interval splitPart = interval.split(optimalSplitPos, allocator);
-
-        splitPart.setInsertMoveWhenActivated(moveNecessary);
-
-        assert splitPart.from() >= currentInterval.currentFrom() : "cannot append new interval before current walk position";
-        unhandledLists.addToListSortedByStartAndUsePositions(RegisterBinding.Any, splitPart);
-
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("      split interval in two parts (insertMoveWhenActivated: %b)", moveNecessary);
-        }
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.print("      ");
-            TTY.println(interval.logString(allocator));
-            TTY.print("      ");
-            TTY.println(splitPart.logString(allocator));
-        }
-    }
-
-// split an interval at the optimal position between minSplitPos and
-// maxSplitPos in two parts:
-// 1) the left part has already a location assigned
-// 2) the right part is always on the stack and therefore ignored in further processing
-
-    void splitForSpilling(Interval interval) {
-        // calculate allowed range of splitting position
-        int maxSplitPos = currentPosition;
-        int minSplitPos = Math.max(interval.previousUsage(RegisterPriority.ShouldHaveRegister, maxSplitPos) + 1, interval.from());
-
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.print("----- splitting and spilling interval: ");
-            TTY.println(interval.logString(allocator));
-            TTY.println("      between %d and %d", minSplitPos, maxSplitPos);
-        }
-
-        assert interval.state == State.Active : "why spill interval that is not active?";
-        assert interval.from() <= minSplitPos : "cannot split before start of interval";
-        assert minSplitPos <= maxSplitPos : "invalid order";
-        assert maxSplitPos < interval.to() : "cannot split at end end of interval";
-        assert currentPosition < interval.to() : "interval must not end before current position";
-
-        if (minSplitPos == interval.from()) {
-            // the whole interval is never used, so spill it entirely to memory
-            if (GraalOptions.TraceLinearScanLevel >= 2) {
-                TTY.println("      spilling entire interval because split pos is at beginning of interval");
-                TTY.println("      use positions: " + interval.usePosList().size());
-            }
-            assert interval.firstUsage(RegisterPriority.ShouldHaveRegister) > currentPosition : "interval must not have use position before currentPosition";
-
-            allocator.assignSpillSlot(interval);
-            allocator.changeSpillState(interval, minSplitPos);
-
-            // Also kick parent intervals out of register to memory when they have no use
-            // position. This avoids short interval in register surrounded by intervals in
-            // memory . avoid useless moves from memory to register and back
-            Interval parent = interval;
-            while (parent != null && parent.isSplitChild()) {
-                parent = parent.getSplitChildBeforeOpId(parent.from());
-
-                if (isRegister(parent.location())) {
-                    if (parent.firstUsage(RegisterPriority.ShouldHaveRegister) == Integer.MAX_VALUE) {
-                        // parent is never used, so kick it out of its assigned register
-                        if (GraalOptions.TraceLinearScanLevel >= 4) {
-                            TTY.println("      kicking out interval %d out of its register because it is never used", parent.operandNumber);
-                        }
-                        allocator.assignSpillSlot(parent);
-                    } else {
-                        // do not go further back because the register is actually used by the interval
-                        parent = null;
-                    }
-                }
-            }
-
-        } else {
-            // search optimal split pos, split interval and spill only the right hand part
-            int optimalSplitPos = findOptimalSplitPos(interval, minSplitPos, maxSplitPos, false);
-
-            assert minSplitPos <= optimalSplitPos && optimalSplitPos <= maxSplitPos : "out of range";
-            assert optimalSplitPos < interval.to() : "cannot split at end of interval";
-            assert optimalSplitPos >= interval.from() : "cannot split before start of interval";
-
-            if (!allocator.isBlockBegin(optimalSplitPos)) {
-                // move position before actual instruction (odd opId)
-                optimalSplitPos = (optimalSplitPos - 1) | 1;
-            }
-
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("      splitting at position %d", optimalSplitPos);
-            }
-            assert allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 1) : "split pos must be odd when not on block boundary";
-            assert !allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 0) : "split pos must be even on block boundary";
-
-            Interval spilledPart = interval.split(optimalSplitPos, allocator);
-            allocator.assignSpillSlot(spilledPart);
-            allocator.changeSpillState(spilledPart, optimalSplitPos);
-
-            if (!allocator.isBlockBegin(optimalSplitPos)) {
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    TTY.println("      inserting move from interval %d to %d", interval.operandNumber, spilledPart.operandNumber);
-                }
-                insertMove(optimalSplitPos, interval, spilledPart);
-            }
-
-            // the currentSplitChild is needed later when moves are inserted for reloading
-            assert spilledPart.currentSplitChild() == interval : "overwriting wrong currentSplitChild";
-            spilledPart.makeCurrentSplitChild();
-
-            if (GraalOptions.TraceLinearScanLevel >= 2) {
-                TTY.println("      split interval in two parts");
-                TTY.print("      ");
-                TTY.println(interval.logString(allocator));
-                TTY.print("      ");
-                TTY.println(spilledPart.logString(allocator));
-            }
-        }
-    }
-
-    void splitStackInterval(Interval interval) {
-        int minSplitPos = currentPosition + 1;
-        int maxSplitPos = Math.min(interval.firstUsage(RegisterPriority.ShouldHaveRegister), interval.to());
-
-        splitBeforeUsage(interval, minSplitPos, maxSplitPos);
-    }
-
-    void splitWhenPartialRegisterAvailable(Interval interval, int registerAvailableUntil) {
-        int minSplitPos = Math.max(interval.previousUsage(RegisterPriority.ShouldHaveRegister, registerAvailableUntil), interval.from() + 1);
-        splitBeforeUsage(interval, minSplitPos, registerAvailableUntil);
-    }
-
-    void splitAndSpillInterval(Interval interval) {
-        assert interval.state == State.Active || interval.state == State.Inactive : "other states not allowed";
-
-        int currentPos = currentPosition;
-        if (interval.state == State.Inactive) {
-            // the interval is currently inactive, so no spill slot is needed for now.
-            // when the split part is activated, the interval has a new chance to get a register,
-            // so in the best case no stack slot is necessary
-            assert interval.hasHoleBetween(currentPos - 1, currentPos + 1) : "interval can not be inactive otherwise";
-            splitBeforeUsage(interval, currentPos + 1, currentPos + 1);
-
-        } else {
-            // search the position where the interval must have a register and split
-            // at the optimal position before.
-            // The new created part is added to the unhandled list and will get a register
-            // when it is activated
-            int minSplitPos = currentPos + 1;
-            int maxSplitPos = Math.min(interval.nextUsage(RegisterPriority.MustHaveRegister, minSplitPos), interval.to());
-
-            splitBeforeUsage(interval, minSplitPos, maxSplitPos);
-
-            assert interval.nextUsage(RegisterPriority.MustHaveRegister, currentPos) == Integer.MAX_VALUE : "the remaining part is spilled to stack and therefore has no register";
-            splitForSpilling(interval);
-        }
-    }
-
-    boolean allocFreeRegister(Interval interval) {
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("trying to find free register for " + interval.logString(allocator));
-        }
-
-        initUseLists(true);
-        freeExcludeActiveFixed();
-        freeExcludeActiveAny();
-        freeCollectInactiveFixed(interval);
-        freeCollectInactiveAny(interval);
-        // freeCollectUnhandled(fixedKind, cur);
-        assert unhandledLists.get(RegisterBinding.Fixed) == Interval.EndMarker : "must not have unhandled fixed intervals because all fixed intervals have a use at position 0";
-
-        // usePos contains the start of the next interval that has this register assigned
-        // (either as a fixed register or a normal allocated register in the past)
-        // only intervals overlapping with cur are processed, non-overlapping invervals can be ignored safely
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("      state of registers:");
-            for (CiRegister register : availableRegs) {
-                int i = register.number;
-                TTY.println("      reg %d: usePos: %d", register.number, usePos[i]);
-            }
-        }
-
-        CiRegister hint = null;
-        Interval locationHint = interval.locationHint(true);
-        if (locationHint != null && locationHint.location() != null && isRegister(locationHint.location())) {
-            hint = asRegister(locationHint.location());
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("      hint register %d from interval %s", hint.number, locationHint.logString(allocator));
-            }
-        }
-        assert interval.location() == null : "register already assigned to interval";
-
-        // the register must be free at least until this position
-        int regNeededUntil = interval.from() + 1;
-        int intervalTo = interval.to();
-
-        boolean needSplit = false;
-        int splitPos = -1;
-
-        CiRegister reg = null;
-        CiRegister minFullReg = null;
-        CiRegister maxPartialReg = null;
-
-        for (int i = 0; i < availableRegs.length; ++i) {
-            CiRegister availableReg = availableRegs[i];
-            int number = availableReg.number;
-            if (usePos[number] >= intervalTo) {
-                // this register is free for the full interval
-                if (minFullReg == null || availableReg == hint || (usePos[number] < usePos[minFullReg.number] && minFullReg != hint)) {
-                    minFullReg = availableReg;
-                }
-            } else if (usePos[number] > regNeededUntil) {
-                // this register is at least free until regNeededUntil
-                if (maxPartialReg == null || availableReg == hint || (usePos[number] > usePos[maxPartialReg.number] && maxPartialReg != hint)) {
-                    maxPartialReg = availableReg;
-                }
-            }
-        }
-
-        if (minFullReg != null) {
-            reg = minFullReg;
-        } else if (maxPartialReg != null) {
-            needSplit = true;
-            reg = maxPartialReg;
-        } else {
-            return false;
-        }
-
-        splitPos = usePos[reg.number];
-        interval.assignLocation(reg.asValue(interval.kind()));
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("selected register %d", reg.number);
-        }
-
-        assert splitPos > 0 : "invalid splitPos";
-        if (needSplit) {
-            // register not available for full interval, so split it
-            splitWhenPartialRegisterAvailable(interval, splitPos);
-        }
-
-        // only return true if interval is completely assigned
-        return true;
-    }
-
-    CiRegister findLockedRegister(int regNeededUntil, int intervalTo, CiValue ignoreReg, boolean[] needSplit) {
-        int maxReg = -1;
-        CiRegister ignore = isRegister(ignoreReg) ? asRegister(ignoreReg) : null;
-
-        for (CiRegister reg : availableRegs) {
-            int i = reg.number;
-            if (reg == ignore) {
-                // this register must be ignored
-
-            } else if (usePos[i] > regNeededUntil) {
-                if (maxReg == -1 || (usePos[i] > usePos[maxReg])) {
-                    maxReg = i;
-                }
-            }
-        }
-
-        if (maxReg != -1) {
-            if (blockPos[maxReg] <= intervalTo) {
-                needSplit[0] = true;
-            }
-            return availableRegs[maxReg];
-        }
-
-        return null;
-    }
-
-    void splitAndSpillIntersectingIntervals(CiRegister reg) {
-        assert reg != null : "no register assigned";
-
-        for (int i = 0; i < spillIntervals[reg.number].size(); i++) {
-            Interval interval = spillIntervals[reg.number].get(i);
-            removeFromList(interval);
-            splitAndSpillInterval(interval);
-        }
-    }
-
-    // Split an Interval and spill it to memory so that cur can be placed in a register
-    void allocLockedRegister(Interval interval) {
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("need to split and spill to get register for " + interval.logString(allocator));
-        }
-
-        // collect current usage of registers
-        initUseLists(false);
-        spillExcludeActiveFixed();
-        //  spillBlockUnhandledFixed(cur);
-        assert unhandledLists.get(RegisterBinding.Fixed) == Interval.EndMarker : "must not have unhandled fixed intervals because all fixed intervals have a use at position 0";
-        spillBlockInactiveFixed(interval);
-        spillCollectActiveAny();
-        spillCollectInactiveAny(interval);
-
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("      state of registers:");
-            for (CiRegister reg : availableRegs) {
-                int i = reg.number;
-                TTY.print("      reg %d: usePos: %d, blockPos: %d, intervals: ", i, usePos[i], blockPos[i]);
-                for (int j = 0; j < spillIntervals[i].size(); j++) {
-                    TTY.print("%d ", spillIntervals[i].get(j).operandNumber);
-                }
-                TTY.println();
-            }
-        }
-
-        // the register must be free at least until this position
-        int firstUsage = interval.firstUsage(RegisterPriority.MustHaveRegister);
-        int regNeededUntil = Math.min(firstUsage, interval.from() + 1);
-        int intervalTo = interval.to();
-        assert regNeededUntil > 0 && regNeededUntil < Integer.MAX_VALUE : "interval has no use";
-
-        CiRegister reg = null;
-        CiRegister ignore = interval.location() != null && isRegister(interval.location()) ? asRegister(interval.location()) : null;
-        for (CiRegister availableReg : availableRegs) {
-            int number = availableReg.number;
-            if (availableReg == ignore) {
-                // this register must be ignored
-            } else if (usePos[number] > regNeededUntil) {
-                if (reg == null || (usePos[number] > usePos[reg.number])) {
-                    reg = availableReg;
-                }
-            }
-        }
-
-        if (reg == null || usePos[reg.number] <= firstUsage) {
-            // the first use of cur is later than the spilling position -> spill cur
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("able to spill current interval. firstUsage(register): %d, usePos: %d", firstUsage, reg == null ? 0 : usePos[reg.number]);
-            }
-
-            if (firstUsage <= interval.from() + 1) {
-                assert false : "cannot spill interval that is used in first instruction (possible reason: no register found) firstUsage=" + firstUsage + ", interval.from()=" + interval.from();
-                // assign a reasonable register and do a bailout in product mode to avoid errors
-                allocator.assignSpillSlot(interval);
-                throw new CiBailout("LinearScan: no register found");
-            }
-
-            splitAndSpillInterval(interval);
-            return;
-        }
-
-        boolean needSplit = blockPos[reg.number] <= intervalTo;
-
-        int splitPos = blockPos[reg.number];
-
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("decided to use register %d", reg.number);
-        }
-        assert splitPos > 0 : "invalid splitPos";
-        assert needSplit || splitPos > interval.from() : "splitting interval at from";
-
-        interval.assignLocation(reg.asValue(interval.kind()));
-        if (needSplit) {
-            // register not available for full interval :  so split it
-            splitWhenPartialRegisterAvailable(interval, splitPos);
-        }
-
-        // perform splitting and spilling for all affected intervals
-        splitAndSpillIntersectingIntervals(reg);
-    }
-
-    boolean noAllocationPossible(Interval interval) {
-
-        if (!hasCalleeSavedRegisters) {
-            // fast calculation of intervals that can never get a register because the
-            // the next instruction is a call that blocks all registers
-            // Note: this does not work if callee-saved registers are available (e.g. on Sparc)
-
-            // check if this interval is the result of a split operation
-            // (an interval got a register until this position)
-            int pos = interval.from();
-            if (isOdd(pos)) {
-                // the current instruction is a call that blocks all registers
-                if (pos < allocator.maxOpId() && allocator.hasCall(pos + 1) && interval.to() > pos + 1) {
-                    if (GraalOptions.TraceLinearScanLevel >= 4) {
-                        TTY.println("      free register cannot be available because all registers blocked by following call");
-                    }
-
-                    // safety check that there is really no register available
-                    assert !allocFreeRegister(interval) : "found a register for this interval";
-                    return true;
-                }
-
-            }
-        }
-        return false;
-    }
-
-    void initVarsForAlloc(Interval interval) {
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = allocator.frameMap.registerConfig.getCategorizedAllocatableRegisters();
-        availableRegs = categorizedRegs.get(asVariable(interval.operand).flag);
-    }
-
-    static boolean isMove(LIRInstruction op, Interval from, Interval to) {
-        if (op instanceof MoveOp) {
-            MoveOp move = (MoveOp) op;
-            return isVariable(move.getInput()) && isVariable(move.getResult()) && move.getInput() == from.operand && move.getResult() == to.operand;
-        }
-        return false;
-    }
-
-    // optimization (especially for phi functions of nested loops):
-    // assign same spill slot to non-intersecting intervals
-    void combineSpilledIntervals(Interval interval) {
-        if (interval.isSplitChild()) {
-            // optimization is only suitable for split parents
-            return;
-        }
-
-        Interval registerHint = interval.locationHint(false);
-        if (registerHint == null) {
-            // cur is not the target of a move : otherwise registerHint would be set
-            return;
-        }
-        assert registerHint.isSplitParent() : "register hint must be split parent";
-
-        if (interval.spillState() != SpillState.NoOptimization || registerHint.spillState() != SpillState.NoOptimization) {
-            // combining the stack slots for intervals where spill move optimization is applied
-            // is not benefitial and would cause problems
-            return;
-        }
-
-        int beginPos = interval.from();
-        int endPos = interval.to();
-        if (endPos > allocator.maxOpId() || isOdd(beginPos) || isOdd(endPos)) {
-            // safety check that lirOpWithId is allowed
-            return;
-        }
-
-        if (!isMove(allocator.instructionForId(beginPos), registerHint, interval) || !isMove(allocator.instructionForId(endPos), interval, registerHint)) {
-            // cur and registerHint are not connected with two moves
-            return;
-        }
-
-        Interval beginHint = registerHint.getSplitChildAtOpId(beginPos, LIRInstruction.OperandMode.Input, allocator);
-        Interval endHint = registerHint.getSplitChildAtOpId(endPos, LIRInstruction.OperandMode.Output, allocator);
-        if (beginHint == endHint || beginHint.to() != beginPos || endHint.from() != endPos) {
-            // registerHint must be split : otherwise the re-writing of use positions does not work
-            return;
-        }
-
-        assert beginHint.location() != null : "must have register assigned";
-        assert endHint.location() == null : "must not have register assigned";
-        assert interval.firstUsage(RegisterPriority.MustHaveRegister) == beginPos : "must have use position at begin of interval because of move";
-        assert endHint.firstUsage(RegisterPriority.MustHaveRegister) == endPos : "must have use position at begin of interval because of move";
-
-        if (isRegister(beginHint.location())) {
-            // registerHint is not spilled at beginPos : so it would not be benefitial to immediately spill cur
-            return;
-        }
-        assert registerHint.spillSlot() != null : "must be set when part of interval was spilled";
-
-        // modify intervals such that cur gets the same stack slot as registerHint
-        // delete use positions to prevent the intervals to get a register at beginning
-        interval.setSpillSlot(registerHint.spillSlot());
-        interval.removeFirstUsePos();
-        endHint.removeFirstUsePos();
-    }
-
-    // allocate a physical register or memory location to an interval
-    @Override
-    boolean activateCurrent() {
-        Interval interval = currentInterval;
-        boolean result = true;
-
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("+++++ activating interval " + interval.logString(allocator));
-        }
-
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("      splitParent: %s, insertMoveWhenActivated: %b", interval.splitParent().operandNumber, interval.insertMoveWhenActivated());
-        }
-
-        final CiValue operand = interval.operand;
-        if (interval.location() != null && isStackSlot(interval.location())) {
-            // activating an interval that has a stack slot assigned . split it at first use position
-            // used for method parameters
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("      interval has spill slot assigned (method parameter) . split it before first use");
-            }
-            splitStackInterval(interval);
-            result = false;
-
-        } else {
-            if (interval.location() == null) {
-                // interval has not assigned register . normal allocation
-                // (this is the normal case for most intervals)
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    TTY.println("      normal allocation of register");
-                }
-
-                // assign same spill slot to non-intersecting intervals
-                combineSpilledIntervals(interval);
-
-                initVarsForAlloc(interval);
-                if (noAllocationPossible(interval) || !allocFreeRegister(interval)) {
-                    // no empty register available.
-                    // split and spill another interval so that this interval gets a register
-                    allocLockedRegister(interval);
-                }
-
-                // spilled intervals need not be move to active-list
-                if (!isRegister(interval.location())) {
-                    result = false;
-                }
-            }
-        }
-
-        // load spilled values that become active from stack slot to register
-        if (interval.insertMoveWhenActivated()) {
-            assert interval.isSplitChild();
-            assert interval.currentSplitChild() != null;
-            assert interval.currentSplitChild().operand != operand : "cannot insert move between same interval";
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println("Inserting move from interval %d to %d because insertMoveWhenActivated is set", interval.currentSplitChild().operandNumber, interval.operandNumber);
-            }
-
-            insertMove(interval.from(), interval.currentSplitChild(), interval);
-        }
-        interval.makeCurrentSplitChild();
-
-        return result; // true = interval is moved to active list
-    }
-
-    public void finishAllocation() {
-        // must be called when all intervals are allocated
-        moveResolver.resolveAndAppendMoves();
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-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.graal.compiler.*;
-import com.oracle.graal.lir.*;
-
-/**
- */
-final class MoveResolver {
-
-    private final LinearScan allocator;
-
-    private int insertIdx;
-    private LIRInsertionBuffer insertionBuffer; // buffer where moves are inserted
-
-    private final List<Interval> mappingFrom;
-    private final List<CiValue> mappingFromOpr;
-    private final List<Interval> mappingTo;
-    private boolean multipleReadsAllowed;
-    private final int[] registerBlocked;
-
-    private int registerBlocked(int reg) {
-        return registerBlocked[reg];
-    }
-
-    private void setRegisterBlocked(int reg, int direction) {
-        assert direction == 1 || direction == -1 : "out of bounds";
-        registerBlocked[reg] += direction;
-    }
-
-    void setMultipleReadsAllowed() {
-        multipleReadsAllowed = true;
-    }
-
-    boolean hasMappings() {
-        return mappingFrom.size() > 0;
-    }
-
-    MoveResolver(LinearScan allocator) {
-
-        this.allocator = allocator;
-        this.multipleReadsAllowed = false;
-        this.mappingFrom = new ArrayList<>(8);
-        this.mappingFromOpr = new ArrayList<>(8);
-        this.mappingTo = new ArrayList<>(8);
-        this.insertIdx = -1;
-        this.insertionBuffer = new LIRInsertionBuffer();
-        this.registerBlocked = new int[allocator.registers.length];
-        assert checkEmpty();
-    }
-
-    boolean checkEmpty() {
-        assert mappingFrom.size() == 0 && mappingFromOpr.size() == 0 && mappingTo.size() == 0 : "list must be empty before and after processing";
-        for (int i = 0; i < allocator.registers.length; i++) {
-            assert registerBlocked(i) == 0 : "register map must be empty before and after processing";
-        }
-        assert !multipleReadsAllowed : "must have default value";
-        return true;
-    }
-
-    private boolean verifyBeforeResolve() {
-        assert mappingFrom.size() == mappingFromOpr.size() : "length must be equal";
-        assert mappingFrom.size() == mappingTo.size() : "length must be equal";
-        assert insertIdx != -1 : "insert position not set";
-
-        int i;
-        int j;
-        if (!multipleReadsAllowed) {
-            for (i = 0; i < mappingFrom.size(); i++) {
-                for (j = i + 1; j < mappingFrom.size(); j++) {
-                    assert mappingFrom.get(i) == null || mappingFrom.get(i) != mappingFrom.get(j) : "cannot read from same interval twice";
-                }
-            }
-        }
-
-        for (i = 0; i < mappingTo.size(); i++) {
-            for (j = i + 1; j < mappingTo.size(); j++) {
-                assert mappingTo.get(i) != mappingTo.get(j) : "cannot write to same interval twice";
-            }
-        }
-
-        HashSet<CiValue> usedRegs = new HashSet<>();
-        if (!multipleReadsAllowed) {
-            for (i = 0; i < mappingFrom.size(); i++) {
-                Interval interval = mappingFrom.get(i);
-                if (interval != null) {
-                    boolean unique = usedRegs.add(interval.location());
-                    assert unique : "cannot read from same register twice";
-                }
-            }
-        }
-
-        usedRegs.clear();
-        for (i = 0; i < mappingTo.size(); i++) {
-            Interval interval = mappingTo.get(i);
-            boolean unique = usedRegs.add(interval.location());
-            assert unique : "cannot write to same register twice";
-        }
-
-        usedRegs.clear();
-        for (i = 0; i < mappingFrom.size(); i++) {
-            Interval interval = mappingFrom.get(i);
-            if (interval != null && !isRegister(interval.location())) {
-                usedRegs.add(interval.location());
-            }
-        }
-        for (i = 0; i < mappingTo.size(); i++) {
-            Interval interval = mappingTo.get(i);
-            assert !usedRegs.contains(interval.location()) || interval.location() == mappingFrom.get(i).location() : "stack slots used in mappingFrom must be disjoint to mappingTo";
-        }
-
-        return true;
-    }
-
-    // mark assignedReg and assignedRegHi of the interval as blocked
-    private void blockRegisters(Interval interval) {
-        CiValue location = interval.location();
-        if (isRegister(location)) {
-            int reg = asRegister(location).number;
-            assert multipleReadsAllowed || registerBlocked(reg) == 0 : "register already marked as used";
-            setRegisterBlocked(reg, 1);
-        }
-    }
-
-    // mark assignedReg and assignedRegHi of the interval as unblocked
-    private void unblockRegisters(Interval interval) {
-        CiValue location = interval.location();
-        if (isRegister(location)) {
-            int reg = asRegister(location).number;
-            assert registerBlocked(reg) > 0 : "register already marked as unused";
-            setRegisterBlocked(reg, -1);
-        }
-    }
-
-    /**
-     * Checks if the {@linkplain Interval#location() location} of {@code to} is not blocked
-     * or is only blocked by {@code from}.
-     */
-    private boolean safeToProcessMove(Interval from, Interval to) {
-        CiValue fromReg = from != null ? from.location() : null;
-
-        CiValue reg = to.location();
-        if (isRegister(reg)) {
-            if (registerBlocked(asRegister(reg).number) > 1 || (registerBlocked(asRegister(reg).number) == 1 && reg != fromReg)) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    private void createInsertionBuffer(List<LIRInstruction> list) {
-        assert !insertionBuffer.initialized() : "overwriting existing buffer";
-        insertionBuffer.init(list);
-    }
-
-    private void appendInsertionBuffer() {
-        if (insertionBuffer.initialized()) {
-            insertionBuffer.finish();
-        }
-        assert !insertionBuffer.initialized() : "must be uninitialized now";
-
-        insertIdx = -1;
-    }
-
-    private void insertMove(Interval fromInterval, Interval toInterval) {
-        assert fromInterval.operand != toInterval.operand : "from and to interval equal: " + fromInterval;
-        assert fromInterval.kind() == toInterval.kind() : "move between different types";
-        assert insertIdx != -1 : "must setup insert position first";
-
-        CiValue fromOpr = fromInterval.operand;
-        CiValue toOpr = toInterval.operand;
-
-        insertionBuffer.append(insertIdx, allocator.ir.spillMoveFactory.createMove(toOpr, fromOpr));
-
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("MoveResolver: inserted move from %d (%s) to %d (%s)", fromInterval.operandNumber, fromInterval.location(), toInterval.operandNumber, toInterval.location());
-        }
-    }
-
-    private void insertMove(CiValue fromOpr, Interval toInterval) {
-        assert fromOpr.kind == toInterval.kind() : "move between different types";
-        assert insertIdx != -1 : "must setup insert position first";
-
-        CiValue toOpr = toInterval.operand;
-        insertionBuffer.append(insertIdx, allocator.ir.spillMoveFactory.createMove(toOpr, fromOpr));
-
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.print("MoveResolver: inserted move from constant %s to %d (%s)", fromOpr, toInterval.operandNumber, toInterval.location());
-        }
-    }
-
-    private void resolveMappings() {
-        assert verifyBeforeResolve();
-
-        // Block all registers that are used as input operands of a move.
-        // When a register is blocked, no move to this register is emitted.
-        // This is necessary for detecting cycles in moves.
-        int i;
-        for (i = mappingFrom.size() - 1; i >= 0; i--) {
-            Interval fromInterval = mappingFrom.get(i);
-            if (fromInterval != null) {
-                blockRegisters(fromInterval);
-            }
-        }
-
-        int spillCandidate = -1;
-        while (mappingFrom.size() > 0) {
-            boolean processedInterval = false;
-
-            for (i = mappingFrom.size() - 1; i >= 0; i--) {
-                Interval fromInterval = mappingFrom.get(i);
-                Interval toInterval = mappingTo.get(i);
-
-                if (safeToProcessMove(fromInterval, toInterval)) {
-                    // this interval can be processed because target is free
-                    if (fromInterval != null) {
-                        insertMove(fromInterval, toInterval);
-                        unblockRegisters(fromInterval);
-                    } else {
-                        insertMove(mappingFromOpr.get(i), toInterval);
-                    }
-                    mappingFrom.remove(i);
-                    mappingFromOpr.remove(i);
-                    mappingTo.remove(i);
-
-                    processedInterval = true;
-                } else if (fromInterval != null && isRegister(fromInterval.location())) {
-                    // this interval cannot be processed now because target is not free
-                    // it starts in a register, so it is a possible candidate for spilling
-                    spillCandidate = i;
-                }
-            }
-
-            if (!processedInterval) {
-                // no move could be processed because there is a cycle in the move list
-                // (e.g. r1 . r2, r2 . r1), so one interval must be spilled to memory
-                assert spillCandidate != -1 : "no interval in register for spilling found";
-
-                // create a new spill interval and assign a stack slot to it
-                Interval fromInterval = mappingFrom.get(spillCandidate);
-                Interval spillInterval = allocator.createDerivedInterval(fromInterval);
-                spillInterval.setKind(fromInterval.kind());
-
-                // add a dummy range because real position is difficult to calculate
-                // Note: this range is a special case when the integrity of the allocation is checked
-                spillInterval.addRange(1, 2);
-
-                // do not allocate a new spill slot for temporary interval, but
-                // use spill slot assigned to fromInterval. Otherwise moves from
-                // one stack slot to another can happen (not allowed by LIRAssembler
-                CiStackSlot spillSlot = fromInterval.spillSlot();
-                if (spillSlot == null) {
-                    spillSlot = allocator.frameMap.allocateSpillSlot(spillInterval.kind());
-                    fromInterval.setSpillSlot(spillSlot);
-                }
-                spillInterval.assignLocation(spillSlot);
-
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    TTY.println("created new Interval %s for spilling", spillInterval.operand);
-                }
-
-                // insert a move from register to stack and update the mapping
-                insertMove(fromInterval, spillInterval);
-                mappingFrom.set(spillCandidate, spillInterval);
-                unblockRegisters(fromInterval);
-            }
-        }
-
-        // reset to default value
-        multipleReadsAllowed = false;
-
-        // check that all intervals have been processed
-        assert checkEmpty();
-    }
-
-    void setInsertPosition(List<LIRInstruction> insertList, int insertIdx) {
-        assert this.insertIdx == -1 : "use moveInsertPosition instead of setInsertPosition when data already set";
-
-        createInsertionBuffer(insertList);
-        this.insertIdx = insertIdx;
-    }
-
-    void moveInsertPosition(List<LIRInstruction> newInsertList, int newInsertIdx) {
-        if (insertionBuffer.lirList() != null && (insertionBuffer.lirList() != newInsertList || this.insertIdx != newInsertIdx)) {
-            // insert position changed . resolve current mappings
-            resolveMappings();
-        }
-
-        if (insertionBuffer.lirList() != newInsertList) {
-            // block changed . append insertionBuffer because it is
-            // bound to a specific block and create a new insertionBuffer
-            appendInsertionBuffer();
-            createInsertionBuffer(newInsertList);
-        }
-
-        this.insertIdx = newInsertIdx;
-    }
-
-    void addMapping(Interval fromInterval, Interval toInterval) {
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("MoveResolver: adding mapping from interval %d (%s) to interval %d (%s)", fromInterval.operandNumber, fromInterval.location(), toInterval.operandNumber, toInterval.location());
-        }
-
-        assert fromInterval.operand != toInterval.operand : "from and to interval equal: " + fromInterval;
-        assert fromInterval.kind() == toInterval.kind();
-        mappingFrom.add(fromInterval);
-        mappingFromOpr.add(CiValue.IllegalValue);
-        mappingTo.add(toInterval);
-    }
-
-    void addMapping(CiValue fromOpr, Interval toInterval) {
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("MoveResolver: adding mapping from %s to %d (%s)", fromOpr, toInterval.operandNumber, toInterval.location());
-        }
-        assert isConstant(fromOpr) : "only for constants";
-
-        mappingFrom.add(null);
-        mappingFromOpr.add(fromOpr);
-        mappingTo.add(toInterval);
-    }
-
-    void resolveAndAppendMoves() {
-        if (hasMappings()) {
-            resolveMappings();
-        }
-        appendInsertionBuffer();
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/Range.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-
-/**
- * Represents a range of integers from a start (inclusive) to an end (exclusive.
- */
-public final class Range {
-
-    public static final Range EndMarker = new Range(Integer.MAX_VALUE, Integer.MAX_VALUE, null);
-
-    /**
-     * The start of the range, inclusive.
-     */
-    public int from;
-
-    /**
-     * The end of the range, exclusive.
-     */
-    public int to;
-
-    /**
-     * A link to allow the range to be put into a singly linked list.
-     */
-    public Range next;
-
-    boolean intersects(Range r) {
-        return intersectsAt(r) != -1;
-    }
-
-
-    /**
-     * Creates a new range.
-     *
-     * @param from the start of the range, inclusive
-     * @param to the end of the range, exclusive
-     * @param next link to the next range in a linked list
-     */
-    Range(int from, int to, Range next) {
-        this.from = from;
-        this.to = to;
-        this.next = next;
-    }
-
-    int intersectsAt(Range other) {
-        Range r1 = this;
-        Range r2 = other;
-
-        assert r2 != null : "null ranges not allowed";
-        assert r1 != EndMarker && r2 != EndMarker : "empty ranges not allowed";
-
-        do {
-            if (r1.from < r2.from) {
-                if (r1.to <= r2.from) {
-                    r1 = r1.next;
-                    if (r1 == EndMarker) {
-                        return -1;
-                    }
-                } else {
-                    return r2.from;
-                }
-            } else {
-                if (r2.from < r1.from) {
-                    if (r2.to <= r1.from) {
-                        r2 = r2.next;
-                        if (r2 == EndMarker) {
-                            return -1;
-                        }
-                    } else {
-                        return r1.from;
-                    }
-                } else { // r1.from() == r2.from()
-                    if (r1.from == r1.to) {
-                        r1 = r1.next;
-                        if (r1 == EndMarker) {
-                            return -1;
-                        }
-                    } else {
-                        if (r2.from == r2.to) {
-                            r2 = r2.next;
-                            if (r2 == EndMarker) {
-                                return -1;
-                            }
-                        } else {
-                            return r1.from;
-                        }
-                    }
-                }
-            }
-        } while (true);
-    }
-
-    @Override
-    public String toString() {
-        return "[" + from + ", " + to + "]";
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.alloc;
-
-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.graal.compiler.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-/**
- */
-final class RegisterVerifier {
-
-    LinearScan allocator;
-    List<Block> workList; // all blocks that must be processed
-    ArrayMap<Interval[]> savedStates; // saved information of previous check
-
-    // simplified access to methods of LinearScan
-    Interval intervalAt(CiValue operand) {
-        return allocator.intervalFor(operand);
-    }
-
-    // currently, only registers are processed
-    int stateSize() {
-        return allocator.maxRegisterNumber() + 1;
-    }
-
-    // accessors
-    Interval[] stateForBlock(Block block) {
-        return savedStates.get(block.getId());
-    }
-
-    void setStateForBlock(Block block, Interval[] savedState) {
-        savedStates.put(block.getId(), savedState);
-    }
-
-    void addToWorkList(Block block) {
-        if (!workList.contains(block)) {
-            workList.add(block);
-        }
-    }
-
-    RegisterVerifier(LinearScan allocator) {
-        this.allocator = allocator;
-        workList = new ArrayList<>(16);
-        this.savedStates = new ArrayMap<>();
-
-    }
-
-    void verify(Block start) {
-        // setup input registers (method arguments) for first block
-        Interval[] inputState = new Interval[stateSize()];
-        setStateForBlock(start, inputState);
-        addToWorkList(start);
-
-        // main loop for verification
-        do {
-            Block block = workList.get(0);
-            workList.remove(0);
-
-            processBlock(block);
-        } while (!workList.isEmpty());
-    }
-
-    private void processBlock(Block block) {
-        if (GraalOptions.TraceLinearScanLevel >= 2) {
-            TTY.println();
-            TTY.println("processBlock B%d", block.getId());
-        }
-
-        // must copy state because it is modified
-        Interval[] inputState = copy(stateForBlock(block));
-
-        if (GraalOptions.TraceLinearScanLevel >= 4) {
-            TTY.println("Input-State of intervals:");
-            TTY.print("    ");
-            for (int i = 0; i < stateSize(); i++) {
-                if (inputState[i] != null) {
-                    TTY.print(" %4d", inputState[i].operandNumber);
-                } else {
-                    TTY.print("   __");
-                }
-            }
-            TTY.println();
-            TTY.println();
-        }
-
-        // process all operations of the block
-        processOperations(block.lir, inputState);
-
-        // iterate all successors
-        for (int i = 0; i < block.numberOfSux(); i++) {
-            Block succ = block.suxAt(i);
-            processSuccessor(succ, inputState);
-        }
-    }
-
-    private void processSuccessor(Block block, Interval[] inputState) {
-        Interval[] savedState = stateForBlock(block);
-
-        if (savedState != null) {
-            // this block was already processed before.
-            // check if new inputState is consistent with savedState
-
-            boolean savedStateCorrect = true;
-            for (int i = 0; i < stateSize(); i++) {
-                if (inputState[i] != savedState[i]) {
-                    // current inputState and previous savedState assume a different
-                    // interval in this register . assume that this register is invalid
-                    if (savedState[i] != null) {
-                        // invalidate old calculation only if it assumed that
-                        // register was valid. when the register was already invalid,
-                        // then the old calculation was correct.
-                        savedStateCorrect = false;
-                        savedState[i] = null;
-
-                        if (GraalOptions.TraceLinearScanLevel >= 4) {
-                            TTY.println("processSuccessor B%d: invalidating slot %d", block.getId(), i);
-                        }
-                    }
-                }
-            }
-
-            if (savedStateCorrect) {
-                // already processed block with correct inputState
-                if (GraalOptions.TraceLinearScanLevel >= 2) {
-                    TTY.println("processSuccessor B%d: previous visit already correct", block.getId());
-                }
-            } else {
-                // must re-visit this block
-                if (GraalOptions.TraceLinearScanLevel >= 2) {
-                    TTY.println("processSuccessor B%d: must re-visit because input state changed", block.getId());
-                }
-                addToWorkList(block);
-            }
-
-        } else {
-            // block was not processed before, so set initial inputState
-            if (GraalOptions.TraceLinearScanLevel >= 2) {
-                TTY.println("processSuccessor B%d: initial visit", block.getId());
-            }
-
-            setStateForBlock(block, copy(inputState));
-            addToWorkList(block);
-        }
-    }
-
-    static Interval[] copy(Interval[] inputState) {
-        return inputState.clone();
-    }
-
-    static void statePut(Interval[] inputState, CiValue location, Interval interval) {
-        if (location != null && isRegister(location)) {
-            CiRegister reg = asRegister(location);
-            int regNum = reg.number;
-            if (interval != null) {
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    TTY.println("        %s = %s", reg, interval.operand);
-                }
-            } else if (inputState[regNum] != null) {
-                if (GraalOptions.TraceLinearScanLevel >= 4) {
-                    TTY.println("        %s = null", reg);
-                }
-            }
-
-            inputState[regNum] = interval;
-        }
-    }
-
-    static boolean checkState(Interval[] inputState, CiValue reg, Interval interval) {
-        if (reg != null && isRegister(reg)) {
-            if (inputState[asRegister(reg).number] != interval) {
-                throw new GraalInternalError("!! Error in register allocation: register %s does not contain interval %s but interval %s", reg, interval.operand, inputState[asRegister(reg).number]);
-            }
-        }
-        return true;
-    }
-
-    void processOperations(List<LIRInstruction> ops, final Interval[] inputState) {
-        // visit all instructions of the block
-        for (int i = 0; i < ops.size(); i++) {
-            final LIRInstruction op = ops.get(i);
-
-            if (GraalOptions.TraceLinearScanLevel >= 4) {
-                TTY.println(op.toStringWithIdPrefix());
-            }
-
-            ValueProcedure useProc = new ValueProcedure() {
-                @Override
-                public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
-                    if (LinearScan.isVariableOrRegister(operand) && allocator.isProcessed(operand)) {
-                        Interval interval = intervalAt(operand);
-                        if (op.id() != -1) {
-                            interval = interval.getSplitChildAtOpId(op.id(), mode, allocator);
-                        }
-
-                        assert checkState(inputState, interval.location(), interval.splitParent());
-                    }
-                    return operand;
-                }
-            };
-
-            ValueProcedure defProc = new ValueProcedure() {
-                @Override
-                public CiValue doValue(CiValue operand, OperandMode mode, EnumSet<OperandFlag> flags) {
-                    if (LinearScan.isVariableOrRegister(operand) && allocator.isProcessed(operand)) {
-                        Interval interval = intervalAt(operand);
-                        if (op.id() != -1) {
-                            interval = interval.getSplitChildAtOpId(op.id(), mode, allocator);
-                        }
-
-                        statePut(inputState, interval.location(), interval.splitParent());
-                    }
-                    return operand;
-                }
-            };
-
-            // check if input operands are correct
-            op.forEachInput(useProc);
-            // invalidate all caller save registers at calls
-            if (op.hasCall()) {
-                for (CiRegister r : allocator.frameMap.registerConfig.getCallerSaveRegisters()) {
-                    statePut(inputState, r.asValue(), null);
-                }
-            }
-            op.forEachAlive(useProc);
-            // set temp operands (some operations use temp operands also as output operands, so can't set them null)
-            op.forEachTemp(defProc);
-            // set output operands
-            op.forEachOutput(defProc);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/debug/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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.
- */
-/**
- * A collection of debugging aids for Graal development.
- */
-package com.oracle.graal.compiler.debug;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.gen;
-
-import java.util.*;
-import java.util.Map.Entry;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.compiler.gen.LIRGenerator.LockScope;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.virtual.*;
-
-public class DebugInfoBuilder {
-    private final NodeMap<CiValue> nodeOperands;
-
-    public DebugInfoBuilder(NodeMap<CiValue> nodeOperands) {
-        this.nodeOperands = nodeOperands;
-    }
-
-
-    private HashMap<VirtualObjectNode, CiVirtualObject> virtualObjects = new HashMap<>();
-
-    public LIRDebugInfo build(FrameState topState, LockScope locks, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
-        assert virtualObjects.size() == 0;
-        CiFrame frame = computeFrameForState(topState, locks);
-
-        CiVirtualObject[] virtualObjectsArray = null;
-        if (virtualObjects.size() != 0) {
-            // collect all VirtualObjectField instances:
-            IdentityHashMap<VirtualObjectNode, VirtualObjectFieldNode> objectStates = new IdentityHashMap<>();
-            FrameState current = topState;
-            do {
-                for (Node n : current.virtualObjectMappings()) {
-                    VirtualObjectFieldNode field = (VirtualObjectFieldNode) n;
-                    // null states occur for objects with 0 fields
-                    if (field != null && !objectStates.containsKey(field.object())) {
-                        objectStates.put(field.object(), field);
-                    }
-                }
-                current = current.outerFrameState();
-            } while (current != null);
-            // fill in the CiVirtualObject values:
-            // during this process new CiVirtualObjects might be discovered, so repeat until no more changes occur.
-            boolean changed;
-            do {
-                changed = false;
-                IdentityHashMap<VirtualObjectNode, CiVirtualObject> virtualObjectsCopy = new IdentityHashMap<>(virtualObjects);
-                for (Entry<VirtualObjectNode, CiVirtualObject> entry : virtualObjectsCopy.entrySet()) {
-                    if (entry.getValue().values() == null) {
-                        VirtualObjectNode vobj = entry.getKey();
-                        if (vobj instanceof BoxedVirtualObjectNode) {
-                            BoxedVirtualObjectNode boxedVirtualObjectNode = (BoxedVirtualObjectNode) vobj;
-                            entry.getValue().setValues(new CiValue[]{toCiValue(boxedVirtualObjectNode.getUnboxedValue())});
-                        } else {
-                            CiValue[] values = new CiValue[vobj.fieldsCount()];
-                            entry.getValue().setValues(values);
-                            if (values.length > 0) {
-                                changed = true;
-                                ValueNode currentField = objectStates.get(vobj);
-                                assert currentField != null;
-                                do {
-                                    if (currentField instanceof VirtualObjectFieldNode) {
-                                        int index = ((VirtualObjectFieldNode) currentField).index();
-                                        if (values[index] == null) {
-                                            values[index] = toCiValue(((VirtualObjectFieldNode) currentField).input());
-                                        }
-                                        currentField = ((VirtualObjectFieldNode) currentField).lastState();
-                                    } else {
-                                        assert currentField instanceof PhiNode : currentField;
-                                        currentField = ((PhiNode) currentField).valueAt(0);
-                                    }
-                                } while (currentField != null);
-                            }
-                        }
-                    }
-                }
-            } while (changed);
-
-            virtualObjectsArray = virtualObjects.values().toArray(new CiVirtualObject[virtualObjects.size()]);
-            virtualObjects.clear();
-        }
-
-        return new LIRDebugInfo(frame, virtualObjectsArray, pointerSlots, exceptionEdge);
-    }
-
-    private CiFrame computeFrameForState(FrameState state, LockScope locks) {
-        int numLocals = state.localsSize();
-        int numStack = state.stackSize();
-        int numLocks = (locks != null && locks.callerState == state.outerFrameState()) ? locks.stateDepth + 1 : 0;
-
-        CiValue[] values = new CiValue[numLocals + numStack + numLocks];
-        for (int i = 0; i < numLocals; i++) {
-            values[i] = toCiValue(state.localAt(i));
-        }
-        for (int i = 0; i < numStack; i++) {
-            values[numLocals + i] = toCiValue(state.stackAt(i));
-        }
-
-        LockScope nextLock = locks;
-        for (int i = numLocks - 1; i >= 0; i--) {
-            assert locks != null && nextLock.callerState == state.outerFrameState() && nextLock.stateDepth == i;
-
-            CiValue owner = toCiValue(nextLock.monitor.object());
-            CiValue lockData = nextLock.lockData;
-            boolean eliminated = nextLock.monitor.eliminated();
-            values[numLocals + numStack + nextLock.stateDepth] = new CiMonitorValue(owner, lockData, eliminated);
-
-            nextLock = nextLock.outer;
-        }
-
-        CiFrame caller = null;
-        if (state.outerFrameState() != null) {
-            caller = computeFrameForState(state.outerFrameState(), nextLock);
-        } else {
-            if (nextLock != null) {
-                throw new CiBailout("unbalanced monitors: found monitor for unknown frame");
-            }
-        }
-        assert state.bci >= 0 || state.bci == FrameState.BEFORE_BCI;
-        CiFrame frame = new CiFrame(caller, state.method(), state.bci, state.rethrowException(), state.duringCall(), values, state.localsSize(), state.stackSize(), numLocks);
-        return frame;
-    }
-
-    private CiValue toCiValue(ValueNode value) {
-        if (value instanceof VirtualObjectNode) {
-            VirtualObjectNode obj = (VirtualObjectNode) value;
-            CiVirtualObject ciObj = virtualObjects.get(value);
-            if (ciObj == null) {
-                ciObj = CiVirtualObject.get(obj.type(), null, virtualObjects.size());
-                virtualObjects.put(obj, ciObj);
-            }
-            Debug.metric("StateVirtualObjects").increment();
-            return ciObj;
-
-        } else if (value instanceof ConstantNode) {
-            Debug.metric("StateConstants").increment();
-            return ((ConstantNode) value).value;
-
-        } else if (value != null) {
-            Debug.metric("StateVariables").increment();
-            CiValue operand = nodeOperands.get(value);
-            assert operand != null && (operand instanceof Variable || operand instanceof CiConstant);
-            return operand;
-
-        } else {
-            // return a dummy value because real value not needed
-            Debug.metric("StateIllegals").increment();
-            return CiValue.IllegalValue;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/InstructionPrinter.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.gen;
-
-import static com.oracle.graal.compiler.gen.InstructionPrinter.InstructionLineColumn.*;
-
-import com.oracle.max.criutils.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * A {@link ValueVisitor} for {@linkplain #printInstruction(ValueNode) printing}
- * an {@link FixedWithNextNode} as an expression or statement.
- */
-public class InstructionPrinter {
-
-
-    /**
-     * The columns printed in a tabulated instruction
-     * {@linkplain InstructionPrinter#printInstructionListing(ValueNode) listing}.
-     */
-    public enum InstructionLineColumn {
-        /**
-         * The instruction's bytecode index.
-         */
-        BCI(2, "bci"),
-
-        /**
-         * The instruction's use count.
-         */
-        USE(7, "use"),
-
-        /**
-         * The instruction as a {@linkplain com.oracle.graal.compiler.util.Util#valueString(com.oracle.graal.compiler.ir.Value) value}.
-         */
-        VALUE(12, "tid"),
-
-        /**
-         * The instruction formatted as an expression or statement.
-         */
-        INSTRUCTION(19, "instr"),
-
-        END(60, "");
-
-        final int position;
-        final String label;
-
-        private InstructionLineColumn(int position, String label) {
-            this.position = position;
-            this.label = label;
-        }
-
-        /**
-         * Prints this column's label to a given stream after padding the stream with '_' characters
-         * until its {@linkplain LogStream#position() position} is equal to this column's position.
-         * @param out the print stream
-         */
-        public void printLabel(LogStream out) {
-            out.fillTo(position + out.indentationLevel(), '_');
-            out.print(label);
-        }
-
-        /**
-         * Prints space characters to a given stream until its {@linkplain LogStream#position() position}
-         * is equal to this column's position.
-         * @param out the print stream
-         */
-        public void advance(LogStream out) {
-            out.fillTo(position + out.indentationLevel(), ' ');
-        }
-    }
-
-    private final LogStream out;
-
-    public InstructionPrinter(LogStream out) {
-        this.out = out;
-    }
-
-    public LogStream out() {
-        return out;
-    }
-
-    /**
-     * Prints a header for the tabulated data printed by {@link #printInstructionListing(ValueNode)}.
-     */
-    public void printInstructionListingHeader() {
-        BCI.printLabel(out);
-        USE.printLabel(out);
-        VALUE.printLabel(out);
-        INSTRUCTION.printLabel(out);
-        END.printLabel(out);
-        out.println();
-    }
-
-    /**
-     * Prints an instruction listing on one line. The instruction listing is composed of the
-     * columns specified by {@link InstructionLineColumn}.
-     *
-     * @param instruction the instruction to print
-     */
-    public void printInstructionListing(ValueNode instruction) {
-        int indentation = out.indentationLevel();
-        out.fillTo(BCI.position + indentation, ' ').
-             print(0).
-             fillTo(USE.position + indentation, ' ').
-             print("0").
-             fillTo(VALUE.position + indentation, ' ').
-             print(ValueUtil.valueString(instruction)).
-             fillTo(INSTRUCTION.position + indentation, ' ');
-        printInstruction(instruction);
-        if (instruction instanceof StateSplit) {
-            out.print("  [state: " + ((StateSplit) instruction).stateAfter() + "]");
-        }
-        out.println();
-    }
-
-    public void printInstruction(ValueNode node) {
-        out.print(node.toString());
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1482 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.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.ci.CiValueUtil.*;
-import static com.oracle.max.cri.util.MemoryBarriers.*;
-import static com.oracle.graal.lir.ValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiTargetMethod.Mark;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.ri.RiType.Representation;
-import com.oracle.max.cri.xir.CiXirAssembler.XirConstant;
-import com.oracle.max.cri.xir.CiXirAssembler.XirInstruction;
-import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
-import com.oracle.max.cri.xir.CiXirAssembler.XirOperand;
-import com.oracle.max.cri.xir.CiXirAssembler.XirParameter;
-import com.oracle.max.cri.xir.CiXirAssembler.XirRegister;
-import com.oracle.max.cri.xir.CiXirAssembler.XirTemp;
-import com.oracle.max.cri.xir.*;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.StandardOp.JumpOp;
-import com.oracle.graal.lir.StandardOp.LabelOp;
-import com.oracle.graal.lir.StandardOp.ParametersOp;
-import com.oracle.graal.lir.StandardOp.PhiJumpOp;
-import com.oracle.graal.lir.StandardOp.PhiLabelOp;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.oracle.graal.nodes.PhiNode.PhiType;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.virtual.*;
-
-/**
- * This class traverses the HIR instructions and generates LIR instructions from them.
- */
-public abstract class LIRGenerator extends LIRGeneratorTool {
-    protected final Graph graph;
-    protected final RiRuntime runtime;
-    protected final CiTarget target;
-    protected final RiResolvedMethod method;
-    protected final FrameMap frameMap;
-    public final NodeMap<CiValue> nodeOperands;
-
-    protected final LIR lir;
-    protected final XirSupport xirSupport;
-    protected final RiXirGenerator xir;
-    private final DebugInfoBuilder debugInfoBuilder;
-
-    private Block currentBlock;
-    private ValueNode currentInstruction;
-    private ValueNode lastInstructionPrinted; // Debugging only
-    private FrameState lastState;
-
-    /**
-     * Class used to reconstruct the nesting of locks that is required for debug information.
-     */
-    public static class LockScope {
-        /**
-         * Linked list of locks. {@link LIRGenerator#curLocks} is the head of the list.
-         */
-        public final LockScope outer;
-
-        /**
-         * The frame state of the caller of the method performing the lock, or null if the outermost method
-         * performs the lock. This information is used to compute the {@link CiFrame} that this lock belongs to.
-         * We cannot use the actual frame state of the locking method, because it is not unique for a method. The
-         * caller frame states are unique, i.e., all frame states of inlined methods refer to the same caller frame state.
-         */
-        public final FrameState callerState;
-
-        /**
-         * The number of locks already found for this frame state.
-         */
-        public final int stateDepth;
-
-        /**
-         * The monitor enter node, with information about the object that is locked and the elimination status.
-         */
-        public final MonitorEnterNode monitor;
-
-        /**
-         * Space in the stack frame needed by the VM to perform the locking.
-         */
-        public final CiStackSlot lockData;
-
-        public LockScope(LockScope outer, FrameState callerState, MonitorEnterNode monitor, CiStackSlot lockData) {
-            this.outer = outer;
-            this.callerState = callerState;
-            this.monitor = monitor;
-            this.lockData = lockData;
-            if (outer != null && outer.callerState == callerState) {
-                this.stateDepth = outer.stateDepth + 1;
-            } else {
-                this.stateDepth = 0;
-            }
-        }
-    }
-
-    /**
-     * Mapping from blocks to the lock state at the end of the block, indexed by the id number of the block.
-     */
-    private BlockMap<LockScope> blockLocks;
-
-    private BlockMap<FrameState> blockLastState;
-
-    /**
-     * The list of currently locked monitors.
-     */
-    private LockScope curLocks;
-
-
-    public LIRGenerator(Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
-        this.graph = graph;
-        this.runtime = runtime;
-        this.target = target;
-        this.frameMap = frameMap;
-        this.method = method;
-        this.nodeOperands = graph.createNodeMap();
-        this.lir = lir;
-        this.xir = xir;
-        this.xirSupport = new XirSupport();
-        this.debugInfoBuilder = new DebugInfoBuilder(nodeOperands);
-        this.blockLocks = new BlockMap<>(lir.cfg);
-        this.blockLastState = new BlockMap<>(lir.cfg);
-    }
-
-    @Override
-    public CiTarget target() {
-        return target;
-    }
-
-    /**
-     * Returns the operand that has been previously initialized by {@link #setResult()}
-     * with the result of an instruction.
-     * @param node A node that produces a result value.
-     */
-    @Override
-    public CiValue operand(ValueNode node) {
-        if (nodeOperands == null) {
-            return null;
-        }
-        return nodeOperands.get(node);
-    }
-
-    /**
-     * Creates a new {@linkplain Variable variable}.
-     * @param kind The kind of the new variable.
-     * @return a new variable
-     */
-    @Override
-    public Variable newVariable(CiKind kind) {
-        CiKind stackKind = kind.stackKind();
-        switch (stackKind) {
-            case Jsr:
-            case Int:
-            case Long:
-            case Object:
-                return new Variable(stackKind, lir.nextVariable(), CiRegister.RegisterFlag.CPU);
-            case Float:
-            case Double:
-                return new Variable(stackKind, lir.nextVariable(), CiRegister.RegisterFlag.FPU);
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    @Override
-    public CiValue setResult(ValueNode x, CiValue operand) {
-        assert (isVariable(operand) && x.kind() == operand.kind) || (isConstant(operand) && x.kind() == operand.kind.stackKind()) : operand.kind + " for node " + x;
-
-        assert operand(x) == null : "operand cannot be set twice";
-        assert operand != null && isLegal(operand) : "operand must be legal";
-        assert operand.kind.stackKind() == x.kind();
-        assert !(x instanceof VirtualObjectNode);
-        nodeOperands.set(x, operand);
-        return operand;
-    }
-
-    @Override
-    public abstract Variable emitMove(CiValue input);
-
-    public Variable load(CiValue value) {
-        if (!isVariable(value)) {
-            return emitMove(value);
-        }
-        return (Variable) value;
-    }
-
-    public CiValue loadNonConst(CiValue value) {
-        if (isConstant(value) && !canInlineConstant((CiConstant) value)) {
-            return emitMove(value);
-        }
-        return value;
-    }
-
-    public CiValue loadForStore(CiValue value, CiKind storeKind) {
-        if (isConstant(value) && canStoreConstant((CiConstant) value)) {
-            return value;
-        }
-        if (storeKind == CiKind.Byte || storeKind == CiKind.Boolean) {
-            Variable tempVar = new Variable(value.kind, lir.nextVariable(), CiRegister.RegisterFlag.Byte);
-            emitMove(value, tempVar);
-            return tempVar;
-        }
-        return load(value);
-    }
-
-    protected LabelRef getLIRBlock(FixedNode b) {
-        Block result = lir.cfg.blockFor(b);
-        int suxIndex = currentBlock.getSuccessors().indexOf(result);
-        assert suxIndex != -1 : "Block not in successor list of current block";
-
-        return LabelRef.forSuccessor(currentBlock, suxIndex);
-    }
-
-    public LIRDebugInfo state() {
-        assert lastState != null : "must have state before instruction";
-        return stateFor(lastState);
-    }
-
-    public LIRDebugInfo stateFor(FrameState state) {
-        return stateFor(state, null, null);
-    }
-
-    public LIRDebugInfo stateFor(FrameState state, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
-        return debugInfoBuilder.build(state, curLocks, pointerSlots, exceptionEdge);
-    }
-
-    /**
-     * Gets the ABI specific operand used to return a value of a given kind from a method.
-     *
-     * @param kind the kind of value being returned
-     * @return the operand representing the ABI defined location used return a value of kind {@code kind}
-     */
-    public CiValue resultOperandFor(CiKind kind) {
-        if (kind == CiKind.Void) {
-            return IllegalValue;
-        }
-        return frameMap.registerConfig.getReturnRegister(kind).asValue(kind);
-    }
-
-
-    public void append(LIRInstruction op) {
-        assert LIRVerifier.verify(op);
-        if (GraalOptions.PrintIRWithLIR && !TTY.isSuppressed()) {
-            if (currentInstruction != null && lastInstructionPrinted != currentInstruction) {
-                lastInstructionPrinted = currentInstruction;
-                InstructionPrinter ip = new InstructionPrinter(TTY.out());
-                ip.printInstructionListing(currentInstruction);
-            }
-            TTY.println(op.toStringWithIdPrefix());
-            TTY.println();
-        }
-        currentBlock.lir.add(op);
-    }
-
-    public void doBlock(Block block) {
-        if (GraalOptions.PrintIRWithLIR) {
-            TTY.print(block.toString());
-        }
-
-        currentBlock = block;
-        // set up the list of LIR instructions
-        assert block.lir == null : "LIR list already computed for this block";
-        block.lir = new ArrayList<>();
-
-        if (GraalOptions.AllocSSA && block.getBeginNode() instanceof MergeNode) {
-            assert phiValues.isEmpty();
-            MergeNode merge = (MergeNode) block.getBeginNode();
-            for (PhiNode phi : merge.phis()) {
-                if (phi.type() == PhiType.Value) {
-                    CiValue phiValue = newVariable(phi.kind());
-                    setResult(phi, phiValue);
-                    phiValues.add(phiValue);
-                }
-            }
-            append(new PhiLabelOp(new Label(), block.align, phiValues.toArray(new CiValue[phiValues.size()])));
-            phiValues.clear();
-        } else {
-            append(new LabelOp(new Label(), block.align));
-        }
-
-        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
-            TTY.println("BEGIN Generating LIR for block B" + block.getId());
-        }
-
-        curLocks = null;
-        for (Block pred : block.getPredecessors()) {
-            LockScope predLocks = blockLocks.get(pred);
-            if (curLocks == null) {
-                curLocks = predLocks;
-            } else if (curLocks != predLocks && (!pred.isLoopEnd() || predLocks != null)) {
-                throw new CiBailout("unbalanced monitors: predecessor blocks have different monitor states");
-            }
-        }
-
-        if (block == lir.cfg.getStartBlock()) {
-            assert block.getPredecessors().size() == 0;
-            emitPrologue();
-
-        } else {
-            assert block.getPredecessors().size() > 0;
-            FrameState fs = null;
-
-            for (Block pred : block.getPredecessors()) {
-                if (fs == null) {
-                    fs = blockLastState.get(pred);
-                } else if (fs != blockLastState.get(pred)) {
-                    fs = null;
-                    break;
-                }
-            }
-            if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
-                if (fs == null) {
-                    TTY.println("STATE RESET");
-                } else {
-                    TTY.println("STATE CHANGE (singlePred)");
-                    if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
-                        TTY.println(fs.toString(Node.Verbosity.Debugger));
-                    }
-                }
-            }
-            lastState = fs;
-        }
-
-        List<Node> nodes = lir.nodesFor(block);
-        for (int i = 0; i < nodes.size(); i++) {
-            Node instr = nodes.get(i);
-
-            if (GraalOptions.OptImplicitNullChecks) {
-                Node nextInstr = null;
-                if (i < nodes.size() - 1) {
-                    nextInstr = nodes.get(i + 1);
-                }
-
-                if (instr instanceof GuardNode) {
-                    GuardNode guardNode = (GuardNode) instr;
-                    if (guardNode.condition() instanceof NullCheckNode) {
-                        NullCheckNode nullCheckNode = (NullCheckNode) guardNode.condition();
-                        if (!nullCheckNode.expectedNull && nextInstr instanceof Access) {
-                            Access access = (Access) nextInstr;
-                            if (nullCheckNode.object() == access.object() && canBeNullCheck(access.location())) {
-                                //TTY.println("implicit null check");
-                                access.setNullCheck(true);
-                                continue;
-                            }
-                        }
-                    }
-                }
-            }
-            if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
-                TTY.println("LIRGen for " + instr);
-            }
-            FrameState stateAfter = null;
-            if (instr instanceof StateSplit) {
-                stateAfter = ((StateSplit) instr).stateAfter();
-            }
-            if (instr instanceof ValueNode) {
-                try {
-                    doRoot((ValueNode) instr);
-                } catch (Throwable e) {
-                    throw new GraalInternalError(e).addContext(instr);
-                }
-            }
-            if (stateAfter != null) {
-                lastState = stateAfter;
-                assert checkStateReady(lastState);
-                if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
-                    TTY.println("STATE CHANGE");
-                    if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
-                        TTY.println(stateAfter.toString(Node.Verbosity.Debugger));
-                    }
-                }
-            }
-        }
-        if (block.numberOfSux() >= 1 && !endsWithJump(block)) {
-            NodeSuccessorsIterable successors = block.getEndNode().successors();
-            assert successors.isNotEmpty() : "should have at least one successor : " + block.getEndNode();
-
-            emitJump(getLIRBlock((FixedNode) successors.first()), null);
-        }
-
-        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
-            TTY.println("END Generating LIR for block B" + block.getId());
-        }
-
-        blockLocks.put(currentBlock, curLocks);
-        blockLastState.put(block, lastState);
-        currentBlock = null;
-
-        if (GraalOptions.PrintIRWithLIR) {
-            TTY.println();
-        }
-    }
-
-    private boolean checkStateReady(FrameState state) {
-        FrameState fs = state;
-        while (fs != null) {
-            for (ValueNode v : fs.values()) {
-                if (v != null && !(v instanceof VirtualObjectNode)) {
-                    assert operand(v) != null : "Value " + v + " in " + fs + " is not ready!";
-                }
-            }
-            fs =  fs.outerFrameState();
-        }
-        return true;
-    }
-
-    private static boolean endsWithJump(Block block) {
-        if (block.lir.size() == 0) {
-            return false;
-        }
-        LIRInstruction lirInstruction = block.lir.get(block.lir.size() - 1);
-        if (lirInstruction instanceof LIRXirInstruction) {
-            LIRXirInstruction lirXirInstruction = (LIRXirInstruction) lirInstruction;
-            return (lirXirInstruction.falseSuccessor != null) && (lirXirInstruction.trueSuccessor != null);
-        }
-        return lirInstruction instanceof StandardOp.JumpOp;
-    }
-
-    private void doRoot(ValueNode instr) {
-        if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
-            TTY.println("Emitting LIR for instruction " + instr);
-        }
-        currentInstruction = instr;
-
-        Debug.log("Visiting %s", instr);
-        emitNode(instr);
-        Debug.log("Operand for %s = %s", instr, operand(instr));
-    }
-
-    protected void emitNode(ValueNode node) {
-        ((LIRLowerable) node).generate(this);
-    }
-
-    private static boolean canBeNullCheck(LocationNode location) {
-        // TODO: Make this part of CiTarget
-        return !(location instanceof IndexedLocationNode) && location.displacement() < 4096;
-    }
-
-    private void emitPrologue() {
-        CiCallingConvention incomingArguments = frameMap.registerConfig.getCallingConvention(JavaCallee, CiUtil.signatureToKinds(method), target, false);
-
-        CiValue[] params = new CiValue[incomingArguments.locations.length];
-        for (int i = 0; i < params.length; i++) {
-            params[i] = toStackKind(incomingArguments.locations[i]);
-        }
-        append(new ParametersOp(params));
-
-        XirSnippet prologue = xir.genPrologue(null, method);
-        if (prologue != null) {
-            emitXir(prologue, null, null, false);
-        }
-
-        for (LocalNode local : graph.getNodes(LocalNode.class)) {
-            CiValue param = params[local.index()];
-            assert param.kind == local.kind().stackKind();
-            setResult(local, emitMove(param));
-        }
-    }
-
-    @Override
-    public void visitArrayLength(ArrayLengthNode x) {
-        XirArgument array = toXirArgument(x.array());
-        XirSnippet snippet = xir.genArrayLength(site(x, x.array()), array);
-        emitXir(snippet, x, state(), true);
-        operand(x);
-    }
-
-    @Override
-    public void visitCheckCast(CheckCastNode x) {
-        if (x.emitCode()) {
-            XirSnippet snippet = xir.genCheckCast(site(x, x.object()), toXirArgument(x.object()), toXirArgument(x.targetClassInstruction()), x.targetClass(), x.hints(), x.hintsExact());
-            emitXir(snippet, x, state(), true);
-        }
-        // The result of a checkcast is the unmodified object, so no need to allocate a new variable for it.
-        setResult(x, operand(x.object()));
-    }
-
-    @Override
-    public void visitMonitorEnter(MonitorEnterNode x) {
-        CiStackSlot lockData = frameMap.allocateStackBlock(runtime.sizeOfLockData(), false);
-        if (x.eliminated()) {
-            // No code is emitted for eliminated locks, but for proper debug information generation we need to
-            // register the monitor and its lock data.
-            curLocks = new LockScope(curLocks, x.stateAfter().outerFrameState(), x, lockData);
-            return;
-        }
-
-        XirArgument obj = toXirArgument(x.object());
-        XirArgument lockAddress = lockData == null ? null : toXirArgument(emitLea(lockData));
-
-        LIRDebugInfo stateBefore = state();
-        // The state before the monitor enter is used for null checks, so it must not contain the newly locked object.
-        curLocks = new LockScope(curLocks, x.stateAfter().outerFrameState(), x, lockData);
-        // The state after the monitor enter is used for deoptimization, after the monitor has blocked, so it must contain the newly locked object.
-        LIRDebugInfo stateAfter = stateFor(x.stateAfter());
-
-        XirSnippet snippet = xir.genMonitorEnter(site(x, x.object()), obj, lockAddress);
-        emitXir(snippet, x, stateBefore, stateAfter, true, null, null);
-    }
-
-    @Override
-    public void visitMonitorExit(MonitorExitNode x) {
-        if (curLocks == null || curLocks.monitor.object() != x.object() || curLocks.monitor.eliminated() != x.eliminated()) {
-            throw new CiBailout("unbalanced monitors: attempting to unlock an object that is not on top of the locking stack");
-        }
-        if (x.eliminated()) {
-            curLocks = curLocks.outer;
-            return;
-        }
-
-        CiStackSlot lockData = curLocks.lockData;
-        XirArgument obj = toXirArgument(x.object());
-        XirArgument lockAddress = lockData == null ? null : toXirArgument(emitLea(lockData));
-
-        LIRDebugInfo stateBefore = state();
-        curLocks = curLocks.outer;
-
-        XirSnippet snippet = xir.genMonitorExit(site(x, x.object()), obj, lockAddress);
-        emitXir(snippet, x, stateBefore, true);
-    }
-
-    @Override
-    public void visitLoadField(LoadFieldNode x) {
-        RiField field = x.field();
-        LIRDebugInfo info = state();
-        if (x.isVolatile()) {
-            emitMembar(JMM_PRE_VOLATILE_READ);
-        }
-        XirArgument receiver = toXirArgument(x.object());
-        XirSnippet snippet = x.isStatic() ? xir.genGetStatic(site(x, x.object()), receiver, field) : xir.genGetField(site(x, x.object()), receiver, field);
-        emitXir(snippet, x, info, true);
-        if (x.isVolatile()) {
-            emitMembar(JMM_POST_VOLATILE_READ);
-        }
-    }
-
-    @Override
-    public void visitStoreField(StoreFieldNode x) {
-        RiField field = x.field();
-        LIRDebugInfo info = state();
-        if (x.isVolatile()) {
-            emitMembar(JMM_PRE_VOLATILE_WRITE);
-        }
-        XirArgument receiver = toXirArgument(x.object());
-        XirArgument value = toXirArgument(x.value());
-        XirSnippet snippet = x.isStatic() ? xir.genPutStatic(site(x, x.object()), receiver, field, value) : xir.genPutField(site(x, x.object()), receiver, field, value);
-        emitXir(snippet, x, info, true);
-        if (x.isVolatile()) {
-            emitMembar(JMM_POST_VOLATILE_WRITE);
-        }
-    }
-
-    @Override
-    public void visitLoadIndexed(LoadIndexedNode x) {
-        XirArgument array = toXirArgument(x.array());
-        XirArgument index = toXirArgument(x.index());
-        XirSnippet snippet = xir.genArrayLoad(site(x, x.array()), array, index, x.elementKind(), null);
-        emitXir(snippet, x, state(), true);
-    }
-
-    @Override
-    public void visitStoreIndexed(StoreIndexedNode x) {
-        XirArgument array = toXirArgument(x.array());
-        XirArgument index = toXirArgument(x.index());
-        XirArgument value = toXirArgument(x.value());
-        XirSnippet snippet = xir.genArrayStore(site(x, x.array()), array, index, value, x.elementKind(), null);
-        emitXir(snippet, x, state(), true);
-    }
-
-    @Override
-    public void visitNewInstance(NewInstanceNode x) {
-        XirSnippet snippet = xir.genNewInstance(site(x), x.instanceClass());
-        emitXir(snippet, x, state(), true);
-    }
-
-    @Override
-    public void visitNewTypeArray(NewTypeArrayNode x) {
-        XirArgument length = toXirArgument(x.length());
-        XirSnippet snippet = xir.genNewArray(site(x), length, x.elementType().kind(true), null, null);
-        emitXir(snippet, x, state(), true);
-    }
-
-    @Override
-    public void visitNewObjectArray(NewObjectArrayNode x) {
-        XirArgument length = toXirArgument(x.length());
-        XirSnippet snippet = xir.genNewArray(site(x), length, CiKind.Object, x.elementType(), x.exactType());
-        emitXir(snippet, x, state(), true);
-    }
-
-    @Override
-    public void visitNewMultiArray(NewMultiArrayNode x) {
-        XirArgument[] dims = new XirArgument[x.dimensionCount()];
-        for (int i = 0; i < dims.length; i++) {
-            dims[i] = toXirArgument(x.dimension(i));
-        }
-        XirSnippet snippet = xir.genNewMultiArray(site(x), dims, x.type());
-        emitXir(snippet, x, state(), true);
-    }
-
-    @Override
-    public void visitExceptionObject(ExceptionObjectNode x) {
-        XirSnippet snippet = xir.genExceptionObject(site(x));
-        LIRDebugInfo info = state();
-        emitXir(snippet, x, info, true);
-    }
-
-    @Override
-    public void visitReturn(ReturnNode x) {
-        CiValue operand = CiValue.IllegalValue;
-        if (!x.kind().isVoid()) {
-            operand = resultOperandFor(x.kind());
-            emitMove(operand(x.result()), operand);
-        }
-        XirSnippet epilogue = xir.genEpilogue(site(x), method);
-        if (epilogue != null) {
-            emitXir(epilogue, x, null, false);
-            emitReturn(operand);
-        }
-    }
-
-    protected abstract void emitReturn(CiValue input);
-
-    @SuppressWarnings("unused")
-    protected void postGCWriteBarrier(CiValue addr, CiValue newVal) {
-        XirSnippet writeBarrier = xir.genWriteBarrier(toXirArgument(addr));
-        if (writeBarrier != null) {
-            emitXir(writeBarrier, null, null, false);
-        }
-     }
-
-    @SuppressWarnings("unused")
-    protected void preGCWriteBarrier(CiValue addrOpr, boolean patch, LIRDebugInfo info) {
-        // TODO (thomaswue): Implement this.
-    }
-
-
-
-    @Override
-    public void visitMerge(MergeNode x) {
-    }
-
-    @Override
-    public void visitEndNode(EndNode end) {
-        moveToPhi(end.merge(), end);
-    }
-
-    @Override
-    public void visitLoopEnd(LoopEndNode x) {
-        if (GraalOptions.GenLoopSafepoints && x.hasSafepointPolling()) {
-            emitSafepointPoll(x);
-        }
-    }
-
-    private ArrayList<CiValue> phiValues = new ArrayList<>();
-
-    private void moveToPhi(MergeNode merge, EndNode pred) {
-        if (GraalOptions.AllocSSA) {
-            assert phiValues.isEmpty();
-            for (PhiNode phi : merge.phis()) {
-                if (phi.type() == PhiType.Value) {
-                    phiValues.add(operand(phi.valueAt(pred)));
-                }
-            }
-            append(new PhiJumpOp(getLIRBlock(merge), phiValues.toArray(new CiValue[phiValues.size()])));
-            phiValues.clear();
-            return;
-        }
-
-        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
-            TTY.println("MOVE TO PHI from " + pred + " to " + merge);
-        }
-        PhiResolver resolver = new PhiResolver(this);
-        for (PhiNode phi : merge.phis()) {
-            if (phi.type() == PhiType.Value) {
-                ValueNode curVal = phi.valueAt(pred);
-                resolver.move(operand(curVal), operandForPhi(phi));
-            }
-        }
-        resolver.dispose();
-
-        append(new JumpOp(getLIRBlock(merge), null));
-    }
-
-    private CiValue operandForPhi(PhiNode phi) {
-        assert phi.type() == PhiType.Value : "wrong phi type: " + phi;
-        CiValue result = operand(phi);
-        if (result == null) {
-            // allocate a variable for this phi
-            Variable newOperand = newVariable(phi.kind());
-            setResult(phi, newOperand);
-            return newOperand;
-        } else {
-            return result;
-        }
-    }
-
-
-    public void emitSafepointPoll(FixedNode x) {
-        if (!lastState.method().noSafepointPolls()) {
-            XirSnippet snippet = xir.genSafepointPoll(site(x));
-            emitXir(snippet, x, state(), false);
-        }
-    }
-
-    @Override
-    public void emitIf(IfNode x) {
-        assert x.defaultSuccessor() == x.falseSuccessor() : "wrong destination";
-        emitBranch(x.compare(), getLIRBlock(x.trueSuccessor()),  getLIRBlock(x.falseSuccessor()), null);
-    }
-
-    @Override
-    public void emitGuardCheck(BooleanNode comp) {
-        if (comp instanceof NullCheckNode && !((NullCheckNode) comp).expectedNull) {
-            emitNullCheckGuard((NullCheckNode) comp);
-        } else if (comp instanceof ConstantNode && comp.asConstant().asBoolean()) {
-            // True constant, nothing to emit.
-        } else {
-            // Fall back to a normal branch.
-            LIRDebugInfo info = state();
-            LabelRef stubEntry = createDeoptStub(DeoptAction.InvalidateReprofile, info, comp);
-            emitBranch(comp, null, stubEntry, info);
-        }
-    }
-
-    protected abstract void emitNullCheckGuard(NullCheckNode node);
-
-    public void emitBranch(BooleanNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
-        if (node instanceof NullCheckNode) {
-            emitNullCheckBranch((NullCheckNode) node, trueSuccessor, falseSuccessor, info);
-        } else if (node instanceof CompareNode) {
-            emitCompareBranch((CompareNode) node, trueSuccessor, falseSuccessor, info);
-        } else if (node instanceof InstanceOfNode) {
-            emitInstanceOfBranch((InstanceOfNode) node, trueSuccessor, falseSuccessor, info);
-        } else if (node instanceof ConstantNode) {
-            emitConstantBranch(((ConstantNode) node).asConstant().asBoolean(), trueSuccessor, falseSuccessor, info);
-        } else if (node instanceof IsTypeNode) {
-            emitTypeBranch((IsTypeNode) node, trueSuccessor, falseSuccessor, info);
-        } else {
-            throw GraalInternalError.unimplemented(node.toString());
-        }
-    }
-
-    private void emitNullCheckBranch(NullCheckNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
-        Condition cond = node.expectedNull ? Condition.NE : Condition.EQ;
-        emitBranch(operand(node.object()), CiConstant.NULL_OBJECT, cond, false, falseSuccessor, info);
-        if (trueSuccessor != null) {
-            emitJump(trueSuccessor, null);
-        }
-    }
-
-    public void emitCompareBranch(CompareNode compare, LabelRef trueSuccessorBlock, LabelRef falseSuccessorBlock, LIRDebugInfo info) {
-        emitBranch(operand(compare.x()), operand(compare.y()), compare.condition().negate(), !compare.unorderedIsTrue(), falseSuccessorBlock, info);
-        if (trueSuccessorBlock != null) {
-            emitJump(trueSuccessorBlock, null);
-        }
-    }
-
-    private void emitInstanceOfBranch(InstanceOfNode x, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
-        XirArgument obj = toXirArgument(x.object());
-        XirSnippet snippet = xir.genInstanceOf(site(x, x.object()), obj, toXirArgument(x.targetClassInstruction()), x.targetClass(), x.hints(), x.hintsExact());
-        emitXir(snippet, x, info, null, false, x.negated() ? falseSuccessor : trueSuccessor, x.negated() ? trueSuccessor : falseSuccessor);
-    }
-
-    public void emitConstantBranch(boolean value, LabelRef trueSuccessorBlock, LabelRef falseSuccessorBlock, LIRDebugInfo info) {
-        LabelRef block = value ? trueSuccessorBlock : falseSuccessorBlock;
-        if (block != null) {
-            emitJump(block, info);
-        }
-    }
-
-    public void emitTypeBranch(IsTypeNode x, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
-        XirArgument thisClass = toXirArgument(x.objectClass());
-        XirArgument otherClass = toXirArgument(x.type().getEncoding(Representation.ObjectHub));
-        XirSnippet snippet = xir.genTypeBranch(site(x), thisClass, otherClass, x.type());
-        emitXir(snippet, x, info, null, false, trueSuccessor, falseSuccessor);
-        if (trueSuccessor != null) {
-            emitJump(trueSuccessor, null);
-        }
-    }
-
-    @Override
-    public void emitConditional(ConditionalNode conditional) {
-        CiValue tVal = operand(conditional.trueValue());
-        CiValue fVal = operand(conditional.falseValue());
-        setResult(conditional, emitConditional(conditional.condition(), tVal, fVal));
-    }
-
-    public Variable emitConditional(BooleanNode node, CiValue trueValue, CiValue falseValue) {
-        if (node instanceof NullCheckNode) {
-            return emitNullCheckConditional((NullCheckNode) node, trueValue, falseValue);
-        } else if (node instanceof CompareNode) {
-            return emitCompareConditional((CompareNode) node, trueValue, falseValue);
-        } else if (node instanceof InstanceOfNode) {
-            return emitInstanceOfConditional((InstanceOfNode) node, trueValue, falseValue);
-        } else if (node instanceof ConstantNode) {
-            return emitConstantConditional(((ConstantNode) node).asConstant().asBoolean(), trueValue, falseValue);
-        } else {
-            throw GraalInternalError.unimplemented(node.toString());
-        }
-    }
-
-    private Variable emitNullCheckConditional(NullCheckNode node, CiValue trueValue, CiValue falseValue) {
-        Condition cond = node.expectedNull ? Condition.EQ : Condition.NE;
-        return emitCMove(operand(node.object()), CiConstant.NULL_OBJECT, cond, false, trueValue, falseValue);
-    }
-
-    private Variable emitInstanceOfConditional(InstanceOfNode x, CiValue trueValue, CiValue falseValue) {
-        XirArgument obj = toXirArgument(x.object());
-        XirArgument trueArg = toXirArgument(x.negated() ? falseValue : trueValue);
-        XirArgument falseArg = toXirArgument(x.negated() ? trueValue : falseValue);
-        XirSnippet snippet = xir.genMaterializeInstanceOf(site(x, x.object()), obj, toXirArgument(x.targetClassInstruction()), trueArg, falseArg, x.targetClass(), x.hints(), x.hintsExact());
-        return (Variable) emitXir(snippet, null, null, false);
-    }
-
-    private Variable emitConstantConditional(boolean value, CiValue trueValue, CiValue falseValue) {
-        return emitMove(value ? trueValue : falseValue);
-    }
-
-    private Variable emitCompareConditional(CompareNode compare, CiValue trueValue, CiValue falseValue) {
-        return emitCMove(operand(compare.x()), operand(compare.y()), compare.condition(), compare.unorderedIsTrue(), trueValue, falseValue);
-    }
-
-
-    public abstract void emitLabel(Label label, boolean align);
-    public abstract void emitJump(LabelRef label, LIRDebugInfo info);
-    public abstract void emitBranch(CiValue left, CiValue right, Condition cond, boolean unorderedIsTrue, LabelRef label, LIRDebugInfo info);
-    public abstract Variable emitCMove(CiValue leftVal, CiValue right, Condition cond, boolean unorderedIsTrue, CiValue trueValue, CiValue falseValue);
-
-    protected FrameState stateBeforeCallWithArguments(FrameState stateAfter, MethodCallTargetNode call, int bci) {
-        return stateAfter.duplicateModified(bci, stateAfter.rethrowException(), call.returnKind(), toJVMArgumentStack(call.targetMethod().signature(), call.isStatic(), call.arguments()));
-    }
-
-    private static ValueNode[] toJVMArgumentStack(RiSignature signature, boolean isStatic, NodeInputList<ValueNode> arguments) {
-        int slotCount = signature.argumentSlots(!isStatic);
-        ValueNode[] stack = new ValueNode[slotCount];
-        int stackIndex = 0;
-        int argumentIndex = 0;
-        for (ValueNode arg : arguments) {
-            stack[stackIndex] = arg;
-
-            if (stackIndex == 0 && !isStatic) {
-                // Current argument is receiver.
-                stackIndex += stackSlots(CiKind.Object);
-            } else {
-                stackIndex += stackSlots(signature.argumentKindAt(argumentIndex, false));
-                argumentIndex++;
-            }
-        }
-        return stack;
-    }
-
-
-    public static int stackSlots(CiKind kind) {
-        return isTwoSlot(kind) ? 2 : 1;
-    }
-
-    public static boolean isTwoSlot(CiKind kind) {
-        assert kind != CiKind.Void && kind != CiKind.Illegal;
-        return kind == CiKind.Long || kind == CiKind.Double;
-    }
-
-    @Override
-    public void emitInvoke(Invoke x) {
-        MethodCallTargetNode callTarget = x.callTarget();
-        RiMethod targetMethod = callTarget.targetMethod();
-
-        XirSnippet snippet = null;
-        XirArgument receiver;
-        switch (callTarget.invokeKind()) {
-            case Static:
-                snippet = xir.genInvokeStatic(site(x.node()), targetMethod);
-                break;
-            case Special:
-                receiver = toXirArgument(callTarget.receiver());
-                snippet = xir.genInvokeSpecial(site(x.node(), callTarget.receiver()), receiver, targetMethod);
-                break;
-            case Virtual:
-                assert callTarget.receiver().kind() == CiKind.Object : callTarget + ": " + callTarget.targetMethod().toString();
-                receiver = toXirArgument(callTarget.receiver());
-                snippet = xir.genInvokeVirtual(site(x.node(), callTarget.receiver()), receiver, targetMethod, x.megamorph());
-                break;
-            case Interface:
-                assert callTarget.receiver().kind() == CiKind.Object : callTarget;
-                receiver = toXirArgument(callTarget.receiver());
-                snippet = xir.genInvokeInterface(site(x.node(), callTarget.receiver()), receiver, targetMethod);
-                break;
-        }
-
-        CiValue destinationAddress = null;
-        if (!target().invokeSnippetAfterArguments) {
-            // This is the version currently necessary for Maxine: since the invokeinterface-snippet uses a division, it
-            // destroys rdx, which is also used to pass a parameter.  Therefore, the snippet must be before the parameters are assigned to their locations.
-            LIRDebugInfo addrInfo = stateFor(stateBeforeCallWithArguments(x.stateAfter(), callTarget, x.bci()));
-            destinationAddress = emitXir(snippet, x.node(), addrInfo, false);
-        }
-
-        CiValue resultOperand = resultOperandFor(x.node().kind());
-
-        CiKind[] signature = CiUtil.signatureToKinds(callTarget.targetMethod().signature(), callTarget.isStatic() ? null : callTarget.targetMethod().holder().kind(true));
-        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(JavaCall, signature, target(), false);
-        frameMap.callsMethod(cc, JavaCall);
-        List<CiValue> argList = visitInvokeArguments(cc, callTarget.arguments());
-
-        if (target().invokeSnippetAfterArguments) {
-            // This is the version currently active for HotSpot.
-            LIRDebugInfo addrInfo = stateFor(stateBeforeCallWithArguments(x.stateAfter(), callTarget, x.bci()), null, null);
-            destinationAddress = emitXir(snippet, x.node(), addrInfo, false);
-        }
-
-        LIRDebugInfo callInfo = stateFor(x.stateDuring(), null, x instanceof InvokeWithExceptionNode ? getLIRBlock(((InvokeWithExceptionNode) x).exceptionEdge()) : null);
-        emitCall(targetMethod, resultOperand, argList, destinationAddress, callInfo, snippet.marks);
-
-        if (isLegal(resultOperand)) {
-            setResult(x.node(), emitMove(resultOperand));
-        }
-    }
-
-    protected abstract void emitCall(Object targetMethod, CiValue result, List<CiValue> arguments, CiValue targetAddress, LIRDebugInfo info, Map<XirMark, Mark> marks);
-
-
-    private static CiValue toStackKind(CiValue value) {
-        if (value.kind.stackKind() != value.kind) {
-            // We only have stack-kinds in the LIR, so convert the operand kind for values from the calling convention.
-            if (isRegister(value)) {
-                return asRegister(value).asValue(value.kind.stackKind());
-            } else if (isStackSlot(value)) {
-                return CiStackSlot.get(value.kind.stackKind(), asStackSlot(value).rawOffset(), asStackSlot(value).rawAddFrameSize());
-            } else {
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        }
-        return value;
-    }
-
-    public List<CiValue> visitInvokeArguments(CiCallingConvention cc, Iterable<ValueNode> arguments) {
-        // for each argument, load it into the correct location
-        List<CiValue> argList = new ArrayList<>();
-        int j = 0;
-        for (ValueNode arg : arguments) {
-            if (arg != null) {
-                CiValue operand = toStackKind(cc.locations[j++]);
-                emitMove(operand(arg), operand);
-                argList.add(operand);
-
-            } else {
-                throw GraalInternalError.shouldNotReachHere("I thought we no longer have null entries for two-slot types...");
-            }
-        }
-        return argList;
-    }
-
-
-    protected abstract LabelRef createDeoptStub(DeoptAction action, LIRDebugInfo info, Object deoptInfo);
-
-    @Override
-    public Variable emitCallToRuntime(CiRuntimeCall runtimeCall, boolean canTrap, CiValue... args) {
-        LIRDebugInfo info = canTrap ? state() : null;
-
-        CiKind result = runtimeCall.resultKind;
-        CiKind[] arguments = runtimeCall.arguments;
-        CiValue physReg = resultOperandFor(result);
-
-        List<CiValue> argumentList;
-        if (arguments.length > 0) {
-            // move the arguments into the correct location
-            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
-            frameMap.callsMethod(cc, RuntimeCall);
-            assert cc.locations.length == args.length : "argument count mismatch";
-            for (int i = 0; i < args.length; i++) {
-                CiValue arg = args[i];
-                CiValue loc = cc.locations[i];
-                emitMove(arg, loc);
-            }
-            argumentList = Arrays.asList(cc.locations);
-        } else {
-            // no arguments
-            assert args == null || args.length == 0;
-            argumentList = Collections.emptyList();
-        }
-
-        emitCall(runtimeCall, physReg, argumentList, CiConstant.forLong(0), info, null);
-
-        if (isLegal(physReg)) {
-            return emitMove(physReg);
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public void emitRuntimeCall(RuntimeCallNode x) {
-        // TODO Merge with emitCallToRuntime() method above.
-
-        CiValue resultOperand = resultOperandFor(x.kind());
-        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, x.call().arguments, target(), false);
-        frameMap.callsMethod(cc, RuntimeCall);
-        List<CiValue> argList = visitInvokeArguments(cc, x.arguments());
-
-        LIRDebugInfo info = null;
-        FrameState stateAfter = x.stateAfter();
-        if (stateAfter != null) {
-            // (cwimmer) I made the code that modifies the operand stack conditional. My scenario: runtime calls to, e.g.,
-            // CreateNullPointerException have no equivalent in the bytecodes, so there is no invoke bytecode.
-            // Therefore, the result of the runtime call was never pushed to the stack, and we cannot pop it here.
-            FrameState stateBeforeReturn = stateAfter;
-            if ((stateAfter.stackSize() > 0 && stateAfter.stackAt(stateAfter.stackSize() - 1) == x) ||
-                (stateAfter.stackSize() > 1 && stateAfter.stackAt(stateAfter.stackSize() - 2) == x)) {
-
-                stateBeforeReturn = stateAfter.duplicateModified(stateAfter.bci, stateAfter.rethrowException(), x.kind());
-            }
-
-            // TODO is it correct here that the pointerSlots are not passed to the oop map generation?
-            info = stateFor(stateBeforeReturn);
-        }
-
-        emitCall(x.call(), resultOperand, argList, CiConstant.forLong(0), info, null);
-
-        if (isLegal(resultOperand)) {
-            setResult(x, emitMove(resultOperand));
-        }
-    }
-
-    @Override
-    public void emitLookupSwitch(LookupSwitchNode x) {
-        Variable tag = load(operand(x.value()));
-        if (x.numberOfCases() == 0 || x.numberOfCases() < GraalOptions.SequentialSwitchLimit) {
-            int len = x.numberOfCases();
-            for (int i = 0; i < len; i++) {
-                emitBranch(tag, CiConstant.forInt(x.keyAt(i)), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
-            }
-            emitJump(getLIRBlock(x.defaultSuccessor()), null);
-        } else {
-            visitSwitchRanges(createSwitchRanges(x, null), tag, getLIRBlock(x.defaultSuccessor()));
-        }
-    }
-
-    @Override
-    public void emitTableSwitch(TableSwitchNode x) {
-        Variable value = load(operand(x.value()));
-        // TODO: tune the defaults for the controls used to determine what kind of translation to use
-        if (x.numberOfCases() == 0 || x.numberOfCases() <= GraalOptions.SequentialSwitchLimit) {
-            int loKey = x.lowKey();
-            int len = x.numberOfCases();
-            for (int i = 0; i < len; i++) {
-                emitBranch(value, CiConstant.forInt(i + loKey), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
-            }
-            emitJump(getLIRBlock(x.defaultSuccessor()), null);
-        } else {
-            SwitchRange[] switchRanges = createSwitchRanges(null, x);
-            int rangeDensity = x.numberOfCases() / switchRanges.length;
-            if (rangeDensity >= GraalOptions.RangeTestsSwitchDensity) {
-                visitSwitchRanges(switchRanges, value, getLIRBlock(x.defaultSuccessor()));
-            } else {
-                LabelRef[] targets = new LabelRef[x.numberOfCases()];
-                for (int i = 0; i < x.numberOfCases(); ++i) {
-                    targets[i] = getLIRBlock(x.blockSuccessor(i));
-                }
-                emitTableSwitch(x.lowKey(), getLIRBlock(x.defaultSuccessor()), targets, value);
-            }
-        }
-    }
-
-    protected abstract void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiValue index);
-
-    // the range of values in a lookupswitch or tableswitch statement
-    private static final class SwitchRange {
-        protected final int lowKey;
-        protected int highKey;
-        protected final LabelRef sux;
-
-        SwitchRange(int lowKey, LabelRef sux) {
-            this.lowKey = lowKey;
-            this.highKey = lowKey;
-            this.sux = sux;
-        }
-    }
-
-    private SwitchRange[] createSwitchRanges(LookupSwitchNode ls, TableSwitchNode ts) {
-        // Only one of the parameters is used, but code is shared because it is mostly the same.
-        SwitchNode x = ls != null ? ls : ts;
-        // we expect the keys to be sorted by increasing value
-        List<SwitchRange> res = new ArrayList<>(x.numberOfCases());
-        int len = x.numberOfCases();
-        if (len > 0) {
-            LabelRef defaultSux = getLIRBlock(x.defaultSuccessor());
-            int key = ls != null ? ls.keyAt(0) : ts.lowKey();
-            LabelRef sux = getLIRBlock(x.blockSuccessor(0));
-            SwitchRange range = new SwitchRange(key, sux);
-            for (int i = 1; i < len; i++) {
-                int newKey = ls != null ? ls.keyAt(i) : key + 1;
-                LabelRef newSux = getLIRBlock(x.blockSuccessor(i));
-                if (key + 1 == newKey && sux == newSux) {
-                    // still in same range
-                    range.highKey = newKey;
-                } else {
-                    // skip tests which explicitly dispatch to the default
-                    if (range.sux != defaultSux) {
-                        res.add(range);
-                    }
-                    range = new SwitchRange(newKey, newSux);
-                }
-                key = newKey;
-                sux = newSux;
-            }
-            if (res.size() == 0 || res.get(res.size() - 1) != range) {
-                res.add(range);
-            }
-        }
-        return res.toArray(new SwitchRange[res.size()]);
-    }
-
-    private void visitSwitchRanges(SwitchRange[] x, Variable value, LabelRef defaultSux) {
-        for (int i = 0; i < x.length; i++) {
-            SwitchRange oneRange = x[i];
-            int lowKey = oneRange.lowKey;
-            int highKey = oneRange.highKey;
-            LabelRef dest = oneRange.sux;
-            if (lowKey == highKey) {
-                emitBranch(value, CiConstant.forInt(lowKey), Condition.EQ, false, dest, null);
-            } else if (highKey - lowKey == 1) {
-                emitBranch(value, CiConstant.forInt(lowKey), Condition.EQ, false, dest, null);
-                emitBranch(value, CiConstant.forInt(highKey), Condition.EQ, false, dest, null);
-            } else {
-                Label l = new Label();
-                emitBranch(value, CiConstant.forInt(lowKey), Condition.LT, false, LabelRef.forLabel(l), null);
-                emitBranch(value, CiConstant.forInt(highKey), Condition.LE, false, dest, null);
-                emitLabel(l, false);
-            }
-        }
-        emitJump(defaultSux, null);
-    }
-
-
-    protected XirArgument toXirArgument(CiValue v) {
-        if (v == null) {
-            return null;
-        }
-        return XirArgument.forInternalObject(v);
-    }
-
-    protected XirArgument toXirArgument(ValueNode i) {
-        if (i == null) {
-            return null;
-        }
-        return XirArgument.forInternalObject(loadNonConst(operand(i)));
-    }
-
-    private CiValue allocateOperand(XirSnippet snippet, XirOperand op) {
-        if (op instanceof XirParameter)  {
-            XirParameter param = (XirParameter) op;
-            return allocateOperand(snippet.arguments[param.parameterIndex], op, param.canBeConstant);
-        } else if (op instanceof XirRegister) {
-            XirRegister reg = (XirRegister) op;
-            return reg.register;
-        } else if (op instanceof XirTemp) {
-            return newVariable(op.kind);
-        } else {
-            GraalInternalError.shouldNotReachHere();
-            return null;
-        }
-    }
-
-    private CiValue allocateOperand(XirArgument arg, XirOperand var, boolean canBeConstant) {
-        if (arg.constant != null) {
-            return arg.constant;
-        }
-
-        CiValue value = (CiValue) arg.object;
-        if (canBeConstant) {
-            return value;
-        }
-        Variable variable = load(value);
-        if (var.kind == CiKind.Byte || var.kind == CiKind.Boolean) {
-            Variable tempVar = new Variable(value.kind, lir.nextVariable(), CiRegister.RegisterFlag.Byte);
-            emitMove(variable, tempVar);
-            variable = tempVar;
-        }
-        return variable;
-    }
-
-    protected CiValue emitXir(XirSnippet snippet, ValueNode x, LIRDebugInfo info, boolean setInstructionResult) {
-        return emitXir(snippet, x, info, null, setInstructionResult, null, null);
-    }
-
-    protected CiValue emitXir(XirSnippet snippet, ValueNode instruction, LIRDebugInfo info, LIRDebugInfo infoAfter, boolean setInstructionResult, LabelRef trueSuccessor, LabelRef falseSuccessor) {
-        if (GraalOptions.PrintXirTemplates) {
-            TTY.println("Emit XIR template " + snippet.template.name);
-        }
-
-        final CiValue[] operandsArray = new CiValue[snippet.template.variableCount];
-
-        frameMap.reserveOutgoing(snippet.template.outgoingStackSize);
-
-        XirOperand resultOperand = snippet.template.resultOperand;
-
-        if (snippet.template.allocateResultOperand) {
-            CiValue outputOperand = IllegalValue;
-            // This snippet has a result that must be separately allocated
-            // Otherwise it is assumed that the result is part of the inputs
-            if (resultOperand.kind != CiKind.Void && resultOperand.kind != CiKind.Illegal) {
-                if (setInstructionResult) {
-                    outputOperand = newVariable(instruction.kind());
-                } else {
-                    outputOperand = newVariable(resultOperand.kind);
-                }
-                assert operandsArray[resultOperand.index] == null;
-            }
-            operandsArray[resultOperand.index] = outputOperand;
-            if (GraalOptions.PrintXirTemplates) {
-                TTY.println("Output operand: " + outputOperand);
-            }
-        }
-
-        for (XirTemp t : snippet.template.temps) {
-            if (t instanceof XirRegister) {
-                XirRegister reg = (XirRegister) t;
-                if (!t.reserve) {
-                    operandsArray[t.index] = reg.register;
-                }
-            }
-        }
-
-        for (XirConstant c : snippet.template.constants) {
-            assert operandsArray[c.index] == null;
-            operandsArray[c.index] = c.value;
-        }
-
-        XirOperand[] inputOperands = snippet.template.inputOperands;
-        XirOperand[] inputTempOperands = snippet.template.inputTempOperands;
-        XirOperand[] tempOperands = snippet.template.tempOperands;
-
-        CiValue[] inputOperandArray = new CiValue[inputOperands.length + inputTempOperands.length];
-        CiValue[] tempOperandArray = new CiValue[tempOperands.length];
-        int[] inputOperandIndicesArray = new int[inputOperands.length + inputTempOperands.length];
-        int[] tempOperandIndicesArray = new int[tempOperands.length];
-        for (int i = 0; i < inputOperands.length; i++) {
-            XirOperand x = inputOperands[i];
-            CiValue op = allocateOperand(snippet, x);
-            operandsArray[x.index] = op;
-            inputOperandArray[i] = op;
-            inputOperandIndicesArray[i] = x.index;
-            if (GraalOptions.PrintXirTemplates) {
-                TTY.println("Input operand: " + x);
-            }
-        }
-
-        assert inputTempOperands.length == 0 : "cwi: I think this code is never used.  If you see this exception being thrown, please tell me...";
-
-        for (int i = 0; i < tempOperands.length; i++) {
-            XirOperand x = tempOperands[i];
-            CiValue op = allocateOperand(snippet, x);
-            operandsArray[x.index] = op;
-            tempOperandArray[i] = op;
-            tempOperandIndicesArray[i] = x.index;
-            if (GraalOptions.PrintXirTemplates) {
-                TTY.println("Temp operand: " + x);
-            }
-        }
-
-        for (CiValue operand : operandsArray) {
-            assert operand != null;
-        }
-
-        CiValue allocatedResultOperand = operandsArray[resultOperand.index];
-        if (!isVariable(allocatedResultOperand) && !isRegister(allocatedResultOperand)) {
-            allocatedResultOperand = IllegalValue;
-        }
-
-        if (setInstructionResult && isLegal(allocatedResultOperand)) {
-            CiValue operand = operand(instruction);
-            if (operand == null) {
-                setResult(instruction, allocatedResultOperand);
-            } else {
-                assert operand == allocatedResultOperand;
-            }
-        }
-
-
-        XirInstruction[] slowPath = snippet.template.slowPath;
-        if (!isConstant(operandsArray[resultOperand.index]) || snippet.template.fastPath.length != 0 || (slowPath != null && slowPath.length > 0)) {
-            // XIR instruction is only needed when the operand is not a constant!
-            emitXir(snippet, operandsArray, allocatedResultOperand,
-                    inputOperandArray, tempOperandArray, inputOperandIndicesArray, tempOperandIndicesArray,
-                    (allocatedResultOperand == IllegalValue) ? -1 : resultOperand.index,
-                    info, infoAfter, trueSuccessor, falseSuccessor);
-            Debug.metric("LIRXIRInstructions").increment();
-        }
-
-        return operandsArray[resultOperand.index];
-    }
-
-    protected abstract void emitXir(XirSnippet snippet, CiValue[] operands, CiValue outputOperand, CiValue[] inputs, CiValue[] temps, int[] inputOperandIndices, int[] tempOperandIndices, int outputOperandIndex,
-                    LIRDebugInfo info, LIRDebugInfo infoAfter, LabelRef trueSuccessor, LabelRef falseSuccessor);
-
-    protected final CiValue callRuntime(CiRuntimeCall runtimeCall, LIRDebugInfo info, CiValue... args) {
-        // get a result register
-        CiKind result = runtimeCall.resultKind;
-        CiKind[] arguments = runtimeCall.arguments;
-
-        CiValue physReg = result.isVoid() ? IllegalValue : resultOperandFor(result);
-
-        List<CiValue> argumentList;
-        if (arguments.length > 0) {
-            // move the arguments into the correct location
-            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
-            frameMap.callsMethod(cc, RuntimeCall);
-            assert cc.locations.length == args.length : "argument count mismatch";
-            for (int i = 0; i < args.length; i++) {
-                CiValue arg = args[i];
-                CiValue loc = cc.locations[i];
-                emitMove(arg, loc);
-            }
-            argumentList = Arrays.asList(cc.locations);
-        } else {
-            // no arguments
-            assert args == null || args.length == 0;
-            argumentList = Util.uncheckedCast(Collections.emptyList());
-        }
-
-        emitCall(runtimeCall, physReg, argumentList, CiConstant.forLong(0), info, null);
-
-        return physReg;
-    }
-
-    protected final Variable callRuntimeWithResult(CiRuntimeCall runtimeCall, LIRDebugInfo info, CiValue... args) {
-        CiValue location = callRuntime(runtimeCall, info, args);
-        return emitMove(location);
-    }
-
-    SwitchRange[] createLookupRanges(LookupSwitchNode x) {
-        // we expect the keys to be sorted by increasing value
-        List<SwitchRange> res = new ArrayList<>(x.numberOfCases());
-        int len = x.numberOfCases();
-        if (len > 0) {
-            LabelRef defaultSux = getLIRBlock(x.defaultSuccessor());
-            int key = x.keyAt(0);
-            LabelRef sux = getLIRBlock(x.blockSuccessor(0));
-            SwitchRange range = new SwitchRange(key, sux);
-            for (int i = 1; i < len; i++) {
-                int newKey = x.keyAt(i);
-                LabelRef newSux = getLIRBlock(x.blockSuccessor(i));
-                if (key + 1 == newKey && sux == newSux) {
-                    // still in same range
-                    range.highKey = newKey;
-                } else {
-                    // skip tests which explicitly dispatch to the default
-                    if (range.sux != defaultSux) {
-                        res.add(range);
-                    }
-                    range = new SwitchRange(newKey, newSux);
-                }
-                key = newKey;
-                sux = newSux;
-            }
-            if (res.size() == 0 || res.get(res.size() - 1) != range) {
-                res.add(range);
-            }
-        }
-        return res.toArray(new SwitchRange[res.size()]);
-    }
-
-    SwitchRange[] createLookupRanges(TableSwitchNode x) {
-        // TODO: try to merge this with the code for LookupSwitch
-        List<SwitchRange> res = new ArrayList<>(x.numberOfCases());
-        int len = x.numberOfCases();
-        if (len > 0) {
-            LabelRef sux = getLIRBlock(x.blockSuccessor(0));
-            int key = x.lowKey();
-            LabelRef defaultSux = getLIRBlock(x.defaultSuccessor());
-            SwitchRange range = new SwitchRange(key, sux);
-            for (int i = 0; i < len; i++, key++) {
-                LabelRef newSux = getLIRBlock(x.blockSuccessor(i));
-                if (sux == newSux) {
-                    // still in same range
-                    range.highKey = key;
-                } else {
-                    // skip tests which explicitly dispatch to the default
-                    if (sux != defaultSux) {
-                        res.add(range);
-                    }
-                    range = new SwitchRange(key, newSux);
-                }
-                sux = newSux;
-            }
-            if (res.size() == 0 || res.get(res.size() - 1) != range) {
-                res.add(range);
-            }
-        }
-        return res.toArray(new SwitchRange[res.size()]);
-    }
-
-    protected XirSupport site(ValueNode x) {
-        return xirSupport.site(x, null);
-    }
-
-    protected XirSupport site(ValueNode x, ValueNode receiver) {
-        return xirSupport.site(x, receiver);
-    }
-
-    /**
-     * Implements site-specific information for the XIR interface.
-     */
-    static class XirSupport implements XirSite {
-        ValueNode current;
-        ValueNode receiver;
-
-        public boolean isNonNull(XirArgument argument) {
-            return false;
-        }
-
-        public boolean requiresNullCheck() {
-            return receiver == null || !receiver.stamp().nonNull();
-        }
-
-        public boolean requiresBoundsCheck() {
-            return true;
-        }
-
-        public boolean requiresReadBarrier() {
-            return current == null || true;
-        }
-
-        public boolean requiresWriteBarrier() {
-            return current == null || true;
-        }
-
-        public boolean requiresArrayStoreCheck() {
-            return true;
-        }
-
-        XirSupport site(ValueNode v, ValueNode r) {
-            current = v;
-            receiver = r;
-            return this;
-        }
-
-        @Override
-        public String toString() {
-            return "XirSupport<" + current + ">";
-        }
-    }
-
-    public FrameMap frameMap() {
-        return frameMap;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.gen;
-
-import static com.oracle.max.cri.ci.CiValue.*;
-import static com.oracle.graal.lir.ValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * Converts {@link PhiNode} instructions into moves.
- *
- * Resolves cycles:
- * <pre>
- *
- *  r1 := r2  becomes  temp := r1
- *  r2 := r1           r1 := r2
- *                     r2 := temp
- * </pre>
- *
- * and orders moves:
- *
- * <pre>
- *  r2 := r3  becomes  r1 := r2
- *  r1 := r2           r2 := r3
- * </pre>
- */
-public class PhiResolver {
-
-    /**
-     * Tracks a data flow dependency between a source operand and any number of the destination operands.
-     */
-    static class PhiResolverNode {
-
-        /**
-         * A source operand whose value flows into the {@linkplain #destinations destination} operands.
-         */
-        final CiValue operand;
-
-        /**
-         * The operands whose values are defined by the {@linkplain #operand source} operand.
-         */
-        final ArrayList<PhiResolverNode> destinations;
-
-        /**
-         * Denotes if a move instruction has already been emitted to initialize the value of {@link #operand}.
-         */
-        boolean assigned;
-
-        /**
-         * Specifies if this operand been visited for the purpose of emitting a move instruction.
-         */
-        boolean visited;
-
-        /**
-         * Specifies if this is the initial definition in data flow path for a given value.
-         */
-        boolean startNode;
-
-        PhiResolverNode(CiValue operand) {
-            this.operand = operand;
-            destinations = new ArrayList<>(4);
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder buf = new StringBuilder(operand.toString());
-            if (!destinations.isEmpty()) {
-                buf.append(" ->");
-                for (PhiResolverNode node : destinations) {
-                    buf.append(' ').append(node.operand);
-                }
-            }
-            return buf.toString();
-        }
-    }
-
-    private final LIRGenerator gen;
-
-    /**
-     * The operand loop header phi for the operand currently being process in {@link #dispose()}.
-     */
-    private PhiResolverNode loop;
-
-    private CiValue temp;
-
-    private final ArrayList<PhiResolverNode> variableOperands = new ArrayList<>(3);
-    private final ArrayList<PhiResolverNode> otherOperands = new ArrayList<>(3);
-
-    /**
-     * Maps operands to nodes.
-     */
-    private final HashMap<CiValue, PhiResolverNode> operandToNodeMap = new HashMap<>();
-
-    public PhiResolver(LIRGenerator gen) {
-        this.gen = gen;
-        temp = IllegalValue;
-    }
-
-    public void dispose() {
-        // resolve any cycles in moves from and to variables
-        for (int i = variableOperands.size() - 1; i >= 0; i--) {
-            PhiResolverNode node = variableOperands.get(i);
-            if (!node.visited) {
-                loop = null;
-                move(null, node);
-                node.startNode = true;
-                assert isIllegal(temp) : "moveTempTo() call missing";
-            }
-        }
-
-        // generate move for move from non variable to arbitrary destination
-        for (int i = otherOperands.size() - 1; i >= 0; i--) {
-            PhiResolverNode node = otherOperands.get(i);
-            for (int j = node.destinations.size() - 1; j >= 0; j--) {
-                emitMove(node.operand, node.destinations.get(j).operand);
-            }
-        }
-    }
-
-    public void move(CiValue src, CiValue dest) {
-        assert isVariable(dest) : "destination must be virtual";
-        // tty.print("move "); src.print(); tty.print(" to "); dest.print(); tty.cr();
-        assert isLegal(src) : "source for phi move is illegal";
-        assert isLegal(dest) : "destination for phi move is illegal";
-        PhiResolverNode srcNode = sourceNode(src);
-        PhiResolverNode destNode = destinationNode(dest);
-        srcNode.destinations.add(destNode);
-      }
-
-    private PhiResolverNode createNode(CiValue operand, boolean source) {
-        PhiResolverNode node;
-        if (isVariable(operand)) {
-            node = operandToNodeMap.get(operand);
-            assert node == null || node.operand.equals(operand);
-            if (node == null) {
-                node = new PhiResolverNode(operand);
-                operandToNodeMap.put(operand, node);
-            }
-            // Make sure that all variables show up in the list when
-            // they are used as the source of a move.
-            if (source) {
-                if (!variableOperands.contains(node)) {
-                    variableOperands.add(node);
-                }
-            }
-        } else {
-            assert source;
-            node = new PhiResolverNode(operand);
-            otherOperands.add(node);
-        }
-        return node;
-    }
-
-    private PhiResolverNode destinationNode(CiValue opr) {
-        return createNode(opr, false);
-    }
-
-    private void emitMove(CiValue src, CiValue dest) {
-        assert isLegal(src);
-        assert isLegal(dest);
-        gen.emitMove(src, dest);
-    }
-
-    // Traverse assignment graph in depth first order and generate moves in post order
-    // ie. two assignments: b := c, a := b start with node c:
-    // Call graph: move(NULL, c) -> move(c, b) -> move(b, a)
-    // Generates moves in this order: move b to a and move c to b
-    // ie. cycle a := b, b := a start with node a
-    // Call graph: move(NULL, a) -> move(a, b) -> move(b, a)
-    // Generates moves in this order: move b to temp, move a to b, move temp to a
-    private void move(PhiResolverNode src, PhiResolverNode dest) {
-        if (!dest.visited) {
-            dest.visited = true;
-            for (int i = dest.destinations.size() - 1; i >= 0; i--) {
-                move(dest, dest.destinations.get(i));
-            }
-        } else if (!dest.startNode) {
-            // cycle in graph detected
-            assert loop == null : "only one loop valid!";
-            loop = dest;
-            moveToTemp(src.operand);
-            return;
-        } // else dest is a start node
-
-        if (!dest.assigned) {
-            if (loop == dest) {
-                moveTempTo(dest.operand);
-                dest.assigned = true;
-            } else if (src != null) {
-                emitMove(src.operand, dest.operand);
-                dest.assigned = true;
-            }
-        }
-    }
-
-    private void moveTempTo(CiValue dest) {
-        assert isLegal(temp);
-        emitMove(temp, dest);
-        temp = IllegalValue;
-    }
-
-    private void moveToTemp(CiValue src) {
-        assert isIllegal(temp);
-        temp = gen.newVariable(src.kind);
-        emitMove(src, temp);
-    }
-
-    private PhiResolverNode sourceNode(CiValue opr) {
-        return createNode(opr, true);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/gen/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-/**
- * This package contains the port of the LIRGenerator which translates
- * HIR instructions to LIR instructions for the backend.
- */
-package com.oracle.graal.compiler.gen;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/graph/MergeableState.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.graph;
-
-import java.util.*;
-
-import com.oracle.graal.nodes.*;
-
-public interface MergeableState <T> {
-    T clone();
-    boolean merge(MergeNode merge, Collection<T> withStates);
-    void loopBegin(LoopBeginNode loopBegin);
-    void loopEnds(LoopBeginNode loopBegin, Collection<T> loopEndStates);
-    void afterSplit(FixedNode node);
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/graph/PostOrderNodeIterator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.graph;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-public abstract class PostOrderNodeIterator<T extends MergeableState<T>> {
-
-    private final NodeBitMap visitedEnds;
-    private final Deque<FixedNode> nodeQueue;
-    private final IdentityHashMap<FixedNode, T> nodeStates;
-    private final FixedNode start;
-
-    protected T state;
-
-    public PostOrderNodeIterator(FixedNode start, T initialState) {
-        visitedEnds = start.graph().createNodeBitMap();
-        nodeQueue = new ArrayDeque<>();
-        nodeStates = new IdentityHashMap<>();
-        this.start = start;
-        this.state = initialState;
-    }
-
-    public void apply() {
-        FixedNode current = start;
-
-        do {
-            if (current instanceof InvokeWithExceptionNode) {
-                invoke((Invoke) current);
-                queueSuccessors(current, null);
-                current = nextQueuedNode();
-            } else if (current instanceof LoopBeginNode) {
-                state.loopBegin((LoopBeginNode) current);
-                nodeStates.put(current, state);
-                state = state.clone();
-                loopBegin((LoopBeginNode) current);
-                current = ((LoopBeginNode) current).next();
-                assert current != null;
-            } else if (current instanceof LoopEndNode) {
-                loopEnd((LoopEndNode) current);
-                finishLoopEnds((LoopEndNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof MergeNode) {
-                merge((MergeNode) current);
-                current = ((MergeNode) current).next();
-                assert current != null;
-            } else if (current instanceof FixedWithNextNode) {
-                FixedNode next = ((FixedWithNextNode) current).next();
-                assert next != null : current;
-                node(current);
-                current = next;
-            } else if (current instanceof EndNode) {
-                end((EndNode) current);
-                queueMerge((EndNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof DeoptimizeNode) {
-                deoptimize((DeoptimizeNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof ReturnNode) {
-                returnNode((ReturnNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof UnwindNode) {
-                unwind((UnwindNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof ControlSplitNode) {
-                Set<Node> successors = controlSplit((ControlSplitNode) current);
-                queueSuccessors(current, successors);
-                current = nextQueuedNode();
-            } else {
-                assert false : current;
-            }
-        } while(current != null);
-    }
-
-    private void queueSuccessors(FixedNode x, Set<Node> successors) {
-        nodeStates.put(x, state);
-        if (successors != null) {
-            for (Node node : successors) {
-                if (node != null) {
-                    nodeStates.put((FixedNode) node.predecessor(), state);
-                    nodeQueue.addFirst((FixedNode) node);
-                }
-            }
-        } else {
-            for (Node node : x.successors()) {
-                if (node != null) {
-                    nodeQueue.addFirst((FixedNode) node);
-                }
-            }
-        }
-    }
-
-    private FixedNode nextQueuedNode() {
-        int maxIterations = nodeQueue.size();
-        while (maxIterations-- > 0) {
-            FixedNode node = nodeQueue.removeFirst();
-            if (node instanceof MergeNode) {
-                MergeNode merge = (MergeNode) node;
-                state = nodeStates.get(merge.forwardEndAt(0)).clone();
-                ArrayList<T> states = new ArrayList<>(merge.forwardEndCount() - 1);
-                for (int i = 1; i < merge.forwardEndCount(); i++) {
-                    T other = nodeStates.get(merge.forwardEndAt(i));
-                    assert other != null;
-                    states.add(other);
-                }
-                boolean ready = state.merge(merge, states);
-                if (ready) {
-                    return merge;
-                } else {
-                    nodeQueue.addLast(merge);
-                }
-            } else {
-                assert node.predecessor() != null;
-                state = nodeStates.get(node.predecessor()).clone();
-                state.afterSplit(node);
-                return node;
-            }
-        }
-        return null;
-    }
-
-    private void finishLoopEnds(LoopEndNode end) {
-        assert !visitedEnds.isMarked(end);
-        assert !nodeStates.containsKey(end);
-        nodeStates.put(end, state);
-        visitedEnds.mark(end);
-        LoopBeginNode begin = end.loopBegin();
-        boolean endsVisited = true;
-        for (LoopEndNode le : begin.loopEnds()) {
-            if (!visitedEnds.isMarked(le)) {
-                endsVisited = false;
-                break;
-            }
-        }
-        if (endsVisited) {
-            ArrayList<T> states = new ArrayList<>(begin.loopEnds().count());
-            for (LoopEndNode le : begin.orderedLoopEnds()) {
-                states.add(nodeStates.get(le));
-            }
-            T loopBeginState = nodeStates.get(begin);
-            if (loopBeginState != null) {
-                loopBeginState.loopEnds(begin, states);
-            }
-        }
-    }
-
-    private void queueMerge(EndNode end) {
-        assert !visitedEnds.isMarked(end);
-        assert !nodeStates.containsKey(end);
-        nodeStates.put(end, state);
-        visitedEnds.mark(end);
-        MergeNode merge = end.merge();
-        boolean endsVisited = true;
-        for (int i = 0; i < merge.forwardEndCount(); i++) {
-            if (!visitedEnds.isMarked(merge.forwardEndAt(i))) {
-                endsVisited = false;
-                break;
-            }
-        }
-        if (endsVisited) {
-            nodeQueue.add(merge);
-        }
-    }
-
-    protected abstract void node(FixedNode node);
-
-    protected void end(EndNode endNode) {
-        node(endNode);
-    }
-
-    protected void merge(MergeNode merge) {
-        node(merge);
-    }
-
-    protected void loopBegin(LoopBeginNode loopBegin) {
-        node(loopBegin);
-    }
-
-    protected void loopEnd(LoopEndNode loopEnd) {
-        node(loopEnd);
-    }
-
-    protected void deoptimize(DeoptimizeNode deoptimize) {
-        node(deoptimize);
-    }
-
-    protected Set<Node> controlSplit(ControlSplitNode controlSplit) {
-        node(controlSplit);
-        return null;
-    }
-
-    protected void returnNode(ReturnNode returnNode) {
-        node(returnNode);
-    }
-
-    protected void invoke(Invoke invoke) {
-        node(invoke.node());
-    }
-
-    protected void unwind(UnwindNode unwind) {
-        node(unwind);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/graph/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- *
- */
-package com.oracle.graal.compiler.graph;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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 top-level package in Graal containing options, metrics, timers and the main compiler class
- * {@link com.oracle.graal.compiler.GraalCompiler}.
- *
- * <H2>{@code GraalCompiler} Overview</H2>
- *
- * Graal is intended to be used with multiple JVM's so makes no use of or reference to classes for a specific JVM, for
- * example Maxine.
- *
- * The compiler is represented by the class {@code GraalCompiler}. {@code GraalCompiler} binds a specific target
- * architecture and JVM interface to produce a usable compiler object.
- * {@code RiMethod} is Graal's representation of a Java method and {@code RiXirGenerator} represents the interface through
- * which the compiler requests the XIR for a given bytecode from the runtime system.
- *
- * <H3>The Graal Compilation Process</H3>
- *
- * {@link com.oracle.graal.compiler.GraalCompiler#compileMethod} creates a {@link GraalCompilation} instance and then returns the result of calling its
- * {@link com.oracle.graal.compiler.GraalCompilation#compile} method.
- * <p>
- * 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.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.oracle.max.cri.ci.CiStatistics} object that accumulates information about the compilation process.
- * </p>
- * <H3>Supported backends</H3>
- *
- * <ul>
- * <li>AMD64/x64 with SSE2</li>
- * </ul>
- */
-package com.oracle.graal.compiler;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/BoxingEliminationPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.PhiNode.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.virtual.*;
-
-public class BoxingEliminationPhase extends Phase {
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        if (graph.getNodes(UnboxNode.class).isNotEmpty()) {
-
-            Map<PhiNode, PhiNode> phiReplacements = new HashMap<>();
-            for (UnboxNode unboxNode : graph.getNodes(UnboxNode.class)) {
-                tryEliminate(graph, unboxNode, phiReplacements);
-            }
-
-            new DeadCodeEliminationPhase().apply(graph);
-
-            for (BoxNode boxNode : graph.getNodes(BoxNode.class)) {
-                tryEliminate(boxNode);
-            }
-        }
-    }
-
-    private void tryEliminate(StructuredGraph graph, UnboxNode unboxNode, Map<PhiNode, PhiNode> phiReplacements) {
-        ValueNode unboxedValue = unboxedValue(unboxNode.source(), unboxNode.destinationKind(), phiReplacements);
-        if (unboxedValue != null) {
-            assert unboxedValue.kind() == unboxNode.kind();
-            unboxNode.replaceAtUsages(unboxedValue);
-            graph.removeFixed(unboxNode);
-        }
-    }
-
-    private PhiNode getReplacementPhi(PhiNode phiNode, CiKind kind, Map<PhiNode, PhiNode> phiReplacements) {
-        if (!phiReplacements.containsKey(phiNode)) {
-            PhiNode result = null;
-            if (phiNode.stamp().nonNull()) {
-                RiResolvedType exactType = phiNode.stamp().exactType();
-                if (exactType != null && exactType.toJava() == kind.toUnboxedJavaClass()) {
-                    StructuredGraph graph = (StructuredGraph) phiNode.graph();
-                    result = graph.add(new PhiNode(kind, phiNode.merge(), PhiType.Value));
-                    phiReplacements.put(phiNode, result);
-                    virtualizeUsages(phiNode, result, exactType);
-                    int i = 0;
-                    for (ValueNode n : phiNode.values()) {
-                        ValueNode unboxedValue = unboxedValue(n, kind, phiReplacements);
-                        if (unboxedValue != null) {
-                            assert unboxedValue.kind() == kind;
-                            result.addInput(unboxedValue);
-                        } else {
-                            UnboxNode unboxNode = graph.add(new UnboxNode(kind, n));
-                            FixedNode pred = phiNode.merge().phiPredecessorAt(i);
-                            graph.addBeforeFixed(pred, unboxNode);
-                            result.addInput(unboxNode);
-                        }
-                        ++i;
-                    }
-                }
-            }
-        }
-        return phiReplacements.get(phiNode);
-    }
-
-    private ValueNode unboxedValue(ValueNode n, CiKind kind, Map<PhiNode, PhiNode> phiReplacements) {
-        if (n instanceof BoxNode) {
-            BoxNode boxNode = (BoxNode) n;
-            return boxNode.source();
-        } else if (n instanceof PhiNode) {
-            PhiNode phiNode = (PhiNode) n;
-            return getReplacementPhi(phiNode, kind, phiReplacements);
-        } else {
-            return null;
-        }
-    }
-
-    private static void tryEliminate(BoxNode boxNode) {
-
-        virtualizeUsages(boxNode, boxNode.source(), boxNode.exactType());
-
-        if (boxNode.usages().filter(isNotA(FrameState.class).nor(VirtualObjectFieldNode.class)).isNotEmpty()) {
-            // Elimination failed, because boxing object escapes.
-            return;
-        }
-
-        FrameState stateAfter = boxNode.stateAfter();
-        boxNode.setStateAfter(null);
-        stateAfter.safeDelete();
-
-        ((StructuredGraph) boxNode.graph()).removeFixed(boxNode);
-    }
-
-    private static void virtualizeUsages(ValueNode boxNode, ValueNode replacement, RiResolvedType exactType) {
-        ValueNode virtualValueNode = null;
-        VirtualObjectNode virtualObjectNode = null;
-        for (Node n : boxNode.usages().filter(NodePredicates.isA(FrameState.class).or(VirtualObjectFieldNode.class)).snapshot()) {
-            if (virtualValueNode == null) {
-                virtualObjectNode = n.graph().unique(new BoxedVirtualObjectNode(exactType, replacement));
-            }
-            n.replaceFirstInput(boxNode, virtualObjectNode);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.util.*;
-
-public class CanonicalizerPhase extends Phase {
-    private static final int MAX_ITERATION_PER_NODE = 10;
-
-    private boolean newNodes;
-    private final CiTarget target;
-    private final CiAssumptions assumptions;
-    private final RiRuntime runtime;
-
-    public CanonicalizerPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions) {
-        this(target, runtime, false, assumptions);
-    }
-
-    public CanonicalizerPhase(CiTarget target, RiRuntime runtime, boolean newNodes, CiAssumptions assumptions) {
-        this.newNodes = newNodes;
-        this.target = target;
-        this.assumptions = assumptions;
-        this.runtime = runtime;
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        NodeWorkList nodeWorkList = graph.createNodeWorkList(!newNodes, MAX_ITERATION_PER_NODE);
-        if (newNodes) {
-            nodeWorkList.addAll(graph.getNewNodes());
-        }
-
-        canonicalize(graph, nodeWorkList, runtime, target, assumptions);
-    }
-
-    public static void canonicalize(StructuredGraph graph, NodeWorkList nodeWorkList, RiRuntime runtime, CiTarget target, CiAssumptions assumptions) {
-        graph.trackInputChange(nodeWorkList);
-        Tool tool = new Tool(nodeWorkList, runtime, target, assumptions);
-        for (Node node : nodeWorkList) {
-            if (node instanceof Canonicalizable) {
-                Debug.log("Canonicalizer: work on %s", node);
-                graph.mark();
-                ValueNode canonical = ((Canonicalizable) node).canonical(tool);
-//     cases:                                           original node:
-//                                         |Floating|Fixed-unconnected|Fixed-connected|
-//                                         --------------------------------------------
-//                                     null|   1    |        X        |       3       |
-//                                         --------------------------------------------
-//                                 Floating|   2    |        X        |       4       |
-//       canonical node:                   --------------------------------------------
-//                        Fixed-unconnected|   X    |        X        |       5       |
-//                                         --------------------------------------------
-//                          Fixed-connected|   2    |        X        |       6       |
-//                                         --------------------------------------------
-//       X: must not happen (checked with assertions)
-                if (canonical != node) {
-                    if (node instanceof FloatingNode) {
-                        if (canonical == null) {
-                            // case 1
-                            graph.removeFloating((FloatingNode) node);
-                        } else {
-                            // case 2
-                            assert !(canonical instanceof FixedNode) || canonical.predecessor() != null : node + " -> " + canonical +
-                                            " : replacement should be floating or fixed and connected";
-                            graph.replaceFloating((FloatingNode) node, canonical);
-                        }
-                    } else {
-                        assert node instanceof FixedWithNextNode && node.predecessor() != null : node + " -> " + canonical + " : node should be fixed & connected (" + node.predecessor() + ")";
-                        if (canonical == null) {
-                            // case 3
-                            graph.removeFixed((FixedWithNextNode) node);
-                        } else if (canonical instanceof FloatingNode) {
-                            // case 4
-                            graph.replaceFixedWithFloating((FixedWithNextNode) node, (FloatingNode) canonical);
-                        } else {
-                            assert canonical instanceof FixedNode;
-                            if (canonical.predecessor() == null) {
-                                assert !canonical.cfgSuccessors().iterator().hasNext() : "replacement " + canonical + " shouldn't have successors";
-                                // case 5
-                                graph.replaceFixedWithFixed((FixedWithNextNode) node, (FixedWithNextNode) canonical);
-                            } else {
-                                assert canonical.cfgSuccessors().iterator().hasNext() : "replacement " + canonical + " should have successors";
-                                // case 6
-                                node.replaceAtUsages(canonical);
-                                graph.removeFixed((FixedWithNextNode) node);
-                            }
-                        }
-                    }
-                    nodeWorkList.addAll(graph.getNewNodes());
-                }
-            } else if (node instanceof Simplifiable) {
-                ((Simplifiable) node).simplify(tool);
-            }
-        }
-        graph.stopTrackingInputChange();
-        while (graph.getUsagesDroppedNodesCount() > 0) {
-            for (Node n : graph.getAndCleanUsagesDroppedNodes()) {
-                if (!n.isDeleted() && n.usages().size() == 0 && n instanceof FloatingNode) {
-                    n.clearInputs();
-                    n.safeDelete();
-                }
-            }
-        }
-    }
-
-    private static final class Tool implements SimplifierTool {
-
-        private final NodeWorkList nodeWorkList;
-        private final RiRuntime runtime;
-        private final CiTarget target;
-        private final CiAssumptions assumptions;
-
-        public Tool(NodeWorkList nodeWorkList, RiRuntime runtime, CiTarget target, CiAssumptions assumptions) {
-            this.nodeWorkList = nodeWorkList;
-            this.runtime = runtime;
-            this.target = target;
-            this.assumptions = assumptions;
-        }
-
-        @Override
-        public void deleteBranch(FixedNode branch) {
-            branch.predecessor().replaceFirstSuccessor(branch, null);
-            GraphUtil.killCFG(branch);
-        }
-
-        /**
-         * @return the current target or {@code null} if no target is available in the current context.
-         */
-        @Override
-        public CiTarget target() {
-            return target;
-        }
-
-        /**
-         * @return an object that can be used for recording assumptions or {@code null} if assumptions are not allowed in the current context.
-         */
-        @Override
-        public CiAssumptions assumptions() {
-            return assumptions;
-        }
-
-        @Override
-        public RiRuntime runtime() {
-            return runtime;
-        }
-
-        @Override
-        public void addToWorkList(Node node) {
-            nodeWorkList.add(node);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.util.*;
-
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.graph.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-
-public class ComputeProbabilityPhase extends Phase {
-    private static final double EPSILON = 1d / Integer.MAX_VALUE;
-
-    /*
-     * The computation of absolute probabilities works in three steps:
-     *
-     * - The first step, "PropagateProbability", traverses the graph in post order (merges after their ends, ...) and keeps track of the "probability state".
-     *   Whenever it encounters a ControlSplit it uses the split's probability information to divide the probability upon the successors.
-     *   Whenever it encounters an Invoke it assumes that the exception edge is unlikely and propagates the whole probability to the normal successor.
-     *   Whenever it encounters a Merge it sums up the probability of all predecessors.
-     *   It also maintains a set of active loops (whose LoopBegin has been visited) and builds def/use information for the second step.
-     *
-     * - The third step propagates the loop frequencies and multiplies each FixedNode's probability with its loop frequency.
-     *
-     *   TODO: add exception probability information to Invokes
-     */
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        new PropagateProbability(graph.start()).apply();
-        Debug.dump(graph, "After PropagateProbability");
-        computeLoopFactors();
-        Debug.dump(graph, "After computeLoopFactors");
-        new PropagateLoopFrequency(graph.start()).apply();
-
-        if (GraalOptions.LoopFrequencyPropagationPolicy < 0) {
-            ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false);
-            BitMap visitedBlocks = new BitMap(cfg.getBlocks().length);
-            for (Loop loop : cfg.getLoops()) {
-                if (loop.parent == null) {
-                    correctLoopFrequencies(loop, 1, visitedBlocks);
-                }
-            }
-        }
-    }
-
-    private void correctLoopFrequencies(Loop loop, double parentFrequency, BitMap visitedBlocks) {
-        LoopBeginNode loopBegin = ((LoopBeginNode) loop.header.getBeginNode());
-        double frequency = parentFrequency * loopBegin.loopFrequency();
-        for (Loop child : loop.children) {
-            correctLoopFrequencies(child, frequency, visitedBlocks);
-        }
-
-        double factor = getCorrectionFactor(loopBegin.probability(), frequency);
-        for (Block block : loop.blocks) {
-            int blockId = block.getId();
-            if (!visitedBlocks.get(blockId)) {
-                visitedBlocks.set(blockId);
-
-                FixedNode node = block.getBeginNode();
-                while (node != block.getEndNode()) {
-                    node.setProbability(node.probability() * factor);
-                    node = ((FixedWithNextNode) node).next();
-                }
-                node.setProbability(node.probability() * factor);
-            }
-        }
-    }
-
-    private static double getCorrectionFactor(double probability, double frequency) {
-        switch (GraalOptions.LoopFrequencyPropagationPolicy) {
-            case -1:
-                return 1 / frequency;
-            case -2:
-                return (1 / frequency) * (Math.log(Math.E + frequency) - 1);
-            case -3:
-                double originalProbability = probability / frequency;
-                assert isRelativeProbability(originalProbability);
-                return (1 / frequency) * Math.max(1, Math.pow(originalProbability, 1.5) * Math.log10(frequency));
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private void computeLoopFactors() {
-        for (LoopInfo info : loopInfos) {
-            double frequency = info.loopFrequency();
-            assert frequency != -1;
-        }
-    }
-
-    private static boolean isRelativeProbability(double prob) {
-        // 1.01 to allow for some rounding errors
-        return prob >= 0 && prob <= 1.01;
-    }
-
-    public static class LoopInfo {
-        public final LoopBeginNode loopBegin;
-
-        public final NodeMap<Set<LoopInfo>> requires;
-
-        private double loopFrequency = -1;
-        public boolean ended = false;
-
-        public LoopInfo(LoopBeginNode loopBegin) {
-            this.loopBegin = loopBegin;
-            this.requires = loopBegin.graph().createNodeMap();
-        }
-
-        public double loopFrequency() {
-            if (loopFrequency == -1 && ended) {
-                double backEdgeProb = 0.0;
-                for (LoopEndNode le : loopBegin.loopEnds()) {
-                    double factor = 1;
-                    Set<LoopInfo> requireds = requires.get(le);
-                    for (LoopInfo required : requireds) {
-                        double t = required.loopFrequency();
-                        if (t == -1) {
-                            return -1;
-                        }
-                        factor *= t;
-                    }
-                    backEdgeProb += le.probability() * factor;
-                }
-                double d = backEdgeProb;
-                if (d < EPSILON) {
-                    d = EPSILON;
-                } else if (d > loopBegin.probability() - EPSILON) {
-                    d = loopBegin.probability() - EPSILON;
-                }
-                loopFrequency = loopBegin.probability() / (loopBegin.probability() - d);
-                loopBegin.setLoopFrequency(loopFrequency);
-            }
-            return loopFrequency;
-        }
-    }
-
-    public Set<LoopInfo> loopInfos = new HashSet<>();
-    public Map<MergeNode, Set<LoopInfo>> mergeLoops = new IdentityHashMap<>();
-
-    private class Probability implements MergeableState<Probability> {
-        public double probability;
-        public HashSet<LoopInfo> loops;
-        public LoopInfo loopInfo;
-
-        public Probability(double probability, HashSet<LoopInfo> loops) {
-            this.probability = probability;
-            this.loops = new HashSet<>(4);
-            if (loops != null) {
-                this.loops.addAll(loops);
-            }
-        }
-
-        @Override
-        public Probability clone() {
-            return new Probability(probability, loops);
-        }
-
-        @Override
-        public boolean merge(MergeNode merge, Collection<Probability> withStates) {
-            if (merge.forwardEndCount() > 1) {
-                HashSet<LoopInfo> intersection = new HashSet<>(loops);
-                for (Probability other : withStates) {
-                    intersection.retainAll(other.loops);
-                }
-                for (LoopInfo info : loops) {
-                    if (!intersection.contains(info)) {
-                        double loopFrequency = info.loopFrequency();
-                        if (loopFrequency == -1) {
-                            return false;
-                        }
-                        probability *= loopFrequency;
-                    }
-                }
-                for (Probability other : withStates) {
-                    double prob = other.probability;
-                    for (LoopInfo info : other.loops) {
-                        if (!intersection.contains(info)) {
-                            double loopFrequency = info.loopFrequency();
-                            if (loopFrequency == -1) {
-                                return false;
-                            }
-                            prob *= loopFrequency;
-                        }
-                    }
-                    probability += prob;
-                }
-                loops = intersection;
-                mergeLoops.put(merge, new HashSet<>(intersection));
-                assert isRelativeProbability(probability) : probability;
-            }
-            return true;
-        }
-
-        @Override
-        public void loopBegin(LoopBeginNode loopBegin) {
-            loopInfo = new LoopInfo(loopBegin);
-            loopInfos.add(loopInfo);
-            loops.add(loopInfo);
-        }
-
-        @Override
-        public void loopEnds(LoopBeginNode loopBegin, Collection<Probability> loopEndStates) {
-            assert loopInfo != null;
-            List<LoopEndNode> loopEnds = loopBegin.orderedLoopEnds();
-            int i = 0;
-            for (Probability proba : loopEndStates) {
-                LoopEndNode loopEnd = loopEnds.get(i++);
-                Set<LoopInfo> requires = loopInfo.requires.get(loopEnd);
-                if (requires == null) {
-                    requires = new HashSet<>();
-                    loopInfo.requires.set(loopEnd, requires);
-                }
-                for (LoopInfo innerLoop : proba.loops) {
-                    if (innerLoop != loopInfo && !this.loops.contains(innerLoop)) {
-                        requires.add(innerLoop);
-                    }
-                }
-            }
-            loopInfo.ended = true;
-        }
-
-        @Override
-        public void afterSplit(FixedNode node) {
-            assert node.predecessor() != null;
-            Node pred = node.predecessor();
-            if (pred instanceof Invoke) {
-                Invoke x = (Invoke) pred;
-                if (x.next() != node) {
-                    probability = 0;
-                }
-            } else {
-                assert pred instanceof ControlSplitNode;
-                ControlSplitNode x = (ControlSplitNode) pred;
-                double sum = 0;
-                for (int i = 0; i < x.blockSuccessorCount(); i++) {
-                    if (x.blockSuccessor(i) == node) {
-                        sum += x.probability(i);
-                    }
-                }
-                probability *= sum;
-            }
-        }
-    }
-
-    private class PropagateProbability extends PostOrderNodeIterator<Probability> {
-
-        public PropagateProbability(FixedNode start) {
-            super(start, new Probability(1d, null));
-        }
-
-        @Override
-        protected void node(FixedNode node) {
-            node.setProbability(state.probability);
-        }
-    }
-
-    private class LoopCount implements MergeableState<LoopCount> {
-        public double count;
-
-        public LoopCount(double count) {
-            this.count = count;
-        }
-
-        @Override
-        public LoopCount clone() {
-            return new LoopCount(count);
-        }
-
-        @Override
-        public boolean merge(MergeNode merge, Collection<LoopCount> withStates) {
-            assert merge.forwardEndCount() == withStates.size() + 1;
-            if (merge.forwardEndCount() > 1) {
-                Set<LoopInfo> loops = mergeLoops.get(merge);
-                assert loops != null;
-                double countProd = 1;
-                for (LoopInfo loop : loops) {
-                    countProd *= loop.loopFrequency();
-                }
-                count = countProd;
-            }
-            return true;
-        }
-
-        @Override
-        public void loopBegin(LoopBeginNode loopBegin) {
-            count *= loopBegin.loopFrequency();
-        }
-
-        @Override
-        public void loopEnds(LoopBeginNode loopBegin, Collection<LoopCount> loopEndStates) {
-            // nothing to do...
-        }
-
-        @Override
-        public void afterSplit(FixedNode node) {
-            // nothing to do...
-        }
-    }
-
-    private class PropagateLoopFrequency extends PostOrderNodeIterator<LoopCount> {
-
-        private final FrequencyPropagationPolicy policy;
-
-        public PropagateLoopFrequency(FixedNode start) {
-            super(start, new LoopCount(1d));
-            this.policy = createFrequencyPropagationPolicy();
-        }
-
-        @Override
-        protected void node(FixedNode node) {
-            node.setProbability(policy.compute(node.probability(), state.count));
-        }
-
-    }
-
-    private static FrequencyPropagationPolicy createFrequencyPropagationPolicy() {
-        switch (GraalOptions.LoopFrequencyPropagationPolicy) {
-            case -3:
-            case -2:
-            case -1:
-            case 0:
-                return new FullFrequencyPropagation();
-            case 1:
-                return new NoFrequencyPropagation();
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private interface FrequencyPropagationPolicy {
-
-        double compute(double probability, double frequency);
-    }
-
-    private static class FullFrequencyPropagation implements FrequencyPropagationPolicy {
-
-        @Override
-        public double compute(double probability, double frequency) {
-            return probability * frequency;
-        }
-    }
-
-    private static class NoFrequencyPropagation implements FrequencyPropagationPolicy {
-
-        @Override
-        public double compute(double probability, double frequency) {
-            return probability;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ConvertDeoptimizeToGuardPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.util.*;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.util.*;
-
-public class ConvertDeoptimizeToGuardPhase extends Phase {
-
-    private static BeginNode findBeginNode(Node startNode) {
-        Node n = startNode;
-        while (true) {
-            if (n instanceof BeginNode) {
-                return (BeginNode) n;
-            } else {
-                n = n.predecessor();
-            }
-        }
-    }
-
-    @Override
-    protected void run(final StructuredGraph graph) {
-        if (graph.getNodes(DeoptimizeNode.class).isEmpty()) {
-            return;
-        }
-
-        for (DeoptimizeNode d : graph.getNodes(DeoptimizeNode.class)) {
-            visitDeoptBranch(findBeginNode(d), d, graph);
-        }
-
-        new DeadCodeEliminationPhase().apply(graph);
-    }
-
-    private void visitDeoptBranch(BeginNode deoptBegin, DeoptimizeNode deopt, StructuredGraph graph) {
-        if (deoptBegin instanceof MergeNode) {
-            MergeNode mergeNode = (MergeNode) deoptBegin;
-            Debug.log("Eliminating %s followed by %s", mergeNode, deopt);
-            List<EndNode> ends = mergeNode.forwardEnds().snapshot();
-            for (EndNode end : ends) {
-                if (!end.isDeleted()) {
-                    BeginNode beginNode = findBeginNode(end);
-                    visitDeoptBranch(beginNode, deopt, graph);
-                }
-            }
-            if (!deopt.isDeleted()) {
-                visitDeoptBranch(findBeginNode(deopt), deopt, graph);
-            }
-        } else if (deoptBegin.predecessor() instanceof IfNode) {
-            IfNode ifNode = (IfNode) deoptBegin.predecessor();
-            BeginNode otherBegin = ifNode.trueSuccessor();
-            BooleanNode conditionNode = ifNode.compare();
-            if (deoptBegin == ifNode.trueSuccessor()) {
-                conditionNode = conditionNode.negate();
-                otherBegin = ifNode.falseSuccessor();
-            }
-            BeginNode ifBlockBegin = findBeginNode(ifNode);
-            Debug.log("Converting %s on %-5s branch of %s to guard for remaining branch %s. IfBegin=%s", deopt, deoptBegin == ifNode.trueSuccessor() ? "true" : "false", ifNode, otherBegin, ifBlockBegin);
-            FixedGuardNode guard = graph.add(new FixedGuardNode(conditionNode));
-            otherBegin.replaceAtUsages(ifBlockBegin);
-            FixedNode next = otherBegin.next();
-            otherBegin.setNext(null);
-            guard.setNext(next);
-            ifNode.replaceAtPredecessors(guard);
-            GraphUtil.killCFG(ifNode);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/DeadCodeEliminationPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-
-public class DeadCodeEliminationPhase extends Phase {
-
-    private NodeFlood flood;
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        this.flood = graph.createNodeFlood();
-
-        flood.add(graph.start());
-        iterateSuccessors();
-        disconnectCFGNodes(graph);
-        iterateInputs(graph);
-        deleteNodes(graph);
-
-        // remove chained Merges
-        for (MergeNode merge : graph.getNodes(MergeNode.class)) {
-            if (merge.forwardEndCount() == 1 && !(merge instanceof LoopBeginNode)) {
-                graph.reduceTrivialMerge(merge);
-            }
-        }
-    }
-
-    private void iterateSuccessors() {
-        for (Node current : flood) {
-            if (current instanceof EndNode) {
-                EndNode end = (EndNode) current;
-                flood.add(end.merge());
-            } else {
-                for (Node successor : current.successors()) {
-                    flood.add(successor);
-                }
-            }
-        }
-    }
-
-    private void disconnectCFGNodes(StructuredGraph graph) {
-        for (EndNode node : graph.getNodes(EndNode.class)) {
-            if (!flood.isMarked(node)) {
-                MergeNode merge = node.merge();
-                if (merge != null && flood.isMarked(merge)) {
-                    // We are a dead end node leading to a live merge.
-                    merge.removeEnd(node);
-                }
-            }
-        }
-        for (LoopBeginNode loop : graph.getNodes(LoopBeginNode.class)) {
-            if (flood.isMarked(loop)) {
-                boolean reachable = false;
-                for (LoopEndNode end : loop.loopEnds()) {
-                    if (flood.isMarked(end)) {
-                        reachable = true;
-                        break;
-                    }
-                }
-                if (!reachable) {
-                    Debug.log("Removing loop with unreachable end: %s", loop);
-                    for (LoopEndNode end : loop.loopEnds().snapshot()) {
-                        loop.removeEnd(end);
-                    }
-                    graph.reduceDegenerateLoopBegin(loop);
-                }
-            }
-        }
-    }
-
-    private void deleteNodes(StructuredGraph graph) {
-        for (Node node : graph.getNodes()) {
-            if (!flood.isMarked(node)) {
-                node.clearInputs();
-                node.clearSuccessors();
-            }
-        }
-        for (Node node : graph.getNodes()) {
-            if (!flood.isMarked(node)) {
-                node.safeDelete();
-            }
-        }
-    }
-
-    private void iterateInputs(StructuredGraph graph) {
-        for (Node node : graph.getNodes()) {
-            if (node instanceof LocalNode) {
-                flood.add(node);
-            }
-            if (flood.isMarked(node)) {
-                for (Node input : node.inputs()) {
-                    flood.add(input);
-                }
-            }
-        }
-        for (Node current : flood) {
-            for (Node input : current.inputs()) {
-                flood.add(input);
-            }
-        }
-    }
-
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,460 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.graph.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.PhiNode.PhiType;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.virtual.*;
-
-
-public class EscapeAnalysisPhase extends Phase {
-
-    public static class BlockExitState implements MergeableState<BlockExitState> {
-        public final ValueNode[] fieldState;
-        public final VirtualObjectNode virtualObject;
-        public ValueNode virtualObjectField;
-        public final Graph graph;
-
-        public BlockExitState(EscapeField[] fields, VirtualObjectNode virtualObject) {
-            this.fieldState = new ValueNode[fields.length];
-            this.virtualObject = virtualObject;
-            this.virtualObjectField = null;
-            this.graph = virtualObject.graph();
-            for (int i = 0; i < fields.length; i++) {
-                fieldState[i] = ConstantNode.defaultForKind(fields[i].type().kind(true), virtualObject.graph());
-                virtualObjectField = graph.add(new VirtualObjectFieldNode(virtualObject, virtualObjectField, fieldState[i], i));
-            }
-        }
-
-        public BlockExitState(BlockExitState state) {
-            this.fieldState = state.fieldState.clone();
-            this.virtualObject = state.virtualObject;
-            this.virtualObjectField = state.virtualObjectField;
-            this.graph = state.graph;
-        }
-
-        public void updateField(int fieldIndex) {
-            virtualObjectField = graph.add(new VirtualObjectFieldNode(virtualObject, virtualObjectField, fieldState[fieldIndex], fieldIndex));
-        }
-
-        @Override
-        public BlockExitState clone() {
-            return new BlockExitState(this);
-        }
-
-        @Override
-        public boolean merge(MergeNode merge, Collection<BlockExitState> withStates) {
-            PhiNode vobjPhi = null;
-            PhiNode[] valuePhis = new PhiNode[fieldState.length];
-            for (BlockExitState other : withStates) {
-                if (virtualObjectField != other.virtualObjectField && vobjPhi == null) {
-                    vobjPhi = graph.add(new PhiNode(CiKind.Illegal, merge, PhiType.Virtual));
-                    vobjPhi.addInput(virtualObjectField);
-                    virtualObjectField = vobjPhi;
-                }
-                for (int i2 = 0; i2 < fieldState.length; i2++) {
-                    if (fieldState[i2] != other.fieldState[i2] && valuePhis[i2] == null) {
-                        valuePhis[i2] = graph.add(new PhiNode(fieldState[i2].kind(), merge, PhiType.Value));
-                        valuePhis[i2].addInput(fieldState[i2]);
-                        fieldState[i2] = valuePhis[i2];
-                    }
-                }
-            }
-            for (BlockExitState other : withStates) {
-                if (vobjPhi != null) {
-                    vobjPhi.addInput(other.virtualObjectField);
-                }
-                for (int i2 = 0; i2 < fieldState.length; i2++) {
-                    if (valuePhis[i2] != null) {
-                        valuePhis[i2].addInput(other.fieldState[i2]);
-                    }
-                }
-            }
-            assert vobjPhi == null || vobjPhi.valueCount() == withStates.size() + 1;
-            for (int i2 = 0; i2 < fieldState.length; i2++) {
-                if (valuePhis[i2] != null) {
-                    virtualObjectField = graph.add(new VirtualObjectFieldNode(virtualObject, virtualObjectField, valuePhis[i2], i2));
-                    assert valuePhis[i2].valueCount() == withStates.size() + 1;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public void loopBegin(LoopBeginNode loopBegin) {
-            assert virtualObjectField != null : "unexpected null virtualObjectField";
-            PhiNode vobjPhi = null;
-            vobjPhi = graph.add(new PhiNode(CiKind.Illegal, loopBegin, PhiType.Virtual));
-            vobjPhi.addInput(virtualObjectField);
-            virtualObjectField = vobjPhi;
-            for (int i2 = 0; i2 < fieldState.length; i2++) {
-                PhiNode valuePhi = graph.add(new PhiNode(fieldState[i2].kind(), loopBegin, PhiType.Value));
-                valuePhi.addInput(fieldState[i2]);
-                fieldState[i2] = valuePhi;
-                updateField(i2);
-            }
-        }
-
-        @Override
-        public void loopEnds(LoopBeginNode loopBegin, Collection<BlockExitState> loopEndStates) {
-            while (!(virtualObjectField instanceof PhiNode)) {
-                virtualObjectField = ((VirtualObjectFieldNode) virtualObjectField).lastState();
-            }
-            for (BlockExitState loopEndState : loopEndStates) {
-                ((PhiNode) virtualObjectField).addInput(loopEndState.virtualObjectField);
-                for (int i2 = 0; i2 < fieldState.length; i2++) {
-                    ((PhiNode) fieldState[i2]).addInput(loopEndState.fieldState[i2]);
-                }
-            }
-        }
-
-        @Override
-        public void afterSplit(FixedNode node) {
-            // nothing to do...
-        }
-    }
-
-
-    public static class EscapementFixup {
-
-        private final Map<Object, Integer> fields = new HashMap<>();
-        private final EscapeOp op;
-        private final StructuredGraph graph;
-        private final FixedWithNextNode node;
-        private EscapeField[] escapeFields;
-
-        public EscapementFixup(EscapeOp op, StructuredGraph graph, FixedWithNextNode node) {
-            this.op = op;
-            this.graph = graph;
-            this.node = node;
-        }
-
-        public void apply() {
-            if (node.usages().isEmpty()) {
-                graph.removeFixed(node);
-            } else {
-                process();
-                removeAllocation();
-            }
-        }
-
-        public void removeAllocation() {
-            escapeFields = op.fields(node);
-            for (int i = 0; i < escapeFields.length; i++) {
-                fields.put(escapeFields[i].representation(), i);
-            }
-            final VirtualObjectNode virtual = graph.add(new VirtualObjectNode(((ValueNode) node).exactType(), escapeFields));
-            if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
-                TTY.println("new virtual object: " + virtual);
-            }
-            node.replaceAtUsages(virtual);
-            FixedNode next = node.next();
-            graph.removeFixed(node);
-
-            if (virtual.fieldsCount() > 0) {
-                final BlockExitState startState = new BlockExitState(escapeFields, virtual);
-                final PostOrderNodeIterator<?> iterator = new PostOrderNodeIterator<BlockExitState>(next, startState) {
-                    @Override
-                    protected void node(FixedNode curNode) {
-                        int changedField = op.updateState(virtual, curNode, fields, state.fieldState);
-                        if (changedField != -1) {
-                            state.updateField(changedField);
-                        }
-                        if (!curNode.isDeleted() && curNode instanceof StateSplit && ((StateSplit) curNode).stateAfter() != null) {
-                            if (state.virtualObjectField != null) {
-                                ((StateSplit) curNode).stateAfter().addVirtualObjectMapping(state.virtualObjectField);
-                            }
-                        }
-                    }
-                };
-                iterator.apply();
-            }
-        }
-
-        private void process() {
-            for (Node usage : node.usages().snapshot()) {
-                op.beforeUpdate(node, usage);
-            }
-        }
-    }
-
-    private final CiTarget target;
-    private final GraalRuntime runtime;
-    private final CiAssumptions assumptions;
-    private final PhasePlan plan;
-
-    public EscapeAnalysisPhase(CiTarget target, GraalRuntime runtime, CiAssumptions assumptions, PhasePlan plan) {
-        this.runtime = runtime;
-        this.target = target;
-        this.assumptions = assumptions;
-        this.plan = plan;
-    }
-
-    public static class EscapeRecord {
-
-        public final Node node;
-        public final ArrayList<Node> escapesThrough = new ArrayList<>();
-        public final ArrayList<Invoke> invokes = new ArrayList<>();
-        public double localWeight;
-
-        public EscapeRecord(Node node) {
-            this.node = node;
-        }
-
-        public void dump() {
-            TTY.print("node %s (%f) escapes through ", node, localWeight);
-            for (Node escape : escapesThrough) {
-                TTY.print("%s ", escape);
-            }
-            TTY.println();
-        }
-    }
-
-    private static Node escape(EscapeRecord record, Node usage) {
-        final Node node = record.node;
-        if (usage instanceof FrameState) {
-            assert usage.inputs().contains(node);
-            return null;
-        } else {
-            if (usage instanceof FixedNode) {
-                record.localWeight += ((FixedNode) usage).probability();
-            }
-            if (usage instanceof NullCheckNode) {
-                assert ((NullCheckNode) usage).object() == node;
-                return null;
-            } else if (usage instanceof IsTypeNode) {
-                assert ((IsTypeNode) usage).objectClass() == node;
-                return null;
-            } else if (usage instanceof AccessMonitorNode) {
-                assert ((AccessMonitorNode) usage).object() == node;
-                return null;
-            } else if (usage instanceof LoadFieldNode) {
-                assert ((LoadFieldNode) usage).object() == node;
-                return null;
-            } else if (usage instanceof StoreFieldNode) {
-                StoreFieldNode x = (StoreFieldNode) usage;
-                // self-references do not escape
-                return x.value() == node ? x.object() : null;
-            } else if (usage instanceof LoadIndexedNode) {
-                LoadIndexedNode x = (LoadIndexedNode) usage;
-                if (x.index() == node) {
-                    return x.array();
-                } else {
-                    assert x.array() == node;
-                    return EscapeOp.isValidConstantIndex(x) ? null : x.array();
-                }
-            } else if (usage instanceof StoreIndexedNode) {
-                StoreIndexedNode x = (StoreIndexedNode) usage;
-                if (x.index() == node) {
-                    return x.array();
-                } else {
-                    assert x.array() == node || x.value() == node;
-                    // in order to not escape, the access needs to have a valid constant index and either a store into node or be self-referencing
-                    return EscapeOp.isValidConstantIndex(x) && x.value() != node ? null : x.array();
-                }
-            } else if (usage instanceof VirtualObjectFieldNode) {
-                return null;
-            } else if (usage instanceof RegisterFinalizerNode) {
-                assert ((RegisterFinalizerNode) usage).object() == node;
-                return null;
-            } else if (usage instanceof ArrayLengthNode) {
-                assert ((ArrayLengthNode) usage).array() == node;
-                return null;
-            } else {
-                return usage;
-            }
-        }
-    }
-
-    @SuppressWarnings("unused")
-    private static void completeAnalysis(StructuredGraph graph) {
-        // TODO (lstadler): debugging code
-
-        TTY.println("================================================================");
-        for (Node node : graph.getNodes()) {
-            if (node != null && node instanceof FixedWithNextNode && node instanceof EscapeAnalyzable) {
-                EscapeOp op = ((EscapeAnalyzable) node).getEscapeOp();
-                if (op != null && op.canAnalyze(node)) {
-                    EscapeRecord record = new EscapeRecord(node);
-
-                    for (Node usage : node.usages()) {
-                        Node escapesThrough = escape(record, usage);
-                        if (escapesThrough != null && escapesThrough != node) {
-                            record.escapesThrough.add(escapesThrough);
-                        }
-                    }
-                    record.dump();
-                }
-            }
-        }
-    }
-
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (Node node : new GraphOrder(graph)) {
-            if (node != null && node instanceof FixedWithNextNode && node instanceof EscapeAnalyzable) {
-                FixedWithNextNode fixedNode = (FixedWithNextNode) node;
-                EscapeOp op = ((EscapeAnalyzable) node).getEscapeOp();
-                if (op != null && op.canAnalyze(fixedNode)) {
-                    try {
-                        performAnalysis(graph, fixedNode, op);
-                    } catch (GraalInternalError e) {
-                        throw e.addContext("escape analysis of node", node);
-                    }
-                }
-            }
-        }
-    }
-
-    private void performAnalysis(StructuredGraph graph, FixedWithNextNode node, EscapeOp op) {
-        if (!shouldAnalyze(node)) {
-            return;
-        }
-        Set<Node> exits = new HashSet<>();
-        Set<Invoke> invokes = new HashSet<>();
-        int iterations = 0;
-
-        int minimumWeight = getMinimumWeight(node);
-        do {
-            double weight = analyze(op, node, exits, invokes);
-            if (exits.size() != 0) {
-                if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
-                    TTY.println("%n####### escaping object: %s (%s)", node, node.exactType());
-                    if (GraalOptions.TraceEscapeAnalysis) {
-                        TTY.print("%d: new value: %s, weight %f, escapes at ", iterations, node, weight);
-                        for (Node n : exits) {
-                            TTY.print("%s, ", n);
-                        }
-                        for (Invoke n : invokes) {
-                            TTY.print("%s, ", n);
-                        }
-                        TTY.println();
-                    }
-                }
-                break;
-            }
-            if (invokes.size() == 0) {
-
-                Debug.dump(graph, "Before escape %s", node);
-                Debug.log("!!!!!!!! non-escaping object: %s (%s)", node, node.exactType());
-                removeAllocation(node, op);
-                Debug.dump(graph, "After escape", graph);
-                break;
-            }
-            if (weight < minimumWeight) {
-                if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
-                    TTY.println("####### possibly escaping object: %s (insufficient weight for inlining: %f)", node, weight);
-                }
-                break;
-            }
-            if (!GraalOptions.Inline) {
-                break;
-            }
-            if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
-                TTY.println("Trying inlining to get a non-escaping object for %s", node);
-            }
-            new InliningPhase(target, runtime, invokes, assumptions, plan).apply(graph);
-            new DeadCodeEliminationPhase().apply(graph);
-            if (node.isDeleted()) {
-                if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
-                    TTY.println("!!!!!!!! object died while performing escape analysis: %s (%s)", node, node.exactType());
-                }
-                break;
-            }
-            exits.clear();
-            invokes.clear();
-        } while (iterations++ < 3);
-    }
-
-    protected void removeAllocation(FixedWithNextNode node, EscapeOp op) {
-        new EscapementFixup(op, (StructuredGraph) node.graph(), node).apply();
-
-        for (PhiNode phi : node.graph().getNodes(PhiNode.class)) {
-            ValueNode simpleValue = phi;
-            boolean required = false;
-            for (ValueNode value : phi.values()) {
-                if (value != phi && value != simpleValue) {
-                    if (simpleValue != phi) {
-                        required = true;
-                        break;
-                    }
-                    simpleValue = value;
-                }
-            }
-            if (!required) {
-                ((StructuredGraph) node.graph()).replaceFloating(phi, simpleValue);
-            }
-        }
-    }
-
-    protected boolean shouldAnalyze(@SuppressWarnings("unused") FixedWithNextNode node) {
-        return true;
-    }
-
-    protected int getMinimumWeight(@SuppressWarnings("unused") FixedWithNextNode node) {
-        return GraalOptions.ForcedInlineEscapeWeight;
-    }
-
-    private static double analyze(EscapeOp op, Node node, Collection<Node> exits, Collection<Invoke> invokes) {
-        double weight = 0;
-        for (Node usage : node.usages().snapshot()) {
-            boolean escapes = op.escape(node, usage);
-            if (escapes) {
-                if (usage instanceof FrameState) {
-                    // nothing to do...
-                } else if (usage instanceof MethodCallTargetNode) {
-                    if (usage.usages().size() == 0) {
-                        usage.safeDelete();
-                    } else {
-                        invokes.add(((MethodCallTargetNode) usage).invoke());
-                    }
-                } else {
-                    exits.add(usage);
-                    break;
-                }
-            } else {
-                if (GraalOptions.ProbabilityAnalysis && usage instanceof FixedNode) {
-                    weight += ((FixedNode) usage).probability();
-                } else {
-                    weight++;
-                }
-            }
-        }
-        return weight;
-    }
-
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ExpandBoxingNodesPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-
-public class ExpandBoxingNodesPhase extends Phase {
-
-    private final BoxingMethodPool pool;
-
-    public ExpandBoxingNodesPhase(BoxingMethodPool pool) {
-        this.pool = pool;
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (BoxNode boxNode : graph.getNodes(BoxNode.class)) {
-            boxNode.expand(pool);
-        }
-
-        for (UnboxNode unboxNode : graph.getNodes(UnboxNode.class)) {
-            unboxNode.expand(pool);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/FloatingReadPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.PhiNode.PhiType;
-import com.oracle.graal.nodes.extended.*;
-
-public class FloatingReadPhase extends Phase {
-
-    private static class MemoryMap {
-        private Block block;
-        private IdentityHashMap<Object, Node> map;
-        private IdentityHashMap<Object, Node> loopEntryMap;
-        private int mergeOperationCount;
-
-        public MemoryMap(Block block) {
-            this.block = block;
-            map = new IdentityHashMap<>();
-        }
-
-        public MemoryMap(Block block, MemoryMap other) {
-            this(block);
-            map.putAll(other.map);
-        }
-
-        public void mergeLoopEntryWith(MemoryMap otherMemoryMap, LoopBeginNode begin) {
-            for (Object keyInOther : otherMemoryMap.map.keySet()) {
-                assert loopEntryMap.containsKey(keyInOther) || map.get(keyInOther) == otherMemoryMap.map.get(keyInOther) : keyInOther + ", " + map.get(keyInOther) + " vs " + otherMemoryMap.map.get(keyInOther) + " " + begin;
-            }
-
-            for (Map.Entry<Object, Node> entry : loopEntryMap.entrySet()) {
-                PhiNode phiNode = (PhiNode) entry.getValue();
-                Object key = entry.getKey();
-                Node other;
-                if (otherMemoryMap.map.containsKey(key)) {
-                    other = otherMemoryMap.map.get(key);
-                } else {
-                    other = otherMemoryMap.map.get(LocationNode.ANY_LOCATION);
-                }
-
-                phiNode.addInput((ValueNode) other);
-            }
-        }
-
-        public void mergeWith(MemoryMap otherMemoryMap, Block b) {
-            Debug.log("Merging block %s into block %s.", otherMemoryMap.block, block);
-            IdentityHashMap<Object, Node> otherMap = otherMemoryMap.map;
-
-            for (Map.Entry<Object, Node> entry : map.entrySet()) {
-                if (otherMap.containsKey(entry.getKey())) {
-                    mergeNodes(entry.getKey(), entry.getValue(), otherMap.get(entry.getKey()), b);
-                } else {
-                    mergeNodes(entry.getKey(), entry.getValue(), otherMap.get(LocationNode.ANY_LOCATION), b);
-                }
-            }
-
-            Node anyLocationNode = map.get(LocationNode.ANY_LOCATION);
-            for (Map.Entry<Object, Node> entry : otherMap.entrySet()) {
-                if (!map.containsKey(entry.getKey())) {
-                    Node current = anyLocationNode;
-                    if (anyLocationNode instanceof PhiNode) {
-                        PhiNode phiNode = (PhiNode) anyLocationNode;
-                        if (phiNode.merge() == block.getBeginNode()) {
-                            PhiNode phiCopy = (PhiNode) phiNode.copyWithInputs();
-                            phiCopy.removeInput(phiCopy.valueCount() - 1);
-                            current = phiCopy;
-                            map.put(entry.getKey(), current);
-                        }
-                    }
-                    mergeNodes(entry.getKey(), current, entry.getValue(), b);
-                }
-            }
-
-            mergeOperationCount++;
-        }
-
-        private void mergeNodes(Object location, Node original, Node newValue, Block mergeBlock) {
-            if (original == newValue) {
-                Debug.log("Nothing to merge both nodes are %s.", original);
-                return;
-            }
-            MergeNode m = (MergeNode) mergeBlock.getBeginNode();
-            if (m.isPhiAtMerge(original)) {
-                PhiNode phi = (PhiNode) original;
-                phi.addInput((ValueNode) newValue);
-                Debug.log("Add new input to %s: %s.", original, newValue);
-                assert phi.valueCount() <= phi.merge().forwardEndCount() : phi.merge();
-            } else {
-                PhiNode phi = m.graph().unique(new PhiNode(CiKind.Illegal, m, PhiType.Memory));
-                for (int i = 0; i < mergeOperationCount + 1; ++i) {
-                    phi.addInput((ValueNode) original);
-                }
-                phi.addInput((ValueNode) newValue);
-                Debug.log("Creating new %s merge=%s newValue=%s location=%s.", phi, phi.merge(), newValue, location);
-                assert phi.valueCount() <= phi.merge().forwardEndCount() + ((phi.merge() instanceof LoopBeginNode) ? 1 : 0) : phi.merge() + "/" + phi.valueCount() + "/" + phi.merge().forwardEndCount() + "/" + mergeOperationCount;
-                assert m.usages().contains(phi);
-                assert phi.merge().usages().contains(phi);
-                for (Node input : phi.inputs()) {
-                    assert input.usages().contains(phi);
-                }
-                map.put(location, phi);
-            }
-        }
-
-        public void processCheckpoint(MemoryCheckpoint checkpoint) {
-            map.clear();
-            map.put(LocationNode.ANY_LOCATION, (Node) checkpoint);
-        }
-
-        public void processWrite(WriteNode writeNode) {
-            map.put(writeNode.location().locationIdentity(), writeNode);
-        }
-
-        public void processRead(ReadNode readNode) {
-            StructuredGraph graph = (StructuredGraph) readNode.graph();
-            assert readNode.getNullCheck() == false;
-
-            Debug.log("Register read to node %s.", readNode);
-            FloatingReadNode floatingRead;
-            if (readNode.location().locationIdentity() == LocationNode.FINAL_LOCATION) {
-                floatingRead = graph.unique(new FloatingReadNode(readNode.kind(), readNode.object(), readNode.guard(), readNode.location()));
-            } else {
-                floatingRead = graph.unique(new FloatingReadNode(readNode.kind(), readNode.object(), readNode.guard(), readNode.location(), getLocationForRead(readNode)));
-            }
-            graph.replaceFixedWithFloating(readNode, floatingRead);
-        }
-
-        private Node getLocationForRead(ReadNode readNode) {
-            Object locationIdentity = readNode.location().locationIdentity();
-            Node result = map.get(locationIdentity);
-            if (result == null) {
-                result = map.get(LocationNode.ANY_LOCATION);
-            }
-            return result;
-        }
-
-        public void createLoopEntryMemoryMap(Set<Object> modifiedLocations, Loop loop) {
-
-            loopEntryMap = new IdentityHashMap<>();
-
-            for (Object modifiedLocation : modifiedLocations) {
-                Node other;
-                if (map.containsKey(modifiedLocation)) {
-                    other = map.get(modifiedLocation);
-                } else {
-                    other = map.get(LocationNode.ANY_LOCATION);
-                }
-                createLoopEntryPhi(modifiedLocation, other, loop);
-            }
-
-            if (modifiedLocations.contains(LocationNode.ANY_LOCATION)) {
-                for (Map.Entry<Object, Node> entry : map.entrySet()) {
-                    if (!modifiedLocations.contains(entry.getKey())) {
-                        createLoopEntryPhi(entry.getKey(), entry.getValue(), loop);
-                    }
-                }
-            }
-        }
-
-        private void createLoopEntryPhi(Object modifiedLocation, Node other, Loop loop) {
-            PhiNode phi = other.graph().unique(new PhiNode(CiKind.Illegal, (MergeNode) loop.header.getBeginNode(), PhiType.Memory));
-            phi.addInput((ValueNode) other);
-            map.put(modifiedLocation, phi);
-            loopEntryMap.put(modifiedLocation, phi);
-        }
-
-
-        public IdentityHashMap<Object, Node> getLoopEntryMap() {
-            return loopEntryMap;
-        }
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-
-        // Add start node write checkpoint.
-        addStartCheckpoint(graph);
-
-        // Identify blocks.
-        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false);
-        Block[] blocks = cfg.getBlocks();
-
-        HashMap<Loop, Set<Object>> modifiedValues = new HashMap<>();
-        // Initialize modified values to empty hash set.
-        for (Loop loop : cfg.getLoops()) {
-            modifiedValues.put(loop, new HashSet<>());
-        }
-
-        // Get modified values in loops.
-        for (Node n : graph.getNodes()) {
-            Block block = cfg.blockFor(n);
-            if (block != null && block.getLoop() != null) {
-                if (n instanceof WriteNode) {
-                    WriteNode writeNode = (WriteNode) n;
-                    traceWrite(block.getLoop(), writeNode.location().locationIdentity(), modifiedValues);
-                } else if (n instanceof MemoryCheckpoint) {
-                    traceMemoryCheckpoint(block.getLoop(), modifiedValues);
-                }
-            }
-        }
-
-        // Propagate values to parent loops.
-        for (Loop loop : cfg.getLoops()) {
-            if (loop.depth == 1) {
-                propagateFromChildren(loop, modifiedValues);
-            }
-        }
-
-        Debug.log("Modified values: %s.", modifiedValues);
-
-
-        // Process blocks (predecessors first).
-        MemoryMap[] memoryMaps = new MemoryMap[blocks.length];
-        for (final Block b : blocks) {
-            processBlock(b, memoryMaps, cfg.getNodeToBlock(), modifiedValues);
-        }
-    }
-
-    private static void addStartCheckpoint(StructuredGraph graph) {
-        BeginNode entryPoint = graph.start();
-        FixedNode next = entryPoint.next();
-        if (!(next instanceof MemoryCheckpoint)) {
-            graph.addAfterFixed(entryPoint, graph.add(new WriteMemoryCheckpointNode()));
-        }
-    }
-
-    private static void processBlock(Block b, MemoryMap[] memoryMaps, NodeMap<Block> nodeToBlock, HashMap<Loop, Set<Object>> modifiedValues) {
-        // Create initial memory map for the block.
-        MemoryMap map = null;
-        if (b.getPredecessors().size() == 0) {
-            map = new MemoryMap(b);
-        } else {
-            map = new MemoryMap(b, memoryMaps[b.getPredecessors().get(0).getId()]);
-            if (b.isLoopHeader()) {
-                Loop loop = b.getLoop();
-                map.createLoopEntryMemoryMap(modifiedValues.get(loop), loop);
-            }
-            for (int i = 1; i < b.getPredecessors().size(); ++i) {
-                Block block = b.getPredecessors().get(i);
-                if (!block.isLoopEnd()) {
-                    map.mergeWith(memoryMaps[block.getId()], b);
-                }
-            }
-        }
-        memoryMaps[b.getId()] = map;
-
-        // Process instructions of this block.
-        for (Node n : b.getNodes()) {
-            if (n instanceof ReadNode) {
-                ReadNode readNode = (ReadNode) n;
-                map.processRead(readNode);
-            } else if (n instanceof WriteNode) {
-                WriteNode writeNode = (WriteNode) n;
-                map.processWrite(writeNode);
-            } else if (n instanceof MemoryCheckpoint) {
-                MemoryCheckpoint checkpoint = (MemoryCheckpoint) n;
-                map.processCheckpoint(checkpoint);
-            }
-        }
-
-
-        if (b.getEndNode() instanceof LoopEndNode) {
-            LoopEndNode end = (LoopEndNode) b.getEndNode();
-            LoopBeginNode begin = end.loopBegin();
-            Block beginBlock = nodeToBlock.get(begin);
-            MemoryMap memoryMap = memoryMaps[beginBlock.getId()];
-            assert memoryMap != null;
-            assert memoryMap.getLoopEntryMap() != null;
-            memoryMap.mergeLoopEntryWith(map, begin);
-        }
-    }
-
-    private static void traceMemoryCheckpoint(Loop loop, HashMap<Loop, Set<Object>> modifiedValues) {
-        modifiedValues.get(loop).add(LocationNode.ANY_LOCATION);
-    }
-
-    private void propagateFromChildren(Loop loop, HashMap<Loop, Set<Object>> modifiedValues) {
-        for (Loop child : loop.children) {
-            propagateFromChildren(child, modifiedValues);
-            modifiedValues.get(loop).addAll(modifiedValues.get(child));
-        }
-    }
-
-    private static void traceWrite(Loop loop, Object locationIdentity, HashMap<Loop, Set<Object>> modifiedValues) {
-        modifiedValues.get(loop).add(locationIdentity);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/GlobalValueNumberingPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-public class GlobalValueNumberingPhase extends Phase {
-
-    public static final DebugMetric metricGlobalValueNumberingHits = Debug.metric("GlobalValueNumberingHits");
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        NodeBitMap visited = graph.createNodeBitMap();
-        for (Node n : graph.getNodes()) {
-            apply(n, visited, graph);
-        }
-    }
-
-    private void apply(Node n, NodeBitMap visited, StructuredGraph compilerGraph) {
-        if (!visited.isMarked(n)) {
-            visited.mark(n);
-            for (Node input : n.inputs()) {
-                apply(input, visited, compilerGraph);
-            }
-            if (n.getNodeClass().valueNumberable()) {
-                Node newNode = compilerGraph.findDuplicate(n);
-                if (newNode != null) {
-                    assert !(n instanceof FixedNode || newNode instanceof FixedNode);
-                    n.replaceAtUsages(newNode);
-                    n.safeDelete();
-                    metricGlobalValueNumberingHits.increment();
-                    Debug.log("GVN applied and new node is %1s", newNode);
-                }
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/IdentifyBoxingPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.lang.reflect.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-
-public class IdentifyBoxingPhase extends Phase {
-
-    private final BoxingMethodPool pool;
-
-    public IdentifyBoxingPhase(BoxingMethodPool pool) {
-        this.pool = pool;
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (Invoke invoke : graph.getInvokes()) {
-            tryIntrinsify(invoke);
-        }
-    }
-
-    public void tryIntrinsify(Invoke invoke) {
-        MethodCallTargetNode callTarget = invoke.callTarget();
-        RiResolvedMethod targetMethod = callTarget.targetMethod();
-        if (pool.isSpecialMethod(targetMethod)) {
-            assert callTarget.arguments().size() == 1 : "boxing/unboxing method must have exactly one argument";
-            CiKind returnKind = callTarget.returnKind();
-            ValueNode sourceValue = callTarget.arguments().get(0);
-
-            // Check whether this is a boxing or an unboxing.
-            Node newNode = null;
-            if (returnKind == CiKind.Object) {
-                // We have a boxing method here.
-                assert Modifier.isStatic(targetMethod.accessFlags()) : "boxing method must be static";
-                CiKind sourceKind = targetMethod.signature().argumentKindAt(0, false);
-                newNode = invoke.graph().add(new BoxNode(sourceValue, targetMethod.holder(), sourceKind, invoke.bci()));
-            } else {
-                // We have an unboxing method here.
-                assert !Modifier.isStatic(targetMethod.accessFlags()) : "unboxing method must be an instance method";
-                newNode = invoke.graph().add(new UnboxNode(returnKind, sourceValue));
-            }
-
-            // Intrinsify the invoke to the special node.
-            invoke.intrinsify(newNode);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.compiler.util.InliningUtil.InlineInfo;
-import com.oracle.graal.compiler.util.InliningUtil.InliningCallback;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.debug.internal.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-
-public class InliningPhase extends Phase implements InliningCallback {
-    /*
-     * - Detect method which only call another method with some parameters set to constants: void foo(a) -> void foo(a, b) -> void foo(a, b, c) ...
-     *   These should not be taken into account when determining inlining depth.
-     * - honor the result of overrideInliningDecision(0, caller, invoke.bci, method, true);
-     */
-
-    private final CiTarget target;
-    private final GraalRuntime runtime;
-
-    private final Collection<? extends Invoke> hints;
-
-    private final PriorityQueue<InlineInfo> inlineCandidates = new PriorityQueue<>();
-    private CiAssumptions assumptions;
-
-    private final PhasePlan plan;
-    private final WeightComputationPolicy weightComputationPolicy;
-    private final InliningPolicy inliningPolicy;
-
-    // Metrics
-    private static final DebugMetric metricInliningPerformed = Debug.metric("InliningPerformed");
-    private static final DebugMetric metricInliningConsidered = Debug.metric("InliningConsidered");
-    private static final DebugMetric metricInliningStoppedByMaxDesiredSize = Debug.metric("InliningStoppedByMaxDesiredSize");
-
-    public InliningPhase(CiTarget target, GraalRuntime runtime, Collection<? extends Invoke> hints, CiAssumptions assumptions, PhasePlan plan) {
-        this.target = target;
-        this.runtime = runtime;
-        this.hints = hints;
-        this.assumptions = assumptions;
-        this.plan = plan;
-        this.weightComputationPolicy = createWeightComputationPolicy();
-        this.inliningPolicy = createInliningPolicy();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    protected void run(StructuredGraph graph) {
-        graph.createNodeMap();
-
-        if (hints != null) {
-            scanInvokes((Iterable<? extends Node>) Util.uncheckedCast(this.hints), -1, graph);
-        } else {
-            scanInvokes(graph.getNodes(InvokeNode.class), 0, graph);
-            scanInvokes(graph.getNodes(InvokeWithExceptionNode.class), 0, graph);
-        }
-
-        while (!inlineCandidates.isEmpty() && graph.getNodeCount() < GraalOptions.MaximumDesiredSize) {
-            InlineInfo info = inlineCandidates.remove();
-            if (info.invoke.node().isAlive() && inliningPolicy.isWorthInlining(graph, info)) {
-                Iterable<Node> newNodes = null;
-                try {
-                    info.inline(graph, runtime, this);
-                    Debug.dump(graph, "after %s", info);
-                    // get the new nodes here, the canonicalizer phase will reset the mark
-                    newNodes = graph.getNewNodes();
-                    if (GraalOptions.OptCanonicalizer) {
-                        new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph);
-                    }
-                    if (GraalOptions.Intrinsify) {
-                        new IntrinsificationPhase(runtime).apply(graph);
-                    }
-                    metricInliningPerformed.increment();
-                } catch (CiBailout bailout) {
-                    // TODO determine if we should really bail out of the whole compilation.
-                    throw bailout;
-                } catch (AssertionError e) {
-                    throw new GraalInternalError(e).addContext(info.toString());
-                } catch (RuntimeException e) {
-                    throw new GraalInternalError(e).addContext(info.toString());
-                } catch (GraalInternalError e) {
-                    throw e.addContext(info.toString());
-                }
-
-                if (newNodes != null && info.level < GraalOptions.MaximumInlineLevel) {
-                    scanInvokes(newNodes, info.level + 1, graph);
-                }
-            }
-        }
-
-        if (GraalOptions.Debug && graph.getNodeCount() >= GraalOptions.MaximumDesiredSize) {
-            Debug.log("inlining cut off by MaximumDesiredSize");
-            metricInliningStoppedByMaxDesiredSize.increment();
-        }
-    }
-
-    private void scanInvokes(Iterable<? extends Node> newNodes, int level, StructuredGraph graph) {
-        graph.mark();
-        for (Node node : newNodes) {
-            if (node != null) {
-                if (node instanceof Invoke) {
-                    Invoke invoke = (Invoke) node;
-                    scanInvoke(invoke, level);
-                }
-                for (Node usage : node.usages().filterInterface(Invoke.class).snapshot()) {
-                    scanInvoke((Invoke) usage, level);
-                }
-            }
-        }
-    }
-
-    private void scanInvoke(Invoke invoke, int level) {
-        InlineInfo info = InliningUtil.getInlineInfo(invoke, level >= 0 ? level : computeInliningLevel(invoke), runtime, assumptions, this);
-        if (info != null) {
-            assert level == -1 || computeInliningLevel(invoke) == level : "outer FramesStates must match inlining level";
-            metricInliningConsidered.increment();
-            inlineCandidates.add(info);
-        }
-    }
-
-    public static final Map<RiMethod, Integer> parsedMethods = new HashMap<>();
-
-    @Override
-    public StructuredGraph buildGraph(RiResolvedMethod method) {
-        StructuredGraph newGraph = new StructuredGraph(method);
-
-        if (plan != null) {
-            plan.runPhases(PhasePosition.AFTER_PARSING, newGraph);
-        }
-        assert newGraph.start().next() != null : "graph needs to be populated during PhasePosition.AFTER_PARSING";
-
-        if (GraalOptions.ProbabilityAnalysis) {
-            new DeadCodeEliminationPhase().apply(newGraph);
-            new ComputeProbabilityPhase().apply(newGraph);
-        }
-        if (GraalOptions.OptCanonicalizer) {
-            new CanonicalizerPhase(target, runtime, assumptions).apply(newGraph);
-        }
-        return newGraph;
-    }
-
-    @Override
-    public double inliningWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke) {
-        boolean preferred = hints != null && hints.contains(invoke);
-        return weightComputationPolicy.computeWeight(caller, method, invoke, preferred);
-    }
-
-    public static int graphComplexity(StructuredGraph graph) {
-        int result = 0;
-        for (Node node : graph.getNodes()) {
-            if (node instanceof ConstantNode || node instanceof LocalNode || node instanceof BeginNode || node instanceof ReturnNode || node instanceof UnwindNode) {
-                result += 0;
-            } else if (node instanceof PhiNode) {
-                result += 5;
-            } else if (node instanceof MergeNode || node instanceof Invoke || node instanceof LoopEndNode || node instanceof EndNode) {
-                result += 0;
-            } else if (node instanceof ControlSplitNode) {
-                result += ((ControlSplitNode) node).blockSuccessorCount();
-            } else {
-                result += 1;
-            }
-        }
-        return Math.max(1, result);
-    }
-
-
-    @Override
-    public void recordConcreteMethodAssumption(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl) {
-        assumptions.recordConcreteMethod(method, context, impl);
-    }
-
-    @Override
-    public void recordMethodContentsAssumption(RiResolvedMethod method) {
-        if (assumptions != null) {
-            assumptions.recordMethodContents(method);
-        }
-    }
-
-    private static int computeInliningLevel(Invoke invoke) {
-        int count = 0;
-        FrameState curState = invoke.stateAfter();
-        while (curState != null) {
-            count++;
-            curState = curState.outerFrameState();
-        }
-        return count - 1;
-    }
-
-    private static InliningPolicy createInliningPolicy() {
-        switch(GraalOptions.InliningPolicy) {
-            case 0: return new WeightBasedInliningPolicy();
-            case 1: return new C1StaticSizeBasedInliningPolicy();
-            case 2: return new MinimumCodeSizeBasedInliningPolicy();
-            case 3: return new DynamicSizeBasedInliningPolicy();
-            case 4: return new GreedySizeBasedInliningPolicy();
-            default:
-                GraalInternalError.shouldNotReachHere();
-                return null;
-        }
-    }
-
-    private WeightComputationPolicy createWeightComputationPolicy() {
-        switch(GraalOptions.WeightComputationPolicy) {
-            case 0: return new ExecutionCountBasedWeightComputationPolicy();
-            case 1: return new BytecodeSizeBasedWeightComputationPolicy();
-            case 2: return new ComplexityBasedWeightComputationPolicy();
-            default:
-                GraalInternalError.shouldNotReachHere();
-                return null;
-        }
-    }
-
-    private interface InliningPolicy {
-        boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info);
-    }
-
-    private static class WeightBasedInliningPolicy implements InliningPolicy {
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            if (!checkCompiledCodeSize(info)) {
-                return false;
-            }
-
-            double penalty = Math.pow(GraalOptions.InliningSizePenaltyExp, callerGraph.getNodeCount() / (double) GraalOptions.MaximumDesiredSize) / GraalOptions.InliningSizePenaltyExp;
-            if (info.weight > GraalOptions.MaximumInlineWeight / (1 + penalty * GraalOptions.InliningSizePenalty)) {
-                Debug.log("not inlining (cut off by weight %e): %s", info.weight, info);
-                return false;
-            }
-
-            Debug.log("inlining (weight %f): %s", info.weight, info);
-            return true;
-        }
-    }
-
-    private static class C1StaticSizeBasedInliningPolicy implements InliningPolicy {
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            double maxSize = Math.max(GraalOptions.MaximumTrivialSize, Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize);
-            return decideSizeBasedInlining(info, maxSize);
-        }
-    }
-
-    private static class MinimumCodeSizeBasedInliningPolicy implements InliningPolicy {
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            assert GraalOptions.ProbabilityAnalysis;
-            if (!checkCompiledCodeSize(info)) {
-                return false;
-            }
-
-            double inlineWeight = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability());
-            double maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize * inlineWeight;
-            maxSize = Math.max(GraalOptions.MaximumTrivialSize, maxSize);
-
-            return decideSizeBasedInlining(info, maxSize);
-        }
-    }
-
-    private static class DynamicSizeBasedInliningPolicy implements InliningPolicy {
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            assert GraalOptions.ProbabilityAnalysis;
-            if (!checkCompiledCodeSize(info)) {
-                return false;
-            }
-
-            double inlineBoost = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability()) + Math.log10(Math.max(1, info.invoke.probability() - GraalOptions.ProbabilityCapForInlining + 1));
-            double maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize;
-            maxSize = maxSize + maxSize * inlineBoost;
-            maxSize = Math.min(GraalOptions.MaximumGreedyInlineSize, Math.max(GraalOptions.MaximumTrivialSize, maxSize));
-
-            return decideSizeBasedInlining(info, maxSize);
-        }
-    }
-
-    private static class GreedySizeBasedInliningPolicy implements InliningPolicy {
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            assert GraalOptions.ProbabilityAnalysis;
-            if (!checkCompiledCodeSize(info)) {
-                return false;
-            }
-
-            double maxSize = GraalOptions.MaximumGreedyInlineSize;
-            if (GraalOptions.InliningBonusPerTransferredValue != 0) {
-                RiSignature signature = info.invoke.callTarget().targetMethod().signature();
-                int transferredValues = signature.argumentCount(true);
-                if (signature.returnKind(false) != CiKind.Void) {
-                    transferredValues++;
-                }
-                maxSize += transferredValues * GraalOptions.InliningBonusPerTransferredValue;
-            }
-
-            double inlineRatio = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability());
-            maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * maxSize * inlineRatio;
-            maxSize = Math.max(maxSize, GraalOptions.MaximumTrivialSize);
-
-            return decideSizeBasedInlining(info, maxSize);
-        }
-    }
-
-    private static boolean decideSizeBasedInlining(InlineInfo info, double maxSize) {
-        boolean success = info.weight <= maxSize;
-        if (DebugScope.getInstance().isLogEnabled()) {
-            String formatterString = success ? "inlining invoke at %s@%d (size %f <= %f): %s" : "not inlining invoke at %s@%d (too large %f > %f): %s";
-            Debug.log(formatterString, CiUtil.format("%H.%n(%p):%r", info.invoke.stateAfter().method()), info.invoke.bci(), info.weight, maxSize, info);
-        }
-        return success;
-    }
-
-    private static boolean checkCompiledCodeSize(InlineInfo info) {
-        if (GraalOptions.SmallCompiledCodeSize >= 0 && info.compiledCodeSize() > GraalOptions.SmallCompiledCodeSize) {
-            Debug.log("not inlining invoke at %s@%d (CompiledCodeSize %d > %d): %s", CiUtil.format("%H.%n(%p):%r", info.invoke.stateAfter().method()), info.invoke.bci(), info.compiledCodeSize(), GraalOptions.SmallCompiledCodeSize, info);
-            return false;
-        }
-        return true;
-    }
-
-
-    private interface WeightComputationPolicy {
-        double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke);
-    }
-
-    private class ExecutionCountBasedWeightComputationPolicy implements WeightComputationPolicy {
-        @Override
-        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
-            double ratio;
-            if (preferredInvoke) {
-                ratio = 1000000;
-            } else {
-                if (GraalOptions.ProbabilityAnalysis) {
-                    ratio = invoke.node().probability();
-                } else {
-                    RiProfilingInfo profilingInfo = method.profilingInfo();
-                    int executionCount = profilingInfo.getExecutionCount(invoke.bci());
-                    if (executionCount > 0) {
-                        RiResolvedMethod parent = invoke.stateAfter().method();
-                        ratio = executionCount / (float) parent.invocationCount();
-                    } else {
-                        ratio = 1;
-                    }
-                }
-            }
-
-            final double normalSize;
-            // TODO (lstadler) get rid of this magic, it's here to emulate the old behavior for the time being
-            if (ratio < 0.01) {
-                ratio = 0.01;
-            }
-            if (ratio < 0.5) {
-                normalSize = 10 * ratio / 0.5;
-            } else if (ratio < 2) {
-                normalSize = 10 + (35 - 10) * (ratio - 0.5) / 1.5;
-            } else if (ratio < 20) {
-                normalSize = 35;
-            } else if (ratio < 40) {
-                normalSize = 35 + (350 - 35) * (ratio - 20) / 20;
-            } else {
-                normalSize = 350;
-            }
-
-            int count;
-            if (GraalOptions.ParseBeforeInlining) {
-                if (!parsedMethods.containsKey(method)) {
-                    StructuredGraph newGraph = new StructuredGraph(method);
-                    if (plan != null) {
-                        plan.runPhases(PhasePosition.AFTER_PARSING, newGraph);
-                    }
-                    if (GraalOptions.OptCanonicalizer) {
-                        new CanonicalizerPhase(target, runtime, assumptions).apply(newGraph);
-                    }
-                    count = graphComplexity(newGraph);
-                    parsedMethods.put(method, count);
-                } else {
-                    count = parsedMethods.get(method);
-                }
-            } else {
-                count = method.codeSize();
-            }
-
-            return count / normalSize;
-        }
-    }
-
-    private static class BytecodeSizeBasedWeightComputationPolicy implements WeightComputationPolicy {
-        @Override
-        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
-            double codeSize = method.codeSize();
-            if (preferredInvoke) {
-                codeSize = codeSize / GraalOptions.BoostInliningForEscapeAnalysis;
-            }
-            return codeSize;
-        }
-    }
-
-    private static class ComplexityBasedWeightComputationPolicy implements WeightComputationPolicy {
-        @Override
-        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
-            double complexity = method.compilationComplexity();
-            if (preferredInvoke) {
-                complexity = complexity / GraalOptions.BoostInliningForEscapeAnalysis;
-            }
-            return complexity;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/InsertStateAfterPlaceholderPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class InsertStateAfterPlaceholderPhase extends Phase {
-
-    private static class PlaceholderNode extends AbstractStateSplit implements Node.IterableNodeType, LIRLowerable {
-        public PlaceholderNode() {
-            super(StampFactory.illegal());
-        }
-
-        @Override
-        public void generate(LIRGeneratorTool gen) {
-            // nothing to do
-        }
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (ReturnNode ret : graph.getNodes(ReturnNode.class)) {
-            PlaceholderNode p = graph.add(new PlaceholderNode());
-            p.setStateAfter(graph.add(new FrameState(null, FrameState.AFTER_BCI, 0, 0, false, false)));
-            graph.addBeforeFixed(ret, p);
-        }
-    }
-
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-public class IntrinsificationPhase extends Phase {
-
-    private final GraalRuntime runtime;
-
-    public IntrinsificationPhase(GraalRuntime runtime) {
-        this.runtime = runtime;
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (InvokeNode invoke : graph.getNodes(InvokeNode.class)) {
-            tryIntrinsify(invoke, runtime);
-        }
-        for (InvokeWithExceptionNode invoke : graph.getNodes(InvokeWithExceptionNode.class)) {
-            tryIntrinsify(invoke, runtime);
-        }
-    }
-
-    public static boolean canIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
-        return getIntrinsicGraph(invoke, target, runtime) != null;
-    }
-
-    private static void tryIntrinsify(Invoke invoke, GraalRuntime runtime) {
-        RiResolvedMethod target = invoke.callTarget().targetMethod();
-        if (target != null) {
-            tryIntrinsify(invoke, target, runtime);
-        }
-    }
-
-    private static void tryIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
-        StructuredGraph intrinsicGraph = getIntrinsicGraph(invoke, target, runtime);
-        if (intrinsicGraph != null) {
-            Debug.log(" > Intrinsify %s", target);
-            InliningUtil.inline(invoke, intrinsicGraph, true);
-        }
-    }
-
-    private static StructuredGraph getIntrinsicGraph(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
-        StructuredGraph intrinsicGraph = (StructuredGraph) target.compilerStorage().get(Graph.class);
-        if (intrinsicGraph == null) {
-            // TODO remove once all intrinsics are available via compilerStorage
-            intrinsicGraph = runtime.intrinsicGraph(invoke.stateAfter().method(), invoke.bci(), target, invoke.callTarget().arguments());
-        }
-        return intrinsicGraph;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-public class LoweringPhase extends Phase {
-
-    private final GraalRuntime runtime;
-
-    public LoweringPhase(GraalRuntime runtime) {
-        this.runtime = runtime;
-    }
-
-    @Override
-    protected void run(final StructuredGraph graph) {
-        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, false, true, true);
-
-        NodeBitMap processed = graph.createNodeBitMap();
-        NodeBitMap activeGuards = graph.createNodeBitMap();
-        processBlock(cfg.getStartBlock(), activeGuards, processed, null);
-
-        processed.negate();
-        final CiLoweringTool loweringTool = new CiLoweringTool() {
-
-            @Override
-            public Node getGuardAnchor() {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override
-            public GraalRuntime getRuntime() {
-                return runtime;
-            }
-
-            @Override
-            public Node createGuard(Node condition) {
-                // TODO (thomaswue): Docuemnt why this must not be called on floating nodes.
-                throw new UnsupportedOperationException();
-            }
-        };
-        for (Node node : processed) {
-            if (node instanceof Lowerable) {
-                assert !(node instanceof FixedNode) || node.predecessor() == null;
-                ((Lowerable) node).lower(loweringTool);
-            }
-        }
-    }
-
-    private void processBlock(Block block, NodeBitMap activeGuards, NodeBitMap processed, FixedNode parentAnchor) {
-
-        FixedNode anchor = parentAnchor;
-        if (anchor == null) {
-            anchor = block.getBeginNode();
-        }
-        process(block, activeGuards, processed, anchor);
-
-        // Process always reached block first.
-        Block alwaysReachedBlock = block.getPostdominator();
-        if (alwaysReachedBlock != null && alwaysReachedBlock.getDominator() == block) {
-            assert alwaysReachedBlock.getDominator() == block;
-            processBlock(alwaysReachedBlock, activeGuards, processed, anchor);
-        }
-
-        // Now go for the other dominators.
-        for (Block dominated : block.getDominated()) {
-            if (dominated != alwaysReachedBlock) {
-                assert dominated.getDominator() == block;
-                processBlock(dominated, activeGuards, processed, null);
-            }
-        }
-
-        if (parentAnchor == null) {
-            for (GuardNode guard : anchor.usages().filter(GuardNode.class)) {
-                activeGuards.clear(guard);
-            }
-        }
-    }
-
-    private void process(final Block b, final NodeBitMap activeGuards, NodeBitMap processed, final Node anchor) {
-
-        final CiLoweringTool loweringTool = new CiLoweringTool() {
-
-            @Override
-            public Node getGuardAnchor() {
-                return anchor;
-            }
-
-            @Override
-            public GraalRuntime getRuntime() {
-                return runtime;
-            }
-
-            @Override
-            public Node createGuard(Node condition) {
-                FixedNode guardAnchor = (FixedNode) getGuardAnchor();
-                if (GraalOptions.OptEliminateGuards) {
-                    for (Node usage : condition.usages()) {
-                        if (activeGuards.isMarked(usage)) {
-                            return usage;
-                        }
-                    }
-                }
-                GuardNode newGuard = guardAnchor.graph().unique(new GuardNode((BooleanNode) condition, guardAnchor));
-                activeGuards.grow();
-                activeGuards.mark(newGuard);
-                return newGuard;
-            }
-        };
-
-        // Lower the instructions of this block.
-        for (Node node : b.getNodes()) {
-            processed.mark(node);
-            if (node instanceof Lowerable) {
-                ((Lowerable) node).lower(loweringTool);
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/Phase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.nodes.*;
-
-public abstract class Phase {
-
-    private String name;
-
-    protected Phase() {
-        this.name = this.getClass().getSimpleName();
-        if (name.endsWith("Phase")) {
-            name = name.substring(0, name.length() - "Phase".length());
-        }
-    }
-
-    protected Phase(String name) {
-        this.name = name;
-    }
-
-    protected String getDetailedName() {
-        return getName();
-    }
-
-    public final void apply(final StructuredGraph graph) {
-        apply(graph, true);
-    }
-
-    public final void apply(final StructuredGraph graph, final boolean dumpGraph) {
-        Debug.scope(name, this, new Runnable() {
-            public void run() {
-                Phase.this.run(graph);
-                if (dumpGraph) {
-                    Debug.dump(graph, "After phase %s", name);
-                }
-                assert graph.verify();
-            }
-        });
-    }
-
-    public final String getName() {
-        return name;
-    }
-
-    protected abstract void run(StructuredGraph graph);
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/PhasePlan.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.util.*;
-
-import com.oracle.graal.nodes.*;
-
-/**
- * Tells the compiler about additional phases that need to be executed during compilation.
- */
-public class PhasePlan {
-    /**
-     * The compilation is split into the following sections:
-     * ========================================================================
-     * Period 1: High-level nodes. (Graph building)
-     * ========================================================================
-     * Runtime-specific lowering.
-     * ========================================================================
-     * Period 2: Mid-level nodes. (Memory dependence graph)
-     * ========================================================================
-     * Target-specific lowering, de-SSA.
-     * ========================================================================
-     * Period 3: Low-level nodes. (Register allocation, code generation)
-     * ========================================================================
-     *
-     * A compiler extension phase can chose to run at the end of periods 1-3.
-     */
-    public static enum PhasePosition {
-        AFTER_PARSING,
-        HIGH_LEVEL,
-        MID_LEVEL,
-        LOW_LEVEL
-    }
-
-    public static final PhasePlan DEFAULT = new PhasePlan();
-
-    @SuppressWarnings("unchecked")
-    private final ArrayList<Phase>[] phases = new ArrayList[PhasePosition.values().length];
-
-    private final Set<Class<? extends Phase>> disabledPhases = new HashSet<>();
-
-    public void addPhase(PhasePosition pos, Phase phase) {
-        if (phases[pos.ordinal()] == null) {
-            phases[pos.ordinal()] = new ArrayList<>();
-        }
-        phases[pos.ordinal()].add(phase);
-    }
-
-    public void runPhases(PhasePosition pos, StructuredGraph graph) {
-        if (phases[pos.ordinal()] != null) {
-            for (Phase p : phases[pos.ordinal()]) {
-                p.apply(graph);
-            }
-        }
-    }
-
-    public void disablePhase(Class<? extends Phase> clazz) {
-        disabledPhases.add(clazz);
-    }
-
-    public boolean isPhaseDisabled(Class<? extends Phase> clazz) {
-        return disabledPhases.contains(clazz);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/PhiStampPhase.java	Thu Mar 08 19:11:12 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.oracle.graal.compiler.phases;
-
-import com.oracle.graal.nodes.*;
-
-public class PhiStampPhase extends Phase {
-    @Override
-    protected void run(StructuredGraph graph) {
-        // Infer phis stopping at loop phis.
-        for (PhiNode phi : graph.getNodes(PhiNode.class)) {
-            inferPhi(phi);
-        }
-
-        // Start iterative inference for loop phis.
-        if (graph.hasLoops()) {
-            for (PhiNode phi : graph.getNodes(PhiNode.class)) {
-                if (phi.isLoopPhi()) {
-                    iterativeInferPhi(phi);
-                }
-            }
-        }
-    }
-
-    private void iterativeInferPhi(PhiNode phi) {
-        if (phi.inferStamp()) {
-            for (PhiNode phiUsage : phi.usages().filter(PhiNode.class)) {
-                iterativeInferPhi(phiUsage);
-            }
-        }
-    }
-
-    private void inferPhi(PhiNode phi) {
-        for (PhiNode phiInput : phi.values().filter(PhiNode.class)) {
-            if (!phiInput.isLoopPhi()) {
-                inferPhi(phiInput);
-            }
-        }
-        phi.inferStamp();
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/ReadEliminationPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-
-public class ReadEliminationPhase extends Phase {
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (FloatingReadNode n : graph.getNodes(FloatingReadNode.class)) {
-            if (n.dependencies().size() > 0) {
-                assert n.dependencies().size() == 1;
-                Node memoryInput = n.dependencies().get(0);
-                if (memoryInput instanceof WriteNode) {
-                    WriteNode other = (WriteNode) memoryInput;
-                    if (other.object() == n.object() && other.location() == n.location()) {
-                        Debug.log("Eliminated memory read %1.1s and replaced with node %s", n, other.value());
-                        graph.replaceFloating(n, other.value());
-                    }
-                }
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/SafepointPollingEliminationPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.util.*;
-
-public class SafepointPollingEliminationPhase extends Phase {
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (LoopEndNode loopEnd : graph.getNodes(LoopEndNode.class)) {
-            NodeIterable<FixedNode> it = NodeIterators.dominators(loopEnd).until(loopEnd.loopBegin());
-            for (FixedNode n : it) {
-                if (n instanceof Invoke) {
-                    loopEnd.setSafepointPolling(false);
-                    break;
-                }
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import java.lang.reflect.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.ConstantNodeParameter;
-import com.oracle.graal.graph.Node.NodeIntrinsic;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.util.*;
-
-public class SnippetIntrinsificationPhase extends Phase {
-
-    private final RiRuntime runtime;
-    private final BoxingMethodPool pool;
-
-    public SnippetIntrinsificationPhase(RiRuntime runtime, BoxingMethodPool pool) {
-        this.runtime = runtime;
-        this.pool = pool;
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        for (Invoke i : graph.getInvokes()) {
-            tryIntrinsify(i);
-        }
-    }
-
-    private void tryIntrinsify(Invoke invoke) {
-        RiResolvedMethod target = invoke.callTarget().targetMethod();
-        NodeIntrinsic intrinsic = target.getAnnotation(Node.NodeIntrinsic.class);
-        if (intrinsic != null) {
-            Class< ? >[] parameterTypes = CiUtil.signatureToTypes(target.signature(), target.holder());
-
-            // Prepare the arguments for the reflective constructor call on the node class.
-            Object[] nodeConstructorArguments = prepareArguments(invoke, parameterTypes, target);
-
-            // Create the new node instance.
-            Class< ? > c = getNodeClass(target, intrinsic);
-            Node newInstance = createNodeInstance(c, parameterTypes, nodeConstructorArguments);
-
-            // Replace the invoke with the new node.
-            invoke.node().graph().add(newInstance);
-            invoke.intrinsify(newInstance);
-
-            // Clean up checkcast instructions inserted by javac if the return type is generic.
-            cleanUpReturnCheckCast(newInstance);
-        }
-    }
-
-    private Object[] prepareArguments(Invoke invoke, Class< ? >[] parameterTypes, RiResolvedMethod target) {
-        NodeInputList<ValueNode> arguments = invoke.callTarget().arguments();
-        Object[] nodeConstructorArguments = new Object[arguments.size()];
-        for (int i = 0; i < nodeConstructorArguments.length; ++i) {
-            int parameterIndex = i;
-            if (!invoke.callTarget().isStatic()) {
-                parameterIndex--;
-            }
-            ValueNode argument = tryBoxingElimination(parameterIndex, target, arguments.get(i));
-            ConstantNodeParameter param = CiUtil.getParameterAnnotation(ConstantNodeParameter.class, parameterIndex, target);
-            if (param != null) {
-                assert argument instanceof ConstantNode : "parameter " + parameterIndex + " must be compile time constant for " + invoke.callTarget().targetMethod();
-                ConstantNode constantNode = (ConstantNode) argument;
-                Object o = constantNode.asConstant().boxedValue();
-                if (o instanceof Class< ? >) {
-                    nodeConstructorArguments[i] = runtime.getType((Class< ? >) o);
-                    parameterTypes[i] = RiResolvedType.class;
-                } else {
-                    nodeConstructorArguments[i] = o;
-                }
-            } else {
-                nodeConstructorArguments[i] = argument;
-                parameterTypes[i] = ValueNode.class;
-            }
-        }
-        return nodeConstructorArguments;
-    }
-
-    private static Class< ? > getNodeClass(RiResolvedMethod target, NodeIntrinsic intrinsic) {
-        Class< ? > result = intrinsic.value();
-        if (result == NodeIntrinsic.class) {
-            result = target.holder().toJava();
-        }
-        assert Node.class.isAssignableFrom(result);
-        return result;
-    }
-
-    private ValueNode tryBoxingElimination(int parameterIndex, RiResolvedMethod target, ValueNode node) {
-        if (parameterIndex >= 0) {
-            Type type = target.getGenericParameterTypes()[parameterIndex];
-            if (type instanceof TypeVariable) {
-                TypeVariable typeVariable = (TypeVariable) type;
-                if (typeVariable.getBounds().length == 1) {
-                    Type boundType = typeVariable.getBounds()[0];
-                    if (boundType instanceof Class && ((Class) boundType).getSuperclass() == null) {
-                        // Unbound generic => try boxing elimination
-                        if (node.usages().size() == 2) {
-                            if (node instanceof Invoke) {
-                                Invoke invokeNode = (Invoke) node;
-                                MethodCallTargetNode callTarget = invokeNode.callTarget();
-                                if (pool.isBoxingMethod(callTarget.targetMethod())) {
-                                    FrameState stateAfter = invokeNode.stateAfter();
-                                    assert stateAfter.usages().size() == 1;
-                                    invokeNode.node().replaceAtUsages(null);
-                                    ValueNode result = callTarget.arguments().get(0);
-                                    StructuredGraph graph = (StructuredGraph) node.graph();
-                                    if (invokeNode instanceof InvokeWithExceptionNode) {
-                                        // Destroy exception edge & clear stateAfter.
-                                        InvokeWithExceptionNode invokeWithExceptionNode = (InvokeWithExceptionNode) invokeNode;
-
-                                        invokeWithExceptionNode.killExceptionEdge();
-                                        graph.removeSplit(invokeWithExceptionNode, InvokeWithExceptionNode.NORMAL_EDGE);
-                                    } else {
-                                        graph.removeFixed((InvokeNode) invokeNode);
-                                    }
-                                    stateAfter.safeDelete();
-                                    GraphUtil.propagateKill(callTarget);
-                                    return result;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return node;
-    }
-
-    private static Node createNodeInstance(Class< ? > nodeClass, Class< ? >[] parameterTypes, Object[] nodeConstructorArguments) {
-
-        Constructor< ? > constructor;
-        try {
-            constructor = nodeClass.getDeclaredConstructor(parameterTypes);
-            constructor.setAccessible(true);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-        try {
-            return (ValueNode) constructor.newInstance(nodeConstructorArguments);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public void cleanUpReturnCheckCast(Node newInstance) {
-        if (newInstance instanceof ValueNode && ((ValueNode) newInstance).kind() != CiKind.Object) {
-            StructuredGraph graph = (StructuredGraph) newInstance.graph();
-            for (CheckCastNode checkCastNode : newInstance.usages().filter(CheckCastNode.class).snapshot()) {
-                for (Node checkCastUsage : checkCastNode.usages().snapshot()) {
-                    if (checkCastUsage instanceof ValueAnchorNode) {
-                        ValueAnchorNode valueAnchorNode = (ValueAnchorNode) checkCastUsage;
-                        graph.removeFixed(valueAnchorNode);
-                    } else if (checkCastUsage instanceof MethodCallTargetNode) {
-                        MethodCallTargetNode checkCastCallTarget = (MethodCallTargetNode) checkCastUsage;
-                        assert pool.isUnboxingMethod(checkCastCallTarget.targetMethod());
-                        Invoke invokeNode = checkCastCallTarget.invoke();
-                        invokeNode.node().replaceAtUsages(newInstance);
-                        if (invokeNode instanceof InvokeWithExceptionNode) {
-                            // Destroy exception edge & clear stateAfter.
-                            InvokeWithExceptionNode invokeWithExceptionNode = (InvokeWithExceptionNode) invokeNode;
-
-                            invokeWithExceptionNode.killExceptionEdge();
-                            graph.removeSplit(invokeWithExceptionNode, InvokeWithExceptionNode.NORMAL_EDGE);
-                        } else {
-                            graph.removeFixed((InvokeNode) invokeNode);
-                        }
-                        checkCastCallTarget.safeDelete();
-                    } else if (checkCastUsage instanceof FrameState) {
-                        checkCastUsage.replaceFirstInput(checkCastNode, null);
-                    } else {
-                        assert false : "unexpected checkcast usage: " + checkCastUsage;
-                    }
-                }
-                checkCastNode.safeDelete();
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/schedule/BlockClosure.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.schedule;
-
-import com.oracle.graal.lir.cfg.*;
-
-/**
- * The {@code BlockClosure} interface represents a closure for iterating over blocks.
- */
-public interface BlockClosure {
-    void apply(Block block);
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/schedule/SchedulePhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,334 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.schedule;
-
-import java.util.*;
-
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.Verbosity;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.virtual.*;
-
-public class SchedulePhase extends Phase {
-    private ControlFlowGraph cfg;
-    private NodeMap<Block> earliestCache;
-
-    private BlockMap<List<Node>> nodesFor;
-
-    public SchedulePhase() {
-        super("Schedule");
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        cfg = ControlFlowGraph.compute(graph, true, true, true, false);
-        earliestCache = graph.createNodeMap();
-        nodesFor = new BlockMap<>(cfg);
-
-        assignBlockToNodes(graph);
-        sortNodesWithinBlocks(graph);
-    }
-
-    public void scheduleGraph() {
-        for (Block block : cfg.getBlocks()) {
-            List<Node> nodeList = nodesFor.get(block);
-            ScheduledNode last = null;
-            for (Node node : nodeList) {
-                if (!(node instanceof FrameState)) {
-                    if (last != null) {
-                        last.setScheduledNext((ScheduledNode) node);
-                    }
-                    last = (ScheduledNode) node;
-                }
-            }
-        }
-    }
-
-    public ControlFlowGraph getCFG() {
-        return cfg;
-    }
-
-    public BlockMap<List<Node>> getNodesFor() {
-        return nodesFor;
-    }
-
-    public List<Node> nodesFor(Block block) {
-        return nodesFor.get(block);
-    }
-
-    private void assignBlockToNodes(StructuredGraph graph) {
-        for (Block block : cfg.getBlocks()) {
-            List<Node> nodes = new ArrayList<>();
-            assert nodesFor.get(block) == null;
-            nodesFor.put(block, nodes);
-            for (Node node : block.getNodes()) {
-                nodes.add(node);
-            }
-        }
-
-        for (Node n : graph.getNodes()) {
-            assignBlockToNode(n);
-        }
-    }
-
-    private void assignBlockToNode(Node n) {
-        if (n == null) {
-            return;
-        }
-
-        assert !n.isDeleted();
-
-        Block prevBlock = cfg.getNodeToBlock().get(n);
-        if (prevBlock != null) {
-            return;
-        }
-        assert !(n instanceof PhiNode) : n;
-        // if in CFG, schedule at the latest position possible in the outermost loop possible
-        Block latestBlock = latestBlock(n);
-        Block block;
-        if (latestBlock == null) {
-            block = earliestBlock(n);
-        } else if (GraalOptions.ScheduleOutOfLoops && !(n instanceof VirtualObjectFieldNode) && !(n instanceof VirtualObjectNode)) {
-            Block earliestBlock = earliestBlock(n);
-            block = scheduleOutOfLoops(n, latestBlock, earliestBlock);
-            assert earliestBlock.dominates(block) : "Graph can not be scheduled : inconsistent for " + n;
-        } else {
-            block = latestBlock;
-        }
-        assert !(n instanceof MergeNode);
-        cfg.getNodeToBlock().set(n, block);
-        nodesFor.get(block).add(n);
-    }
-
-    private Block latestBlock(Node n) {
-        Block block = null;
-        for (Node succ : n.successors()) {
-            if (succ == null) {
-                continue;
-            }
-            assignBlockToNode(succ);
-            block = getCommonDominator(block, cfg.getNodeToBlock().get(succ));
-        }
-        ensureScheduledUsages(n);
-        CommonDominatorBlockClosure cdbc = new CommonDominatorBlockClosure(block);
-        for (Node usage : n.usages()) {
-            blocksForUsage(n, usage, cdbc);
-        }
-        return cdbc.block;
-    }
-
-    private class CommonDominatorBlockClosure implements BlockClosure {
-        public Block block;
-        public CommonDominatorBlockClosure(Block block) {
-            this.block = block;
-        }
-        @Override
-        public void apply(Block newBlock) {
-            this.block = getCommonDominator(this.block, newBlock);
-        }
-    }
-
-    private Block earliestBlock(Node n) {
-        Block earliest = cfg.getNodeToBlock().get(n);
-        if (earliest != null) {
-            return earliest;
-        }
-        earliest = earliestCache.get(n);
-        if (earliest != null) {
-            return earliest;
-        }
-        BitMap bits = new BitMap(cfg.getBlocks().length);
-        ArrayList<Node> before = new ArrayList<>();
-        if (n.predecessor() != null) {
-            before.add(n.predecessor());
-        }
-        for (Node input : n.inputs()) {
-            before.add(input);
-        }
-        for (Node pred : before) {
-            if (pred == null) {
-                continue;
-            }
-            Block b = earliestBlock(pred);
-            if (!bits.get(b.getId())) {
-                earliest = b;
-                do {
-                    bits.set(b.getId());
-                    b = b.getDominator();
-                } while(b != null && !bits.get(b.getId()));
-            }
-        }
-        if (earliest == null) {
-            Block start = cfg.getNodeToBlock().get(((StructuredGraph) n.graph()).start());
-            assert start != null;
-            return start;
-        }
-        earliestCache.set(n, earliest);
-        return earliest;
-    }
-
-
-    private static Block scheduleOutOfLoops(Node n, Block latestBlock, Block earliest) {
-        assert latestBlock != null : "no latest : " + n;
-        Block cur = latestBlock;
-        Block result = latestBlock;
-        while (cur.getLoop() != null && cur != earliest && cur.getDominator() != null) {
-            Block dom = cur.getDominator();
-            if (dom.getLoopDepth() < result.getLoopDepth()) {
-                result = dom;
-            }
-            cur = dom;
-        }
-        return result;
-    }
-
-    private void blocksForUsage(Node node, Node usage, BlockClosure closure) {
-        if (usage instanceof PhiNode) {
-            PhiNode phi = (PhiNode) usage;
-            MergeNode merge = phi.merge();
-            Block mergeBlock = cfg.getNodeToBlock().get(merge);
-            assert mergeBlock != null : "no block for merge " + merge.toString(Verbosity.Id);
-            for (int i = 0; i < phi.valueCount(); ++i) {
-                if (phi.valueAt(i) == node) {
-                    if (mergeBlock.getPredecessors().size() <= i) {
-                        TTY.println(merge.toString());
-                        TTY.println(phi.toString());
-                        TTY.println(merge.cfgPredecessors().toString());
-                        TTY.println(mergeBlock.getPredecessors().toString());
-                        TTY.println(phi.inputs().toString());
-                        TTY.println("value count: " + phi.valueCount());
-                    }
-                    closure.apply(mergeBlock.getPredecessors().get(i));
-                }
-            }
-        } else if (usage instanceof FrameState && ((FrameState) usage).block() != null) {
-            MergeNode merge = ((FrameState) usage).block();
-            Block block = null;
-            for (Node pred : merge.cfgPredecessors()) {
-                block = getCommonDominator(block, cfg.getNodeToBlock().get(pred));
-            }
-            closure.apply(block);
-        } else {
-            assignBlockToNode(usage);
-            closure.apply(cfg.getNodeToBlock().get(usage));
-        }
-    }
-
-    private void ensureScheduledUsages(Node node) {
-        for (Node usage : node.usages().snapshot()) {
-            assignBlockToNode(usage);
-        }
-        // now true usages are ready
-    }
-
-    private static Block getCommonDominator(Block a, Block b) {
-        if (a == null) {
-            return b;
-        }
-        if (b == null) {
-            return a;
-        }
-        return ControlFlowGraph.commonDominator(a, b);
-    }
-
-    private void sortNodesWithinBlocks(StructuredGraph graph) {
-        NodeBitMap map = graph.createNodeBitMap();
-        for (Block b : cfg.getBlocks()) {
-            sortNodesWithinBlocks(b, map);
-        }
-    }
-
-    private void sortNodesWithinBlocks(Block b, NodeBitMap map) {
-        List<Node> instructions = nodesFor.get(b);
-        List<Node> sortedInstructions = new ArrayList<>(instructions.size() + 2);
-
-        assert !map.isMarked(b.getBeginNode()) && cfg.blockFor(b.getBeginNode()) == b;
-        assert !map.isMarked(b.getEndNode()) && cfg.blockFor(b.getEndNode()) == b;
-
-        for (Node i : instructions) {
-            addToSorting(b, i, sortedInstructions, map);
-        }
-
-        // Make sure that last node gets really last (i.e. when a frame state successor hangs off it).
-        Node lastSorted = sortedInstructions.get(sortedInstructions.size() - 1);
-        if (lastSorted != b.getEndNode()) {
-            int idx = sortedInstructions.indexOf(b.getEndNode());
-            boolean canNotMove = false;
-            for (int i = idx + 1; i < sortedInstructions.size(); i++) {
-                if (sortedInstructions.get(i).inputs().contains(b.getEndNode())) {
-                    canNotMove = true;
-                    break;
-                }
-            }
-            if (canNotMove) {
-                if (b.getEndNode() instanceof ControlSplitNode) {
-                    throw new GraalInternalError("Schedule is not possible : needs to move a node after the last node of the block which can not be move").
-                    addContext(lastSorted).
-                    addContext(b.getEndNode());
-                }
-
-                //b.setLastNode(lastSorted);
-            } else {
-                sortedInstructions.remove(b.getEndNode());
-                sortedInstructions.add(b.getEndNode());
-            }
-        }
-        nodesFor.put(b, sortedInstructions);
-    }
-
-    private void addToSorting(Block b, Node i, List<Node> sortedInstructions, NodeBitMap map) {
-        if (i == null || map.isMarked(i) || cfg.getNodeToBlock().get(i) != b || i instanceof PhiNode || i instanceof LocalNode) {
-            return;
-        }
-
-        FrameState state = null;
-        WriteNode writeNode = null;
-        for (Node input : i.inputs()) {
-            if (input instanceof WriteNode && !map.isMarked(input) && cfg.getNodeToBlock().get(input) == b) {
-                writeNode = (WriteNode) input;
-            } else if (input instanceof FrameState) {
-                state = (FrameState) input;
-            } else {
-                addToSorting(b, input, sortedInstructions, map);
-            }
-        }
-
-        if (i.predecessor() != null) {
-            addToSorting(b, i.predecessor(), sortedInstructions, map);
-        }
-
-        map.mark(i);
-
-        addToSorting(b, state, sortedInstructions, map);
-        assert writeNode == null || !map.isMarked(writeNode);
-        addToSorting(b, writeNode, sortedInstructions, map);
-
-        // Now predecessors and inputs are scheduled => we can add this node.
-        sortedInstructions.add(i);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/schedule/UnscheduleNodes.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.schedule;
-
-import java.util.*;
-
-import com.oracle.graal.compiler.graph.*;
-import com.oracle.graal.compiler.types.*;
-import com.oracle.graal.nodes.*;
-
-class UnscheduleState implements MergeableState<UnscheduleState> {
-
-    public FixedWithNextNode last;
-
-    @Override
-    public boolean merge(MergeNode merge, Collection<UnscheduleState> withStates) {
-        last = null;
-        return true;
-    }
-
-    @Override
-    public void loopBegin(LoopBeginNode loop) {
-        last = null;
-    }
-
-    @Override
-    public void loopEnds(LoopBeginNode loop, Collection<UnscheduleState> loopEndStates) {
-        last = null;
-    }
-
-    @Override
-    public void afterSplit(FixedNode node) {
-        last = null;
-    }
-
-    @Override
-    public UnscheduleState clone() {
-        return new UnscheduleState();
-    }
-}
-
-public class UnscheduleNodes extends ScheduledNodeIterator<UnscheduleState> {
-
-    public UnscheduleNodes(FixedNode start) {
-        super(start, new UnscheduleState());
-    }
-
-    @Override
-    protected void node(ScheduledNode node) {
-        if (node instanceof FixedNode) {
-            if (state.last != null) {
-                state.last.setNext((FixedNode) node);
-            }
-            if (node instanceof FixedWithNextNode) {
-                state.last = (FixedWithNextNode) node;
-            }
-        } else {
-            node.setScheduledNext(null);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.target;
-
-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.graal.compiler.gen.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-
-/**
- * The {@code Backend} class represents a compiler backend for Graal.
- */
-public abstract class Backend {
-    public final RiRuntime runtime;
-    public final CiTarget target;
-
-    protected Backend(RiRuntime runtime, CiTarget target) {
-        this.runtime = runtime;
-        this.target = target;
-    }
-
-    public static Backend create(CiArchitecture arch, RiRuntime runtime, CiTarget target) {
-        String className = arch.getClass().getName().replace("com.oracle.max.asm", "com.oracle.graal.compiler") + "Backend";
-        try {
-            Class<?> c = Class.forName(className);
-            Constructor<?> cons = c.getDeclaredConstructor(RiRuntime.class, CiTarget.class);
-            return (Backend) cons.newInstance(runtime, target);
-        } catch (Exception e) {
-            throw new Error("Could not instantiate " + className, e);
-        }
-    }
-
-    public abstract FrameMap newFrameMap(RiRegisterConfig registerConfig);
-    public abstract LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir);
-    public abstract AbstractAssembler newAssembler(RiRegisterConfig registerConfig);
-    public abstract CiXirAssembler newXirAssembler();
-
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64Backend.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.target.amd64;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.xir.*;
-import com.oracle.graal.compiler.gen.*;
-import com.oracle.graal.compiler.target.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-
-/**
- * The {@code X86Backend} class represents the backend for the AMD64 architecture.
- */
-public class AMD64Backend extends Backend {
-
-    public AMD64Backend(RiRuntime runtime, CiTarget target) {
-        super(runtime, target);
-    }
-    /**
-     * Creates a new LIRGenerator for x86.
-     * @param compilation the compilation for which to create the LIR generator
-     * @return an appropriate LIR generator instance
-     */
-    @Override
-    public LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
-        return new AMD64LIRGenerator(graph, runtime, target, frameMap, method, lir, xir);
-    }
-
-    @Override
-    public FrameMap newFrameMap(RiRegisterConfig registerConfig) {
-        return new FrameMap(runtime, target, registerConfig);
-    }
-
-    @Override
-    public AbstractAssembler newAssembler(RiRegisterConfig registerConfig) {
-        return new AMD64MacroAssembler(target, registerConfig);
-    }
-
-    @Override
-    public CiXirAssembler newXirAssembler() {
-        return new AMD64XirAssembler(target);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.target.amd64;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.amd64.*;
-import com.oracle.graal.lir.asm.*;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-
-public class AMD64DeoptimizationStub extends AMD64SlowPath {
-    public final Label label = new Label();
-    public final LIRDebugInfo info;
-    public final DeoptAction action;
-    public final Object deoptInfo;
-
-    public AMD64DeoptimizationStub(DeoptAction action, LIRDebugInfo info, Object deoptInfo) {
-        this.action = action;
-        this.info = info;
-        this.deoptInfo = deoptInfo;
-    }
-
-
-    private static ArrayList<Object> keepAlive = new ArrayList<>();
-
-    @Override
-    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        // TODO (cwimmer): we want to get rid of a generally reserved scratch register.
-        CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
-
-        masm.bind(label);
-        if (GraalOptions.CreateDeoptInfo && deoptInfo != null) {
-            masm.nop();
-            keepAlive.add(deoptInfo.toString());
-            AMD64Move.move(tasm, masm, scratch.asValue(), CiConstant.forObject(deoptInfo));
-            // TODO Make this an explicit calling convention instead of using a scratch register
-            AMD64Call.directCall(tasm, masm, CiRuntimeCall.SetDeoptInfo, info);
-        }
-        int code;
-        switch(action) {
-            case None:
-                code = 0;
-                break;
-            case Recompile:
-                code = 1;
-                break;
-            case InvalidateReprofile:
-                code = 2;
-                break;
-            case InvalidateRecompile:
-                code = 3;
-                break;
-            case InvalidateStopCompiling:
-                code = 4;
-                break;
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-        masm.movq(scratch, code);
-     // TODO Make this an explicit calling convention instead of using a scratch register
-        AMD64Call.directCall(tasm, masm, CiRuntimeCall.Deoptimize, info);
-        AMD64Call.shouldNotReachHere(tasm, masm);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,606 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.compiler.target.amd64;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.lir.amd64.AMD64Arithmetic.*;
-import static com.oracle.graal.lir.amd64.AMD64Compare.*;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiTargetMethod.Mark;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
-import com.oracle.max.cri.xir.*;
-import com.oracle.graal.compiler.gen.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.StandardOp.JumpOp;
-import com.oracle.graal.lir.StandardOp.LabelOp;
-import com.oracle.graal.lir.amd64.AMD64Arithmetic.DivOp;
-import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op1Reg;
-import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op1Stack;
-import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op2Reg;
-import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op2Stack;
-import com.oracle.graal.lir.amd64.AMD64Arithmetic.ShiftOp;
-import com.oracle.graal.lir.amd64.AMD64Call.DirectCallOp;
-import com.oracle.graal.lir.amd64.AMD64Call.IndirectCallOp;
-import com.oracle.graal.lir.amd64.AMD64Compare.CompareOp;
-import com.oracle.graal.lir.amd64.AMD64ControlFlow.BranchOp;
-import com.oracle.graal.lir.amd64.AMD64ControlFlow.CondMoveOp;
-import com.oracle.graal.lir.amd64.AMD64ControlFlow.FloatBranchOp;
-import com.oracle.graal.lir.amd64.AMD64ControlFlow.FloatCondMoveOp;
-import com.oracle.graal.lir.amd64.AMD64ControlFlow.ReturnOp;
-import com.oracle.graal.lir.amd64.AMD64ControlFlow.TableSwitchOp;
-import com.oracle.graal.lir.amd64.AMD64Move.CompareAndSwapOp;
-import com.oracle.graal.lir.amd64.AMD64Move.LeaOp;
-import com.oracle.graal.lir.amd64.AMD64Move.LoadOp;
-import com.oracle.graal.lir.amd64.AMD64Move.MembarOp;
-import com.oracle.graal.lir.amd64.AMD64Move.MoveFromRegOp;
-import com.oracle.graal.lir.amd64.AMD64Move.MoveToRegOp;
-import com.oracle.graal.lir.amd64.AMD64Move.NullCheckOp;
-import com.oracle.graal.lir.amd64.AMD64Move.SpillMoveOp;
-import com.oracle.graal.lir.amd64.AMD64Move.StoreOp;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-
-/**
- * This class implements the X86-specific portion of the LIR generator.
- */
-public class AMD64LIRGenerator extends LIRGenerator {
-
-    private static final CiRegisterValue RAX_I = AMD64.rax.asValue(CiKind.Int);
-    private static final CiRegisterValue RAX_L = AMD64.rax.asValue(CiKind.Long);
-    private static final CiRegisterValue RDX_I = AMD64.rdx.asValue(CiKind.Int);
-    private static final CiRegisterValue RDX_L = AMD64.rdx.asValue(CiKind.Long);
-    private static final CiRegisterValue RCX_I = AMD64.rcx.asValue(CiKind.Int);
-
-    public static class AMD64SpillMoveFactory implements LIR.SpillMoveFactory {
-        @Override
-        public LIRInstruction createMove(CiValue result, CiValue input) {
-            return new SpillMoveOp(result, input);
-        }
-
-        @Override
-        public LIRInstruction createExchange(CiValue input1, CiValue input2) {
-            // TODO (cwimmer) implement XCHG operation for LIR
-            return null;
-        }
-    }
-
-    public AMD64LIRGenerator(Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
-        super(graph, runtime, target, frameMap, method, lir, xir);
-        lir.methodEndMarker = new AMD64MethodEndStub();
-        lir.spillMoveFactory = new AMD64SpillMoveFactory();
-    }
-
-    @Override
-    protected void emitNode(ValueNode node) {
-        if (node instanceof AMD64LIRLowerable) {
-            ((AMD64LIRLowerable) node).generateAmd64(this);
-        } else {
-            super.emitNode(node);
-        }
-    }
-
-    @Override
-    public boolean canStoreConstant(CiConstant c) {
-        // there is no immediate move of 64-bit constants on Intel
-        switch (c.kind) {
-            case Long:   return Util.isInt(c.asLong());
-            case Double: return false;
-            case Object: return c.isNull();
-            default:     return true;
-        }
-    }
-
-    @Override
-    public boolean canInlineConstant(CiConstant c) {
-        switch (c.kind) {
-            case Long:   return NumUtil.isInt(c.asLong());
-            case Object: return c.isNull();
-            default:     return true;
-        }
-    }
-
-    @Override
-    public CiAddress makeAddress(LocationNode location, ValueNode object) {
-        CiValue base = operand(object);
-        CiValue index = CiValue.IllegalValue;
-        int scale = 1;
-        long displacement = location.displacement();
-
-        if (isConstant(base)) {
-            if (!asConstant(base).isNull()) {
-                displacement += asConstant(base).asLong();
-            }
-            base = CiValue.IllegalValue;
-        }
-
-        if (location instanceof IndexedLocationNode) {
-            IndexedLocationNode indexedLoc = (IndexedLocationNode) location;
-
-            index = operand(indexedLoc.index());
-            if (indexedLoc.indexScalingEnabled()) {
-                scale = target().sizeInBytes(location.getValueKind());
-            }
-            if (isConstant(index)) {
-                long newDisplacement = displacement + asConstant(index).asLong() * scale;
-                // only use the constant index if the resulting displacement fits into a 32 bit offset
-                if (NumUtil.isInt(newDisplacement)) {
-                    displacement = newDisplacement;
-                    index = CiValue.IllegalValue;
-                } else {
-                    // create a temporary variable for the index, the pointer load cannot handle a constant index
-                    CiValue newIndex = newVariable(CiKind.Long);
-                    emitMove(index, newIndex);
-                    index = newIndex;
-                }
-            }
-        }
-
-        return new CiAddress(location.getValueKind(), base, index, CiAddress.Scale.fromInt(scale), (int) displacement);
-    }
-
-    @Override
-    public Variable emitMove(CiValue input) {
-        Variable result = newVariable(input.kind);
-        emitMove(input, result);
-        return result;
-    }
-
-    @Override
-    public void emitMove(CiValue src, CiValue dst) {
-        if (isRegister(src) || isStackSlot(dst)) {
-            append(new MoveFromRegOp(dst, src));
-        } else {
-            append(new MoveToRegOp(dst, src));
-        }
-    }
-
-    @Override
-    public Variable emitLoad(CiValue loadAddress, boolean canTrap) {
-        Variable result = newVariable(loadAddress.kind);
-        append(new LoadOp(result, loadAddress, canTrap ? state() : null));
-        return result;
-    }
-
-    @Override
-    public void emitStore(CiValue storeAddress, CiValue inputVal, boolean canTrap) {
-        CiValue input = loadForStore(inputVal, storeAddress.kind);
-        append(new StoreOp(storeAddress, input, canTrap ? state() : null));
-    }
-
-    @Override
-    public Variable emitLea(CiValue address) {
-        Variable result = newVariable(target().wordKind);
-        append(new LeaOp(result, address));
-        return result;
-    }
-
-    @Override
-    public void emitLabel(Label label, boolean align) {
-        append(new LabelOp(label, align));
-    }
-
-    @Override
-    public void emitJump(LabelRef label, LIRDebugInfo info) {
-        append(new JumpOp(label, info));
-    }
-
-    @Override
-    public void emitBranch(CiValue left, CiValue right, Condition cond, boolean unorderedIsTrue, LabelRef label, LIRDebugInfo info) {
-        emitCompare(left, right);
-        switch (left.kind) {
-            case Boolean:
-            case Int:
-            case Long:
-            case Object: append(new BranchOp(cond, label, info)); break;
-            case Float:
-            case Double: append(new FloatBranchOp(cond, unorderedIsTrue, label, info)); break;
-            default: throw GraalInternalError.shouldNotReachHere("" + left.kind);
-        }
-    }
-
-    @Override
-    public Variable emitCMove(CiValue left, CiValue right, Condition cond, boolean unorderedIsTrue, CiValue trueValue, CiValue falseValue) {
-        emitCompare(left, right);
-
-        Variable result = newVariable(trueValue.kind);
-        switch (left.kind) {
-            case Boolean:
-            case Int:
-            case Long:
-            case Object: append(new CondMoveOp(result, cond, load(trueValue), loadNonConst(falseValue))); break;
-            case Float:
-            case Double: append(new FloatCondMoveOp(result, cond, unorderedIsTrue, load(trueValue), load(falseValue))); break;
-
-        }
-        return result;
-    }
-
-    private void emitCompare(CiValue a, CiValue b) {
-        Variable left = load(a);
-        CiValue right = loadNonConst(b);
-        switch (left.kind) {
-            case Jsr:
-            case Int: append(new CompareOp(ICMP, left, right)); break;
-            case Long: append(new CompareOp(LCMP, left, right)); break;
-            case Object: append(new CompareOp(ACMP, left, right)); break;
-            case Float: append(new CompareOp(FCMP, left, right)); break;
-            case Double: append(new CompareOp(DCMP, left, right)); break;
-            default: throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    @Override
-    public Variable emitNegate(CiValue input) {
-        Variable result = newVariable(input.kind);
-        switch (input.kind) {
-            case Int:    append(new Op1Stack(INEG, result, input)); break;
-            case Long:   append(new Op1Stack(LNEG, result, input)); break;
-            case Float:  append(new Op2Reg(FXOR, result, input, CiConstant.forFloat(Float.intBitsToFloat(0x80000000)))); break;
-            case Double: append(new Op2Reg(DXOR, result, input, CiConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L)))); break;
-            default: throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitAdd(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch(a.kind) {
-            case Int:    append(new Op2Stack(IADD, result, a, loadNonConst(b))); break;
-            case Long:   append(new Op2Stack(LADD, result, a, loadNonConst(b))); break;
-            case Float:  append(new Op2Stack(FADD, result, a, loadNonConst(b))); break;
-            case Double: append(new Op2Stack(DADD, result, a, loadNonConst(b))); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitSub(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch(a.kind) {
-            case Int:    append(new Op2Stack(ISUB, result, a, loadNonConst(b))); break;
-            case Long:   append(new Op2Stack(LSUB, result, a, loadNonConst(b))); break;
-            case Float:  append(new Op2Stack(FSUB, result, a, loadNonConst(b))); break;
-            case Double: append(new Op2Stack(DSUB, result, a, loadNonConst(b))); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitMul(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch(a.kind) {
-            case Int:    append(new Op2Reg(IMUL, result, a, loadNonConst(b))); break;
-            case Long:   append(new Op2Reg(LMUL, result, a, loadNonConst(b))); break;
-            case Float:  append(new Op2Stack(FMUL, result, a, loadNonConst(b))); break;
-            case Double: append(new Op2Stack(DMUL, result, a, loadNonConst(b))); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitDiv(CiValue a, CiValue b) {
-        switch(a.kind) {
-            case Int:
-                emitMove(a, RAX_I);
-                append(new DivOp(IDIV, RAX_I, RAX_I, load(b), state()));
-                return emitMove(RAX_I);
-            case Long:
-                emitMove(a, RAX_L);
-                append(new DivOp(LDIV, RAX_L, RAX_L, load(b), state()));
-                return emitMove(RAX_L);
-            case Float: {
-                Variable result = newVariable(a.kind);
-                append(new Op2Stack(FDIV, result, a, loadNonConst(b)));
-                return result;
-            }
-            case Double: {
-                Variable result = newVariable(a.kind);
-                append(new Op2Stack(DDIV, result, a, loadNonConst(b)));
-                return result;
-            }
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    @Override
-    public Variable emitRem(CiValue a, CiValue b) {
-        switch(a.kind) {
-            case Int:
-                emitMove(a, RAX_I);
-                append(new DivOp(IREM, RDX_I, RAX_I, load(b), state()));
-                return emitMove(RDX_I);
-            case Long:
-                emitMove(a, RAX_L);
-                append(new DivOp(LREM, RDX_L, RAX_L, load(b), state()));
-                return emitMove(RDX_L);
-            case Float:
-                return emitCallToRuntime(CiRuntimeCall.ArithmeticFrem, false, a, b);
-            case Double:
-                return emitCallToRuntime(CiRuntimeCall.ArithmeticDrem, false, a, b);
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    @Override
-    public Variable emitUDiv(CiValue a, CiValue b) {
-        switch(a.kind) {
-            case Int:
-                emitMove(a, RAX_I);
-                append(new DivOp(IUDIV, RAX_I, RAX_I, load(b), state()));
-                return emitMove(RAX_I);
-            case Long:
-                emitMove(a, RAX_L);
-                append(new DivOp(LUDIV, RAX_L, RAX_L, load(b), state()));
-                return emitMove(RAX_L);
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    @Override
-    public Variable emitURem(CiValue a, CiValue b) {
-        switch(a.kind) {
-            case Int:
-                emitMove(a, RAX_I);
-                append(new DivOp(IUREM, RDX_I, RAX_I, load(b), state()));
-                return emitMove(RDX_I);
-            case Long:
-                emitMove(a, RAX_L);
-                append(new DivOp(LUREM, RDX_L, RAX_L, load(b), state()));
-                return emitMove(RDX_L);
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    @Override
-    public Variable emitAnd(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch(a.kind) {
-            case Int:    append(new Op2Stack(IAND, result, a, loadNonConst(b))); break;
-            case Long:   append(new Op2Stack(LAND, result, a, loadNonConst(b))); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitOr(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch(a.kind) {
-            case Int:    append(new Op2Stack(IOR, result, a, loadNonConst(b))); break;
-            case Long:   append(new Op2Stack(LOR, result, a, loadNonConst(b))); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitXor(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch(a.kind) {
-            case Int:    append(new Op2Stack(IXOR, result, a, loadNonConst(b))); break;
-            case Long:   append(new Op2Stack(LXOR, result, a, loadNonConst(b))); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-
-    @Override
-    public Variable emitShl(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch (a.kind) {
-            case Int:    append(new ShiftOp(ISHL, result, a, loadShiftCount(b))); break;
-            case Long:   append(new ShiftOp(LSHL, result, a, loadShiftCount(b))); break;
-            default: GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitShr(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch (a.kind) {
-            case Int:    append(new ShiftOp(ISHR, result, a, loadShiftCount(b))); break;
-            case Long:   append(new ShiftOp(LSHR, result, a, loadShiftCount(b))); break;
-            default: GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    @Override
-    public Variable emitUShr(CiValue a, CiValue b) {
-        Variable result = newVariable(a.kind);
-        switch (a.kind) {
-            case Int:    append(new ShiftOp(IUSHR, result, a, loadShiftCount(b))); break;
-            case Long:   append(new ShiftOp(LUSHR, result, a, loadShiftCount(b))); break;
-            default: GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-    private CiValue loadShiftCount(CiValue value) {
-        if (isConstant(value)) {
-            return value;
-        }
-        // Non-constant shift count must be in RCX
-        emitMove(value, RCX_I);
-        return RCX_I;
-    }
-
-
-    @Override
-    public Variable emitConvert(ConvertNode.Op opcode, CiValue inputVal) {
-        Variable input = load(inputVal);
-        Variable result = newVariable(opcode.to);
-        switch (opcode) {
-            case I2L: append(new Op1Reg(I2L, result, input)); break;
-            case L2I: append(new Op1Stack(L2I, result, input)); break;
-            case I2B: append(new Op1Stack(I2B, result, input)); break;
-            case I2C: append(new Op1Stack(I2C, result, input)); break;
-            case I2S: append(new Op1Stack(I2S, result, input)); break;
-            case F2D: append(new Op1Reg(F2D, result, input)); break;
-            case D2F: append(new Op1Reg(D2F, result, input)); break;
-            case I2F: append(new Op1Reg(I2F, result, input)); break;
-            case I2D: append(new Op1Reg(I2D, result, input)); break;
-            case F2I: append(new Op1Reg(F2I, result, input)); break;
-            case D2I: append(new Op1Reg(D2I, result, input)); break;
-            case L2F: append(new Op1Reg(L2F, result, input)); break;
-            case L2D: append(new Op1Reg(L2D, result, input)); break;
-            case F2L: append(new Op1Reg(F2L, result, input)); break;
-            case D2L: append(new Op1Reg(D2L, result, input)); break;
-            case MOV_I2F: append(new Op1Reg(MOV_I2F, result, input)); break;
-            case MOV_L2D: append(new Op1Reg(MOV_L2D, result, input)); break;
-            case MOV_F2I: append(new Op1Reg(MOV_F2I, result, input)); break;
-            case MOV_D2L: append(new Op1Reg(MOV_D2L, result, input)); break;
-            default: throw GraalInternalError.shouldNotReachHere();
-        }
-        return result;
-    }
-
-
-    @Override
-    public void emitDeoptimizeOn(Condition cond, DeoptAction action, Object deoptInfo) {
-        LIRDebugInfo info = state();
-        LabelRef stubEntry = createDeoptStub(action, info, deoptInfo);
-        if (cond != null) {
-            append(new BranchOp(cond, stubEntry, info));
-        } else {
-            append(new JumpOp(stubEntry, info));
-        }
-    }
-
-    @Override
-    public void emitMembar(int barriers) {
-        int necessaryBarriers = target.arch.requiredBarriers(barriers);
-        if (target.isMP && necessaryBarriers != 0) {
-            append(new MembarOp(necessaryBarriers));
-        }
-    }
-
-    @Override
-    protected void emitCall(Object targetMethod, CiValue result, List<CiValue> arguments, CiValue targetAddress, LIRDebugInfo info, Map<XirMark, Mark> marks) {
-        if (isConstant(targetAddress)) {
-            assert asConstant(targetAddress).isDefaultValue() : "destination address should be zero";
-            append(new DirectCallOp(targetMethod, result, arguments.toArray(new CiValue[arguments.size()]), info, marks));
-        } else {
-            append(new IndirectCallOp(targetMethod, result, arguments.toArray(new CiValue[arguments.size()]), targetAddress, info, marks));
-        }
-    }
-
-    @Override
-    protected void emitReturn(CiValue input) {
-        append(new ReturnOp(input));
-    }
-
-    @Override
-    protected void emitXir(XirSnippet snippet, CiValue[] operands, CiValue outputOperand, CiValue[] inputs, CiValue[] temps, int[] inputOperandIndices, int[] tempOperandIndices, int outputOperandIndex,
-                    LIRDebugInfo info, LIRDebugInfo infoAfter, LabelRef trueSuccessor, LabelRef falseSuccessor) {
-        append(new AMD64XirOp(snippet, operands, outputOperand, inputs, temps, inputOperandIndices, tempOperandIndices, outputOperandIndex, info, infoAfter, trueSuccessor, falseSuccessor));
-    }
-
-    @Override
-    protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiValue index) {
-        // Making a copy of the switch value is necessary because jump table destroys the input value
-        Variable tmp = emitMove(index);
-        append(new TableSwitchOp(lowKey, defaultTarget, targets, tmp, newVariable(target.wordKind)));
-    }
-
-    @Override
-    protected LabelRef createDeoptStub(DeoptAction action, LIRDebugInfo info, Object deoptInfo) {
-        assert info.topFrame.bci >= 0 : "invalid bci for deopt framestate";
-        AMD64DeoptimizationStub stub = new AMD64DeoptimizationStub(action, info, deoptInfo);
-        lir.deoptimizationStubs.add(stub);
-        return LabelRef.forLabel(stub.label);
-    }
-
-    @Override
-    protected void emitNullCheckGuard(NullCheckNode node) {
-        assert !node.expectedNull;
-        Variable value = load(operand(node.object()));
-        LIRDebugInfo info = state();
-        append(new NullCheckOp(value, info));
-    }
-
-    // TODO (cwimmer) The CompareAndSwapNode in its current form needs to be lowered to several Nodes before code generation to separate three parts:
-    // * The write barriers (and possibly read barriers) when accessing an object field
-    // * The distinction of returning a boolean value (semantic similar to a BooleanNode to be used as a condition?) or the old value being read
-    // * The actual compare-and-swap
-    @Override
-    public void visitCompareAndSwap(CompareAndSwapNode node) {
-        CiKind kind = node.newValue().kind();
-        assert kind == node.expected().kind();
-
-        CiValue expected = loadNonConst(operand(node.expected()));
-        Variable newValue = load(operand(node.newValue()));
-
-        CiAddress address;
-        CiValue index = operand(node.offset());
-        if (isConstant(index) && NumUtil.isInt(asConstant(index).asLong())) {
-            address = new CiAddress(kind, load(operand(node.object())), (int) asConstant(index).asLong());
-        } else {
-            address = new CiAddress(kind, load(operand(node.object())), load(index), CiAddress.Scale.Times1, 0);
-        }
-
-        if (kind == CiKind.Object) {
-            address = new CiAddress(kind, emitLea(address));
-            preGCWriteBarrier(address.base, false, null);
-        }
-
-        CiRegisterValue rax = AMD64.rax.asValue(kind);
-        emitMove(expected, rax);
-        append(new CompareAndSwapOp(rax, address, rax, newValue));
-
-        Variable result = newVariable(node.kind());
-        if (node.directResult()) {
-            emitMove(rax, result);
-        } else {
-            append(new CondMoveOp(result, Condition.EQ, load(CiConstant.TRUE), CiConstant.FALSE));
-        }
-        setResult(node, result);
-
-        if (kind == CiKind.Object) {
-            postGCWriteBarrier(address.base, newValue);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRLowerable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.target.amd64;
-
-public interface AMD64LIRLowerable {
-
-    void generateAmd64(AMD64LIRGenerator generator);
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64MethodEndStub.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.target.amd64;
-
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.lir.amd64.*;
-import com.oracle.graal.lir.asm.*;
-
-public class AMD64MethodEndStub extends AMD64SlowPath {
-    @Override
-    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        for (int i = 0; i < GraalOptions.MethodEndBreakpointGuards; ++i) {
-            masm.int3();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirAssembler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.target.amd64;
-
-import static com.oracle.max.cri.xir.XirTemplate.GlobalFlags.*;
-
-import java.util.*;
-
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.xir.*;
-
-/**
- * AMD64 version of {@link CiXirAssembler}.
- *
- */
-public class AMD64XirAssembler extends CiXirAssembler {
-    public AMD64XirAssembler(CiTarget target) {
-        super(target);
-    }
-
-    @Override
-    protected XirTemplate buildTemplate(String name, boolean isStub) {
-        List<XirInstruction> fastPath = new ArrayList<>(instructions.size());
-        List<XirInstruction> slowPath = new ArrayList<>();
-
-        int flags = 0;
-
-        if (isStub) {
-            flags |= GLOBAL_STUB.mask;
-        }
-
-        List<XirInstruction> currentList = fastPath;
-
-        XirOperand fixedRDX = null;
-        XirOperand fixedRAX = null;
-        XirOperand fixedRCX = null;
-        XirOperand fixedRSI = null;
-        XirOperand fixedRDI = null;
-        HashSet<XirLabel> boundLabels = new HashSet<>();
-
-        for (XirInstruction i : instructions) {
-            boolean appended = false;
-            switch (i.op) {
-                case Mov:
-                    break;
-
-                case Add:
-                case Sub:
-                case Div:
-                case Mul:
-                case Mod:
-                case Shl:
-                case Shr:
-                case And:
-                case Or:
-                case Xor:
-                    // Convert to two operand form
-                    XirOperand xOp = i.x();
-                    if (i.op == XirOp.Div || i.op == XirOp.Mod) {
-                        if (fixedRDX == null) {
-                            fixedRDX = createRegisterTemp("divModTemp", CiKind.Int, AMD64.rdx);
-                        }
-                        // Special treatment to make sure that the left input of % and / is in RAX
-                        if (fixedRAX == null) {
-                            fixedRAX = createRegisterTemp("divModLeftInput", CiKind.Int, AMD64.rax);
-                        }
-                        currentList.add(new XirInstruction(i.x().kind, XirOp.Mov, fixedRAX, i.x()));
-                        xOp = fixedRAX;
-                    } else {
-                        if (i.result != i.x()) {
-                            currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, i.result, i.x()));
-                            xOp = i.result;
-                        }
-                    }
-
-                    XirOperand yOp = i.y();
-                    if ((i.op == XirOp.Shl || i.op == XirOp.Shr) && (!(i.y() instanceof XirConstantOperand))) {
-                        // Special treatment to make sure that the shift count is always in RCX
-                        if (fixedRCX == null) {
-                            fixedRCX = createRegisterTemp("fixedShiftCount", i.y().kind, AMD64.rcx);
-                        }
-                        currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, fixedRCX, i.y()));
-                        yOp = fixedRCX;
-                    } else if (i.op == XirOp.Mul && (i.y() instanceof XirConstantOperand)) {
-                        // Cannot multiply directly with a constant, so introduce a new temporary variable
-                        XirOperand tempLocation = createTemp("mulTempLocation", i.y().kind);
-                        currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, tempLocation, i.y()));
-                        yOp = tempLocation;
-
-                    }
-
-                    XirOperand resultOp = i.result;
-                    if (i.op == XirOp.Div) {
-                        resultOp = fixedRAX;
-                    } else if (i.op == XirOp.Mod) {
-                        resultOp = fixedRDX;
-                    }
-
-                    if (xOp != i.x() || yOp != i.y() || resultOp != i.result) {
-                        currentList.add(new XirInstruction(i.result.kind, i.op, resultOp, xOp, yOp));
-                        appended = true;
-                    }
-
-                    if (resultOp != i.result) {
-                        currentList.add(new XirInstruction(i.result.kind, XirOp.Mov, i.result, resultOp));
-                    }
-                    break;
-
-                case RepeatMoveWords:
-                case RepeatMoveBytes:
-                    if (fixedRSI == null) {
-                        fixedRSI = createRegisterTemp("fixedRSI", target.wordKind, AMD64.rsi);
-                    }
-                    if (fixedRDI == null) {
-                        fixedRDI = createRegisterTemp("fixedRDI", target.wordKind, AMD64.rdi);
-                    }
-                    if (fixedRCX == null) {
-                        fixedRCX = createRegisterTemp("fixedRCX", target.wordKind, AMD64.rcx);
-                    }
-                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRSI, i.x()));
-                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRDI, i.y()));
-                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRCX, i.z()));
-                    currentList.add(new XirInstruction(CiKind.Illegal, i.op, i.result, fixedRSI, fixedRDI, fixedRCX));
-                    appended = true;
-                    break;
-
-                case NullCheck:
-                case PointerLoad:
-                case LoadEffectiveAddress:
-                case PointerStore:
-                case PointerLoadDisp:
-                case PointerStoreDisp:
-                    break;
-                case PointerCAS:
-                    if (fixedRAX == null) {
-                        fixedRAX = createRegisterTemp("fixedRAX", target.wordKind, AMD64.rax);
-                    }
-                    // x = source of cmpxch
-                    // y = new value
-                    // z = old value (i.e., the one compared to). Must be in RAX (and so must the result).
-                    currentList.add(new XirInstruction(target.wordKind, XirOp.Mov, fixedRAX, i.z()));
-                    currentList.add(new XirInstruction(i.kind, i.op, i.result, i.x(), i.y(), fixedRAX));
-                    appended = true;
-                    break;
-                case CallRuntime:
-                    flags |= HAS_RUNTIME_CALL.mask;
-                    break;
-                case Jmp:
-                    // jmp can be either into the snippet or to a runtime target
-                    flags |= i.extra instanceof XirLabel ? HAS_CONTROL_FLOW.mask : HAS_RUNTIME_CALL.mask;
-                    break;
-                case Jeq:
-                case Jneq:
-                case Jgt:
-                case Jgteq:
-                case Jugteq:
-                case Jlt:
-                case Jlteq:
-                case DecAndJumpNotZero:
-                case Jbset:
-                    flags |= HAS_CONTROL_FLOW.mask;
-                    break;
-                case Bind:
-                    XirLabel label = (XirLabel) i.extra;
-                    currentList = label.inline ? fastPath : slowPath;
-                    assert !boundLabels.contains(label) : "label may be bound only once";
-                    boundLabels.add(label);
-                    break;
-                case Safepoint:
-                case Align:
-                case StackOverflowCheck:
-                case PushFrame:
-                case PopFrame:
-                case Push:
-                case Pop:
-                case Mark:
-                case Nop:
-                case RawBytes:
-                case ShouldNotReachHere:
-                    break;
-                default:
-                    assert false : "Unknown XIR operation " + i.op;
-            }
-            if (!appended) {
-                currentList.add(i);
-            }
-        }
-        for (XirLabel label : labels) {
-            assert label.name == XirLabel.TrueSuccessor || label.name == XirLabel.FalseSuccessor || boundLabels.contains(label) : "label " + label.name + " is not bound!";
-        }
-        XirInstruction[] fp = fastPath.toArray(new XirInstruction[fastPath.size()]);
-        XirInstruction[] sp = slowPath.size() > 0 ? slowPath.toArray(new XirInstruction[slowPath.size()]) : null;
-        XirLabel[] xirLabels = labels.toArray(new XirLabel[labels.size()]);
-        XirParameter[] xirParameters = parameters.toArray(new XirParameter[parameters.size()]);
-        XirTemp[] temporaryOperands = temps.toArray(new XirTemp[temps.size()]);
-        XirConstant[] constantOperands = constants.toArray(new XirConstant[constants.size()]);
-        XirMark[] marksArray = marks.toArray(new XirMark[marks.size()]);
-        return new XirTemplate(name, this.variableCount, this.allocateResultOperand, resultOperand, fp, sp, xirLabels, xirParameters, temporaryOperands, constantOperands, flags, marksArray, outgoingStackSize);
-    }
-
-    @Override
-    public CiXirAssembler copy() {
-        return new AMD64XirAssembler(target);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,553 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.target.amd64;
-
-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.Mark;
-import com.oracle.max.cri.xir.*;
-import com.oracle.max.cri.xir.CiXirAssembler.RuntimeCallInformation;
-import com.oracle.max.cri.xir.CiXirAssembler.XirInstruction;
-import com.oracle.max.cri.xir.CiXirAssembler.XirLabel;
-import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.amd64.*;
-import com.oracle.graal.lir.asm.*;
-
-public class AMD64XirOp extends LIRXirInstruction {
-    public AMD64XirOp(XirSnippet snippet, CiValue[] operands, CiValue outputOperand, CiValue[] inputs, CiValue[] temps, int[] inputOperandIndices, int[] tempOperandIndices, int outputOperandIndex,
-                        LIRDebugInfo info, LIRDebugInfo infoAfter, LabelRef trueSuccessor, LabelRef falseSuccessor) {
-        super("XIR", snippet, operands, outputOperand, inputs, temps, inputOperandIndices, tempOperandIndices, outputOperandIndex, info, infoAfter, trueSuccessor, falseSuccessor);
-    }
-
-    @Override
-    public void emitCode(TargetMethodAssembler tasm) {
-        AMD64MacroAssembler masm = (AMD64MacroAssembler) tasm.asm;
-
-        Label endLabel = null;
-        Label[] labels = new Label[snippet.template.labels.length];
-        for (int i = 0; i < labels.length; i++) {
-            labels[i] = new Label();
-            if (snippet.template.labels[i].name == XirLabel.TrueSuccessor) {
-                if (trueSuccessor == null) {
-                    assert endLabel == null;
-                    endLabel = new Label();
-                    labels[i] = endLabel;
-                } else {
-                    labels[i] = trueSuccessor.label();
-                }
-            } else if (snippet.template.labels[i].name == XirLabel.FalseSuccessor) {
-                if (falseSuccessor == null) {
-                    assert endLabel == null;
-                    endLabel = new Label();
-                    labels[i] = endLabel;
-                } else {
-                    labels[i] = falseSuccessor.label();
-                }
-            }
-        }
-        emitXirInstructions(tasm, masm, snippet.template.fastPath, labels, getOperands(), snippet.marks);
-        if (endLabel != null) {
-            masm.bind(endLabel);
-        }
-
-        if (snippet.template.slowPath != null) {
-            tasm.slowPaths.add(new SlowPath(labels));
-        }
-    }
-
-    private class SlowPath extends AMD64SlowPath {
-        public final Label[] labels;
-
-        public SlowPath(Label[] labels) {
-            this.labels = labels;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            emitXirInstructions(tasm, masm, snippet.template.slowPath, labels, getOperands(), snippet.marks);
-            masm.nop();
-        }
-    }
-
-
-    protected void emitXirInstructions(TargetMethodAssembler tasm, AMD64MacroAssembler masm, XirInstruction[] instructions, Label[] labels, CiValue[] operands, Map<XirMark, Mark> marks) {
-        for (XirInstruction inst : instructions) {
-            switch (inst.op) {
-                case Add:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IADD, AMD64Arithmetic.LADD, AMD64Arithmetic.FADD, AMD64Arithmetic.DADD, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Sub:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.ISUB, AMD64Arithmetic.LSUB, AMD64Arithmetic.FSUB, AMD64Arithmetic.DSUB, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Div:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IDIV, AMD64Arithmetic.LDIV, AMD64Arithmetic.FDIV, AMD64Arithmetic.DDIV, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Mul:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IMUL, AMD64Arithmetic.LMUL, AMD64Arithmetic.FMUL, AMD64Arithmetic.DMUL, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Mod:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IREM, AMD64Arithmetic.LREM, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Shl:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.ISHL, AMD64Arithmetic.LSHL, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Sar:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.ISHR, AMD64Arithmetic.LSHR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Shr:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IUSHR, AMD64Arithmetic.LUSHR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case And:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IAND, AMD64Arithmetic.LAND, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Or:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IOR, AMD64Arithmetic.LOR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Xor:
-                    emitXirViaLir(tasm, masm, AMD64Arithmetic.IXOR, AMD64Arithmetic.LXOR, null, null, operands[inst.x().index], operands[inst.y().index], operands[inst.result.index]);
-                    break;
-
-                case Mov: {
-                    CiValue result = operands[inst.result.index];
-                    CiValue source = operands[inst.x().index];
-                    AMD64Move.move(tasm, masm, result, source);
-                    break;
-                }
-
-                case PointerLoad: {
-                    CiValue result = operands[inst.result.index];
-                    CiValue pointer = operands[inst.x().index];
-                    CiRegisterValue register = assureInRegister(tasm, masm, pointer);
-
-                    AMD64Move.load(tasm, masm, result, new CiAddress(inst.kind, register), (Boolean) inst.extra ? info : null);
-                    break;
-                }
-
-                case PointerStore: {
-                    CiValue value = assureNot64BitConstant(tasm, masm, operands[inst.y().index]);
-                    CiValue pointer = operands[inst.x().index];
-                    assert isRegister(pointer);
-
-                    AMD64Move.store(tasm, masm, new CiAddress(inst.kind, pointer), value, (Boolean) inst.extra ? info : null);
-                    break;
-                }
-
-                case PointerLoadDisp: {
-                    CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
-                    boolean canTrap = addressInformation.canTrap;
-
-                    CiAddress.Scale scale = addressInformation.scale;
-                    int displacement = addressInformation.disp;
-
-                    CiValue result = operands[inst.result.index];
-                    CiValue pointer = operands[inst.x().index];
-                    CiValue index = operands[inst.y().index];
-
-                    pointer = assureInRegister(tasm, masm, pointer);
-                    assert isRegister(pointer);
-
-                    CiAddress src;
-                    if (isConstant(index)) {
-                        assert index.kind == CiKind.Int;
-                        CiConstant constantIndex = (CiConstant) index;
-                        src = new CiAddress(inst.kind, pointer, constantIndex.asInt() * scale.value + displacement);
-                    } else {
-                        src = new CiAddress(inst.kind, pointer, index, scale, displacement);
-                    }
-
-                    AMD64Move.load(tasm, masm, result, src, canTrap ? info : null);
-                    break;
-                }
-
-                case LoadEffectiveAddress: {
-                    CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
-
-                    CiAddress.Scale scale = addressInformation.scale;
-                    int displacement = addressInformation.disp;
-
-                    CiValue result = operands[inst.result.index];
-                    CiValue pointer = operands[inst.x().index];
-                    CiValue index = operands[inst.y().index];
-
-                    pointer = assureInRegister(tasm, masm, pointer);
-                    assert isRegister(pointer);
-                    CiAddress src = new CiAddress(CiKind.Illegal, pointer, index, scale, displacement);
-                    masm.leaq(asRegister(result), src);
-                    break;
-                }
-
-                case PointerStoreDisp: {
-                    CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
-                    boolean canTrap = addressInformation.canTrap;
-
-                    CiAddress.Scale scale = addressInformation.scale;
-                    int displacement = addressInformation.disp;
-
-                    CiValue value = assureNot64BitConstant(tasm, masm, operands[inst.z().index]);
-                    CiValue pointer = operands[inst.x().index];
-                    CiValue index = operands[inst.y().index];
-
-                    pointer = assureInRegister(tasm, masm, pointer);
-                    assert isRegister(pointer);
-
-                    CiAddress dst;
-                    if (isConstant(index)) {
-                        assert index.kind == CiKind.Int;
-                        CiConstant constantIndex = (CiConstant) index;
-                        dst = new CiAddress(inst.kind, pointer, IllegalValue, scale, constantIndex.asInt() * scale.value + displacement);
-                    } else {
-                        dst = new CiAddress(inst.kind, pointer, index, scale, displacement);
-                    }
-
-                    AMD64Move.store(tasm, masm, dst, value, canTrap ? info : null);
-                    break;
-                }
-
-                case RepeatMoveBytes:
-                    assert asRegister(operands[inst.x().index]).equals(AMD64.rsi) : "wrong input x: " + operands[inst.x().index];
-                    assert asRegister(operands[inst.y().index]).equals(AMD64.rdi) : "wrong input y: " + operands[inst.y().index];
-                    assert asRegister(operands[inst.z().index]).equals(AMD64.rcx) : "wrong input z: " + operands[inst.z().index];
-                    masm.repeatMoveBytes();
-                    break;
-
-                case RepeatMoveWords:
-                    assert asRegister(operands[inst.x().index]).equals(AMD64.rsi) : "wrong input x: " + operands[inst.x().index];
-                    assert asRegister(operands[inst.y().index]).equals(AMD64.rdi) : "wrong input y: " + operands[inst.y().index];
-                    assert asRegister(operands[inst.z().index]).equals(AMD64.rcx) : "wrong input z: " + operands[inst.z().index];
-                    masm.repeatMoveWords();
-                    break;
-
-                case PointerCAS:
-                    assert asRegister(operands[inst.x().index]).equals(AMD64.rax) : "wrong input x: " + operands[inst.x().index];
-
-                    CiValue exchangedVal = operands[inst.y().index];
-                    CiValue exchangedAddress = operands[inst.x().index];
-                    CiRegisterValue pointerRegister = assureInRegister(tasm, masm, exchangedAddress);
-                    CiAddress addr = new CiAddress(tasm.target.wordKind, pointerRegister);
-
-                    if ((Boolean) inst.extra && info != null) {
-                        tasm.recordImplicitException(masm.codeBuffer.position(), info);
-                    }
-                    masm.cmpxchgq(asRegister(exchangedVal), addr);
-
-                    break;
-
-                case CallRuntime: {
-                    CiKind[] signature = new CiKind[inst.arguments.length];
-                    for (int i = 0; i < signature.length; i++) {
-                        signature[i] = inst.arguments[i].kind;
-                    }
-
-                    CiCallingConvention cc = tasm.frameMap.registerConfig.getCallingConvention(RuntimeCall, signature, tasm.target, false);
-                    for (int i = 0; i < inst.arguments.length; i++) {
-                        CiValue argumentLocation = cc.locations[i];
-                        CiValue argumentSourceLocation = operands[inst.arguments[i].index];
-                        if (argumentLocation != argumentSourceLocation) {
-                            AMD64Move.move(tasm, masm, argumentLocation, argumentSourceLocation);
-                        }
-                    }
-
-                    RuntimeCallInformation runtimeCallInformation = (RuntimeCallInformation) inst.extra;
-                    AMD64Call.directCall(tasm, masm, runtimeCallInformation.target, (runtimeCallInformation.useInfoAfter) ? infoAfter : info);
-
-                    if (inst.result != null && inst.result.kind != CiKind.Illegal && inst.result.kind != CiKind.Void) {
-                        CiRegister returnRegister = tasm.frameMap.registerConfig.getReturnRegister(inst.result.kind);
-                        CiValue resultLocation = returnRegister.asValue(inst.result.kind.stackKind());
-                        AMD64Move.move(tasm, masm, operands[inst.result.index], resultLocation);
-                    }
-                    break;
-                }
-                case Jmp: {
-                    if (inst.extra instanceof XirLabel) {
-                        Label label = labels[((XirLabel) inst.extra).index];
-                        masm.jmp(label);
-                    } else {
-                        AMD64Call.directJmp(tasm, masm, inst.extra);
-                    }
-                    break;
-                }
-                case DecAndJumpNotZero: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    CiValue value = operands[inst.x().index];
-                    if (value.kind == CiKind.Long) {
-                        masm.decq(asRegister(value));
-                    } else {
-                        assert value.kind == CiKind.Int;
-                        masm.decl(asRegister(value));
-                    }
-                    masm.jcc(ConditionFlag.notZero, label);
-                    break;
-                }
-                case Jeq: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    emitXirCompare(tasm, masm, inst, ConditionFlag.equal, operands, label);
-                    break;
-                }
-                case Jneq: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    emitXirCompare(tasm, masm, inst, ConditionFlag.notEqual, operands, label);
-                    break;
-                }
-
-                case Jgt: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    emitXirCompare(tasm, masm, inst, ConditionFlag.greater, operands, label);
-                    break;
-                }
-
-                case Jgteq: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    emitXirCompare(tasm, masm, inst, ConditionFlag.greaterEqual, operands, label);
-                    break;
-                }
-
-                case Jugteq: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    emitXirCompare(tasm, masm, inst, ConditionFlag.aboveEqual, operands, label);
-                    break;
-                }
-
-                case Jlt: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    emitXirCompare(tasm, masm, inst, ConditionFlag.less, operands, label);
-                    break;
-                }
-
-                case Jlteq: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    emitXirCompare(tasm, masm, inst, ConditionFlag.lessEqual, operands, label);
-                    break;
-                }
-
-                case Jbset: {
-                    Label label = labels[((XirLabel) inst.extra).index];
-                    CiValue pointer = operands[inst.x().index];
-                    CiValue offset = operands[inst.y().index];
-                    CiValue bit = operands[inst.z().index];
-                    assert isConstant(offset) && isConstant(bit);
-                    CiConstant constantOffset = (CiConstant) offset;
-                    CiConstant constantBit = (CiConstant) bit;
-                    CiAddress src = new CiAddress(inst.kind, pointer, constantOffset.asInt());
-                    masm.btli(src, constantBit.asInt());
-                    masm.jcc(ConditionFlag.aboveEqual, label);
-                    break;
-                }
-
-                case Bind: {
-                    XirLabel l = (XirLabel) inst.extra;
-                    Label label = labels[l.index];
-                    masm.bind(label);
-                    break;
-                }
-                case Safepoint: {
-                    assert info != null : "Must have debug info in order to create a safepoint.";
-                    tasm.recordSafepoint(masm.codeBuffer.position(), info);
-                    break;
-                }
-                case NullCheck: {
-                    tasm.recordImplicitException(masm.codeBuffer.position(), info);
-                    CiValue pointer = operands[inst.x().index];
-                    masm.nullCheck(asRegister(pointer));
-                    break;
-                }
-                case Align: {
-                    masm.align((Integer) inst.extra);
-                    break;
-                }
-                case StackOverflowCheck: {
-                    int frameSize = tasm.frameMap.frameSize();
-                    int lastFramePage = frameSize / tasm.target.pageSize;
-                    // emit multiple stack bangs for methods with frames larger than a page
-                    for (int i = 0; i <= lastFramePage; i++) {
-                        int offset = (i + GraalOptions.StackShadowPages) * tasm.target.pageSize;
-                        // Deduct 'frameSize' to handle frames larger than the shadow
-                        bangStackWithOffset(tasm, masm, offset - frameSize);
-                    }
-                    break;
-                }
-                case PushFrame: {
-                    int frameSize = tasm.frameMap.frameSize();
-                    masm.decrementq(AMD64.rsp, frameSize); // does not emit code for frameSize == 0
-                    if (GraalOptions.ZapStackOnMethodEntry) {
-                        final int intSize = 4;
-                        for (int i = 0; i < frameSize / intSize; ++i) {
-                            masm.movl(new CiAddress(CiKind.Int, AMD64.rsp.asValue(), i * intSize), 0xC1C1C1C1);
-                        }
-                    }
-                    CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
-                    if (csl != null && csl.size != 0) {
-                        int frameToCSA = tasm.frameMap.offsetToCalleeSaveArea();
-                        assert frameToCSA >= 0;
-                        masm.save(csl, frameToCSA);
-                    }
-                    break;
-                }
-                case PopFrame: {
-                    int frameSize = tasm.frameMap.frameSize();
-
-                    CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
-                    if (csl != null && csl.size != 0) {
-                        tasm.targetMethod.setRegisterRestoreEpilogueOffset(masm.codeBuffer.position());
-                        // saved all registers, restore all registers
-                        int frameToCSA = tasm.frameMap.offsetToCalleeSaveArea();
-                        masm.restore(csl, frameToCSA);
-                    }
-
-                    masm.incrementq(AMD64.rsp, frameSize);
-                    break;
-                }
-                case Push: {
-                    CiRegisterValue value = assureInRegister(tasm, masm, operands[inst.x().index]);
-                    masm.push(asRegister(value));
-                    break;
-                }
-                case Pop: {
-                    CiValue result = operands[inst.result.index];
-                    if (isRegister(result)) {
-                        masm.pop(asRegister(result));
-                    } else {
-                        CiRegister rscratch = tasm.frameMap.registerConfig.getScratchRegister();
-                        masm.pop(rscratch);
-                        AMD64Move.move(tasm, masm, result, rscratch.asValue());
-                    }
-                    break;
-                }
-                case Mark: {
-                    XirMark xmark = (XirMark) inst.extra;
-                    Mark[] references = new Mark[xmark.references.length];
-                    for (int i = 0; i < references.length; i++) {
-                        references[i] = marks.get(xmark.references[i]);
-                        assert references[i] != null;
-                    }
-                    Mark mark = tasm.recordMark(xmark.id, references);
-                    marks.put(xmark, mark);
-                    break;
-                }
-                case Nop: {
-                    for (int i = 0; i < (Integer) inst.extra; i++) {
-                        masm.nop();
-                    }
-                    break;
-                }
-                case RawBytes: {
-                    for (byte b : (byte[]) inst.extra) {
-                        masm.codeBuffer.emitByte(b & 0xff);
-                    }
-                    break;
-                }
-                case ShouldNotReachHere: {
-                    AMD64Call.shouldNotReachHere(tasm, masm);
-                    break;
-                }
-                default:
-                    throw GraalInternalError.shouldNotReachHere("Unknown XIR operation " + inst.op);
-            }
-        }
-    }
-
-    private static void emitXirViaLir(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Arithmetic intOp, AMD64Arithmetic longOp, AMD64Arithmetic floatOp,
-                    AMD64Arithmetic doubleOp, CiValue left, CiValue right, CiValue result) {
-        AMD64Arithmetic code;
-        switch (result.kind) {
-            case Int: code = intOp; break;
-            case Long: code = longOp; break;
-            case Float: code = floatOp; break;
-            case Double: code = doubleOp; break;
-            default: throw GraalInternalError.shouldNotReachHere();
-        }
-        assert left == result;
-        if (isRegister(right) && right.kind != result.kind) {
-            // XIR is not strongly typed, so we can have a type mismatch that we have to fix here.
-            AMD64Arithmetic.emit(tasm, masm, code, result, asRegister(right).asValue(result.kind), null);
-        } else {
-            AMD64Arithmetic.emit(tasm, masm, code, result, right, null);
-        }
-    }
-
-    private static void emitXirCompare(TargetMethodAssembler tasm, AMD64MacroAssembler masm, XirInstruction inst, ConditionFlag cflag, CiValue[] ops, Label label) {
-        CiValue x = ops[inst.x().index];
-        CiValue y = ops[inst.y().index];
-        AMD64Compare code;
-        switch (x.kind) {
-            case Int: code = AMD64Compare.ICMP; break;
-            case Long: code = AMD64Compare.LCMP; break;
-            case Object: code = AMD64Compare.ACMP; break;
-            case Float: code = AMD64Compare.FCMP; break;
-            case Double: code = AMD64Compare.DCMP; break;
-            default: throw GraalInternalError.shouldNotReachHere();
-        }
-        AMD64Compare.emit(tasm, masm, code, x, y);
-        masm.jcc(cflag, label);
-    }
-
-    /**
-     * @param offset the offset RSP at which to bang. Note that this offset is relative to RSP after RSP has been
-     *            adjusted to allocated the frame for the method. It denotes an offset "down" the stack.
-     *            For very large frames, this means that the offset may actually be negative (i.e. denoting
-     *            a slot "up" the stack above RSP).
-     */
-    private static void bangStackWithOffset(TargetMethodAssembler tasm, AMD64MacroAssembler masm, int offset) {
-        masm.movq(new CiAddress(tasm.target.wordKind, AMD64.RSP, -offset), AMD64.rax);
-    }
-
-    private static CiValue assureNot64BitConstant(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue value) {
-        if (isConstant(value) && (value.kind == CiKind.Long || value.kind == CiKind.Object)) {
-            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(value.kind);
-            AMD64Move.move(tasm, masm, register, value);
-            return register;
-        }
-        return value;
-    }
-
-    private static CiRegisterValue assureInRegister(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue pointer) {
-        if (isConstant(pointer)) {
-            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(pointer.kind);
-            AMD64Move.move(tasm, masm, register, pointer);
-            return register;
-        }
-
-        assert isRegister(pointer) : "should be register, but is: " + pointer;
-        return (CiRegisterValue) pointer;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/types/PostOrderBlockIterator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.types;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.cfg.*;
-
-public abstract class PostOrderBlockIterator {
-
-    private final BitMap visitedEndBlocks;
-    private final Deque<Block> blockQueue;
-
-    public PostOrderBlockIterator(Block start, int blockCount) {
-        visitedEndBlocks = new BitMap(blockCount);
-        blockQueue = new ArrayDeque<>();
-        blockQueue.add(start);
-    }
-
-    public void apply() {
-        while (!blockQueue.isEmpty()) {
-            Block current = blockQueue.removeLast();
-            block(current);
-
-            for (int i = 0; i < current.getSuccessors().size(); i++) {
-                Block successor = current.getSuccessors().get(i);
-                if (successor.getPredecessors().size() > 1) {
-                    queueMerge(current, successor);
-                } else {
-                    blockQueue.addLast(successor);
-                }
-            }
-        }
-    }
-
-    protected abstract void block(Block block);
-
-    private void queueMerge(Block end, Block merge) {
-        visitedEndBlocks.set(end.getId());
-        for (Block pred : merge.getPredecessors()) {
-            if (!visitedEndBlocks.get(pred.getId())) {
-                return;
-            }
-        }
-        blockQueue.addFirst(merge);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypesPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.types;
-
-import java.util.*;
-import java.util.Map.Entry;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.graph.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.schedule.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.NodeClass.NodeClassIterator;
-import com.oracle.graal.graph.NodeClass.Position;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class PropagateTypesPhase extends Phase {
-
-    private final CiTarget target;
-    private final RiRuntime runtime;
-    private final CiAssumptions assumptions;
-
-    private NodeWorkList changedNodes;
-
-    public PropagateTypesPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions) {
-        this.target = target;
-        this.runtime = runtime;
-        this.assumptions = assumptions;
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-
-        new DeadCodeEliminationPhase().apply(graph);
-
-        changedNodes = graph.createNodeWorkList(false, 10);
-
-        SchedulePhase schedule = new SchedulePhase();
-        schedule.apply(graph);
-
-        schedule.scheduleGraph();
-        Debug.dump(graph, "scheduled");
-
-        new PropagateTypes(graph.start()).apply();
-        Debug.dump(graph, "after propagation");
-
-        new UnscheduleNodes(graph.start()).apply();
-
-        CanonicalizerPhase.canonicalize(graph, changedNodes, runtime, target, assumptions);
-    }
-
-    private class PiNodeList {
-
-        public final PiNodeList last;
-        public final ValueNode replacement;
-        public final int depth;
-
-        public PiNodeList(ValueNode replacement, PiNodeList last) {
-            this.last = last;
-            this.replacement = replacement;
-            this.depth = last != null ? last.depth + 1 : 1;
-        }
-
-        public PiNodeList merge(PiNodeList other) {
-            PiNodeList thisList = this;
-            PiNodeList otherList = other;
-            while (thisList.depth > otherList.depth) {
-                thisList = thisList.last;
-            }
-            while (otherList.depth > thisList.depth) {
-                otherList = otherList.last;
-            }
-            while (thisList != otherList) {
-                thisList = thisList.last;
-                otherList = otherList.last;
-            }
-            return thisList;
-        }
-    }
-
-    private class TypeInfo implements MergeableState<TypeInfo> {
-
-        private HashMap<ValueNode, PiNodeList> piNodes = new HashMap<>();
-
-        public TypeInfo(HashMap<ValueNode, PiNodeList> piNodes) {
-            this.piNodes.putAll(piNodes);
-        }
-
-        @Override
-        public TypeInfo clone() {
-            return new TypeInfo(piNodes);
-        }
-
-        @Override
-        public boolean merge(MergeNode merge, Collection<TypeInfo> withStates) {
-            if (merge.forwardEndCount() > 1) {
-                HashMap<ValueNode, PiNodeList> newPiNodes = new HashMap<>();
-                for (Entry<ValueNode, PiNodeList> entry : piNodes.entrySet()) {
-                    PiNodeList list = entry.getValue();
-                    for (TypeInfo info : withStates) {
-                        PiNodeList other = info.piNodes.get(entry.getKey());
-                        if (other == null) {
-                            list = null;
-                        } else {
-                            list = list.merge(other);
-                        }
-                        if (list == null) {
-                            break;
-                        }
-                    }
-                    if (list != null) {
-                        newPiNodes.put(entry.getKey(), list);
-                    }
-                }
-                piNodes = newPiNodes;
-            }
-            return true;
-        }
-
-        @Override
-        public void loopBegin(LoopBeginNode loop) {
-        }
-
-        @Override
-        public void loopEnds(LoopBeginNode loop, Collection<TypeInfo> loopEndStates) {
-        }
-
-        @Override
-        public void afterSplit(FixedNode node) {
-            assert node.predecessor() != null;
-            assert node.predecessor() instanceof ControlSplitNode;
-//            TTY.println("after split: %s", node);
-            if (node.predecessor() instanceof IfNode) {
-                IfNode ifNode = (IfNode) node.predecessor();
-                if (ifNode.compare() instanceof InstanceOfNode) {
-                    InstanceOfNode instanceOf = (InstanceOfNode) ifNode.compare();
-                    assert node == ifNode.trueSuccessor() || node == ifNode.falseSuccessor();
-                    if ((node == ifNode.trueSuccessor() && !instanceOf.negated()) || (node == ifNode.falseSuccessor() && instanceOf.negated())) {
-                        ValueNode value = instanceOf.object();
-                        if (value.declaredType() != instanceOf.targetClass() || !value.stamp().nonNull()) {
-                            PiNode piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.declaredNonNull(instanceOf.targetClass())));
-                            PiNodeList list = piNodes.get(value);
-                            piNodes.put(value, new PiNodeList(piNode, list));
-                        }
-                    }
-                } else if (ifNode.compare() instanceof CompareNode) {
-                    CompareNode compare = (CompareNode) ifNode.compare();
-                    assert node == ifNode.trueSuccessor() || node == ifNode.falseSuccessor();
-                    if ((node == ifNode.trueSuccessor() && compare.condition() == Condition.EQ) || (node == ifNode.falseSuccessor() && compare.condition() == Condition.NE)) {
-                        if (compare.y().isConstant()) {
-                            ValueNode value = compare.x();
-                            PiNodeList list = piNodes.get(value);
-                            piNodes.put(value, new PiNodeList(compare.y(), list));
-                        }
-                    } else if ((node == ifNode.trueSuccessor() && compare.condition() == Condition.NE) || (node == ifNode.falseSuccessor() && compare.condition() == Condition.EQ)) {
-                        if (!compare.x().isConstant() && compare.y().isNullConstant() && !compare.x().stamp().nonNull()) {
-                            ValueNode value = compare.x();
-                            PiNode piNode;
-                            if (value.exactType() != null) {
-                                piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.declaredNonNull(value.exactType())));
-                            } else if (value.declaredType() != null) {
-                                piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.declaredNonNull(value.declaredType())));
-                            } else {
-                                piNode = node.graph().unique(new PiNode(value, (BeginNode) node, StampFactory.objectNonNull()));
-                            }
-                            PiNodeList list = piNodes.get(value);
-                            piNodes.put(value, new PiNodeList(piNode, list));
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    private class Tool implements CanonicalizerTool {
-        @Override
-        public CiTarget target() {
-            return target;
-        }
-
-        @Override
-        public CiAssumptions assumptions() {
-            return assumptions;
-        }
-
-        @Override
-        public RiRuntime runtime() {
-            return runtime;
-        }
-    }
-
-    private final Tool tool = new Tool();
-
-    private class PropagateTypes extends ScheduledNodeIterator<TypeInfo> {
-
-        public PropagateTypes(FixedNode start) {
-            super(start, new TypeInfo(new HashMap<ValueNode, PiNodeList>()));
-        }
-
-        @Override
-        protected void node(ScheduledNode node) {
-            if (node instanceof Canonicalizable || node instanceof Invoke) {
-                NodeClassIterator iter = node.inputs().iterator();
-                ArrayList<Node> changedInputs = new ArrayList<>();
-                while (iter.hasNext()) {
-                    Position pos = iter.nextPosition();
-                    Node value = pos.get(node);
-                    PiNodeList list = state.piNodes.get(value);
-                    if (list != null) {
-                        changedInputs.add(list.replacement instanceof PiNode ? value : null);
-                        pos.set(node, list.replacement);
-                    } else {
-                        changedInputs.add(null);
-                    }
-                }
-
-                ValueNode canonical = null;
-                if (node instanceof Canonicalizable) {
-                    canonical = ((Canonicalizable) node).canonical(tool);
-                }
-
-                if (canonical == node) {
-                    iter = node.inputs().iterator();
-                    int i = 0;
-                    while (iter.hasNext()) {
-                        Position pos = iter.nextPosition();
-                        if (changedInputs.get(i) != null) {
-                            pos.set(node, changedInputs.get(i));
-                        }
-                        i++;
-                    }
-                } else {
-                    changedNodes.add(node);
-                }
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/types/ScheduledNodeIterator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.types;
-
-import java.util.*;
-
-import com.oracle.graal.compiler.graph.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-public abstract class ScheduledNodeIterator<T extends MergeableState<T>> {
-
-    private final NodeBitMap visitedEnds;
-    private final Deque<ScheduledNode> nodeQueue;
-    private final IdentityHashMap<ScheduledNode, T> nodeStates;
-    private final FixedNode start;
-
-    protected T state;
-
-    public ScheduledNodeIterator(FixedNode start, T initialState) {
-        visitedEnds = start.graph().createNodeBitMap();
-        nodeQueue = new ArrayDeque<>();
-        nodeStates = new IdentityHashMap<>();
-        this.start = start;
-        this.state = initialState;
-    }
-
-    public void apply() {
-        ScheduledNode current = start;
-
-        do {
-            if (current instanceof LoopBeginNode) {
-                state.loopBegin((LoopBeginNode) current);
-                nodeStates.put(current, state);
-                state = state.clone();
-                loopBegin((LoopBeginNode) current);
-                current = current.scheduledNext();
-                assert current != null;
-            } else if (current instanceof LoopEndNode) {
-                loopEnd((LoopEndNode) current);
-                finishLoopEnds((LoopEndNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof MergeNode) {
-                merge((MergeNode) current);
-                current = current.scheduledNext();
-                assert current != null;
-            } else if (current instanceof EndNode) {
-                end((EndNode) current);
-                queueMerge((EndNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof ControlSplitNode) {
-                controlSplit((ControlSplitNode) current);
-                queueSuccessors(current);
-                current = nextQueuedNode();
-            } else {
-                ScheduledNode next = current.scheduledNext();
-                node(current);
-                if (next == null) {
-                    current = nextQueuedNode();
-                } else {
-                    current = next;
-                }
-            }
-        } while(current != null);
-    }
-
-    private void queueSuccessors(ScheduledNode x) {
-        nodeStates.put(x, state);
-        for (Node node : x.successors()) {
-            if (node != null) {
-                nodeQueue.addFirst((FixedNode) node);
-            }
-        }
-    }
-
-    private ScheduledNode nextQueuedNode() {
-        int maxIterations = nodeQueue.size();
-        while (maxIterations-- > 0) {
-            ScheduledNode node = nodeQueue.removeFirst();
-            if (node instanceof MergeNode) {
-                MergeNode merge = (MergeNode) node;
-                state = nodeStates.get(merge.forwardEndAt(0)).clone();
-                ArrayList<T> states = new ArrayList<>(merge.forwardEndCount() - 1);
-                for (int i = 1; i < merge.forwardEndCount(); i++) {
-                    T other = nodeStates.get(merge.forwardEndAt(i));
-                    assert other != null;
-                    states.add(other);
-                }
-                boolean ready = state.merge(merge, states);
-                if (ready) {
-                    return merge;
-                } else {
-                    nodeQueue.addLast(merge);
-                }
-            } else {
-                assert node.predecessor() != null;
-                state = nodeStates.get(node.predecessor()).clone();
-                state.afterSplit((FixedNode) node);
-                return node;
-            }
-        }
-        return null;
-    }
-
-    private void queueMerge(EndNode end) {
-        assert !visitedEnds.isMarked(end);
-        assert !nodeStates.containsKey(end);
-        nodeStates.put(end, state);
-        visitedEnds.mark(end);
-        MergeNode merge = end.merge();
-        boolean endsVisited = true;
-        for (int i = 0; i < merge.forwardEndCount(); i++) {
-            if (!visitedEnds.isMarked(merge.forwardEndAt(i))) {
-                endsVisited = false;
-                break;
-            }
-        }
-        if (endsVisited) {
-            nodeQueue.add(merge);
-        }
-    }
-
-    private void finishLoopEnds(LoopEndNode end) {
-        assert !visitedEnds.isMarked(end);
-        assert !nodeStates.containsKey(end);
-        nodeStates.put(end, state);
-        visitedEnds.mark(end);
-        LoopBeginNode begin = end.loopBegin();
-        boolean endsVisited = true;
-        for (LoopEndNode le : begin.loopEnds()) {
-            if (!visitedEnds.isMarked(le)) {
-                endsVisited = false;
-                break;
-            }
-        }
-        if (endsVisited) {
-            ArrayList<T> states = new ArrayList<>(begin.loopEnds().count());
-            for (LoopEndNode le : begin.orderedLoopEnds()) {
-                states.add(nodeStates.get(le));
-            }
-            T loopBeginState = nodeStates.get(begin);
-            if (loopBeginState != null) {
-                loopBeginState.loopEnds(begin, states);
-            }
-        }
-    }
-
-    protected abstract void node(ScheduledNode node);
-
-    protected void end(EndNode endNode) {
-        node(endNode);
-    }
-
-    protected void merge(MergeNode merge) {
-        node(merge);
-    }
-
-    protected void loopBegin(LoopBeginNode loopBegin) {
-        node(loopBegin);
-    }
-
-    protected void loopEnd(LoopEndNode loopEnd) {
-        node(loopEnd);
-    }
-
-    protected void controlSplit(ControlSplitNode controlSplit) {
-        node(controlSplit);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/ArrayMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.util;
-
-/**
- * The {@code ArrayMap} class implements an efficient one-level map which is implemented
- * as an array. Note that because of the one-level array inside, this data structure performs best
- * when the range of integer keys is small and densely used. Note that the implementation can
- * handle arbitrary intervals, including negative numbers, up to intervals of size 2^31 - 1.
- */
-public class ArrayMap<T> {
-
-    private static final int INITIAL_SIZE = 5; // how big the initial array should be
-    private static final int EXTRA = 2; // how far on the left or right of a new element to grow
-
-    Object[] map;
-    int low;
-
-    /**
-     * Constructs a new {@code ArrayMap} with no initial assumptions.
-     */
-    public ArrayMap() {
-    }
-
-    /**
-     * Constructs a new {@code ArrayMap} that initially covers the specified interval.
-     * Note that this map will automatically expand if necessary later.
-     * @param low the low index, inclusive
-     * @param high the high index, exclusive
-     */
-    public ArrayMap(int low, int high) {
-        this.low = low;
-        this.map = new Object[high - low + 1];
-    }
-
-    /**
-     * Puts a new value in the map at the specified index.
-     * @param i the index at which to store the value
-     * @param value the value to store at the specified index
-     */
-    public void put(int i, T value) {
-        int index = i - low;
-        if (map == null) {
-            // no map yet
-            map = new Object[INITIAL_SIZE];
-            low = index - 2;
-            map[INITIAL_SIZE / 2] = value;
-        } else if (index < 0) {
-            // grow backwards
-            growBackward(i, value);
-        } else if (index >= map.length) {
-            // grow forwards
-            growForward(i, value);
-        } else {
-            // no growth necessary
-            map[index] = value;
-        }
-    }
-
-    /**
-     * Gets the value at the specified index in the map.
-     * @param i the index
-     * @return the value at the specified index; {@code null} if there is no value at the specified index,
-     * or if the index is out of the currently stored range
-     */
-    public T get(int i) {
-        int index = i - low;
-        if (map == null || index < 0 || index >= map.length) {
-            return null;
-        }
-        Class<T> type = null;
-        return Util.uncheckedCast(type, map[index]);
-    }
-
-    public int length() {
-        return map.length;
-    }
-
-    private void growBackward(int i, T value) {
-        int nlow = i - EXTRA;
-        Object[] nmap = new Object[low - nlow + map.length];
-        System.arraycopy(map, 0, nmap, low - nlow, map.length);
-        map = nmap;
-        low = nlow;
-        map[i - low] = value;
-    }
-
-    private void growForward(int i, T value) {
-        int nlen = i - low + 1 + EXTRA;
-        Object[] nmap = new Object[nlen];
-        System.arraycopy(map, 0, nmap, 0, map.length);
-        map = nmap;
-        map[i - low] = value;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/BitMap2D.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.util;
-
-import com.oracle.graal.graph.*;
-
-/**
- * This class implements a two-dimensional bitmap.
- */
-public final class BitMap2D {
-
-    private BitMap map;
-    private final int bitsPerSlot;
-
-    private int bitIndex(int slotIndex, int bitWithinSlotIndex)  {
-      return slotIndex * bitsPerSlot + bitWithinSlotIndex;
-    }
-
-    private boolean verifyBitWithinSlotIndex(int index)  {
-      assert index < bitsPerSlot : "index " + index + " is out of bounds " + bitsPerSlot;
-      return true;
-    }
-
-    public BitMap2D(int sizeInSlots, int bitsPerSlot) {
-        map = new BitMap(sizeInSlots * bitsPerSlot);
-        this.bitsPerSlot = bitsPerSlot;
-    }
-
-    public int sizeInBits() {
-      return map.size();
-    }
-
-    // Returns number of full slots that have been allocated
-    public int sizeInSlots() {
-      return map.size() / bitsPerSlot;
-    }
-
-    public boolean isValidIndex(int slotIndex, int bitWithinSlotIndex) {
-      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
-      return (bitIndex(slotIndex, bitWithinSlotIndex) < sizeInBits());
-    }
-
-    public boolean at(int slotIndex, int bitWithinSlotIndex)  {
-      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
-      return map.get(bitIndex(slotIndex, bitWithinSlotIndex));
-    }
-
-    public void setBit(int slotIndex, int bitWithinSlotIndex) {
-      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
-      map.set(bitIndex(slotIndex, bitWithinSlotIndex));
-    }
-
-    public void clearBit(int slotIndex, int bitWithinSlotIndex) {
-      assert verifyBitWithinSlotIndex(bitWithinSlotIndex);
-      map.clear(bitIndex(slotIndex, bitWithinSlotIndex));
-    }
-
-    public void atPutGrow(int slotIndex, int bitWithinSlotIndex, boolean value) {
-       int size = sizeInSlots();
-       if (size <= slotIndex) {
-           while (size <= slotIndex) {
-               size *= 2;
-           }
-           BitMap newBitMap = new BitMap(size * bitsPerSlot);
-           newBitMap.setUnion(map);
-           map = newBitMap;
-       }
-
-       if (value) {
-           setBit(slotIndex, bitWithinSlotIndex);
-       } else {
-           clearBit(slotIndex, bitWithinSlotIndex);
-       }
-    }
-
-    public void clear() {
-        map.clearAll();
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/BlockWorkList.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.util;
-
-import com.oracle.graal.nodes.*;
-
-/**
- * This class implements a worklist for dealing with blocks. The worklist can
- * operate either as a stack (i.e. first-in / last-out), or as a sorted list,
- * where blocks can be sorted by a supplied number. The latter usage lends itself
- * naturally to iterative dataflow analysis problems.
- *
- * This implementation is not able to tell if a block is in the worklist already.
- * Note that this implementation is slightly less efficient than the dedicated
- * work list in {@link com.oracle.graal.compiler.graph.ScopeData}, because this worklist uses
- * an externally supplied number.
- */
-public class BlockWorkList {
-    MergeNode[] workList;
-    int[] workListNumbers;
-    int workListIndex;
-
-    /**
-     * Adds a block to this list in an unsorted fashion, like a stack.
-     * @param block the block to add
-     */
-    public void add(MergeNode block) {
-        if (workList == null) {
-            // worklist not allocated yet
-            allocate();
-        } else if (workListIndex == workList.length) {
-            // need to grow the worklist
-            grow();
-        }
-        // put the block at the end of the array
-        workList[workListIndex++] = block;
-    }
-
-    /**
-     * Adds a block to this list, sorted by the supplied number. The block
-     * with the lowest number is returned upon subsequent removes.
-     * @param block the block to add
-     * @param number the number used to sort the block
-     */
-    public void addSorted(MergeNode block, int number) {
-        if (workList == null) {
-            // worklist not allocated yet
-            allocate();
-        } else if (workListIndex == workList.length) {
-            // need to grow the worklist
-            grow();
-        }
-        // put the block at the end of the array
-        workList[workListIndex] = block;
-        workListNumbers[workListIndex] = number;
-        workListIndex++;
-        int i = workListIndex - 2;
-        // push block towards the beginning of the array
-        for (; i >= 0; i--) {
-            int n = workListNumbers[i];
-            if (n >= number) {
-                break; // already in the right position
-            }
-            workList[i + 1] = workList[i]; // bubble b down by one
-            workList[i] = block;           // and overwrite its place with block
-            workListNumbers[i + 1] = n;    // bubble n down by one
-            workListNumbers[i] = number;   // and overwrite its place with number
-        }
-    }
-
-    /**
-     * Removes the next block from this work list. If the blocks have been added
-     * in a sorted order, then the block with the lowest number is returned. Otherwise,
-     * the last block added is returned.
-     * @return the next block in the list
-     */
-    public MergeNode removeFromWorkList() {
-        if (workListIndex != 0) {
-            return workList[--workListIndex];
-        }
-        return null;
-    }
-
-    /**
-     * Checks whether the list is empty.
-     * @return {@code true} if this list is empty
-     */
-    public boolean isEmpty() {
-        return workListIndex == 0;
-    }
-
-    private void allocate() {
-        workList = new MergeNode[5];
-        workListNumbers = new int[5];
-    }
-
-    private void grow() {
-        int prevLength = workList.length;
-        MergeNode[] nworkList = new MergeNode[prevLength * 3];
-        System.arraycopy(workList, 0, nworkList, 0, prevLength);
-        workList = nworkList;
-
-        int[] nworkListNumbers = new int[prevLength * 3];
-        System.arraycopy(workListNumbers, 0, nworkListNumbers, 0, prevLength);
-        workListNumbers = nworkListNumbers;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/GraphOrder.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.util;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-public class GraphOrder implements Iterable<Node> {
-
-    private final ArrayList<Node> nodes = new ArrayList<>();
-
-    private GraphOrder() {
-    }
-
-    public GraphOrder(Graph graph) {
-        NodeBitMap visited = graph.createNodeBitMap();
-
-        for (ReturnNode node : graph.getNodes(ReturnNode.class)) {
-            visitForward(visited, node);
-        }
-        for (UnwindNode node : graph.getNodes(UnwindNode.class)) {
-            visitForward(visited, node);
-        }
-        for (DeoptimizeNode node : graph.getNodes(DeoptimizeNode.class)) {
-            visitForward(visited, node);
-        }
-    }
-
-    public static GraphOrder forwardGraph(Graph graph) {
-        GraphOrder result = new GraphOrder();
-
-        NodeBitMap visited = graph.createNodeBitMap();
-
-        for (ReturnNode node : graph.getNodes(ReturnNode.class)) {
-            result.visitForward(visited, node);
-        }
-        for (UnwindNode node : graph.getNodes(UnwindNode.class)) {
-            result.visitForward(visited, node);
-        }
-        for (DeoptimizeNode node : graph.getNodes(DeoptimizeNode.class)) {
-            result.visitForward(visited, node);
-        }
-        return result;
-    }
-
-    public static GraphOrder backwardGraph(Graph graph) {
-        GraphOrder result = new GraphOrder();
-
-        NodeBitMap visited = graph.createNodeBitMap();
-
-        for (Node node : forwardGraph(graph)) {
-            result.visitBackward(visited, node);
-        }
-        return result;
-    }
-
-    private void visitForward(NodeBitMap visited, Node node) {
-        if (node != null && !visited.isMarked(node)) {
-            visited.mark(node);
-            if (node.predecessor() != null) {
-                visitForward(visited, node.predecessor());
-            }
-            if (node instanceof MergeNode) {
-                // make sure that the cfg predecessors of a MergeNode are processed first
-                MergeNode merge = (MergeNode) node;
-                for (int i = 0; i < merge.forwardEndCount(); i++) {
-                    visitForward(visited, merge.forwardEndAt(i));
-                }
-            }
-            for (Node input : node.inputs()) {
-                visitForward(visited, input);
-            }
-            nodes.add(node);
-        }
-    }
-
-    private void visitBackward(NodeBitMap visited, Node node) {
-        if (node != null && !visited.isMarked(node)) {
-            visited.mark(node);
-            for (Node successor : node.successors()) {
-                visitBackward(visited, successor);
-            }
-            for (Node usage : node.usages()) {
-                visitBackward(visited, usage);
-            }
-            nodes.add(node);
-        }
-    }
-
-    @Override
-    public Iterator<Node> iterator() {
-        return new Iterator<Node>() {
-
-            private int pos = 0;
-
-            private void removeDeleted() {
-                while (pos < nodes.size() && nodes.get(pos).isDeleted()) {
-                    pos++;
-                }
-            }
-
-            @Override
-            public boolean hasNext() {
-                removeDeleted();
-                return pos < nodes.size();
-            }
-
-            @Override
-            public Node next() {
-                return nodes.get(pos++);
-            }
-
-            @Override
-            public void remove() {
-                throw new UnsupportedOperationException();
-            }
-        };
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,906 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.util;
-
-import java.lang.reflect.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.ri.RiType.Representation;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.oracle.graal.nodes.PhiNode.PhiType;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind;
-import com.oracle.graal.nodes.util.*;
-
-public class InliningUtil {
-
-    public interface InliningCallback {
-        StructuredGraph buildGraph(RiResolvedMethod method);
-        double inliningWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke);
-        void recordMethodContentsAssumption(RiResolvedMethod method);
-        void recordConcreteMethodAssumption(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl);
-    }
-
-    public static String methodName(RiResolvedMethod method) {
-        return CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
-    }
-
-    private static String methodName(RiResolvedMethod method, Invoke invoke) {
-        if (Debug.isLogEnabled()) {
-            if (invoke != null && invoke.stateAfter() != null) {
-                RiMethod parent = invoke.stateAfter().method();
-                return parent.name() + "@" + invoke.bci() + ": " + CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
-            } else {
-                return CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
-            }
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Represents an opportunity for inlining at the given invoke, with the given weight and level.
-     * The weight is the amortized weight of the additional code - so smaller is better.
-     * The level is the number of nested inlinings that lead to this invoke.
-     */
-    public abstract static class InlineInfo implements Comparable<InlineInfo> {
-        public final Invoke invoke;
-        public final double weight;
-        public final int level;
-
-        public InlineInfo(Invoke invoke, double weight, int level) {
-            this.invoke = invoke;
-            this.weight = weight;
-            this.level = level;
-        }
-
-        public abstract int compiledCodeSize();
-
-        @Override
-        public int compareTo(InlineInfo o) {
-            return (weight < o.weight) ? -1 : (weight > o.weight) ? 1 : 0;
-        }
-
-        protected static StructuredGraph getGraph(final RiResolvedMethod concrete, final InliningCallback callback) {
-            return Debug.scope("Inlining", concrete, new Callable<StructuredGraph>() {
-                @Override
-                public StructuredGraph call() throws Exception {
-                    return callback.buildGraph(concrete);
-                }
-            });
-        }
-
-        public abstract boolean canDeopt();
-
-        /**
-         * Performs the inlining described by this object and returns the node that represents the return value of the
-         * inlined method (or null for void methods and methods that have no non-exceptional exit).
-         *
-         * @param graph
-         * @param runtime
-         * @param callback
-         */
-        public abstract void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback);
-    }
-
-    /**
-     * Represents an inlining opportunity where the compiler can statically determine a monomorphic target method and
-     * therefore is able to determine the called method exactly.
-     */
-    private static class ExactInlineInfo extends InlineInfo {
-        public final RiResolvedMethod concrete;
-
-        public ExactInlineInfo(Invoke invoke, double weight, int level, RiResolvedMethod concrete) {
-            super(invoke, weight, level);
-            this.concrete = concrete;
-        }
-
-        @Override
-        public void inline(StructuredGraph compilerGraph, GraalRuntime runtime, final InliningCallback callback) {
-            StructuredGraph graph = getGraph(concrete, callback);
-            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
-            callback.recordMethodContentsAssumption(concrete);
-            InliningUtil.inline(invoke, graph, true);
-        }
-
-        @Override
-        public int compiledCodeSize() {
-            return concrete.compiledCodeSize();
-        }
-
-        @Override
-        public String toString() {
-            return "exact " + CiUtil.format("%H.%n(%p):%r", concrete);
-        }
-
-        @Override
-        public boolean canDeopt() {
-            return false;
-        }
-    }
-
-    /**
-     * Represents an inlining opportunity for which profiling information suggests a monomorphic receiver, but for which
-     * the receiver type cannot be proven. A type check guard will be generated if this inlining is performed.
-     */
-    private static class TypeGuardInlineInfo extends InlineInfo {
-        public final RiResolvedMethod concrete;
-        public final RiResolvedType type;
-
-        public TypeGuardInlineInfo(Invoke invoke, double weight, int level, RiResolvedMethod concrete, RiResolvedType type) {
-            super(invoke, weight, level);
-            this.concrete = concrete;
-            this.type = type;
-        }
-
-        @Override
-        public int compiledCodeSize() {
-            return concrete.compiledCodeSize();
-        }
-
-        @Override
-        public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
-            // receiver null check must be before the type check
-            InliningUtil.receiverNullCheck(invoke);
-            ValueNode receiver = invoke.callTarget().receiver();
-            ReadHubNode objectClass = graph.add(new ReadHubNode(receiver));
-            IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClass, type));
-            FixedGuardNode guard = graph.add(new FixedGuardNode(isTypeNode));
-            AnchorNode anchor = graph.add(new AnchorNode());
-            assert invoke.predecessor() != null;
-
-            CheckCastNode checkCast = createAnchoredReceiver(graph, runtime, anchor, type, receiver);
-            invoke.callTarget().replaceFirstInput(receiver, checkCast);
-
-            graph.addBeforeFixed(invoke.node(), objectClass);
-            graph.addBeforeFixed(invoke.node(), guard);
-            graph.addBeforeFixed(invoke.node(), anchor);
-
-            StructuredGraph calleeGraph = getGraph(concrete, callback);
-            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
-            callback.recordMethodContentsAssumption(concrete);
-            InliningUtil.inline(invoke, calleeGraph, false);
-        }
-
-        @Override
-        public String toString() {
-            return "type-checked " + CiUtil.format("%H.%n(%p):%r", concrete);
-        }
-
-        @Override
-        public boolean canDeopt() {
-            return true;
-        }
-    }
-
-    /**
-     * Polymorphic inlining of m methods with n type checks (n >= m) in case that the profiling information suggests a reasonable
-     * amounts of different receiver types and different methods. If an unknown type is encountered a deoptimization is triggered.
-     */
-    private static class MultiTypeGuardInlineInfo extends InlineInfo {
-        public final List<RiResolvedMethod> concretes;
-        public final RiResolvedType[] types;
-        public final int[] typesToConcretes;
-        public final double[] typeProbabilities;
-        public final double notRecordedTypeProbability;
-
-        public MultiTypeGuardInlineInfo(Invoke invoke, double weight, int level, List<RiResolvedMethod> concretes, RiResolvedType[] types,
-                        int[] typesToConcretes, double[] typeProbabilities, double notRecordedTypeProbability) {
-            super(invoke, weight, level);
-            assert concretes.size() > 0 && concretes.size() <= types.length : "must have at least one method but no more than types methods";
-            assert types.length == typesToConcretes.length && types.length == typeProbabilities.length : "array length must match";
-
-            this.concretes = concretes;
-            this.types = types;
-            this.typesToConcretes = typesToConcretes;
-            this.typeProbabilities = typeProbabilities;
-            this.notRecordedTypeProbability = notRecordedTypeProbability;
-        }
-
-        @Override
-        public int compiledCodeSize() {
-            int result = 0;
-            for (RiResolvedMethod m: concretes) {
-                result += m.compiledCodeSize();
-            }
-            return result;
-        }
-
-        @Override
-        public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
-            int numberOfMethods = concretes.size();
-            boolean hasReturnValue = invoke.node().kind() != CiKind.Void;
-
-            // receiver null check must be the first node
-            InliningUtil.receiverNullCheck(invoke);
-            if (numberOfMethods > 1 || shouldFallbackToInvoke()) {
-                inlineMultipleMethods(graph, runtime, callback, numberOfMethods, hasReturnValue);
-            } else {
-                inlineSingleMethod(graph, runtime, callback);
-            }
-        }
-
-        private boolean shouldFallbackToInvoke() {
-            return notRecordedTypeProbability > 0;
-        }
-
-        private void inlineMultipleMethods(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback, int numberOfMethods, boolean hasReturnValue) {
-            FixedNode continuation = invoke.next();
-
-            // setup merge and phi nodes for results and exceptions
-            MergeNode returnMerge = graph.add(new MergeNode());
-            returnMerge.setProbability(invoke.probability());
-            returnMerge.setStateAfter(invoke.stateAfter().duplicate(invoke.stateAfter().bci));
-
-            PhiNode returnValuePhi = null;
-            if (hasReturnValue) {
-                returnValuePhi = graph.unique(new PhiNode(invoke.node().kind(), returnMerge, PhiType.Value));
-            }
-
-            MergeNode exceptionMerge = null;
-            PhiNode exceptionObjectPhi = null;
-            if (invoke instanceof InvokeWithExceptionNode) {
-                InvokeWithExceptionNode invokeWithException = (InvokeWithExceptionNode) invoke;
-                BeginNode exceptionEdge = invokeWithException.exceptionEdge();
-                ExceptionObjectNode exceptionObject = (ExceptionObjectNode) exceptionEdge.next();
-
-                exceptionMerge = graph.add(new MergeNode());
-                exceptionMerge.setProbability(exceptionEdge.probability());
-
-                FixedNode exceptionSux = exceptionObject.next();
-                graph.addBeforeFixed(exceptionSux, exceptionMerge);
-                exceptionObjectPhi = graph.unique(new PhiNode(CiKind.Object, exceptionMerge, PhiType.Value));
-                exceptionMerge.setStateAfter(exceptionEdge.stateAfter().duplicateModified(invoke.stateAfter().bci, true, CiKind.Void, exceptionObjectPhi));
-            }
-
-            // create one separate block for each invoked method
-            BeginNode[] calleeEntryNodes = new BeginNode[numberOfMethods];
-            for (int i = 0; i < numberOfMethods; i++) {
-                int predecessors = 0;
-                double probability = 0;
-                for (int j = 0; j < typesToConcretes.length; j++) {
-                    if (typesToConcretes[j] == i) {
-                        predecessors++;
-                        probability += typeProbabilities[j];
-                    }
-                }
-
-                calleeEntryNodes[i] = createInvocationBlock(graph, invoke, returnMerge, returnValuePhi, exceptionMerge, exceptionObjectPhi, predecessors, invoke.probability() * probability, true);
-            }
-
-            // create the successor for an unknown type
-            FixedNode unknownTypeNode;
-            if (shouldFallbackToInvoke()) {
-                unknownTypeNode = createInvocationBlock(graph, invoke, returnMerge, returnValuePhi, exceptionMerge, exceptionObjectPhi, 1, notRecordedTypeProbability, false);
-            } else {
-                unknownTypeNode = graph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile));
-            }
-
-            // replace the invoke exception edge
-            if (invoke instanceof InvokeWithExceptionNode) {
-                InvokeWithExceptionNode invokeWithExceptionNode = (InvokeWithExceptionNode) invoke;
-                BeginNode exceptionEdge = invokeWithExceptionNode.exceptionEdge();
-                ExceptionObjectNode exceptionObject = (ExceptionObjectNode) exceptionEdge.next();
-                exceptionObject.replaceAtUsages(exceptionObjectPhi);
-                exceptionObject.setNext(null);
-                GraphUtil.killCFG(invokeWithExceptionNode.exceptionEdge());
-            }
-
-            // replace the invoke with a cascade of if nodes
-            ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver()));
-            graph.addBeforeFixed(invoke.node(), objectClassNode);
-            FixedNode dispatchOnType = createDispatchOnType(graph, objectClassNode, calleeEntryNodes, unknownTypeNode);
-
-            assert invoke.next() == continuation;
-            invoke.setNext(null);
-            returnMerge.setNext(continuation);
-            invoke.node().replaceAtUsages(returnValuePhi);
-            invoke.node().replaceAndDelete(dispatchOnType);
-
-            // do the actual inlining for every invoke
-            for (int i = 0; i < calleeEntryNodes.length; i++) {
-                BeginNode node = calleeEntryNodes[i];
-                Invoke invokeForInlining = (Invoke) node.next();
-
-                RiResolvedType commonType = getLeastCommonType(i);
-                ValueNode receiver = invokeForInlining.callTarget().receiver();
-                CheckCastNode checkCast = createAnchoredReceiver(graph, runtime, node, commonType, receiver);
-                invokeForInlining.callTarget().replaceFirstInput(receiver, checkCast);
-
-                RiResolvedMethod concrete = concretes.get(i);
-                StructuredGraph calleeGraph = getGraph(concrete, callback);
-                callback.recordMethodContentsAssumption(concrete);
-                assert !IntrinsificationPhase.canIntrinsify(invokeForInlining, concrete, runtime);
-                InliningUtil.inline(invokeForInlining, calleeGraph, false);
-            }
-        }
-
-        private RiResolvedType getLeastCommonType(int concreteMethodIndex) {
-            RiResolvedType commonType = null;
-            for (int i = 0; i < typesToConcretes.length; i++) {
-                if (typesToConcretes[i] == concreteMethodIndex) {
-                    if (commonType == null) {
-                        commonType = types[i];
-                    } else {
-                        commonType = commonType.leastCommonAncestor(types[i]);
-                    }
-                }
-            }
-            assert commonType != null;
-            return commonType;
-        }
-
-        private void inlineSingleMethod(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
-            assert concretes.size() == 1 && types.length > 1 && !shouldFallbackToInvoke() && notRecordedTypeProbability == 0;
-
-            MergeNode calleeEntryNode = graph.add(new MergeNode());
-            calleeEntryNode.setProbability(invoke.probability());
-            ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver()));
-            graph.addBeforeFixed(invoke.node(), objectClassNode);
-
-            FixedNode unknownTypeNode = graph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile));
-            FixedNode dispatchOnType = createDispatchOnType(graph, objectClassNode, new BeginNode[] {calleeEntryNode}, unknownTypeNode);
-
-            FixedWithNextNode pred = (FixedWithNextNode) invoke.node().predecessor();
-            pred.setNext(dispatchOnType);
-            calleeEntryNode.setNext(invoke.node());
-
-            RiResolvedMethod concrete = concretes.get(0);
-            StructuredGraph calleeGraph = getGraph(concrete, callback);
-            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
-            callback.recordMethodContentsAssumption(concrete);
-            InliningUtil.inline(invoke, calleeGraph, false);
-        }
-
-        private FixedNode createDispatchOnType(StructuredGraph graph, ReadHubNode objectClassNode, BeginNode[] calleeEntryNodes, FixedNode unknownTypeSux) {
-            assert types.length > 1;
-
-            int lastIndex = types.length - 1;
-            double[] branchProbabilities = convertTypeToBranchProbabilities(typeProbabilities, notRecordedTypeProbability);
-            double nodeProbability = typeProbabilities[lastIndex];
-            IfNode nextNode = createTypeCheck(graph, objectClassNode, types[lastIndex], calleeEntryNodes[typesToConcretes[lastIndex]], unknownTypeSux, branchProbabilities[lastIndex], invoke.probability() * nodeProbability);
-            for (int i = lastIndex - 1; i >= 0; i--) {
-                nodeProbability += typeProbabilities[i];
-                nextNode = createTypeCheck(graph, objectClassNode, types[i], calleeEntryNodes[typesToConcretes[i]], nextNode, branchProbabilities[i], invoke.probability() * nodeProbability);
-            }
-
-            return nextNode;
-        }
-
-        private static IfNode createTypeCheck(StructuredGraph graph, ReadHubNode objectClassNode, RiResolvedType type, BeginNode tsux, FixedNode nextNode, double tsuxProbability, double probability) {
-            IfNode result;
-            IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClassNode, type));
-            if (tsux instanceof MergeNode) {
-                EndNode endNode = graph.add(new EndNode());
-                result = graph.add(new IfNode(isTypeNode, endNode, nextNode, tsuxProbability));
-                ((MergeNode) tsux).addForwardEnd(endNode);
-            } else {
-                result = graph.add(new IfNode(isTypeNode, tsux, nextNode, tsuxProbability));
-            }
-            result.setProbability(probability);
-            return result;
-        }
-
-        private static double[] convertTypeToBranchProbabilities(double[] typeProbabilities, double notRecordedTypeProbability) {
-            double[] result = new double[typeProbabilities.length];
-            double total = notRecordedTypeProbability;
-            for (int i = typeProbabilities.length - 1; i >= 0; i--) {
-                total += typeProbabilities[i];
-                result[i] = typeProbabilities[i] / total;
-            }
-            assert total > 0.99 && total < 1.01;
-            return result;
-        }
-
-        private static BeginNode createInvocationBlock(StructuredGraph graph, Invoke invoke, MergeNode returnMerge, PhiNode returnValuePhi,
-                        MergeNode exceptionMerge, PhiNode exceptionObjectPhi, int predecessors, double probability, boolean useForInlining) {
-            Invoke duplicatedInvoke = duplicateInvokeForInlining(graph, invoke, exceptionMerge, exceptionObjectPhi, useForInlining, probability);
-            BeginNode calleeEntryNode = graph.add(predecessors > 1 ? new MergeNode() : new BeginNode());
-            calleeEntryNode.setNext(duplicatedInvoke.node());
-            calleeEntryNode.setProbability(probability);
-
-            EndNode endNode = graph.add(new EndNode());
-            endNode.setProbability(probability);
-
-            duplicatedInvoke.setNext(endNode);
-            returnMerge.addForwardEnd(endNode);
-
-            if (returnValuePhi != null) {
-                returnValuePhi.addInput(duplicatedInvoke.node());
-            }
-            return calleeEntryNode;
-        }
-
-        private static Invoke duplicateInvokeForInlining(StructuredGraph graph, Invoke invoke, MergeNode exceptionMerge, PhiNode exceptionObjectPhi, boolean useForInlining, double probability) {
-            Invoke result = (Invoke) invoke.node().copyWithInputs();
-            Node callTarget = result.callTarget().copyWithInputs();
-            result.node().replaceFirstInput(result.callTarget(), callTarget);
-            result.setUseForInlining(useForInlining);
-            result.setProbability(probability);
-
-            CiKind kind = invoke.node().kind();
-            if (!kind.isVoid()) {
-                FrameState stateAfter = invoke.stateAfter();
-                stateAfter = stateAfter.duplicate(stateAfter.bci);
-                stateAfter.replaceFirstInput(invoke.node(), result.node());
-                result.setStateAfter(stateAfter);
-            }
-
-            if (invoke instanceof InvokeWithExceptionNode) {
-                assert exceptionMerge != null && exceptionObjectPhi != null;
-
-                InvokeWithExceptionNode invokeWithException = (InvokeWithExceptionNode) invoke;
-                BeginNode exceptionEdge = invokeWithException.exceptionEdge();
-                ExceptionObjectNode exceptionObject = (ExceptionObjectNode) exceptionEdge.next();
-                FrameState stateAfterException = exceptionObject.stateAfter();
-
-                BeginNode newExceptionEdge = (BeginNode) exceptionEdge.copyWithInputs();
-                ExceptionObjectNode newExceptionObject = (ExceptionObjectNode) exceptionObject.copyWithInputs();
-                // set new state (pop old exception object, push new one)
-                newExceptionObject.setStateAfter(stateAfterException.duplicateModified(stateAfterException.bci, stateAfterException.rethrowException(), CiKind.Object, newExceptionObject));
-                newExceptionEdge.setNext(newExceptionObject);
-
-                EndNode endNode = graph.add(new EndNode());
-                newExceptionObject.setNext(endNode);
-                exceptionMerge.addForwardEnd(endNode);
-                exceptionObjectPhi.addInput(newExceptionObject);
-
-                ((InvokeWithExceptionNode) result).setExceptionEdge(newExceptionEdge);
-            }
-            return result;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder builder = new StringBuilder(shouldFallbackToInvoke() ? "megamorphic" : "polymorphic");
-            builder.append(String.format(", %d methods with %d type checks:", concretes.size(), types.length));
-            for (int i = 0; i < concretes.size(); i++) {
-                builder.append(CiUtil.format("  %H.%n(%p):%r", concretes.get(i)));
-            }
-            return builder.toString();
-        }
-
-        @Override
-        public boolean canDeopt() {
-            return true;
-        }
-    }
-
-
-    /**
-     * Represents an inlining opportunity where the current class hierarchy leads to a monomorphic target method,
-     * but for which an assumption has to be registered because of non-final classes.
-     */
-    private static class AssumptionInlineInfo extends ExactInlineInfo {
-        public final RiResolvedType context;
-
-        public AssumptionInlineInfo(Invoke invoke, double weight, int level, RiResolvedType context, RiResolvedMethod concrete) {
-            super(invoke, weight, level, concrete);
-            this.context = context;
-        }
-
-        @Override
-        public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
-            if (Debug.isLogEnabled()) {
-                String targetName = CiUtil.format("%H.%n(%p):%r", invoke.callTarget().targetMethod());
-                String concreteName = CiUtil.format("%H.%n(%p):%r", concrete);
-                Debug.log("recording concrete method assumption: %s on receiver type %s -> %s", targetName, context, concreteName);
-            }
-            callback.recordConcreteMethodAssumption(invoke.callTarget().targetMethod(), context, concrete);
-
-            super.inline(graph, runtime, callback);
-        }
-
-        @Override
-        public String toString() {
-            return "assumption " + CiUtil.format("%H.%n(%p):%r", concrete);
-        }
-
-        @Override
-        public boolean canDeopt() {
-            return true;
-        }
-    }
-
-    /**
-     * Determines if inlining is possible at the given invoke node.
-     * @param invoke the invoke that should be inlined
-     * @param level the number of nested inlinings that lead to this invoke, or 0 if the invoke was part of the initial graph
-     * @param runtime a GraalRuntime instance used to determine of the invoke can be inlined and/or should be intrinsified
-     * @param callback a callback that is used to determine the weight of a specific inlining
-     * @return an instance of InlineInfo, or null if no inlining is possible at the given invoke
-     */
-    public static InlineInfo getInlineInfo(Invoke invoke, int level, GraalRuntime runtime, CiAssumptions assumptions, InliningCallback callback) {
-        if (!checkInvokeConditions(invoke)) {
-            return null;
-        }
-        RiResolvedMethod parent = invoke.stateAfter().method();
-        MethodCallTargetNode callTarget = invoke.callTarget();
-        RiResolvedMethod targetMethod = callTarget.targetMethod();
-
-        if (targetMethod == null) {
-            return null;
-        }
-        if (callTarget.invokeKind() == InvokeKind.Special || targetMethod.canBeStaticallyBound()) {
-            if (checkTargetConditions(invoke, targetMethod)) {
-                double weight = callback == null ? 0 : callback.inliningWeight(parent, targetMethod, invoke);
-                return new ExactInlineInfo(invoke, weight, level, targetMethod);
-            }
-            return null;
-        }
-        if (callTarget.receiver().exactType() != null) {
-            RiResolvedType exact = callTarget.receiver().exactType();
-            assert exact.isSubtypeOf(targetMethod.holder()) : exact + " subtype of " + targetMethod.holder() + " for " + targetMethod;
-            RiResolvedMethod resolved = exact.resolveMethodImpl(targetMethod);
-            if (checkTargetConditions(invoke, resolved)) {
-                double weight = callback == null ? 0 : callback.inliningWeight(parent, resolved, invoke);
-                return new ExactInlineInfo(invoke, weight, level, resolved);
-            }
-            return null;
-        }
-        RiResolvedType holder = targetMethod.holder();
-
-        if (callTarget.receiver().declaredType() != null) {
-            RiResolvedType declared = callTarget.receiver().declaredType();
-            // the invoke target might be more specific than the holder (happens after inlining: locals lose their declared type...)
-            // TODO (lstadler) fix this
-            if (declared != null && declared.isSubtypeOf(holder)) {
-                holder = declared;
-            }
-        }
-        // TODO (thomaswue) fix this
-        if (assumptions != null) {
-            RiResolvedMethod concrete = holder.uniqueConcreteMethod(targetMethod);
-            if (concrete != null) {
-                if (checkTargetConditions(invoke, concrete)) {
-                    double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
-                    return new AssumptionInlineInfo(invoke, weight, level, holder, concrete);
-                }
-                return null;
-            }
-        }
-
-        // type check based inlining
-        RiProfilingInfo profilingInfo = parent.profilingInfo();
-        RiTypeProfile typeProfile = profilingInfo.getTypeProfile(invoke.bci());
-        if (typeProfile != null) {
-            RiResolvedType[] types = typeProfile.getTypes();
-            double[] probabilities = typeProfile.getProbabilities();
-
-            if (types != null && probabilities != null && types.length > 0) {
-                assert types.length == probabilities.length : "length must match";
-                double notRecordedTypeProbability = typeProfile.getNotRecordedProbability();
-                if (types.length == 1 && notRecordedTypeProbability == 0) {
-                    if (GraalOptions.InlineMonomorphicCalls) {
-                        RiResolvedType type = types[0];
-                        RiResolvedMethod concrete = type.resolveMethodImpl(targetMethod);
-                        if (checkTargetConditions(invoke, concrete)) {
-                            double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
-                            return new TypeGuardInlineInfo(invoke, weight, level, concrete, type);
-                        }
-
-                        Debug.log("not inlining %s because method can't be inlined", methodName(targetMethod, invoke));
-                        return null;
-                    } else {
-                        Debug.log("not inlining %s because GraalOptions.InlineMonomorphicCalls == false", methodName(targetMethod, invoke));
-                        return null;
-                    }
-                } else {
-                    invoke.setMegamorph(true);
-                    if (GraalOptions.InlinePolymorphicCalls && notRecordedTypeProbability == 0 || GraalOptions.InlineMegamorphicCalls && notRecordedTypeProbability > 0) {
-                        // TODO (chaeubl) inlining of multiple methods should work differently
-                        // 1. check which methods can be inlined
-                        // 2. for those methods, use weight and probability to compute which of them should be inlined
-                        // 3. do the inlining
-                        //    a) all seen methods can be inlined -> do so and guard with deopt
-                        //    b) some methods can be inlined -> inline them and fall back to invocation if violated
-                        // TODO (chaeubl) sort types by probability
-
-                        // determine concrete methods and map type to specific method
-                        ArrayList<RiResolvedMethod> concreteMethods = new ArrayList<>();
-                        int[] typesToConcretes = new int[types.length];
-                        for (int i = 0; i < types.length; i++) {
-                            RiResolvedMethod concrete = types[i].resolveMethodImpl(targetMethod);
-
-                            int index = concreteMethods.indexOf(concrete);
-                            if (index < 0) {
-                                index = concreteMethods.size();
-                                concreteMethods.add(concrete);
-                            }
-                            typesToConcretes[i] = index;
-                        }
-
-                        double totalWeight = 0;
-                        boolean canInline = true;
-                        for (RiResolvedMethod concrete: concreteMethods) {
-                            if (!checkTargetConditions(invoke, concrete)) {
-                                canInline = false;
-                                break;
-                            }
-                            totalWeight += callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
-                        }
-
-                        if (canInline) {
-                            return new MultiTypeGuardInlineInfo(invoke, totalWeight, level, concreteMethods, types, typesToConcretes, probabilities, notRecordedTypeProbability);
-                        } else {
-                            Debug.log("not inlining %s because it is a polymorphic method call and at least one invoked method cannot be inlined", methodName(targetMethod, invoke));
-                            return null;
-                        }
-                    } else {
-                        if (!GraalOptions.InlinePolymorphicCalls && notRecordedTypeProbability == 0) {
-                            Debug.log("not inlining %s because GraalOptions.InlinePolymorphicCalls == false", methodName(targetMethod, invoke));
-                        } else {
-                            Debug.log("not inlining %s because GraalOptions.InlineMegamorphicCalls == false", methodName(targetMethod, invoke));
-                        }
-                        return null;
-                    }
-                }
-            }
-
-            Debug.log("not inlining %s because no types/probabilities were recorded", methodName(targetMethod, invoke));
-            return null;
-        } else {
-            Debug.log("not inlining %s because no type profile exists", methodName(targetMethod, invoke));
-            return null;
-        }
-    }
-
-    private static CheckCastNode createAnchoredReceiver(StructuredGraph graph, GraalRuntime runtime, FixedNode anchor, RiResolvedType commonType, ValueNode receiver) {
-        // to avoid that floating reads on receiver fields float above the type check
-        ConstantNode typeConst = graph.unique(ConstantNode.forCiConstant(commonType.getEncoding(Representation.ObjectHub), runtime, graph));
-        CheckCastNode checkCast = graph.unique(new CheckCastNode(anchor, typeConst, commonType, receiver, false));
-        return checkCast;
-    }
-
-    private static boolean checkInvokeConditions(Invoke invoke) {
-        if (invoke.stateAfter() == null) {
-            Debug.log("not inlining %s because the invoke has no after state", methodName(invoke.callTarget().targetMethod(), invoke));
-            return false;
-        }
-        if (invoke.predecessor() == null) {
-            Debug.log("not inlining %s because the invoke is dead code", methodName(invoke.callTarget().targetMethod(), invoke));
-            return false;
-        }
-        if (!invoke.useForInlining()) {
-            Debug.log("not inlining %s because invoke is marked to be not used for inlining", methodName(invoke.callTarget().targetMethod(), invoke));
-            return false;
-        }
-        return true;
-    }
-
-    private static boolean checkTargetConditions(Invoke invoke, RiMethod method) {
-        if (method == null) {
-            Debug.log("not inlining because method is not resolved");
-            return false;
-        }
-        if (!(method instanceof RiResolvedMethod)) {
-            Debug.log("not inlining %s because it is unresolved", method.toString());
-            return false;
-        }
-        RiResolvedMethod resolvedMethod = (RiResolvedMethod) method;
-        if (Modifier.isNative(resolvedMethod.accessFlags())) {
-            Debug.log("not inlining %s because it is a native method", methodName(resolvedMethod));
-            return false;
-        }
-        if (Modifier.isAbstract(resolvedMethod.accessFlags())) {
-            Debug.log("not inlining %s because it is an abstract method", methodName(resolvedMethod));
-            return false;
-        }
-        if (!resolvedMethod.holder().isInitialized()) {
-            Debug.log("not inlining %s because of non-initialized class", methodName(resolvedMethod));
-            return false;
-        }
-        if (!resolvedMethod.canBeInlined()) {
-            Debug.log("not inlining %s because it is marked non-inlinable", methodName(resolvedMethod));
-            return false;
-        }
-        if (computeRecursiveInliningLevel(invoke.stateAfter(), (RiResolvedMethod) method) > GraalOptions.MaximumRecursiveInlining) {
-            Debug.log("not inlining %s because it exceeds the maximum recursive inlining depth", methodName(resolvedMethod));
-            return false;
-        }
-
-        return true;
-    }
-
-    private static int computeRecursiveInliningLevel(FrameState state, RiResolvedMethod method) {
-        assert state != null;
-
-        int count = 0;
-        FrameState curState = state;
-        while (curState != null) {
-            if (curState.method() == method) {
-                count++;
-            }
-            curState = curState.outerFrameState();
-        }
-        return count;
-    }
-
-    /**
-     * Performs an actual inlining, thereby replacing the given invoke with the given inlineGraph.
-     * @param invoke the invoke that will be replaced
-     * @param inlineGraph the graph that the invoke will be replaced with
-     * @param receiverNullCheck true if a null check needs to be generated for non-static inlinings, false if no such check is required
-     * @return The node that represents the return value, or null for void methods and methods that have no non-exceptional exit.
-     */
-    public static void inline(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck) {
-        NodeInputList<ValueNode> parameters = invoke.callTarget().arguments();
-        StructuredGraph graph = (StructuredGraph) invoke.node().graph();
-
-        FrameState stateAfter = invoke.stateAfter();
-        assert stateAfter.isAlive();
-
-        IdentityHashMap<Node, Node> replacements = new IdentityHashMap<>();
-        ArrayList<Node> nodes = new ArrayList<>();
-        ReturnNode returnNode = null;
-        UnwindNode unwindNode = null;
-        BeginNode entryPointNode = inlineGraph.start();
-        FixedNode firstCFGNode = entryPointNode.next();
-        for (Node node : inlineGraph.getNodes()) {
-            if (node == entryPointNode || node == entryPointNode.stateAfter()) {
-                // Do nothing.
-            } else if (node instanceof LocalNode) {
-                replacements.put(node, parameters.get(((LocalNode) node).index()));
-            } else {
-                nodes.add(node);
-                if (node instanceof ReturnNode) {
-                    returnNode = (ReturnNode) node;
-                } else if (node instanceof UnwindNode) {
-                    unwindNode = (UnwindNode) node;
-                }
-            }
-        }
-
-        assert invoke.node().successors().first() != null : invoke;
-        assert invoke.node().predecessor() != null;
-
-        Map<Node, Node> duplicates = graph.addDuplicates(nodes, replacements);
-        FixedNode firstCFGNodeDuplicate = (FixedNode) duplicates.get(firstCFGNode);
-        if (receiverNullCheck) {
-            receiverNullCheck(invoke);
-        }
-        invoke.node().replaceAtPredecessors(firstCFGNodeDuplicate);
-
-        FrameState stateAtExceptionEdge = null;
-        if (invoke instanceof InvokeWithExceptionNode) {
-            InvokeWithExceptionNode invokeWithException = ((InvokeWithExceptionNode) invoke);
-            if (unwindNode != null) {
-                assert unwindNode.predecessor() != null;
-                assert invokeWithException.exceptionEdge().successors().count() == 1;
-                ExceptionObjectNode obj = (ExceptionObjectNode) invokeWithException.exceptionEdge().next();
-                stateAtExceptionEdge = obj.stateAfter();
-                UnwindNode unwindDuplicate = (UnwindNode) duplicates.get(unwindNode);
-                obj.replaceAtUsages(unwindDuplicate.exception());
-                unwindDuplicate.clearInputs();
-                Node n = obj.next();
-                obj.setNext(null);
-                unwindDuplicate.replaceAndDelete(n);
-            } else {
-                invokeWithException.killExceptionEdge();
-            }
-        } else {
-            if (unwindNode != null) {
-                UnwindNode unwindDuplicate = (UnwindNode) duplicates.get(unwindNode);
-                DeoptimizeNode deoptimizeNode = new DeoptimizeNode(DeoptAction.InvalidateRecompile);
-                unwindDuplicate.replaceAndDelete(graph.add(deoptimizeNode));
-                // move the deopt upwards if there is a monitor exit that tries to use the "after exception" frame state
-                // (because there is no "after exception" frame state!)
-                if (deoptimizeNode.predecessor() instanceof MonitorExitNode) {
-                    MonitorExitNode monitorExit = (MonitorExitNode) deoptimizeNode.predecessor();
-                    if (monitorExit.stateAfter() != null && monitorExit.stateAfter().bci == FrameState.AFTER_EXCEPTION_BCI) {
-                        FrameState monitorFrameState = monitorExit.stateAfter();
-                        graph.removeFixed(monitorExit);
-                        monitorFrameState.safeDelete();
-                    }
-                }
-            }
-        }
-
-        FrameState outerFrameState = null;
-        double invokeProbability = invoke.node().probability();
-        for (Node node : duplicates.values()) {
-            if (GraalOptions.ProbabilityAnalysis) {
-                if (node instanceof FixedNode) {
-                    FixedNode fixed = (FixedNode) node;
-                    double newProbability = fixed.probability() * invokeProbability;
-                    if (GraalOptions.LimitInlinedProbability) {
-                        newProbability = Math.min(newProbability, invokeProbability);
-                    }
-                    fixed.setProbability(newProbability);
-                }
-            }
-            if (node instanceof FrameState) {
-                FrameState frameState = (FrameState) node;
-                assert frameState.bci != FrameState.BEFORE_BCI;
-                if (frameState.bci == FrameState.AFTER_BCI) {
-                    frameState.replaceAndDelete(stateAfter);
-                } else if (frameState.bci == FrameState.AFTER_EXCEPTION_BCI) {
-                    if (frameState.isAlive()) {
-                        assert stateAtExceptionEdge != null;
-                        frameState.replaceAndDelete(stateAtExceptionEdge);
-                    } else {
-                        assert stateAtExceptionEdge == null;
-                    }
-                } else {
-                    if (outerFrameState == null) {
-                        outerFrameState = stateAfter.duplicateModified(invoke.bci(), stateAfter.rethrowException(), invoke.node().kind());
-                        outerFrameState.setDuringCall(true);
-                    }
-                    frameState.setOuterFrameState(outerFrameState);
-                }
-            }
-        }
-
-        Node returnValue = null;
-        if (returnNode != null) {
-            if (returnNode.result() instanceof LocalNode) {
-                returnValue = replacements.get(returnNode.result());
-            } else {
-                returnValue = duplicates.get(returnNode.result());
-            }
-            invoke.node().replaceAtUsages(returnValue);
-            Node returnDuplicate = duplicates.get(returnNode);
-            returnDuplicate.clearInputs();
-            Node n = invoke.next();
-            invoke.setNext(null);
-            if (n instanceof BeginNode) {
-                BeginNode begin = (BeginNode) n;
-                FixedNode next = begin.next();
-                begin.setNext(null);
-                returnDuplicate.replaceAndDelete(next);
-                begin.safeDelete();
-            } else {
-                returnDuplicate.replaceAndDelete(n);
-            }
-        }
-
-        invoke.node().clearInputs();
-        invoke.node().replaceAtUsages(null);
-        GraphUtil.killCFG(invoke.node());
-
-        if (stateAfter.usages().isEmpty()) {
-            stateAfter.safeDelete();
-        }
-    }
-
-    public static void receiverNullCheck(Invoke invoke) {
-        MethodCallTargetNode callTarget = invoke.callTarget();
-        StructuredGraph graph = (StructuredGraph) invoke.graph();
-        NodeInputList<ValueNode> parameters = callTarget.arguments();
-        ValueNode firstParam = parameters.size() <= 0 ? null : parameters.get(0);
-        if (!callTarget.isStatic() && firstParam.kind() == CiKind.Object && !firstParam.stamp().nonNull()) {
-            graph.addBeforeFixed(invoke.node(), graph.add(new FixedGuardNode(graph.unique(new NullCheckNode(firstParam, false)))));
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/IntList.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.util;
-
-import java.util.*;
-
-/**
- * An expandable and indexable list of {@code int}s.
- *
- * This class avoids the boxing/unboxing incurred by {@code ArrayList<Integer>}.
- */
-public final class IntList {
-
-    private int[] array;
-    private int size;
-
-    /**
-     * Creates an int list with a specified initial capacity.
-     *
-     * @param initialCapacity
-     */
-    public IntList(int initialCapacity) {
-        array = new int[initialCapacity];
-    }
-
-    /**
-     * Creates an int list with a specified initial array.
-     *
-     * @param array the initial array used for the list (no copy is made)
-     * @param initialSize the initial {@linkplain #size() size} of the list (must be less than or equal to {@code array.length}
-     */
-    public IntList(int[] array, int initialSize) {
-        assert initialSize <= array.length;
-        this.array = array;
-        this.size = initialSize;
-    }
-
-    /**
-     * Makes a new int list by copying a range from a given int list.
-     *
-     * @param other the list from which a range of values is to be copied into the new list
-     * @param startIndex the index in {@code other} at which to start copying
-     * @param length the number of values to copy from {@code other}
-     * @return a new int list whose {@linkplain #size() size} and capacity is {@code length}
-     */
-    public static IntList copy(IntList other, int startIndex, int length) {
-        return copy(other, startIndex, length, length);
-    }
-
-    /**
-     * Makes a new int list by copying a range from a given int list.
-     *
-     * @param other the list from which a range of values is to be copied into the new list
-     * @param startIndex the index in {@code other} at which to start copying
-     * @param length the number of values to copy from {@code other}
-     * @param initialCapacity the initial capacity of the new int list (must be greater or equal to {@code length})
-     * @return a new int list whose {@linkplain #size() size} is {@code length}
-     */
-    public static IntList copy(IntList other, int startIndex, int length, int initialCapacity) {
-        assert initialCapacity >= length : "initialCapacity < length";
-        int[] array = new int[initialCapacity];
-        System.arraycopy(other.array, startIndex, array, 0, length);
-        return new IntList(array, length);
-    }
-
-    public int size() {
-        return size;
-    }
-
-    /**
-     * Appends a value to the end of this list, increasing its {@linkplain #size() size} by 1.
-     *
-     * @param value the value to append
-     */
-    public void add(int value) {
-        if (size == array.length) {
-            int newSize = (size * 3) / 2 + 1;
-            array = Arrays.copyOf(array, newSize);
-        }
-        array[size++] = value;
-    }
-
-    /**
-     * Gets the value in this list at a given index.
-     *
-     * @param index the index of the element to return
-     * @throws IndexOutOfBoundsException if {@code index < 0 || index >= size()}
-     */
-    public int get(int index) {
-        if (index >= size) {
-            throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
-        }
-        return array[index];
-    }
-
-    /**
-     * Sets the size of this list to 0.
-     */
-    public void clear() {
-        size = 0;
-    }
-
-    /**
-     * Sets a value at a given index in this list.
-     *
-     * @param index the index of the element to update
-     * @param value the new value of the element
-     * @throws IndexOutOfBoundsException if {@code index < 0 || index >= size()}
-     */
-    public void set(int index, int value) {
-        if (index >= size) {
-            throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
-        }
-        array[index] = value;
-    }
-
-    /**
-     * Adjusts the {@linkplain #size() size} of this int list.
-     *
-     * If {@code newSize < size()}, the size is changed to {@code newSize}.
-     * If {@code newSize > size()}, sufficient 0 elements are {@linkplain #add(int) added}
-     * until {@code size() == newSize}.
-     *
-     * @param newSize the new size of this int list
-     */
-    public void setSize(int newSize) {
-        if (newSize < size) {
-            size = newSize;
-        } else if (newSize > size) {
-            array = Arrays.copyOf(array, newSize);
-        }
-    }
-
-    @Override
-    public String toString() {
-        if (array.length == size) {
-            return Arrays.toString(array);
-        }
-        return Arrays.toString(Arrays.copyOf(array, size));
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/graal/compiler/util/Util.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,364 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.util;
-
-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.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-
-/**
- * The {@code Util} class contains a motley collection of utility methods used throughout the compiler.
- */
-public class Util {
-
-    public static final int PRINTING_LINE_WIDTH = 40;
-    public static final char SECTION_CHARACTER = '*';
-    public static final char SUB_SECTION_CHARACTER = '=';
-    public static final char SEPERATOR_CHARACTER = '-';
-
-    public static <T> boolean replaceInList(T a, T b, List<T> list) {
-        final int max = list.size();
-        for (int i = 0; i < max; i++) {
-            if (list.get(i) == a) {
-                list.set(i, b);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static <T> boolean replaceAllInList(T a, T b, List<T> list) {
-        final int max = list.size();
-        for (int i = 0; i < max; i++) {
-            if (list.get(i) == a) {
-                list.set(i, b);
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Statically cast an object to an arbitrary Object type. Dynamically checked.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T uncheckedCast(@SuppressWarnings("unused") Class<T> type, Object object) {
-        return (T) object;
-    }
-
-    /**
-     * Statically cast an object to an arbitrary Object type. Dynamically checked.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T uncheckedCast(Object object) {
-        return (T) object;
-    }
-
-    /**
-     * Utility method to combine a base hash with the identity hash of one or more objects.
-     *
-     * @param hash the base hash
-     * @param x the object to add to the hash
-     * @return the combined hash
-     */
-    public static int hash1(int hash, Object x) {
-        // always set at least one bit in case the hash wraps to zero
-        return 0x10000000 | (hash + 7 * System.identityHashCode(x));
-    }
-
-    /**
-     * Utility method to combine a base hash with the identity hash of one or more objects.
-     *
-     * @param hash the base hash
-     * @param x the first object to add to the hash
-     * @param y the second object to add to the hash
-     * @return the combined hash
-     */
-    public static int hash2(int hash, Object x, Object y) {
-        // always set at least one bit in case the hash wraps to zero
-        return 0x20000000 | (hash + 7 * System.identityHashCode(x) + 11 * System.identityHashCode(y));
-    }
-
-    /**
-     * Utility method to combine a base hash with the identity hash of one or more objects.
-     *
-     * @param hash the base hash
-     * @param x the first object to add to the hash
-     * @param y the second object to add to the hash
-     * @param z the third object to add to the hash
-     * @return the combined hash
-     */
-    public static int hash3(int hash, Object x, Object y, Object z) {
-        // always set at least one bit in case the hash wraps to zero
-        return 0x30000000 | (hash + 7 * System.identityHashCode(x) + 11 * System.identityHashCode(y) + 13 * System.identityHashCode(z));
-    }
-
-    /**
-     * Utility method to combine a base hash with the identity hash of one or more objects.
-     *
-     * @param hash the base hash
-     * @param x the first object to add to the hash
-     * @param y the second object to add to the hash
-     * @param z the third object to add to the hash
-     * @param w the fourth object to add to the hash
-     * @return the combined hash
-     */
-    public static int hash4(int hash, Object x, Object y, Object z, Object w) {
-        // always set at least one bit in case the hash wraps to zero
-        return 0x40000000 | (hash + 7 * System.identityHashCode(x) + 11 * System.identityHashCode(y) + 13 * System.identityHashCode(z) + 17 * System.identityHashCode(w));
-    }
-
-    static {
-        assert CiUtil.log2(2) == 1;
-        assert CiUtil.log2(4) == 2;
-        assert CiUtil.log2(8) == 3;
-        assert CiUtil.log2(16) == 4;
-        assert CiUtil.log2(32) == 5;
-        assert CiUtil.log2(0x40000000) == 30;
-
-        assert CiUtil.log2(2L) == 1;
-        assert CiUtil.log2(4L) == 2;
-        assert CiUtil.log2(8L) == 3;
-        assert CiUtil.log2(16L) == 4;
-        assert CiUtil.log2(32L) == 5;
-        assert CiUtil.log2(0x4000000000000000L) == 62;
-
-        assert !CiUtil.isPowerOf2(3);
-        assert !CiUtil.isPowerOf2(5);
-        assert !CiUtil.isPowerOf2(7);
-        assert !CiUtil.isPowerOf2(-1);
-
-        assert CiUtil.isPowerOf2(2);
-        assert CiUtil.isPowerOf2(4);
-        assert CiUtil.isPowerOf2(8);
-        assert CiUtil.isPowerOf2(16);
-        assert CiUtil.isPowerOf2(32);
-        assert CiUtil.isPowerOf2(64);
-    }
-
-    /**
-     * Sets the element at a given position of a list and ensures that this position exists. If the list is current
-     * shorter than the position, intermediate positions are filled with a given value.
-     *
-     * @param list the list to put the element into
-     * @param pos the position at which to insert the element
-     * @param x the element that should be inserted
-     * @param filler the filler element that is used for the intermediate positions in case the list is shorter than pos
-     */
-    public static <T> void atPutGrow(List<T> list, int pos, T x, T filler) {
-        if (list.size() < pos + 1) {
-            while (list.size() < pos + 1) {
-                list.add(filler);
-            }
-            assert list.size() == pos + 1;
-        }
-
-        assert list.size() >= pos + 1;
-        list.set(pos, x);
-    }
-
-    public static void breakpoint() {
-        // do nothing.
-    }
-
-    public static void guarantee(boolean b, String string) {
-        if (!b) {
-            throw new CiBailout(string);
-        }
-    }
-
-    public static void warning(String string) {
-        TTY.println("WARNING: " + string);
-    }
-
-    public static int safeToInt(long l) {
-        assert (int) l == l;
-        return (int) l;
-    }
-
-    public static int roundUp(int number, int mod) {
-        return ((number + mod - 1) / mod) * mod;
-    }
-
-    public static void truncate(List<?> list, int length) {
-        while (list.size() > length) {
-            list.remove(list.size() - 1);
-        }
-    }
-
-    public static void printSection(String name, char sectionCharacter) {
-
-        String header = " " + name + " ";
-        int remainingCharacters = PRINTING_LINE_WIDTH - header.length();
-        int leftPart = remainingCharacters / 2;
-        int rightPart = remainingCharacters - leftPart;
-        for (int i = 0; i < leftPart; i++) {
-            TTY.print(sectionCharacter);
-        }
-
-        TTY.print(header);
-
-        for (int i = 0; i < rightPart; i++) {
-            TTY.print(sectionCharacter);
-        }
-
-        TTY.println();
-    }
-
-    /**
-     * Prints entries in a byte array as space separated hex values to {@link TTY}.
-     *
-     * @param address an address at which the bytes are located. This is used to print an address prefix per line of output.
-     * @param array the array containing all the bytes to print
-     * @param bytesPerLine the number of values to print per line of output
-     */
-    public static void printBytes(long address, byte[] array, int bytesPerLine) {
-        printBytes(address, array, 0, array.length, bytesPerLine);
-    }
-
-    /**
-     * Prints entries in a byte array as space separated hex values to {@link TTY}.
-     *
-     * @param address an address at which the bytes are located. This is used to print an address prefix per line of output.
-     * @param array the array containing the bytes to print
-     * @param offset the offset in {@code array} of the values to print
-     * @param length the number of values from {@code array} print
-     * @param bytesPerLine the number of values to print per line of output
-     */
-    public static void printBytes(long address, byte[] array, int offset, int length, int bytesPerLine) {
-        assert bytesPerLine > 0;
-        boolean newLine = true;
-        for (int i = 0; i < length; i++) {
-            if (newLine) {
-                TTY.print("%08x: ", address + i);
-                newLine = false;
-            }
-            TTY.print("%02x ", array[i]);
-            if (i % bytesPerLine == bytesPerLine - 1) {
-                TTY.println();
-                newLine = true;
-            }
-        }
-
-        if (length % bytesPerLine != bytesPerLine) {
-            TTY.println();
-        }
-    }
-
-    public static boolean isShiftCount(int x) {
-        return 0 <= x && x < 32;
-    }
-
-    /**
-     * Determines if a given {@code int} value is the range of unsigned byte values.
-     */
-    public static boolean isUByte(int x) {
-        return (x & 0xff) == x;
-    }
-
-    /**
-     * Determines if a given {@code int} value is the range of signed byte values.
-     */
-    public static boolean isByte(int x) {
-        return (byte) x == x;
-    }
-
-    /**
-     * Determines if a given {@code long} value is the range of unsigned byte values.
-     */
-    public static boolean isUByte(long x) {
-        return (x & 0xffL) == x;
-    }
-
-    /**
-     * Determines if a given {@code long} value is the range of signed byte values.
-     */
-    public static boolean isByte(long l) {
-        return (byte) l == l;
-    }
-
-    /**
-     * Determines if a given {@code long} value is the range of unsigned int values.
-     */
-    public static boolean isUInt(long x) {
-        return (x & 0xffffffffL) == x;
-    }
-
-    /**
-     * Determines if a given {@code long} value is the range of signed int values.
-     */
-    public static boolean isInt(long l) {
-        return (int) l == l;
-    }
-    /**
-     * Determines if a given {@code int} value is the range of signed short values.
-     */
-    public static boolean isShort(int x) {
-        return (short) x == x;
-    }
-
-    public static boolean is32bit(long x) {
-        return -0x80000000L <= x && x < 0x80000000L;
-    }
-
-    public static short safeToShort(int v) {
-        assert isShort(v);
-        return (short) v;
-    }
-
-    /**
-     * Checks that two instructions are equivalent, optionally comparing constants.
-     * @param x the first instruction
-     * @param y the second instruction
-     * @param compareConstants {@code true} if equivalent constants should be considered equivalent
-     * @return {@code true} if the instructions are equivalent; {@code false} otherwise
-     */
-    public static boolean equivalent(FixedWithNextNode x, FixedWithNextNode y, boolean compareConstants) {
-        if (x == y) {
-            return true;
-        }
-        if (compareConstants && x != null && y != null) {
-            if (x.isConstant() && x.asConstant().equivalent(y.asConstant())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static boolean isFixed(Node n) {
-        return n instanceof FixedNode;
-    }
-
-    public static boolean isFloating(Node n) {
-        return n instanceof FloatingNode;
-    }
-
-    public static boolean isFinalClass(RiResolvedType type) {
-        return Modifier.isFinal(type.accessFlags()) || (type.isArrayClass() && Modifier.isFinal(type.componentType().accessFlags()));
-    }
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/Debug.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,225 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug;
-
-import com.oracle.graal.debug.internal.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-public class Debug {
-
-    private static boolean ENABLED = false;
-
-    public static void enable() {
-        ENABLED = true;
-        DebugScope.initialize();
-    }
-
-    public static boolean isEnabled() {
-        return ENABLED;
-    }
-
-    public static boolean isDumpEnabled() {
-        return ENABLED && DebugScope.getInstance().isDumpEnabled();
-    }
-
-    public static boolean isMeterEnabled() {
-        return ENABLED && DebugScope.getInstance().isMeterEnabled();
-    }
-
-    public static boolean isTimeEnabled() {
-        return ENABLED && DebugScope.getInstance().isTimeEnabled();
-    }
-
-    public static boolean isLogEnabled() {
-        return ENABLED && DebugScope.getInstance().isLogEnabled();
-    }
-
-    public static void sandbox(String name, Runnable runnable) {
-        if (ENABLED) {
-            DebugScope.getInstance().scope(name, runnable, null, true, new Object[0]);
-        } else {
-            runnable.run();
-        }
-    }
-
-    public static void scope(String name, Runnable runnable) {
-        scope(name, new Object[0], runnable);
-    }
-
-    public static <T> T scope(String name, Callable<T> callable) {
-        return scope(name, new Object[0], callable);
-    }
-
-    public static void scope(String name, Object context, Runnable runnable) {
-        scope(name, new Object[] {context}, runnable);
-    }
-
-    public static void scope(String name, Object[] context, Runnable runnable) {
-        if (ENABLED) {
-            DebugScope.getInstance().scope(name, runnable, null, false, context);
-        } else {
-            runnable.run();
-        }
-    }
-
-    public static String currentScope() {
-        if (ENABLED) {
-            return DebugScope.getInstance().getQualifiedName();
-        } else {
-            return "";
-        }
-    }
-
-    public static <T> T scope(String name, Object context, Callable<T> callable) {
-        return scope(name, new Object[] {context}, callable);
-    }
-
-    public static <T> T scope(String name, Object[] context, Callable<T> callable) {
-        if (ENABLED) {
-            return DebugScope.getInstance().scope(name, null, callable, false, context);
-        } else {
-            return DebugScope.call(callable);
-        }
-    }
-
-    public static void log(String msg, Object... args) {
-        if (ENABLED && DebugScope.getInstance().isLogEnabled()) {
-            DebugScope.getInstance().log(msg, args);
-        }
-    }
-
-    public static void dump(Object object, String msg, Object... args) {
-        if (ENABLED && DebugScope.getInstance().isDumpEnabled()) {
-            DebugScope.getInstance().dump(object, msg, args);
-        }
-    }
-
-    public static Iterable<Object> context() {
-        if (ENABLED) {
-            return DebugScope.getInstance().getCurrentContext();
-        } else {
-            return Collections.emptyList();
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public static <T> List<T> contextSnapshot(Class<T> clazz) {
-        if (ENABLED) {
-            List<T> result = new ArrayList<>();
-            for (Object o : context()) {
-                if (clazz.isInstance(o)) {
-                    result.add((T) o);
-                }
-            }
-            return result;
-        } else {
-            return Collections.emptyList();
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public static <T> T contextLookup(Class<T> clazz) {
-        if (ENABLED) {
-            for (Object o : context()) {
-                if (clazz.isInstance(o)) {
-                    return ((T) o);
-                }
-            }
-        }
-        return null;
-    }
-
-    public static DebugMetric metric(String name) {
-        if (ENABLED) {
-            return new MetricImpl(name);
-        } else {
-            return VOID_METRIC;
-        }
-    }
-
-    public static void setConfig(DebugConfig config) {
-        if (ENABLED) {
-            DebugScope.getInstance().setConfig(config);
-        }
-    }
-
-    public static DebugConfig fixedConfig(final boolean isLogEnabled, final boolean isDumpEnabled, final boolean isMeterEnabled, final boolean isTimerEnabled, final Collection<? extends DebugDumpHandler> dumpHandlers) {
-        return new DebugConfig() {
-
-            @Override
-            public boolean isLogEnabled() {
-                return isLogEnabled;
-            }
-
-            @Override
-            public boolean isMeterEnabled() {
-                return isMeterEnabled;
-            }
-
-            @Override
-            public boolean isDumpEnabled() {
-                return isDumpEnabled;
-            }
-
-            @Override
-            public boolean isTimeEnabled() {
-                return isTimerEnabled;
-            }
-
-            @Override
-            public RuntimeException interceptException(Throwable e) {
-                return null;
-            }
-
-            @Override
-            public Collection< ? extends DebugDumpHandler> dumpHandlers() {
-                return dumpHandlers;
-            }
-        };
-    }
-
-    private static final DebugMetric VOID_METRIC = new DebugMetric() {
-
-        public void increment() {
-        }
-
-        public void add(int value) {
-        }
-    };
-
-    public static DebugTimer timer(String name) {
-        if (ENABLED) {
-            return new TimerImpl(name);
-        } else {
-            return VOID_TIMER;
-        }
-    }
-
-    private static final DebugTimer VOID_TIMER = new DebugTimer() {
-
-        public TimerCloseable start() {
-            return TimerImpl.VOID_CLOSEABLE;
-        }
-    };
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugConfig.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug;
-
-import java.util.*;
-
-
-public interface DebugConfig {
-    boolean isLogEnabled();
-    boolean isMeterEnabled();
-    boolean isDumpEnabled();
-    boolean isTimeEnabled();
-    RuntimeException interceptException(Throwable e);
-    Collection<? extends DebugDumpHandler> dumpHandlers();
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug;
-
-public interface DebugDumpHandler {
-    void dump(Object object, String message);
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugDumpScope.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug;
-
-public final class DebugDumpScope {
-
-    private final String name;
-
-    public DebugDumpScope(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String toString() {
-        return "DebugDumpScope[" + name + "]";
-    }
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugMetric.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug;
-
-public interface DebugMetric {
-    void increment();
-    void add(int value);
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/DebugTimer.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug;
-
-import com.oracle.graal.debug.internal.*;
-
-public interface DebugTimer {
-    TimerCloseable start();
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug.internal;
-
-import java.io.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import com.oracle.graal.debug.*;
-
-public final class DebugScope {
-
-    private static ThreadLocal<DebugScope> instanceTL = new ThreadLocal<>();
-    private static ThreadLocal<DebugConfig> configTL = new ThreadLocal<>();
-    private static ThreadLocal<Throwable> lastExceptionThrownTL = new ThreadLocal<>();
-    private static DebugTimer scopeTime = Debug.timer("ScopeTime");
-
-    private final DebugScope parent;
-
-    private Object[] context;
-
-    private DebugValueMap valueMap;
-    private String qualifiedName;
-    private String name;
-
-    private static final char SCOPE_SEP = '.';
-
-    private boolean logEnabled;
-    private boolean meterEnabled;
-    private boolean timeEnabled;
-    private boolean dumpEnabled;
-
-    public static DebugScope getInstance() {
-        DebugScope result = instanceTL.get();
-        if (result == null) {
-            DebugScope topLevelDebugScope = new DebugScope(Thread.currentThread().getName(), "", null);
-            instanceTL.set(topLevelDebugScope);
-            DebugValueMap.registerTopLevel(topLevelDebugScope.getValueMap());
-            return topLevelDebugScope;
-        } else {
-            return result;
-        }
-    }
-
-    public static DebugConfig getConfig() {
-        return configTL.get();
-    }
-
-    private DebugScope(String name, String qualifiedName, DebugScope parent, Object... context) {
-        this.name = name;
-        this.parent = parent;
-        this.context = context;
-        this.qualifiedName = qualifiedName;
-        assert context != null;
-    }
-
-    public boolean isDumpEnabled() {
-        return dumpEnabled;
-    }
-
-    public boolean isLogEnabled() {
-        return logEnabled;
-    }
-
-    public boolean isMeterEnabled() {
-        return meterEnabled;
-    }
-
-    public boolean isTimeEnabled() {
-        return timeEnabled;
-    }
-
-    public void log(String msg, Object... args) {
-        if (isLogEnabled()) {
-            cachedOut.println(String.format(msg, args));
-        }
-    }
-
-    public void dump(Object object, String formatString, Object[] args) {
-        if (isDumpEnabled()) {
-            DebugConfig config = getConfig();
-            if (config != null) {
-                String message = String.format(formatString, args);
-                for (DebugDumpHandler dumpHandler : config.dumpHandlers()) {
-                    dumpHandler.dump(object, message);
-                }
-            }
-        }
-    }
-
-    public <T> T scope(String newName, Runnable runnable, Callable<T> callable, boolean sandbox, Object[] newContext) {
-        DebugScope oldContext = getInstance();
-        DebugConfig oldConfig = getConfig();
-        DebugScope newChild = null;
-        if (sandbox) {
-            newChild = new DebugScope(newName, newName, null, newContext);
-            setConfig(null);
-        } else {
-            newChild = oldContext.createChild(newName, newContext);
-        }
-        instanceTL.set(newChild);
-        newChild.updateFlags();
-        try (TimerCloseable a = scopeTime.start()) {
-            return executeScope(runnable, callable);
-        } finally {
-            if (!sandbox && newChild.hasValueMap()) {
-                getValueMap().addChild(newChild.getValueMap());
-            }
-            newChild.context = null;
-            instanceTL.set(oldContext);
-            setConfig(oldConfig);
-        }
-    }
-
-    private <T> T executeScope(Runnable runnable, Callable<T> callable) {
-        try {
-            if (runnable != null) {
-                runnable.run();
-            }
-            if (callable != null) {
-                return call(callable);
-            }
-        } catch (Throwable e) {
-            if (e == lastExceptionThrownTL.get()) {
-                throw e;
-            } else {
-                RuntimeException newException = interceptException(e);
-                if (newException == null) {
-                    lastExceptionThrownTL.set(e);
-                    throw e;
-                } else {
-                    lastExceptionThrownTL.set(newException);
-                    throw newException;
-                }
-            }
-        }
-        return null;
-    }
-
-    private void updateFlags() {
-        DebugConfig config = getConfig();
-        if (config == null) {
-            logEnabled = false;
-            meterEnabled = false;
-            timeEnabled = false;
-            dumpEnabled = false;
-        } else {
-            logEnabled = config.isLogEnabled();
-            meterEnabled = config.isMeterEnabled();
-            timeEnabled = config.isTimeEnabled();
-            dumpEnabled = config.isDumpEnabled();
-        }
-    }
-
-    private RuntimeException interceptException(final Throwable e) {
-        final DebugConfig config = getConfig();
-        if (config != null) {
-            return scope("InterceptException", null, new Callable<RuntimeException>() {
-
-                @Override
-                public RuntimeException call() throws Exception {
-                    try {
-                        return config.interceptException(e);
-                    } catch (Throwable t) {
-                        return new RuntimeException("Exception while intercepting exception", t);
-                    }
-                }
-            }, false, new Object[] {e});
-        }
-        return null;
-    }
-
-    private DebugValueMap getValueMap() {
-        if (valueMap == null) {
-            valueMap = new DebugValueMap(name);
-        }
-        return valueMap;
-    }
-
-    private boolean hasValueMap() {
-        return valueMap != null;
-    }
-
-    long getCurrentValue(int index) {
-        return getValueMap().getCurrentValue(index);
-    }
-
-    void setCurrentValue(int index, long l) {
-        getValueMap().setCurrentValue(index, l);
-    }
-
-    private DebugScope createChild(String newName, Object[] newContext) {
-        String newQualifiedName = newName;
-        if (this.qualifiedName.length() > 0) {
-            newQualifiedName = this.qualifiedName + SCOPE_SEP + newName;
-        }
-        DebugScope result = new DebugScope(newName, newQualifiedName, this, newContext);
-        return result;
-    }
-
-    public Iterable<Object> getCurrentContext() {
-        return new Iterable<Object>() {
-
-            @Override
-            public Iterator<Object> iterator() {
-                return new Iterator<Object>() {
-
-                    DebugScope currentScope = DebugScope.this;
-                    int objectIndex;
-
-                    @Override
-                    public boolean hasNext() {
-                        selectScope();
-                        return currentScope != null;
-                    }
-
-                    private void selectScope() {
-                        while (currentScope != null && currentScope.context.length <= objectIndex) {
-                            currentScope = currentScope.parent;
-                            objectIndex = 0;
-                        }
-                    }
-
-                    @Override
-                    public Object next() {
-                        selectScope();
-                        if (currentScope != null) {
-                            return currentScope.context[objectIndex++];
-                        }
-                        throw new IllegalStateException("May only be called if there is a next element.");
-                    }
-
-                    @Override
-                    public void remove() {
-                        throw new UnsupportedOperationException("This iterator is read only.");
-                    }
-                };
-            }
-        };
-    }
-
-    public static <T> T call(Callable<T> callable) {
-        try {
-            return callable.call();
-        } catch (Exception e) {
-            if (e instanceof RuntimeException) {
-                throw (RuntimeException) e;
-            } else {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    public void setConfig(DebugConfig newConfig) {
-        configTL.set(newConfig);
-        updateFlags();
-    }
-
-    public String getQualifiedName() {
-        return qualifiedName;
-    }
-
-    public static PrintStream cachedOut;
-
-    public static void initialize() {
-        cachedOut = System.out;
-    }
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/DebugValue.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug.internal;
-
-public class DebugValue {
-
-    private String name;
-    private int index;
-
-    protected DebugValue(String name) {
-        this.name = name;
-        this.index = -1;
-    }
-
-    protected long getCurrentValue() {
-        ensureInitialized();
-        return DebugScope.getInstance().getCurrentValue(index);
-    }
-
-    protected void setCurrentValue(long l) {
-        ensureInitialized();
-        DebugScope.getInstance().setCurrentValue(index, l);
-    }
-
-    private void ensureInitialized() {
-        if (index == -1) {
-            index = KeyRegistry.register(name, this);
-        }
-    }
-
-    protected void addToCurrentValue(long timeSpan) {
-        setCurrentValue(getCurrentValue() + timeSpan);
-    }
-
-    public int getIndex() {
-        return index;
-    }
-
-    public String getName() {
-        return name;
-    }
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug.internal;
-
-import java.util.*;
-
-public class DebugValueMap {
-
-    private static List<DebugValueMap> topLevelMaps = new ArrayList<>();
-
-    private long[] values;
-    private List<DebugValueMap> children;
-    private String name;
-
-    public DebugValueMap(String name) {
-        this.name = name;
-    }
-
-    public void setCurrentValue(int index, long l) {
-        ensureSize(index);
-        values[index] = l;
-    }
-
-    public long getCurrentValue(int index) {
-        ensureSize(index);
-        return values[index];
-    }
-
-    private void ensureSize(int index) {
-        if (values == null) {
-            values = new long[index + 1];
-        }
-        if (values.length <= index) {
-            values = Arrays.copyOf(values, index + 1);
-        }
-    }
-
-    private int capacity() {
-        return (values == null) ? 0 : values.length;
-    }
-
-    public void addChild(DebugValueMap map) {
-        if (children == null) {
-            children = new ArrayList<>(4);
-        }
-        children.add(map);
-    }
-
-    public List<DebugValueMap> getChildren() {
-        if (children == null) {
-            return Collections.emptyList();
-        } else {
-            return Collections.unmodifiableList(children);
-        }
-    }
-
-    public boolean hasChildren() {
-        return children != null && !children.isEmpty();
-    }
-
-    public String getName() {
-        return this.name;
-    }
-
-    @Override
-    public String toString() {
-        return "DebugValueMap<" + getName() + ">";
-    }
-
-    public static synchronized void registerTopLevel(DebugValueMap map) {
-        topLevelMaps.add(map);
-    }
-
-    public static synchronized List<DebugValueMap> getTopLevelMaps() {
-        return topLevelMaps;
-    }
-
-    public void normalize() {
-        if (this.hasChildren()) {
-            Map<String, DebugValueMap> occurred = new HashMap<>();
-            for (DebugValueMap map : this.children) {
-                String mapName = map.getName();
-                if (!occurred.containsKey(mapName)) {
-                    occurred.put(mapName, map);
-                    map.normalize();
-                } else {
-                    occurred.get(mapName).mergeWith(map);
-                    occurred.get(mapName).normalize();
-                }
-            }
-
-            if (occurred.values().size() < children.size()) {
-                // At least one duplicate was found.
-                children.clear();
-                for (DebugValueMap map : occurred.values()) {
-                    children.add(map);
-                    map.normalize();
-                }
-            }
-        }
-    }
-
-    private void mergeWith(DebugValueMap map) {
-        if (map.hasChildren()) {
-            if (hasChildren()) {
-                children.addAll(map.children);
-            } else {
-                children = map.children;
-            }
-            map.children = null;
-        }
-
-        int size = Math.max(this.capacity(), map.capacity());
-        ensureSize(size);
-        for (int i = 0; i < size; ++i) {
-            long curValue = getCurrentValue(i);
-            long otherValue = map.getCurrentValue(i);
-            setCurrentValue(i, curValue + otherValue);
-        }
-    }
-
-    public void group() {
-        if (this.hasChildren()) {
-            List<DebugValueMap> oldChildren = new ArrayList<>(this.children);
-            this.children.clear();
-            for (DebugValueMap map : oldChildren) {
-                mergeWith(map);
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/KeyRegistry.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug.internal;
-
-import java.util.*;
-
-public class KeyRegistry {
-    private static int keyCount;
-    private static Map<String, Integer> keyMap = new HashMap<>();
-    private static List<DebugValue> debugValues = new ArrayList<>();
-
-    public static synchronized int register(String name, DebugValue value) {
-        if (!keyMap.containsKey(name)) {
-            keyMap.put(name, keyCount++);
-            debugValues.add(value);
-        }
-        return keyMap.get(name);
-    }
-
-    public static synchronized List<DebugValue> getDebugValues() {
-        return Collections.unmodifiableList(debugValues);
-    }
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/MetricImpl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug.internal;
-
-import com.oracle.graal.debug.*;
-
-public final class MetricImpl extends DebugValue implements DebugMetric {
-
-    public MetricImpl(String name) {
-        super(name);
-    }
-
-    public void increment() {
-        add(1);
-    }
-
-    public void add(int value) {
-        if (Debug.isMeterEnabled()) {
-            super.addToCurrentValue(value);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/TimerCloseable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug.internal;
-
-public interface TimerCloseable extends AutoCloseable {
-    void close();
-}
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/graal/debug/internal/TimerImpl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.debug.internal;
-
-import com.oracle.graal.debug.*;
-
-public final class TimerImpl extends DebugValue implements DebugTimer {
-
-    public static final TimerCloseable VOID_CLOSEABLE = new TimerCloseable() {
-        @Override
-        public void close() {
-        }
-    };
-
-    public TimerImpl(String name) {
-        super(name);
-    }
-
-    @Override
-    public TimerCloseable start() {
-        if (Debug.isTimeEnabled()) {
-            final long startTime = System.currentTimeMillis();
-            return new TimerCloseable() {
-                @Override
-                public void close() {
-                    long timeSpan = System.currentTimeMillis() - startTime;
-                    TimerImpl.this.addToCurrentValue(timeSpan);
-                }
-            };
-        } else {
-            return VOID_CLOSEABLE;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.examples/src/examples/HelloWorld.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package examples;
-
-
-public class HelloWorld {
-    public static void main(String[] args) {
-        System.out.println("hello world!");
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/BitMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,723 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.BitSet;
-
-/**
- * Implements a bitmap that stores a single bit for a range of integers (0-n).
- */
-public final class BitMap implements Serializable {
-
-    public static final long serialVersionUID = 0L;
-
-    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 BitMap() {
-        this(DEFAULT_LENGTH);
-    }
-
-    /**
-     * Constructs a new bit map from a byte array encoded bit map.
-     *
-     * @param bitmap the bit map to convert
-     */
-    public BitMap(byte[] bitmap) {
-        this(bitmap, 0, bitmap.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 BitMap(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 BitMap}.
-     */
-    public static BitMap fromLong(long bitmap) {
-        BitMap bm = new BitMap(64);
-        bm.low = bitmap;
-        return bm;
-    }
-
-    /**
-     * Constructs a new bit map with the specified length.
-     *
-     * @param length the length of the bitmap
-     */
-    public BitMap(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(BitMap 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, all bits set in either of the two
-     * bitmaps will be set in this bitmap following this operation. It returns whether this bitmap was changed by the operation.
-     *
-     * @param other the other bitmap for the union operation
-     */
-    public boolean setUnionWithResult(BitMap other) {
-        long temp = low | other.low;
-        boolean changed = temp != low;
-        low = temp;
-
-        if (extra != null && other.extra != null) {
-            for (int i = 0; i < extra.length && i < other.extra.length; i++) {
-                temp = extra[i] | other.extra[i];
-                changed = changed || temp != extra[i];
-                extra[i] |= temp;
-            }
-        }
-        return changed;
-    }
-
-    /**
-     * 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(BitMap 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("Index " + i + " is out of bounds (size=" + size + ")");
-        }
-        return i;
-    }
-
-    public void setFrom(BitMap 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(BitMap 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 negate() {
-        low = ~low;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] = ~extra[i];
-            }
-        }
-    }
-
-    public boolean isSame(BitMap 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 BitMap) {
-            BitMap bm = (BitMap) 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;
-    }
-
-    /**
-     * 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();
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + Arrays.hashCode(extra);
-        result = prime * result + (int) (low ^ (low >>> 32));
-        result = prime * result + size;
-        return result;
-    }
-
-    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 = 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();
-    }
-
-    private static int align(int size, int align) {
-        return (size + align - 1) & ~(align - 1);
-    }
-
-    public BitMap copy() {
-        BitMap n = new BitMap(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.
-     * @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;
-    }
-
-    public boolean containsAll(BitMap other) {
-        assert this.size == other.size : "must have same size";
-        if ((low & other.low) != other.low) {
-            return false;
-        }
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                if ((extra[i] & other.extra[i]) != other.extra[i]) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/GraalInternalError.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.*;
-
-/**
- * This error represents a conditions that should never occur during normal operation.
- */
-public class GraalInternalError extends Error {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 8776065085829593278L;
-    private Node node;
-    private Graph graph;
-    private final ArrayList<String> context = new ArrayList<>();
-
-    public static RuntimeException unimplemented() {
-        throw new GraalInternalError("unimplemented");
-    }
-
-    public static RuntimeException unimplemented(String msg) {
-        throw new GraalInternalError("unimplemented: %s", msg);
-    }
-
-    public static RuntimeException shouldNotReachHere() {
-        throw new GraalInternalError("should not reach here");
-    }
-
-    public static RuntimeException shouldNotReachHere(String msg) {
-        throw new GraalInternalError("should not reach here: %s", msg);
-    }
-
-
-    /**
-     * This constructor creates a {@link GraalInternalError} with a message assembled via {@link String#format(String, Object...)}.
-     * It always uses the ENGLISH locale in order to always generate the same output.
-     * @param msg the message that will be associated with the error, in String.format syntax
-     * @param args parameters to String.format - parameters that implement {@link Iterable} will be expanded into a [x, x, ...] representation.
-     */
-    public GraalInternalError(String msg, Object... args) {
-        super(format(msg, args));
-    }
-
-    /**
-     * This constructor creates a {@link GraalInternalError} for a given causing Throwable instance.
-     * @param cause the original exception that contains additional information on this error
-     */
-    public GraalInternalError(Throwable cause) {
-        super(cause);
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder str = new StringBuilder();
-        str.append(super.toString());
-        for (String s : context) {
-            str.append("\n\tat ").append(s);
-        }
-        return str.toString();
-    }
-
-    private static String format(String msg, Object... args) {
-        if (args != null) {
-            // expand Iterable parameters into a list representation
-            for (int i = 0; i < args.length; i++) {
-                if (args[i] instanceof Iterable<?>) {
-                    ArrayList<Object> list = new ArrayList<>();
-                    for (Object o : (Iterable<?>) args[i]) {
-                        list.add(o);
-                    }
-                    args[i] = list.toString();
-                }
-            }
-        }
-        return String.format(Locale.ENGLISH, msg, args);
-    }
-
-    public GraalInternalError addContext(String newContext) {
-        this.context.add(newContext);
-        return this;
-    }
-
-    public GraalInternalError addContext(String name, Object obj) {
-        return addContext(format("%s: %s", name, obj));
-    }
-
-    /**
-     * Adds a graph to the context of this VerificationError. The first graph added via this method will be returned by {@link #graph()}.
-     * @param newGraph the graph which is in a incorrect state, if the verification error was not caused by a specific node
-     */
-    public GraalInternalError addContext(Graph newGraph) {
-        if (newGraph != this.graph) {
-            addContext("graph", newGraph);
-            if (this.graph == null) {
-                this.graph = newGraph;
-            }
-        }
-        return this;
-    }
-
-    /**
-     * Adds a node to the context of this VerificationError. The first node added via this method will be returned by {@link #node()}.
-     * @param newNode the node which is in a incorrect state, if the verification error was caused by a node
-     */
-    public GraalInternalError addContext(Node newNode) {
-        if (newNode != this.node) {
-            addContext("node", newNode);
-            if (this.node == null) {
-                this.node = newNode;
-            }
-        }
-        return this;
-    }
-
-    public Node node() {
-        return node;
-    }
-
-    public Graph graph() {
-        return graph;
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/Graph.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,506 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.*;
-
-import com.oracle.graal.graph.GraphEvent.NodeEvent;
-import com.oracle.graal.graph.Node.IterableNodeType;
-import com.oracle.graal.graph.Node.ValueNumberable;
-import com.oracle.graal.graph.iterators.*;
-
-/**
- * This class is a graph container, it contains the set of nodes that belong to this graph.
- */
-public class Graph {
-
-    protected final String name;
-
-    private static final boolean TIME_TRAVEL = false;
-
-    private final ArrayList<Node> nodes;
-
-    // these two arrays contain one entry for each NodeClass, indexed by NodeClass.iterableId.
-    // they contain the first and last pointer to a linked list of all nodes with this type.
-    private final ArrayList<Node> nodeCacheFirst;
-    private final ArrayList<Node> nodeCacheLast;
-    private int deletedNodeCount;
-    private int mark;
-    private GraphEventLog eventLog;
-
-    ArrayList<Node> usagesDropped = new ArrayList<>();
-    NodeWorkList inputChanged;
-    private final HashMap<CacheEntry, Node> cachedNodes = new HashMap<>();
-
-    private static final class CacheEntry {
-
-        private final Node node;
-
-        public CacheEntry(Node node) {
-            this.node = node;
-        }
-
-        @Override
-        public int hashCode() {
-            return node.getNodeClass().valueNumber(node);
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj == this) {
-                return true;
-            }
-            if (obj instanceof CacheEntry) {
-                CacheEntry other = (CacheEntry) obj;
-                NodeClass nodeClass = node.getNodeClass();
-                if (other.node.getNodeClass() == nodeClass) {
-                    return nodeClass.valueNumberable() && nodeClass.valueEqual(node, other.node) && nodeClass.edgesEqual(node, other.node);
-                }
-            }
-            return false;
-        }
-    }
-
-    /**
-     * Creates an empty Graph with no name.
-     */
-    public Graph() {
-        this(null);
-    }
-
-    /**
-     * Creates an empty Graph with a given name.
-     *
-     * @param name the name of the graph, used for debugging purposes
-     */
-    public Graph(String name) {
-        nodes = new ArrayList<>(32);
-        nodeCacheFirst = new ArrayList<>(NodeClass.cacheSize());
-        nodeCacheLast = new ArrayList<>(NodeClass.cacheSize());
-        this.name = name;
-    }
-
-    /**
-     * Creates a copy of this graph.
-     */
-    public Graph copy() {
-        return copy(name);
-    }
-
-    /**
-     * Creates a copy of this graph.
-     *
-     * @param name the name of the copy, used for debugging purposes (can be null)
-     */
-    public Graph copy(String newName) {
-        Graph copy = new Graph(newName);
-        Map<Node, Node> emptyMap = Collections.emptyMap();
-        copy.addDuplicates(getNodes(), emptyMap);
-        return copy;
-    }
-
-    @Override
-    public String toString() {
-        return name == null ? super.toString() : "Graph " + name;
-    }
-
-    /**
-     * Gets the number of live nodes in this graph. That is the number of nodes which have been added to the graph minus the number of deleted nodes.
-     * @return the number of live nodes in this graph
-     */
-    public int getNodeCount() {
-        return nodes.size() - getDeletedNodeCount();
-    }
-
-    /**
-     * Gets the number of node which have been deleted from this graph.
-     * @return the number of node which have been deleted from this graph
-     */
-    public int getDeletedNodeCount() {
-        return deletedNodeCount;
-    }
-
-    /**
-     * Adds a new node to the graph.
-     * @param node the node to be added
-     * @return the node which was added to the graph
-     */
-    public <T extends Node> T add(T node) {
-        node.initialize(this);
-        return node;
-    }
-
-    public int getUsagesDroppedNodesCount() {
-        return usagesDropped.size();
-    }
-
-    public List<Node> getAndCleanUsagesDroppedNodes() {
-        ArrayList<Node> result = usagesDropped;
-        usagesDropped = new ArrayList<>();
-        return result;
-    }
-
-    public void trackInputChange(NodeWorkList worklist) {
-        this.inputChanged = worklist;
-    }
-
-    public void stopTrackingInputChange() {
-        inputChanged = null;
-    }
-
-    /**
-     * Adds a new node to the graph, if a <i>similar</i> node already exists in the graph, the provided node will not be added to the graph but the <i>similar</i> node will be returned instead.
-     * @param node
-     * @return the node which was added to the graph or a <i>similar</i> which was already in the graph.
-     */
-    @SuppressWarnings("unchecked")
-    public <T extends Node & ValueNumberable> T unique(T node) {
-        assert checkValueNumberable(node);
-
-        for (Node input : node.inputs()) {
-            if (input != null) {
-                for (Node usage : input.usages()) {
-                    if (usage != node && node.getNodeClass().valueEqual(node, usage) && node.getNodeClass().edgesEqual(node, usage)) {
-                        return (T) usage;
-                    }
-                }
-                return add(node);
-            }
-        }
-        Node cachedNode = cachedNodes.get(new CacheEntry(node));
-        if (cachedNode != null && cachedNode.isAlive()) {
-            return (T) cachedNode;
-        } else {
-            Node result = add(node);
-            cachedNodes.put(new CacheEntry(node), result);
-            return (T) result;
-        }
-    }
-
-    public Node findDuplicate(Node node) {
-        if (node.getNodeClass().valueNumberable()) {
-            for (Node input : node.inputs()) {
-                if (input != null) {
-                    for (Node usage : input.usages()) {
-                        if (usage != node && node.getNodeClass().valueEqual(node, usage) && node.getNodeClass().edgesEqual(node, usage)) {
-                            return usage;
-                        }
-                    }
-                    break;
-                }
-            }
-        }
-        return null;
-    }
-
-    private static boolean checkValueNumberable(Node node) {
-        if (!node.getNodeClass().valueNumberable()) {
-            throw new VerificationError("node is not valueNumberable").addContext(node);
-        }
-        return true;
-    }
-
-    public void mark() {
-        this.mark = nodeIdCount();
-    }
-
-    private class NodeIterator implements Iterator<Node> {
-        private int index;
-
-        public NodeIterator() {
-            this(0);
-        }
-
-        public NodeIterator(int index) {
-            this.index = index - 1;
-            forward();
-        }
-
-        private void forward() {
-            if (index < nodes.size()) {
-                do {
-                    index++;
-                } while (index < nodes.size() && nodes.get(index) == null);
-            }
-        }
-
-        @Override
-        public boolean hasNext() {
-            checkForDeletedNode();
-            return index < nodes.size();
-        }
-
-        private void checkForDeletedNode() {
-            if (index < nodes.size()) {
-                while (index < nodes.size() && nodes.get(index) == null) {
-                    index++;
-                }
-            }
-        }
-
-        @Override
-        public Node next() {
-            try {
-                return nodes.get(index);
-            } finally {
-                forward();
-            }
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    /**
-     * Returns an {@link Iterable} providing all nodes added since the last {@link Graph#mark() mark}.
-     * @return an {@link Iterable} providing the new nodes
-     */
-    public NodeIterable<Node> getNewNodes() {
-        final int index = this.mark;
-        return new NodeIterable<Node>() {
-            @Override
-            public Iterator<Node> iterator() {
-                return new NodeIterator(index);
-            }
-        };
-    }
-
-    /**
-     * Returns an {@link Iterable} providing all the live nodes.
-     * @return an {@link Iterable} providing all the live nodes.
-     */
-    public NodeIterable<Node> getNodes() {
-        return new NodeIterable<Node>() {
-            @Override
-            public Iterator<Node> iterator() {
-                return new NodeIterator();
-            }
-        };
-    }
-
-    private static class TypedNodeIterator<T extends IterableNodeType> implements Iterator<T> {
-        private Node current;
-        private final Node start;
-
-        public TypedNodeIterator(Node start) {
-            if (start != null && start.isDeleted()) {
-                this.current = start;
-            } else {
-                this.current = null;
-            }
-            this.start = start;
-        }
-
-        @Override
-        public boolean hasNext() {
-            if (current != null) {
-                Node next = current.typeCacheNext;
-                if (next != null) {
-                    while (next.isDeleted()) {
-                        next = next.typeCacheNext;
-                        if (next == null) {
-                            return false;
-                        }
-                        current.typeCacheNext = next;
-                    }
-                    return true;
-                }
-                return false;
-            } else {
-                return start != null;
-            }
-        }
-
-        @Override
-        @SuppressWarnings("unchecked")
-        public T next() {
-            if (current == null) {
-                Node result = start;
-                current = result;
-                return (T) result;
-            } else {
-                Node result = current.typeCacheNext;
-                current = result;
-                return (T) result;
-            }
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    /**
-     * Returns an {@link Iterable} providing all the live nodes whose type is compatible with {@code type}.
-     * @param type the type of node to return
-     * @return an {@link Iterable} providing all the matching nodes.
-     */
-    public <T extends Node & IterableNodeType> NodeIterable<T> getNodes(final Class<T> type) {
-        final Node start = getStartNode(type);
-        return new NodeIterable<T>() {
-            @Override
-            public Iterator<T> iterator() {
-                return new TypedNodeIterator<>(start);
-            }
-        };
-    }
-
-    /**
-     * Returns whether the graph contains at least one node of the given type.
-     * @param type the type of node that is checked for occurrence
-     * @return whether there is at least one such node
-     */
-    public <T extends Node & IterableNodeType> boolean hasNode(final Class<T> type) {
-        return getNodes(type).iterator().hasNext();
-    }
-
-    private <T> Node getStartNode(final Class<T> type) {
-        int nodeClassId = NodeClass.get(type).iterableId();
-        assert nodeClassId != -1 : type + " is not iterable within graphs (missing \"implements IterableNodeType\"?)";
-        Node start = nodeCacheFirst.size() <= nodeClassId ? null : nodeCacheFirst.get(nodeClassId);
-        return start;
-    }
-
-    public NodeBitMap createNodeBitMap() {
-        return new NodeBitMap(this);
-    }
-
-    public <T> NodeMap<T> createNodeMap() {
-        return new NodeMap<>(this);
-    }
-
-    public NodeFlood createNodeFlood() {
-        return new NodeFlood(this);
-    }
-
-    public NodeWorkList createNodeWorkList() {
-        return new NodeWorkList(this);
-    }
-
-    public NodeWorkList createNodeWorkList(boolean fill, int iterationLimitPerNode) {
-        return new NodeWorkList(this, fill, iterationLimitPerNode);
-    }
-
-    void register(Node node) {
-        assert node.id() == Node.INITIAL_ID;
-        int id = nodes.size();
-        nodes.add(id, node);
-
-        int nodeClassId = node.getNodeClass().iterableId();
-        if (nodeClassId != NodeClass.NOT_ITERABLE) {
-            while (nodeCacheFirst.size() <= nodeClassId) {
-                nodeCacheFirst.add(null);
-                nodeCacheLast.add(null);
-            }
-            Node prev = nodeCacheLast.get(nodeClassId);
-            if (prev != null) {
-                prev.typeCacheNext = node;
-            } else {
-                nodeCacheFirst.set(nodeClassId, node);
-            }
-            nodeCacheLast.set(nodeClassId, node);
-        }
-
-        node.id = id;
-        logNodeAdded(node);
-    }
-
-    void logNodeAdded(Node node) {
-        if (TIME_TRAVEL) {
-            log(new GraphEvent.NodeEvent(node, GraphEvent.NodeEvent.Type.ADDED));
-        }
-    }
-
-    void logNodeDeleted(Node node) {
-        if (TIME_TRAVEL) {
-            log(new GraphEvent.NodeEvent(node, GraphEvent.NodeEvent.Type.DELETED));
-        }
-    }
-
-    private void log(NodeEvent nodeEvent) {
-        if (eventLog == null) {
-            eventLog = new GraphEventLog();
-        }
-        eventLog.add(nodeEvent);
-    }
-
-    public GraphEventLog getEventLog() {
-        return eventLog;
-    }
-
-    void unregister(Node node) {
-        assert !node.isDeleted() : "cannot delete a node twice! node=" + node;
-        logNodeDeleted(node);
-        nodes.set(node.id(), null);
-        deletedNodeCount++;
-
-        // nodes aren't removed from the type cache here - they will be removed during iteration
-    }
-
-    public boolean verify() {
-        for (Node node : getNodes()) {
-            try {
-                try {
-                    assert node.verify();
-                } catch (AssertionError t) {
-                    throw new GraalInternalError(t);
-                } catch (RuntimeException t) {
-                    throw new GraalInternalError(t);
-                }
-            } catch (GraalInternalError e) {
-                throw e.addContext(node).addContext(this);
-            }
-        }
-        return true;
-    }
-
-    Node getNode(int i) {
-        return nodes.get(i);
-    }
-
-    /**
-     * Returns the number of node ids generated so far.
-     * @return the number of node ids generated so far
-     */
-    int nodeIdCount() {
-        return nodes.size();
-    }
-
-    /**
-     * Adds duplicates of the nodes in {@code nodes} to this graph.
-     * This will recreate any edges between the duplicate nodes. The {@code replacement} map can be used to
-     * replace a node from the source graph by a given node (which must already be in this graph).
-     * Edges between duplicate and replacement nodes will also be recreated so care should be taken
-     * regarding the matching of node types in the replacement map.
-     *
-     * @param newNodes the nodes to be duplicated
-     * @param replacements the replacement map (can be null if no replacement is to be performed)
-     * @return a map which associates the original nodes from {@code nodes} to their duplicates
-     */
-    public Map<Node, Node> addDuplicates(Iterable<Node> newNodes, Map<Node, Node> replacements) {
-        return NodeClass.addGraphDuplicate(this, newNodes, replacements);
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/GraphEvent.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-
-public abstract class GraphEvent {
-
-    private Exception exceptionContext;
-
-    public static class NodeEvent extends GraphEvent {
-
-        public static enum Type {
-            ADDED,
-            DELETED,
-            CHANGED
-        }
-
-        public final Node node;
-        public final Type type;
-        private final String nodeString;
-
-        public NodeEvent(Node n, Type type) {
-            this.node = n;
-            this.type = type;
-            nodeString = n.toString();
-        }
-
-        @Override
-        public StackTraceElement[] print(StackTraceElement[] last) {
-            System.out.println(type.toString() + ", " + nodeString);
-            return super.print(last);
-        }
-    }
-
-    public static class EdgeEvent extends GraphEvent {
-
-        public static enum Type {
-            INPUT,
-            SUCC
-        }
-
-        public final Node node;
-        public final int index;
-        public final Node newValue;
-        public final Type type;
-
-        public EdgeEvent(Node node, int index, Node newValue, Type type) {
-            this.node = node;
-            this.index = index;
-            this.newValue = newValue;
-            this.type = type;
-        }
-    }
-
-    public GraphEvent() {
-        exceptionContext = new Exception();
-    }
-
-    public StackTraceElement[] print(StackTraceElement[] last) {
-        StackTraceElement[] stackTrace = exceptionContext.getStackTrace();
-
-        boolean atTop = true;
-        for (int i = 0; i < stackTrace.length; ++i) {
-            StackTraceElement elem = stackTrace[i];
-            int toBottom = stackTrace.length - i;
-            if (atTop) {
-                if (!elem.getClassName().startsWith("com.oracle.graal.graph.Graph") && !elem.getClassName().startsWith("com.oracle.graal.graph.Node")) {
-                    atTop = false;
-                } else {
-                    continue;
-                }
-            } else {
-                if (last.length >= toBottom && last[last.length - toBottom].equals(elem)) {
-                    continue;
-                }
-            }
-            System.out.println(String.format("%s.%s(%s:%d)", elem.getClassName(), elem.getMethodName(), elem.getFileName(), elem.getLineNumber()));
-        }
-        return stackTrace;
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/GraphEventLog.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.*;
-
-
-public class GraphEventLog {
-
-    private List<GraphEvent> events = new ArrayList<>();
-
-    public void add(GraphEvent e) {
-        this.events.add(e);
-    }
-
-    public void printEvents() {
-        StackTraceElement[] last = new StackTraceElement[0];
-        for (GraphEvent e : events) {
-            last = e.print(last);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/Node.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,561 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.lang.annotation.*;
-import java.util.*;
-
-import com.oracle.graal.graph.NodeClass.*;
-
-
-/**
- * This class is the base class for all nodes, it represent a node which can be inserted in a {@link Graph}.<br>
- * Once a node has been added to a graph, it has a graph-unique {@link #id()}. Edges in the subclasses are represented
- * with annotated fields. There are two kind of edges : {@link Input} and {@link Successor}. If a field, of a type
- * compatible with {@link Node}, annotated with either {@link Input} and {@link Successor} is not null, then there is an
- * edge from this node to the node this field points to.<br>
- * Fields in a node subclass can also be annotated with {@link Data} : such fields will be used when comparing 2 nodes
- * with {@link #equals(Object)}, for value numbering and for debugging purposes.<br>
- * Nodes which are be value numberable should implement the {@link ValueNumberable} interface.
- *
- * <h1>Assertions and Verification</h1>
- *
- * The Node class supplies the {@link #assertTrue(boolean, String, Object...)} and
- * {@link #assertFalse(boolean, String, Object...)} methods, which will check the supplied boolean and throw a
- * VerificationError if it has the wrong value. Both methods will always either throw an exception or return true.
- * They can thus be used within an assert statement, so that the check is only performed if assertions are enabled.
- *
- *
- */
-public abstract class Node implements Cloneable, Formattable {
-
-    static final int DELETED_ID_START = -1000000000;
-    static final int INITIAL_ID = -1;
-    static final int ALIVE_ID_START = 0;
-
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.FIELD)
-    public static @interface Input {
-        boolean notDataflow() default false;
-    }
-
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.FIELD)
-    public static @interface Successor {}
-
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.FIELD)
-    public static @interface Data {}
-
-    /**
-     * Denotes that a parameter of an {@linkplain NodeIntrinsic intrinsic} method
-     * must be a compile time constant at all call sites to the intrinic method.
-     */
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.PARAMETER)
-    public static @interface ConstantNodeParameter {}
-
-    /**
-     * Annotates a method that can be replaced by a compiler intrinsic.
-     * That is, a (resolved) call to the annotated method can be replaced
-     * with an instance of the node class denoted by {@link #value()}.
-     * For this reason, the signature of the annotated method must match
-     * the signature of a constructor in the node class.
-     */
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.METHOD)
-    public static @interface NodeIntrinsic {
-        /**
-         * Gets the {@link Node} subclass instantiated when intrinsifying a call to the annotated method.
-         * If not specified, then the class in which the annotated method is declared is used
-         * (and is assumed to be a {@link Node} subclass).
-         */
-        Class value() default NodeIntrinsic.class;
-    }
-
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.METHOD)
-    public static @interface NodePhase {
-        Class value() default NodePhase.class;
-    }
-
-    public interface ValueNumberable {}
-
-    public interface IterableNodeType {}
-
-    private Graph graph;
-    int id;
-
-    // this next pointer is used in Graph to implement fast iteration over NodeClass types, it therefore points to the next Node of the same type.
-    Node typeCacheNext;
-
-    private NodeUsagesList usages;
-    private Node predecessor;
-    private int modCount;
-    private NodeClass nodeClass;
-
-    public Node() {
-        this.graph = null;
-        this.id = INITIAL_ID;
-        nodeClass = NodeClass.get(getClass());
-    }
-
-    protected int id() {
-        return id;
-    }
-
-    public Graph graph() {
-        return graph;
-    }
-
-    /**
-     * Returns an {@link NodeInputsIterable iterable} which can be used to traverse all non-null input edges of this node.
-     * @return an {@link NodeInputsIterable iterable} for all non-null input edges.
-     */
-    public NodeInputsIterable inputs() {
-        return getNodeClass().getInputIterable(this);
-    }
-
-    /**
-     * Returns an {@link NodeSuccessorsIterable iterable} which can be used to traverse all non-null successor edges of this node.
-     * @return an {@link NodeSuccessorsIterable iterable} for all non-null successor edges.
-     */
-    public NodeSuccessorsIterable successors() {
-        return getNodeClass().getSuccessorIterable(this);
-    }
-
-    public final NodeUsagesList usages() {
-        return usages;
-    }
-
-    public final Node predecessor() {
-        return predecessor;
-    }
-
-    final int modCount() {
-        return modCount;
-    }
-
-    final void incModCount() {
-        modCount++;
-    }
-
-    public boolean isDeleted() {
-        return id <= DELETED_ID_START;
-    }
-
-    public boolean isAlive() {
-        return id >= ALIVE_ID_START;
-    }
-
-    /**
-     * Updates the usages sets of the given nodes after an input slot is changed from oldInput to newInput:
-     * removes this node from oldInput's usages and adds this node to newInput's usages.
-     */
-    protected void updateUsages(Node oldInput, Node newInput) {
-        assert assertTrue(usages != null, "usages == null while adding %s to %s", newInput, this);
-        if (oldInput != newInput) {
-            if (oldInput != null) {
-                boolean result = removeThisFromUsages(oldInput);
-                assert assertTrue(result, "not found in usages, old input: %s", oldInput);
-            }
-            if (newInput != null) {
-                NodeWorkList inputChanged = graph.inputChanged;
-                if (inputChanged != null) {
-                    inputChanged.addAgain(this);
-                }
-                newInput.usages.add(this);
-            }
-        }
-    }
-
-    /**
-     * Updates the predecessor sets of the given nodes after a successor slot is changed from oldSuccessor to newSuccessor:
-     * removes this node from oldSuccessor's predecessors and adds this node to newSuccessor's predecessors.
-     */
-    protected void updatePredecessors(Node oldSuccessor, Node newSuccessor) {
-        assert assertTrue(usages != null, "usages == null while adding %s to %s", newSuccessor, this);
-        if (oldSuccessor != newSuccessor) {
-            if (oldSuccessor != null) {
-                assert assertTrue(oldSuccessor.predecessor == this, "wrong predecessor in old successor (%s): %s", oldSuccessor, oldSuccessor.predecessor);
-                oldSuccessor.predecessor = null;
-            }
-            if (newSuccessor != null) {
-                assert assertTrue(newSuccessor.predecessor == null, "unexpected non-null predecessor in new successor (%s): %s", newSuccessor, newSuccessor.predecessor);
-                newSuccessor.predecessor = this;
-            }
-        }
-    }
-
-    void initialize(Graph newGraph) {
-        assert assertTrue(id == INITIAL_ID, "unexpected id: %d", id);
-        this.graph = newGraph;
-        newGraph.register(this);
-        usages = new NodeUsagesList();
-        for (Node input : inputs()) {
-            updateUsages(null, input);
-        }
-        for (Node successor : successors()) {
-            updatePredecessors(null, successor);
-        }
-    }
-
-    public final NodeClass getNodeClass() {
-        return nodeClass;
-    }
-
-    // TODO (thomaswue): Do not allow to replace with null.
-    private boolean checkReplaceWith(Node other) {
-        assert assertFalse(other == this, "cannot replace a node with itself");
-        assert assertFalse(isDeleted(), "cannot replace deleted node");
-//        assert assertTrue(other != null, "cannot replace with null node");
-        assert assertTrue(other == null || !other.isDeleted(), "cannot replace with deleted node %s", other);
-        assert assertTrue(other == null || other.graph() == graph, "cannot replace with node in different graph: %s", other == null ? null : other.graph());
-        return true;
-    }
-
-    public void replaceAtUsages(Node other) {
-        assert checkReplaceWith(other);
-        for (Node usage : usages) {
-            boolean result = usage.getNodeClass().replaceFirstInput(usage, this, other);
-            assert assertTrue(result, "not found in inputs, usage: %s", usage);
-            if (other != null) {
-                other.usages.add(usage);
-            }
-        }
-        usages.clear();
-    }
-
-    public void replaceAtPredecessors(Node other) {
-        assert checkReplaceWith(other);
-        if (predecessor != null) {
-            boolean result = predecessor.getNodeClass().replaceFirstSuccessor(predecessor, this, other);
-            assert assertTrue(result, "not found in successors, predecessor: %s", predecessor);
-            predecessor.updatePredecessors(this, other);
-        }
-    }
-
-    public void replaceAndDelete(Node other) {
-        assert checkReplaceWith(other);
-        if (other != null) {
-            clearSuccessors();
-            replaceAtUsages(other);
-            replaceAtPredecessors(other);
-        }
-        safeDelete();
-    }
-
-    public void replaceFirstSuccessor(Node oldSuccessor, Node newSuccessor) {
-        if (getNodeClass().replaceFirstSuccessor(this, oldSuccessor, newSuccessor)) {
-            updatePredecessors(oldSuccessor, newSuccessor);
-        }
-    }
-
-    public void replaceFirstInput(Node oldInput, Node newInput) {
-        if (getNodeClass().replaceFirstInput(this, oldInput, newInput)) {
-            updateUsages(oldInput, newInput);
-        }
-    }
-
-    public void clearInputs() {
-        assert assertFalse(isDeleted(), "cannot clear inputs of deleted node");
-
-        for (Node input : inputs()) {
-            removeThisFromUsages(input);
-        }
-        getNodeClass().clearInputs(this);
-    }
-
-    private boolean removeThisFromUsages(Node n) {
-        if (n.usages.remove(this)) {
-            if (n.usages.size() == 0) {
-                graph.usagesDropped.add(n);
-            }
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    public void clearSuccessors() {
-        assert assertFalse(isDeleted(), "cannot clear successors of deleted node");
-
-        for (Node successor : successors()) {
-            assert assertTrue(successor.predecessor == this, "wrong predecessor in old successor (%s): %s", successor, successor.predecessor);
-            successor.predecessor = null;
-        }
-        getNodeClass().clearSuccessors(this);
-    }
-
-    private boolean checkDeletion() {
-        assertTrue(usages.isEmpty(), "cannot delete node %s because of usages: %s", this, usages);
-        assertTrue(predecessor == null, "cannot delete node %s because of predecessor: %s", this, predecessor);
-        return true;
-    }
-
-    public void safeDelete() {
-        assert checkDeletion();
-        clearInputs();
-        clearSuccessors();
-        graph.unregister(this);
-        id = DELETED_ID_START - id;
-        assert isDeleted();
-    }
-
-    public final Node copyWithInputs() {
-        Node newNode = clone(graph);
-        NodeClass clazz = getNodeClass();
-        clazz.copyInputs(this, newNode);
-        for (Node input : inputs()) {
-            input.usages.add(newNode);
-        }
-        return newNode;
-    }
-
-    public Node clone(Graph into) {
-        Node newNode = null;
-        try {
-            newNode = (Node) this.clone();
-        } catch (CloneNotSupportedException e) {
-            throw new GraalInternalError(e).addContext(this);
-        }
-        getNodeClass().clearInputs(newNode);
-        getNodeClass().clearSuccessors(newNode);
-        newNode.graph = into;
-        newNode.typeCacheNext = null;
-        newNode.id = INITIAL_ID;
-        into.register(newNode);
-        newNode.usages = new NodeUsagesList();
-        newNode.predecessor = null;
-        newNode.modCount = 0;
-        return newNode;
-    }
-
-    public boolean verify() {
-        assertTrue(isAlive(), "cannot verify inactive nodes (id=%d)", id);
-        assertTrue(graph() != null, "null graph");
-        for (Node input : inputs()) {
-            assertTrue(input.usages().contains(this), "missing usage in input %s", input);
-            assertTrue(input.graph() == graph(), "mismatching graph in input %s", input);
-        }
-        for (Node successor : successors()) {
-            assertTrue(successor.predecessor() == this, "missing predecessor in %s (actual: %s)", successor, successor.predecessor());
-            assertTrue(successor.graph() == graph(), "mismatching graph in successor %s", successor);
-        }
-        for (Node usage : usages()) {
-            assertFalse(usage.isDeleted(), "usage must never be deleted");
-            assertTrue(usage.inputs().contains(this), "missing input in usage %s", usage);
-        }
-        if (predecessor != null) {
-            assertFalse(predecessor.isDeleted(), "predecessor must never be deleted");
-            assertTrue(predecessor.successors().contains(this), "missing successor in predecessor %s", predecessor);
-        }
-        return true;
-    }
-
-    public boolean assertTrue(boolean condition, String message, Object... args) {
-        if (condition) {
-            return true;
-        } else {
-            throw new VerificationError(message, args).addContext(this);
-        }
-    }
-
-    public boolean assertFalse(boolean condition, String message, Object... args) {
-        if (condition) {
-            throw new VerificationError(message, args).addContext(this);
-        } else {
-            return true;
-        }
-    }
-
-    public Iterable<? extends Node> cfgPredecessors() {
-        if (predecessor == null) {
-            return Collections.emptySet();
-        } else {
-            return Collections.singleton(predecessor);
-        }
-    }
-
-    /**
-     * Returns an iterator that will provide all control-flow successors of this node. Normally this will be the contents of all fields marked as NodeSuccessor,
-     * but some node classes (like EndNode) may return different nodes.
-     * Note that the iterator may generate null values if the fields contain them.
-     */
-    public Iterable<? extends Node> cfgSuccessors() {
-        return successors();
-    }
-
-    /**
-     * hashCode and equals should always rely on object identity alone, thus hashCode and equals are final.
-     */
-    @Override
-    public final int hashCode() {
-        return super.hashCode();
-    }
-
-    /**
-     * hashCode and equals should always rely on object identity alone, thus hashCode and equals are final.
-     */
-    @Override
-    public final boolean equals(Object obj) {
-        return super.equals(obj);
-    }
-
-    /**
-     * Provides a {@link Map} of properties of this node for use in debugging (e.g., to view in the ideal graph
-     * visualizer). Subclasses overriding this method should add to the map returned by their superclass.
-     */
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> map = new HashMap<>();
-        map.put("usageCount", usages.size());
-        map.put("predecessorCount", predecessor == null ? 0 : 1);
-        getNodeClass().getDebugProperties(this, map);
-        return map;
-    }
-
-    /**
-     * This method is a shortcut for {@link #toString(Verbosity)} with {@link Verbosity#Short}.
-     */
-    @Override
-    public final String toString() {
-        return toString(Verbosity.Short);
-    }
-
-    public enum Verbosity {
-        /**
-         * Only the id of the node.
-         */
-        Id,
-        /**
-         * Only the name of the node, which may contain some more information for certain node types (constants, ...).
-         */
-        Name,
-        /**
-         * {@link #Id} + {@link #Name}.
-         */
-        Short,
-        /**
-         * Defaults to {@link #Short} and may be enhanced by subclasses.
-         */
-        Long,
-        /**
-         * For use by a custom formatting facility in an IDE.
-         */
-        Debugger,
-        /**
-         * All the other information plus all debug properties of the node.
-         */
-        All
-    }
-
-    /**
-     * Creates a String representation for this node with a given {@link Verbosity}.
-     */
-    public String toString(Verbosity verbosity) {
-        switch (verbosity) {
-            case Id:
-                return Integer.toString(id);
-            case Name:
-                return getNodeClass().shortName();
-            case Short:
-                return toString(Verbosity.Id) + "|" + toString(Verbosity.Name);
-            case Long:
-                return toString(Verbosity.Short);
-            case Debugger:
-            case All: {
-                StringBuilder str = new StringBuilder();
-                str.append(toString(Verbosity.Short)).append(" { ");
-                for (Map.Entry<Object, Object> entry : getDebugProperties().entrySet()) {
-                    str.append(entry.getKey()).append("=").append(entry.getValue()).append(", ");
-                }
-                str.append(" }");
-                return str.toString();
-            }
-            default:
-                throw new RuntimeException("unknown verbosity: " + verbosity);
-        }
-    }
-
-    @Override
-    public void formatTo(Formatter formatter, int flags, int width, int precision) {
-        if ((flags & FormattableFlags.ALTERNATE) == FormattableFlags.ALTERNATE) {
-            formatter.format("%s", toString(Verbosity.Id));
-        } else if ((flags & FormattableFlags.UPPERCASE) == FormattableFlags.UPPERCASE) {
-            formatter.format("%s", toString(Verbosity.Long));
-        } else {
-            formatter.format("%s", toString(Verbosity.Short));
-        }
-
-        boolean neighborsAlternate = ((flags & FormattableFlags.LEFT_JUSTIFY) == FormattableFlags.LEFT_JUSTIFY);
-        int neighborsFlags = (neighborsAlternate ? FormattableFlags.ALTERNATE | FormattableFlags.LEFT_JUSTIFY : 0);
-        if (width > 0) {
-            if (this.predecessor != null) {
-                formatter.format(" pred={");
-                this.predecessor.formatTo(formatter, neighborsFlags, width - 1, 0);
-                formatter.format("}");
-            }
-
-            NodeClassIterator inputIter = inputs().iterator();
-            while (inputIter.hasNext()) {
-                Position position = inputIter.nextPosition();
-                Node input = getNodeClass().get(this, position);
-                if (input != null) {
-                    formatter.format(" ");
-                    formatter.format(getNodeClass().getName(position));
-                    formatter.format("={");
-                    input.formatTo(formatter, neighborsFlags, width - 1, 0);
-                    formatter.format("}");
-                }
-            }
-        }
-
-        if (precision > 0) {
-            if (this.usages.size() > 0) {
-                formatter.format(" usages={");
-                int z = 0;
-                for (Node usage : this.usages) {
-                    if (z != 0) {
-                        formatter.format(", ");
-                    }
-                    usage.formatTo(formatter, neighborsFlags, 0, precision - 1);
-                    ++z;
-                }
-                formatter.format("}");
-            }
-
-            NodeClassIterator succIter = successors().iterator();
-            while (succIter.hasNext()) {
-                Position position = succIter.nextPosition();
-                Node successor = getNodeClass().get(this, position);
-                if (successor != null) {
-                    formatter.format(" ");
-                    formatter.format(getNodeClass().getName(position));
-                    formatter.format("={");
-                    successor.formatTo(formatter, neighborsFlags, 0, precision - 1);
-                    formatter.format("}");
-                }
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeBitMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-
-
-public final class NodeBitMap implements Iterable<Node>{
-
-    private final BitMap bitMap;
-    private final Graph graph;
-
-    public NodeBitMap(Graph graph) {
-        this.graph = graph;
-        bitMap = new BitMap(graph.nodeIdCount());
-    }
-
-    public Graph graph() {
-        return graph;
-    }
-
-    public boolean setIntersect(NodeBitMap other) {
-        return bitMap.setIntersect(other.bitMap);
-    }
-
-    public void setUnion(NodeBitMap other) {
-        bitMap.setUnion(other.bitMap);
-    }
-
-    public void negate() {
-        grow();
-        bitMap.negate();
-    }
-
-    public boolean isNotNewMarked(Node node) {
-        return !isNew(node) && isMarked(node);
-    }
-
-    public boolean isNotNewNotMarked(Node node) {
-        return !isNew(node) && !isMarked(node);
-    }
-
-    public boolean isMarked(Node node) {
-        check(node);
-        return bitMap.get(node.id());
-    }
-
-    public boolean isNew(Node node) {
-        return node.id() >= bitMap.size();
-    }
-
-    public void mark(Node node) {
-        check(node);
-        bitMap.set(node.id());
-    }
-
-    public void clear(Node node) {
-        check(node);
-        bitMap.clear(node.id());
-    }
-
-    public void clearAll() {
-        bitMap.clearAll();
-    }
-
-    public void grow(Node node) {
-        bitMap.grow(node.id() + 1);
-    }
-
-    public void grow() {
-        bitMap.grow(graph.nodeIdCount());
-    }
-
-    private void check(Node node) {
-        assert node.graph() == graph : "this node is not part of the graph";
-        assert !isNew(node) : "this node (" + node.id() + ") was added to the graph after creating the node bitmap (" + bitMap.length() + ")";
-        assert node.isAlive() : "node " + node + " is deleted!";
-    }
-
-    @Override
-    public String toString() {
-        return bitMap.toBinaryString();
-    }
-
-    public <T extends Node> void markAll(Collection<T> nodes) {
-        for (Node node : nodes) {
-            mark(node);
-        }
-    }
-
-    private static class MarkedNodeIterator implements Iterator<Node> {
-        private final NodeBitMap visited;
-        private Iterator<Node> nodes;
-        private Node nextNode;
-
-        public MarkedNodeIterator(NodeBitMap visited, Iterator<Node> nodes) {
-            this.visited = visited;
-            this.nodes = nodes;
-            forward();
-        }
-
-        private void forward() {
-            do {
-                if (!nodes.hasNext()) {
-                    nextNode = null;
-                    return;
-                }
-                nextNode = nodes.next();
-                if (visited.isNew(nextNode)) {
-                    nextNode = null;
-                    return;
-                }
-            } while (!visited.isMarked(nextNode));
-        }
-
-        @Override
-        public boolean hasNext() {
-            return nextNode != null;
-        }
-
-        @Override
-        public Node next() {
-            try {
-                return nextNode;
-            } finally {
-                forward();
-            }
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-
-    }
-
-    @Override
-    public Iterator<Node> iterator() {
-        return new MarkedNodeIterator(NodeBitMap.this, graph().getNodes().iterator());
-    }
-
-    public int cardinality() {
-        return bitMap.cardinality();
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeClass.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,949 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.*;
-import java.util.Map.*;
-import java.util.concurrent.ConcurrentHashMap;
-
-import com.oracle.graal.graph.Node.Data;
-
-import sun.misc.Unsafe;
-
-public class NodeClass {
-
-    public static final int NOT_ITERABLE = -1;
-
-    /**
-     * Interface used by {@link NodeClass#rescanAllFieldOffsets(CalcOffset)} to determine the offset (in bytes) of a field.
-     */
-    public interface CalcOffset {
-        long getOffset(Field field);
-    }
-
-    private static final Class< ? > NODE_CLASS = Node.class;
-    private static final Class< ? > INPUT_LIST_CLASS = NodeInputList.class;
-    private static final Class< ? > SUCCESSOR_LIST_CLASS = NodeSuccessorList.class;
-
-    private static final Unsafe unsafe = getUnsafe();
-
-    private static Unsafe getUnsafe() {
-        try {
-            // this will only fail if graal is not part of the boot class path
-            return Unsafe.getUnsafe();
-        } catch (SecurityException e) {
-            // nothing to do
-        }
-        try {
-            Field theUnsafeInstance = Unsafe.class.getDeclaredField("theUnsafe");
-            theUnsafeInstance.setAccessible(true);
-            return (Unsafe) theUnsafeInstance.get(Unsafe.class);
-        } catch (Exception e) {
-            // currently we rely on being able to use Unsafe...
-            throw new RuntimeException("exception while trying to get Unsafe.theUnsafe via reflection:", e);
-        }
-    }
-
-    private static final Map<Class< ? >, NodeClass> nodeClasses = new ConcurrentHashMap<>();
-    private static int nextIterableId = 0;
-
-    private final Class< ? > clazz;
-    private final int directInputCount;
-    private final long[] inputOffsets;
-    private final Class<?>[] inputTypes;
-    private final String[] inputNames;
-    private final int directSuccessorCount;
-    private final long[] successorOffsets;
-    private final Class<?>[] successorTypes;
-    private final String[] successorNames;
-    private final long[] dataOffsets;
-    private final Class<?>[] dataTypes;
-    private final String[] dataNames;
-    private final boolean canGVN;
-    private final int startGVNNumber;
-    private final String shortName;
-    private final int iterableId;
-    private final boolean hasOutgoingEdges;
-
-    static class DefaultCalcOffset implements CalcOffset {
-        @Override
-        public long getOffset(Field field) {
-            return unsafe.objectFieldOffset(field);
-        }
-    }
-
-    public NodeClass(Class< ? > clazz) {
-        assert NODE_CLASS.isAssignableFrom(clazz);
-        this.clazz = clazz;
-
-        FieldScanner scanner = new FieldScanner(new DefaultCalcOffset());
-        scanner.scan(clazz);
-
-        directInputCount = scanner.inputOffsets.size();
-        inputOffsets = sortedLongCopy(scanner.inputOffsets, scanner.inputListOffsets);
-        directSuccessorCount = scanner.successorOffsets.size();
-        successorOffsets = sortedLongCopy(scanner.successorOffsets, scanner.successorListOffsets);
-        dataOffsets = new long[scanner.dataOffsets.size()];
-        for (int i = 0; i < scanner.dataOffsets.size(); ++i) {
-            dataOffsets[i] = scanner.dataOffsets.get(i);
-        }
-        dataTypes = scanner.dataTypes.toArray(new Class[0]);
-        dataNames = scanner.dataNames.toArray(new String[0]);
-        inputTypes = arrayUsingSortedOffsets(scanner.inputTypesMap, inputOffsets, new Class<?>[inputOffsets.length]);
-        inputNames = arrayUsingSortedOffsets(scanner.inputNamesMap, inputOffsets, new String[inputOffsets.length]);
-        successorTypes = arrayUsingSortedOffsets(scanner.successorTypesMap, successorOffsets, new Class<?>[successorOffsets.length]);
-        successorNames = arrayUsingSortedOffsets(scanner.successorNamesMap, successorOffsets, new String[successorOffsets.length]);
-
-        canGVN = Node.ValueNumberable.class.isAssignableFrom(clazz);
-        startGVNNumber = clazz.hashCode();
-
-        String newShortName = clazz.getSimpleName();
-        if (newShortName.endsWith("Node") && !newShortName.equals("StartNode") && !newShortName.equals("EndNode")) {
-            newShortName = newShortName.substring(0, newShortName.length() - 4);
-        }
-        NodeInfo info = clazz.getAnnotation(NodeInfo.class);
-        if (info != null) {
-            if (!info.shortName().isEmpty()) {
-                newShortName = info.shortName();
-            }
-        }
-        this.shortName = newShortName;
-        if (Node.IterableNodeType.class.isAssignableFrom(clazz)) {
-            this.iterableId = nextIterableId++;
-            // TODO (lstadler) add type hierarchy - based node iteration
-//            for (NodeClass nodeClass : nodeClasses.values()) {
-//                if (clazz.isAssignableFrom(nodeClass.clazz)) {
-//                    throw new UnsupportedOperationException("iterable non-final Node classes not supported: " + clazz);
-//                }
-//            }
-        } else {
-            this.iterableId = NOT_ITERABLE;
-        }
-        this.hasOutgoingEdges = this.inputOffsets.length > 0 || this.successorOffsets.length > 0;
-    }
-
-    public static void rescanAllFieldOffsets(CalcOffset calc) {
-        for (NodeClass nodeClass : nodeClasses.values()) {
-            nodeClass.rescanFieldOffsets(calc);
-        }
-    }
-
-    private void rescanFieldOffsets(CalcOffset calc) {
-        FieldScanner scanner = new FieldScanner(calc);
-        scanner.scan(clazz);
-        assert directInputCount == scanner.inputOffsets.size();
-        copyInto(inputOffsets, sortedLongCopy(scanner.inputOffsets, scanner.inputListOffsets));
-        assert directSuccessorCount == scanner.successorOffsets.size();
-        copyInto(successorOffsets, sortedLongCopy(scanner.successorOffsets, scanner.successorListOffsets));
-        assert dataOffsets.length == scanner.dataOffsets.size();
-        for (int i = 0; i < scanner.dataOffsets.size(); ++i) {
-            dataOffsets[i] = scanner.dataOffsets.get(i);
-        }
-        copyInto(dataTypes, scanner.dataTypes);
-        copyInto(dataNames, scanner.dataNames);
-
-        copyInto(inputTypes, arrayUsingSortedOffsets(scanner.inputTypesMap, this.inputOffsets, new Class<?>[this.inputOffsets.length]));
-        copyInto(inputNames, arrayUsingSortedOffsets(scanner.inputNamesMap, this.inputOffsets, new String[this.inputOffsets.length]));
-        copyInto(successorTypes, arrayUsingSortedOffsets(scanner.successorTypesMap, this.successorOffsets, new Class<?>[this.successorOffsets.length]));
-        copyInto(successorNames, arrayUsingSortedOffsets(scanner.successorNamesMap, this.successorOffsets, new String[this.successorNames.length]));
-    }
-
-    private static void copyInto(long[] dest, long[] src) {
-        assert dest.length == src.length;
-        for (int i = 0; i < dest.length; i++) {
-            dest[i] = src[i];
-        }
-    }
-
-    private static <T> void copyInto(T[] dest, T[] src) {
-        assert dest.length == src.length;
-        for (int i = 0; i < dest.length; i++) {
-            dest[i] = src[i];
-        }
-    }
-
-    private static <T> void copyInto(T[] dest, List<T> src) {
-        assert dest.length == src.size();
-        for (int i = 0; i < dest.length; i++) {
-            dest[i] = src.get(i);
-        }
-    }
-
-    public boolean hasOutgoingEdges() {
-        return hasOutgoingEdges;
-    }
-
-    public String shortName() {
-        return shortName;
-    }
-
-    public int iterableId() {
-        return iterableId;
-    }
-
-    public boolean valueNumberable() {
-        return canGVN;
-    }
-
-    private static synchronized NodeClass getSynchronized(Class< ? > c) {
-        NodeClass clazz = nodeClasses.get(c);
-        if (clazz == null) {
-            clazz = new NodeClass(c);
-            nodeClasses.put(c, clazz);
-        }
-        return clazz;
-    }
-
-    public static final NodeClass get(Class< ? > c) {
-        NodeClass clazz = nodeClasses.get(c);
-        return clazz == null ? getSynchronized(c) : clazz;
-    }
-
-    public static int cacheSize() {
-        return nextIterableId;
-    }
-
-    private static class FieldScanner {
-        public final ArrayList<Long> inputOffsets = new ArrayList<>();
-        public final ArrayList<Long> inputListOffsets = new ArrayList<>();
-        public final Map<Long, Class< ? >> inputTypesMap = new HashMap<>();
-        public final Map<Long, String> inputNamesMap = new HashMap<>();
-        public final ArrayList<Long> successorOffsets = new ArrayList<>();
-        public final ArrayList<Long> successorListOffsets = new ArrayList<>();
-        public final Map<Long, Class< ? >> successorTypesMap = new HashMap<>();
-        public final Map<Long, String> successorNamesMap = new HashMap<>();
-        public final ArrayList<Long> dataOffsets = new ArrayList<>();
-        public final ArrayList<Class< ? >> dataTypes = new ArrayList<>();
-        public final ArrayList<String> dataNames = new ArrayList<>();
-        public final CalcOffset calc;
-
-        public FieldScanner(CalcOffset calc) {
-            this.calc = calc;
-        }
-
-        public void scan(Class< ? > clazz) {
-            Class< ? > currentClazz = clazz;
-            do {
-                for (Field field : currentClazz.getDeclaredFields()) {
-                    if (!Modifier.isStatic(field.getModifiers())) {
-                        Class< ? > type = field.getType();
-                        long offset = calc.getOffset(field);
-                        String name = field.getName();
-                        if (field.isAnnotationPresent(Node.Input.class)) {
-                            assert !field.isAnnotationPresent(Node.Successor.class) : "field cannot be both input and successor";
-                            if (INPUT_LIST_CLASS.isAssignableFrom(type)) {
-                                inputListOffsets.add(offset);
-                            } else {
-                                assert NODE_CLASS.isAssignableFrom(type) : "invalid input type: " + type;
-                                inputOffsets.add(offset);
-                                inputTypesMap.put(offset, type);
-                            }
-                            if (field.getAnnotation(Node.Input.class).notDataflow()) {
-                                inputNamesMap.put(offset, name + "#NDF");
-                            } else {
-                                inputNamesMap.put(offset, name);
-                            }
-                        } else if (field.isAnnotationPresent(Node.Successor.class)) {
-                            if (SUCCESSOR_LIST_CLASS.isAssignableFrom(type)) {
-                                successorListOffsets.add(offset);
-                            } else {
-                                assert NODE_CLASS.isAssignableFrom(type) : "invalid successor type: " + type;
-                                successorOffsets.add(offset);
-                                successorTypesMap.put(offset, type);
-                            }
-                            successorNamesMap.put(offset, name);
-                        } else if (field.isAnnotationPresent(Node.Data.class)) {
-                            dataOffsets.add(offset);
-                            dataTypes.add(type);
-                            dataNames.add(name);
-                        } else {
-                            assert !NODE_CLASS.isAssignableFrom(type) || name.equals("Null") : "suspicious node field: " + field;
-                            assert !INPUT_LIST_CLASS.isAssignableFrom(type) : "suspicious node input list field: " + field;
-                            assert !SUCCESSOR_LIST_CLASS.isAssignableFrom(type) : "suspicious node successor list field: " + field;
-                        }
-                    }
-                }
-                currentClazz = currentClazz.getSuperclass();
-            } while (currentClazz != Node.class);
-        }
-    }
-
-    private static <T> T[] arrayUsingSortedOffsets(Map<Long, T> map, long[] sortedOffsets, T[] result) {
-        for (int i = 0; i < sortedOffsets.length; i++) {
-            result[i] = map.get(sortedOffsets[i]);
-        }
-        return result;
-    }
-
-    private static long[] sortedLongCopy(ArrayList<Long> list1, ArrayList<Long> list2) {
-        Collections.sort(list1);
-        Collections.sort(list2);
-        long[] result = new long[list1.size() + list2.size()];
-        for (int i = 0; i < list1.size(); i++) {
-            result[i] = list1.get(i);
-        }
-        for (int i = 0; i < list2.size(); i++) {
-            result[list1.size() + i] = list2.get(i);
-        }
-        return result;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder str = new StringBuilder();
-        str.append("NodeClass ").append(clazz.getSimpleName()).append(" [");
-        for (int i = 0; i < inputOffsets.length; i++) {
-            str.append(i == 0 ? "" : ", ").append(inputOffsets[i]);
-        }
-        str.append("] [");
-        for (int i = 0; i < successorOffsets.length; i++) {
-            str.append(i == 0 ? "" : ", ").append(successorOffsets[i]);
-        }
-        str.append("] [");
-        for (int i = 0; i < dataOffsets.length; i++) {
-            str.append(i == 0 ? "" : ", ").append(dataOffsets[i]);
-        }
-        str.append("]");
-        return str.toString();
-    }
-
-    public static final class Position {
-        public final boolean input;
-        public final int index;
-        public final int subIndex;
-
-        public Position(boolean input, int index, int subIndex) {
-            this.input = input;
-            this.index = index;
-            this.subIndex = subIndex;
-        }
-
-        @Override
-        public String toString() {
-            return (input ? "input " : "successor ") + index + "/" + subIndex;
-        }
-
-        public Node get(Node node) {
-            return node.getNodeClass().get(node, this);
-        }
-
-        public void set(Node node, Node value) {
-            node.getNodeClass().set(node, this, value);
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + index;
-            result = prime * result + (input ? 1231 : 1237);
-            result = prime * result + subIndex;
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            Position other = (Position) obj;
-            if (index != other.index) {
-                return false;
-            }
-            if (input != other.input) {
-                return false;
-            }
-            if (subIndex != other.subIndex) {
-                return false;
-            }
-            return true;
-        }
-    }
-
-    private static Node getNode(Node node, long offset) {
-        return (Node) unsafe.getObject(node, offset);
-    }
-
-    @SuppressWarnings("unchecked")
-    private static NodeList<Node> getNodeList(Node node, long offset) {
-        return (NodeList<Node>) unsafe.getObject(node, offset);
-    }
-
-    private static void putNode(Node node, long offset, Node value) {
-        unsafe.putObject(node, offset, value);
-    }
-
-    private static void putNodeList(Node node, long offset, NodeList value) {
-        unsafe.putObject(node, offset, value);
-    }
-
-    /**
-     * An iterator that will iterate over the fields given in {@link offsets}.
-     * The first {@ directCount} offsets are treated as fields of type {@link Node}, while the rest of the fields are treated as {@link NodeList}s.
-     * All elements of these NodeLists will be visited by the iterator as well.
-     * This iterator can be used to iterate over the inputs or successors of a node.
-     *
-     * An iterator of this type will not return null values, unless the field values are modified concurrently.
-     * Concurrent modifications are detected by an assertion on a best-effort basis.
-     */
-    public static final class NodeClassIterator implements Iterator<Node> {
-
-        private final Node node;
-        private final int modCount;
-        private final int directCount;
-        private final long[] offsets;
-        private int index;
-        private int subIndex;
-
-        /**
-         * Creates an iterator that will iterate over fields in the given node.
-         * @param node the node which contains the fields.
-         * @param offsets the offsets of the fields.
-         * @param directCount the number of fields that should be treated as fields of type {@link Node}, the rest are treated as {@link NodeList}s.
-         */
-        private NodeClassIterator(Node node, long[] offsets, int directCount) {
-            this.node = node;
-            this.modCount = node.modCount();
-            this.offsets = offsets;
-            this.directCount = directCount;
-            index = NOT_ITERABLE;
-            subIndex = 0;
-            forward();
-        }
-
-        private void forward() {
-            if (index < directCount) {
-                index++;
-                while (index < directCount) {
-                    Node element = getNode(node, offsets[index]);
-                    if (element != null) {
-                        return;
-                    }
-                    index++;
-                }
-            } else {
-                subIndex++;
-            }
-            while (index < offsets.length) {
-                NodeList<Node> list = getNodeList(node, offsets[index]);
-                while (subIndex < list.size()) {
-                    if (list.get(subIndex) != null) {
-                        return;
-                    }
-                    subIndex++;
-                }
-                subIndex = 0;
-                index++;
-            }
-        }
-
-        private Node nextElement() {
-            if (index < directCount) {
-                return getNode(node, offsets[index]);
-            } else  if (index < offsets.length) {
-                NodeList<Node> list = getNodeList(node, offsets[index]);
-                return list.get(subIndex);
-            }
-            return null;
-        }
-
-        @Override
-        public boolean hasNext() {
-            try {
-                return index < offsets.length;
-            } finally {
-                assert modCount == node.modCount() : "must not be modified";
-            }
-        }
-
-        @Override
-        public Node next() {
-            try {
-                return nextElement();
-            } finally {
-                forward();
-                assert modCount == node.modCount();
-            }
-        }
-
-        public Position nextPosition() {
-            try {
-                if (index < directCount) {
-                    return new Position(offsets == node.getNodeClass().inputOffsets, index, NOT_ITERABLE);
-                } else {
-                    return new Position(offsets == node.getNodeClass().inputOffsets, index, subIndex);
-                }
-            } finally {
-                forward();
-                assert modCount == node.modCount();
-            }
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    public int valueNumber(Node n) {
-        int number = 0;
-        if (canGVN) {
-            number = startGVNNumber;
-            for (int i = 0; i < dataOffsets.length; ++i) {
-                Class<?> type = dataTypes[i];
-                if (type.isPrimitive()) {
-                    if (type == Integer.TYPE) {
-                        int intValue = unsafe.getInt(n, dataOffsets[i]);
-                        number += intValue;
-                    } else if (type == Boolean.TYPE) {
-                        boolean booleanValue = unsafe.getBoolean(n, dataOffsets[i]);
-                        if (booleanValue) {
-                            number += 7;
-                        }
-                    } else {
-                        assert false;
-                    }
-                } else {
-                    Object o = unsafe.getObject(n, dataOffsets[i]);
-                    if (o != null) {
-                        number += o.hashCode();
-                    }
-                }
-                number *= 13;
-            }
-        }
-        return number;
-    }
-
-    /**
-     * Populates a given map with the names and values of all fields marked with @{@link Data}.
-     * @param node the node from which to take the values.
-     * @param properties a map that will be populated.
-     */
-    public void getDebugProperties(Node node, Map<Object, Object> properties) {
-        for (int i = 0; i < dataOffsets.length; ++i) {
-            Class<?> type = dataTypes[i];
-            Object value = null;
-            if (type.isPrimitive()) {
-                if (type == Integer.TYPE) {
-                    value = unsafe.getInt(node, dataOffsets[i]);
-                } else if (type == Boolean.TYPE) {
-                    value = unsafe.getBoolean(node, dataOffsets[i]);
-                } else {
-                    assert false;
-                }
-            } else {
-                value = unsafe.getObject(node, dataOffsets[i]);
-            }
-            properties.put("data." + dataNames[i], value);
-        }
-    }
-
-    public boolean valueEqual(Node a, Node b) {
-        if (!canGVN || a.getNodeClass() != b.getNodeClass()) {
-            return a == b;
-        }
-        for (int i = 0; i < dataOffsets.length; ++i) {
-            Class<?> type = dataTypes[i];
-            if (type.isPrimitive()) {
-                if (type == Integer.TYPE) {
-                    int aInt = unsafe.getInt(a, dataOffsets[i]);
-                    int bInt = unsafe.getInt(b, dataOffsets[i]);
-                    if (aInt != bInt) {
-                        return false;
-                    }
-                } else if (type == Boolean.TYPE) {
-                    boolean aBoolean = unsafe.getBoolean(a, dataOffsets[i]);
-                    boolean bBoolean = unsafe.getBoolean(b, dataOffsets[i]);
-                    if (aBoolean != bBoolean) {
-                        return false;
-                    }
-                } else {
-                    assert false;
-                }
-            } else {
-                Object objectA = unsafe.getObject(a, dataOffsets[i]);
-                Object objectB = unsafe.getObject(b, dataOffsets[i]);
-                if (objectA != objectB) {
-                    if (objectA != null && objectB != null) {
-                        if (!(objectA.equals(objectB))) {
-                            return false;
-                        }
-                    } else {
-                        return false;
-                    }
-                }
-            }
-        }
-        return true;
-    }
-
-    public Node get(Node node, Position pos) {
-        long offset = pos.input ? inputOffsets[pos.index] : successorOffsets[pos.index];
-        if (pos.subIndex == NOT_ITERABLE) {
-            return getNode(node, offset);
-        } else {
-            return getNodeList(node, offset).get(pos.subIndex);
-        }
-    }
-
-    public String getName(Position pos) {
-        return pos.input ? inputNames[pos.index] : successorNames[pos.index];
-    }
-
-    private void set(Node node, Position pos, Node x) {
-        long offset = pos.input ? inputOffsets[pos.index] : successorOffsets[pos.index];
-        if (pos.subIndex == NOT_ITERABLE) {
-            Node old = getNode(node,  offset);
-            assert x == null || (pos.input ? inputTypes : successorTypes)[pos.index].isAssignableFrom(x.getClass()) : this + ".set(node, pos, " + x + ") while type is " + (pos.input ? inputTypes : successorTypes)[pos.index];
-            putNode(node, offset, x);
-            if (pos.input) {
-                node.updateUsages(old, x);
-            } else {
-                node.updatePredecessors(old, x);
-            }
-        } else {
-            NodeList<Node> list = getNodeList(node, offset);
-            if (pos.subIndex < list.size()) {
-                list.set(pos.subIndex, x);
-            } else {
-                while (pos.subIndex < list.size() - 1) {
-                    list.add(null);
-                }
-                list.add(x);
-            }
-        }
-    }
-
-    public NodeInputsIterable getInputIterable(final Node node) {
-        assert clazz.isInstance(node);
-        return new NodeInputsIterable() {
-
-            @Override
-            public NodeClassIterator iterator() {
-                return new NodeClassIterator(node, inputOffsets, directInputCount);
-            }
-
-            @Override
-            public boolean contains(Node other) {
-                return inputContains(node, other);
-            }
-        };
-    }
-
-    public NodeSuccessorsIterable getSuccessorIterable(final Node node) {
-        assert clazz.isInstance(node);
-        return new NodeSuccessorsIterable() {
-            @Override
-            public NodeClassIterator iterator() {
-                return new NodeClassIterator(node, successorOffsets, directSuccessorCount);
-            }
-
-            @Override
-            public boolean contains(Node other) {
-                return successorContains(node, other);
-            }
-        };
-    }
-
-    public boolean replaceFirstInput(Node node, Node old, Node other) {
-        int index = 0;
-        while (index < directInputCount) {
-            Node input = getNode(node, inputOffsets[index]);
-            if (input == old) {
-                assert other == null || inputTypes[index].isAssignableFrom(other.getClass());
-                putNode(node, inputOffsets[index], other);
-                return true;
-            }
-            index++;
-        }
-        while (index < inputOffsets.length) {
-            NodeList<Node> list = getNodeList(node, inputOffsets[index]);
-            assert list != null : clazz;
-            if (list.replaceFirst(old, other)) {
-                return true;
-            }
-            index++;
-        }
-        return false;
-    }
-
-    public boolean replaceFirstSuccessor(Node node, Node old, Node other) {
-        int index = 0;
-        while (index < directSuccessorCount) {
-            Node successor = getNode(node, successorOffsets[index]);
-            if (successor == old) {
-                assert other == null || successorTypes[index].isAssignableFrom(other.getClass()) : successorTypes[index] + " is not compatible with " + other.getClass();
-                putNode(node, successorOffsets[index], other);
-                return true;
-            }
-            index++;
-        }
-        while (index < successorOffsets.length) {
-            NodeList<Node> list = getNodeList(node, successorOffsets[index]);
-            assert list != null : clazz + " " + successorOffsets[index] + " " + node;
-            if (list.replaceFirst(old, other)) {
-                return true;
-            }
-            index++;
-        }
-        return false;
-    }
-
-    /**
-     * Clear all inputs in the given node. This is accomplished by setting input fields to null and replacing input lists with new lists.
-     * (which is important so that this method can be used to clear the inputs of cloned nodes.)
-     * @param node the node to be cleared
-     */
-    public void clearInputs(Node node) {
-        int index = 0;
-        while (index < directInputCount) {
-            putNode(node, inputOffsets[index++], null);
-        }
-        while (index < inputOffsets.length) {
-            long curOffset = inputOffsets[index++];
-            int size = (getNodeList(node, curOffset)).initialSize;
-            // replacing with a new list object is the expected behavior!
-            putNodeList(node, curOffset, new NodeInputList<>(node, size));
-        }
-    }
-
-    /**
-     * Clear all successors in the given node. This is accomplished by setting successor fields to null and replacing successor lists with new lists.
-     * (which is important so that this method can be used to clear the successors of cloned nodes.)
-     * @param node the node to be cleared
-     */
-    public void clearSuccessors(Node node) {
-        int index = 0;
-        while (index < directSuccessorCount) {
-            putNode(node, successorOffsets[index++], null);
-        }
-        while (index < successorOffsets.length) {
-            long curOffset = successorOffsets[index++];
-            int size = getNodeList(node, curOffset).initialSize;
-            // replacing with a new list object is the expected behavior!
-            putNodeList(node, curOffset, new NodeSuccessorList<>(node, size));
-        }
-    }
-
-    /**
-     * Copies the inputs from node to newNode. The nodes are expected to be of the exact same NodeClass type.
-     * @param node the node from which the inputs should be copied.
-     * @param newNode the node to which the inputs should be copied.
-     */
-    public void copyInputs(Node node, Node newNode) {
-        assert node.getClass() == clazz && newNode.getClass() == clazz;
-
-        int index = 0;
-        while (index < directInputCount) {
-            putNode(newNode, inputOffsets[index], getNode(node, inputOffsets[index]));
-            index++;
-        }
-        while (index < inputOffsets.length) {
-            NodeList<Node> list = getNodeList(newNode, inputOffsets[index]);
-            list.copy(getNodeList(node, inputOffsets[index]));
-            index++;
-        }
-    }
-
-    /**
-     * Copies the successors from node to newNode. The nodes are expected to be of the exact same NodeClass type.
-     * @param node the node from which the successors should be copied.
-     * @param newNode the node to which the successors should be copied.
-     */
-    public void copySuccessors(Node node, Node newNode) {
-        assert node.getClass() == clazz && newNode.getClass() == clazz;
-
-        int index = 0;
-        while (index < directSuccessorCount) {
-            putNode(newNode, successorOffsets[index], getNode(node, successorOffsets[index]));
-            index++;
-        }
-        while (index < successorOffsets.length) {
-            NodeList<Node> list = getNodeList(newNode, successorOffsets[index]);
-            list.copy(getNodeList(node, successorOffsets[index]));
-            index++;
-        }
-    }
-
-    public boolean edgesEqual(Node node, Node other) {
-        assert node.getClass() == clazz && other.getClass() == clazz;
-
-        int index = 0;
-        while (index < directInputCount) {
-            if (getNode(other, inputOffsets[index]) != getNode(node, inputOffsets[index])) {
-                return false;
-            }
-            index++;
-        }
-        while (index < inputOffsets.length) {
-            NodeList<Node> list = getNodeList(other, inputOffsets[index]);
-            if (!list.equals(getNodeList(node, inputOffsets[index]))) {
-                return false;
-            }
-            index++;
-        }
-
-        index = 0;
-        while (index < directSuccessorCount) {
-            if (getNode(other, successorOffsets[index]) != getNode(node, successorOffsets[index])) {
-                return false;
-            }
-            index++;
-        }
-        while (index < successorOffsets.length) {
-            NodeList<Node> list = getNodeList(other, successorOffsets[index]);
-            if (!list.equals(getNodeList(node, successorOffsets[index]))) {
-                return false;
-            }
-            index++;
-        }
-        return true;
-    }
-
-    public boolean inputContains(Node node, Node other) {
-        assert node.getClass() == clazz;
-
-        int index = 0;
-        while (index < directInputCount) {
-            if (getNode(node, inputOffsets[index]) == other) {
-                return true;
-            }
-            index++;
-        }
-        while (index < inputOffsets.length) {
-            NodeList<Node> list = getNodeList(node, inputOffsets[index]);
-            if (list.contains(other)) {
-                return true;
-            }
-            index++;
-        }
-        return false;
-    }
-
-    public boolean successorContains(Node node, Node other) {
-        assert node.getClass() == clazz;
-
-        int index = 0;
-        while (index < directSuccessorCount) {
-            if (getNode(node, successorOffsets[index]) == other) {
-                return true;
-            }
-            index++;
-        }
-        while (index < successorOffsets.length) {
-            NodeList<Node> list = getNodeList(node, successorOffsets[index]);
-            if (list.contains(other)) {
-                return true;
-            }
-            index++;
-        }
-        return false;
-    }
-
-    public int directInputCount() {
-        return directInputCount;
-    }
-
-    public int directSuccessorCount() {
-        return directSuccessorCount;
-    }
-
-    static Map<Node, Node> addGraphDuplicate(Graph graph, Iterable<Node> nodes, Map<Node, Node> replacements) {
-        Map<Node, Node> newNodes = new IdentityHashMap<>();
-        // create node duplicates
-        for (Node node : nodes) {
-            if (node != null && !replacements.containsKey(node)) {
-                assert !node.isDeleted() : "trying to duplicate deleted node";
-                Node newNode = node.clone(graph);
-                assert newNode.getClass() == node.getClass();
-                newNodes.put(node, newNode);
-            }
-        }
-        // re-wire inputs
-        for (Entry<Node, Node> entry : newNodes.entrySet()) {
-            Node oldNode = entry.getKey();
-            Node node = entry.getValue();
-            for (NodeClassIterator iter = oldNode.inputs().iterator(); iter.hasNext();) {
-                Position pos = iter.nextPosition();
-                Node input = oldNode.getNodeClass().get(oldNode, pos);
-                Node target = replacements.get(input);
-                if (target == null) {
-                    target = newNodes.get(input);
-                }
-                node.getNodeClass().set(node, pos, target);
-            }
-        }
-        for (Entry<Node, Node> entry : replacements.entrySet()) {
-            Node oldNode = entry.getKey();
-            Node node = entry.getValue();
-            if (oldNode == node) {
-                continue;
-            }
-            for (NodeClassIterator iter = oldNode.inputs().iterator(); iter.hasNext();) {
-                Position pos = iter.nextPosition();
-                Node input = oldNode.getNodeClass().get(oldNode, pos);
-                if (newNodes.containsKey(input)) {
-                    node.getNodeClass().set(node, pos, newNodes.get(input));
-                }
-            }
-        }
-
-        // re-wire successors
-        for (Entry<Node, Node> entry : newNodes.entrySet()) {
-            Node oldNode = entry.getKey();
-            Node node = entry.getValue();
-            for (NodeClassIterator iter = oldNode.successors().iterator(); iter.hasNext();) {
-                Position pos = iter.nextPosition();
-                Node succ = oldNode.getNodeClass().get(oldNode, pos);
-                Node target = replacements.get(succ);
-                if (target == null) {
-                    target = newNodes.get(succ);
-                }
-                node.getNodeClass().set(node, pos, target);
-            }
-        }
-        for (Entry<Node, Node> entry : replacements.entrySet()) {
-            Node oldNode = entry.getKey();
-            Node node = entry.getValue();
-            if (oldNode == node) {
-                continue;
-            }
-            for (NodeClassIterator iter = oldNode.successors().iterator(); iter.hasNext();) {
-                Position pos = iter.nextPosition();
-                Node succ = oldNode.getNodeClass().get(oldNode, pos);
-                if (newNodes.containsKey(succ)) {
-                    node.getNodeClass().set(node, pos, newNodes.get(succ));
-                }
-            }
-        }
-        return newNodes;
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeFlood.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.ArrayDeque;
-import java.util.Iterator;
-import java.util.Queue;
-
-
-public class NodeFlood implements Iterable<Node> {
-    private final NodeBitMap visited;
-    private final Queue<Node> worklist;
-
-    public NodeFlood(Graph graph) {
-        visited = graph.createNodeBitMap();
-        worklist = new ArrayDeque<>();
-    }
-
-    public void add(Node node) {
-        if (node != null && !visited.isMarked(node)) {
-            visited.mark(node);
-            worklist.add(node);
-        }
-    }
-
-    public void addAll(Iterable<Node> nodes) {
-        for (Node node : nodes) {
-            this.add(node);
-        }
-    }
-
-    public boolean isMarked(Node node) {
-        return visited.isMarked(node);
-    }
-
-    public boolean isNew(Node node) {
-        return visited.isNew(node);
-    }
-
-    private static class QueueConsumingIterator implements Iterator<Node> {
-        private final Queue<Node> queue;
-
-        public QueueConsumingIterator(Queue<Node> queue) {
-            this.queue = queue;
-        }
-
-        @Override
-        public boolean hasNext() {
-            return !queue.isEmpty();
-        }
-
-        @Override
-        public Node next() {
-            return queue.remove();
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    @Override
-    public Iterator<Node> iterator() {
-        return new QueueConsumingIterator(worklist);
-    }
-
-    private static class UnmarkedNodeIterator implements Iterator<Node> {
-        private final NodeBitMap visited;
-        private Iterator<Node> nodes;
-        private Node nextNode;
-
-        public UnmarkedNodeIterator(NodeBitMap visited, Iterator<Node> nodes) {
-            this.visited = visited;
-            this.nodes = nodes;
-            forward();
-        }
-
-        private void forward() {
-            do {
-                if (!nodes.hasNext()) {
-                    nextNode = null;
-                    return;
-                }
-                nextNode = nodes.next();
-            } while (visited.isMarked(nextNode));
-        }
-
-        @Override
-        public boolean hasNext() {
-            return nextNode != null;
-        }
-
-        @Override
-        public Node next() {
-            try {
-                return nextNode;
-            } finally {
-                forward();
-            }
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    public Iterable<Node> unmarkedNodes() {
-        return new Iterable<Node>() {
-            @Override
-            public Iterator<Node> iterator() {
-                return new UnmarkedNodeIterator(visited, visited.graph().getNodes().iterator());
-            }
-        };
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeInfo.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface NodeInfo {
-    String shortName() default "";
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeInputList.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.*;
-
-
-public final class NodeInputList<T extends Node> extends NodeList<T> {
-
-    private final Node self;
-
-    public NodeInputList(Node self, int initialSize) {
-        super(initialSize);
-        this.self = self;
-    }
-
-    public NodeInputList(Node self) {
-        this.self = self;
-    }
-
-    public NodeInputList(Node self, T[] elements) {
-        super(elements);
-        assert self.usages() == null;
-        this.self = self;
-    }
-
-    public NodeInputList(Node self, List<? extends T> elements) {
-        super(elements);
-        assert self.usages() == null;
-        this.self = self;
-    }
-
-    @Override
-    protected void update(T oldNode, T newNode) {
-        self.updateUsages(oldNode, newNode);
-    }
-
-    @Override
-    public boolean add(T node) {
-        assert !node.isDeleted();
-        self.incModCount();
-        return super.add(node);
-    }
-
-    @Override
-    public T remove(int index) {
-        self.incModCount();
-        return super.remove(index);
-    }
-
-    @Override
-    public boolean remove(Object node) {
-        self.incModCount();
-        return super.remove(node);
-    }
-
-    @Override
-    public void clear() {
-        self.incModCount();
-        super.clear();
-    }
-
-    @Override
-    void copy(NodeList<T> other) {
-        self.incModCount();
-        super.copy(other);
-    }
-
-    @Override
-    public void setAll(NodeList<T> values) {
-        self.incModCount();
-        super.setAll(values);
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeInputsIterable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import com.oracle.graal.graph.NodeClass.NodeClassIterator;
-import com.oracle.graal.graph.iterators.*;
-
-public abstract class NodeInputsIterable extends NodeIterable<Node> {
-    @Override
-    public abstract NodeClassIterator iterator();
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeList.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,377 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import com.oracle.graal.graph.iterators.*;
-
-public abstract class NodeList<T extends Node> extends NodeIterable<T> implements List<T> {
-
-    protected static final Node[] EMPTY_NODE_ARRAY = new Node[0];
-
-    protected Node[] nodes;
-    private int size;
-    private int modCount;
-    protected final int initialSize;
-
-    protected NodeList() {
-        this.nodes = EMPTY_NODE_ARRAY;
-        this.initialSize = 0;
-    }
-
-    protected NodeList(int initialSize) {
-        this.size = initialSize;
-        this.initialSize = initialSize;
-        this.nodes = new Node[initialSize];
-    }
-
-    protected NodeList(T[] elements) {
-        if (elements == null) {
-            this.size = 0;
-            this.nodes = EMPTY_NODE_ARRAY;
-            this.initialSize = 0;
-        } else {
-            this.size = elements.length;
-            this.initialSize = elements.length;
-            this.nodes = new Node[elements.length];
-            for (int i = 0; i < elements.length; i++) {
-                this.nodes[i] = elements[i];
-            }
-        }
-    }
-
-    protected NodeList(List<? extends T> elements) {
-        if (elements == null || elements.isEmpty()) {
-            this.size = 0;
-            this.nodes = EMPTY_NODE_ARRAY;
-            this.initialSize = 0;
-        } else {
-            this.size = elements.size();
-            this.initialSize = elements.size();
-            this.nodes = new Node[elements.size()];
-            for (int i = 0; i < elements.size(); i++) {
-                this.nodes[i] = elements.get(i);
-            }
-        }
-    }
-
-    protected abstract void update(T oldNode, T newNode);
-
-    @Override
-    public final int size() {
-        return size;
-    }
-
-    @Override
-    public final boolean isEmpty() {
-        return size == 0;
-    }
-
-    @Override
-    public boolean isNotEmpty() {
-        return size > 0;
-    }
-
-    @Override
-    public int count() {
-        return size;
-    }
-
-    protected final void incModCount() {
-        modCount++;
-    }
-
-    @Override
-    public boolean add(T node) {
-        incModCount();
-        if (size == nodes.length) {
-            nodes = Arrays.copyOf(nodes, nodes.length * 2 + 1);
-        }
-        nodes[size++] = node;
-        update(null, node);
-        return true;
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public T get(int index) {
-        assert index < size() : index + " < " + size();
-        return (T) nodes[index];
-    }
-
-    public T last() {
-        return get(size() - 1);
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public T set(int index, T node) {
-        incModCount();
-        T oldValue = (T) nodes[index];
-        assert index < size();
-        update((T) nodes[index], node);
-        nodes[index] = node;
-        return oldValue;
-    }
-
-    void copy(NodeList<T> other) {
-        incModCount();
-        nodes = Arrays.copyOf(other.nodes, other.size);
-        size = other.size;
-    }
-
-    public boolean equals(NodeList<T> other) {
-        if (size != other.size) {
-            return false;
-        }
-        for (int i = 0; i < size; i++) {
-            if (nodes[i] != other.nodes[i]) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public void clear() {
-        incModCount();
-        for (int i = 0; i < size; i++) {
-            update((T) nodes[i], null);
-        }
-        nodes = EMPTY_NODE_ARRAY;
-        size = 0;
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public boolean remove(Object node) {
-        int i = 0;
-        incModCount();
-        while (i < size && nodes[i] != node) {
-            i++;
-        }
-        if (i < size) {
-            T oldValue = (T) nodes[i];
-            i++;
-            while (i < size) {
-                nodes[i - 1] = nodes[i];
-                i++;
-            }
-            nodes[--size] = null;
-            update(oldValue, null);
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public T remove(int index) {
-        T oldValue = (T) nodes[index];
-        int i = index + 1;
-        incModCount();
-        while (i < size) {
-            nodes[i - 1] = nodes[i];
-            i++;
-        }
-        nodes[--size] = null;
-        update(oldValue, null);
-        return oldValue;
-    }
-
-    boolean replaceFirst(Node node, Node other) {
-        for (int i = 0; i < size; i++) {
-            if (nodes[i] == node) {
-                nodes[i] = other;
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public Iterator<T> iterator() {
-        return new Iterator<T>() {
-            private final int expectedModCount = NodeList.this.modCount;
-            private int index = 0;
-
-            @Override
-            public boolean hasNext() {
-                assert expectedModCount == NodeList.this.modCount;
-                return index < NodeList.this.size;
-            }
-
-            @SuppressWarnings("unchecked")
-            @Override
-            public T next() {
-                assert expectedModCount == NodeList.this.modCount;
-                return (T) NodeList.this.nodes[index++];
-            }
-
-            @Override
-            public void remove() {
-                throw new UnsupportedOperationException();
-            }
-        };
-    }
-
-    @Override
-    public boolean contains(T other) {
-        for (int i = 0; i < size; i++) {
-            if (nodes[i] == other) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public List<T> snapshot() {
-        return (List<T>) Arrays.asList(Arrays.copyOf(this.nodes, this.size));
-    }
-
-    @SuppressWarnings("unchecked")
-    public void setAll(NodeList<T> values) {
-        incModCount();
-        for (int i = 0; i < size(); i++) {
-            update((T) nodes[i], null);
-        }
-        nodes = Arrays.copyOf(values.nodes, values.size());
-        size = values.size();
-
-        for (int i = 0; i < size(); i++) {
-            update(null, (T) nodes[i]);
-        }
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public <A> A[] toArray(A[] template) {
-        return (A[]) Arrays.copyOf(nodes, size, template.getClass());
-    }
-
-    @Override
-    public Object[] toArray() {
-        return Arrays.copyOf(nodes, size);
-    }
-
-    protected void replace(T node, T other) {
-        incModCount();
-        for (int i = 0; i < size(); i++) {
-            if (nodes[i] == node) {
-                nodes[i] = other;
-                update(node, other);
-            }
-        }
-    }
-
-    @Override
-    public int indexOf(Object node) {
-        for (int i = 0; i < size; i++) {
-            if (nodes[i] == node) {
-                return i;
-            }
-        }
-        return -1;
-    }
-
-
-    @Override
-    public boolean contains(Object o) {
-        return indexOf(o) != -1;
-    }
-
-    @Override
-    public boolean containsAll(Collection< ? > c) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public boolean addAll(Collection< ? extends T> c) {
-        for (T e : c) {
-            add(e);
-        }
-        return true;
-    }
-
-    @Override
-    public boolean addAll(int index, Collection< ? extends T> c) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public boolean removeAll(Collection< ? > c) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public boolean retainAll(Collection< ? > c) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public void add(int index, T element) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public int lastIndexOf(Object o) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public ListIterator<T> listIterator() {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public ListIterator<T> listIterator(int index) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public List<T> subList(int fromIndex, int toIndex) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append('[');
-        for (int i = 0; i < size; i++) {
-            if (i != 0) {
-                sb.append(", ");
-            }
-            sb.append(nodes[i]);
-        }
-        sb.append(']');
-        return sb.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.AbstractMap.SimpleEntry;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map.Entry;
-
-
-public final class NodeMap<T> {
-    private final Graph graph;
-    private Object[] values;
-    private int size;
-
-    public NodeMap(Graph graph) {
-        this.graph = graph;
-        values = new Object[graph.nodeIdCount()];
-        size = values.length;
-    }
-
-    public NodeMap(NodeMap<T> copyFrom) {
-        this.graph = copyFrom.graph;
-        this.values = Arrays.copyOf(copyFrom.values, copyFrom.values.length);
-        this.size = copyFrom.size;
-    }
-
-    @SuppressWarnings("unchecked")
-    public T get(Node node) {
-        check(node);
-        return (T) values[node.id()];
-    }
-
-    public Graph graph() {
-        return graph;
-    }
-
-    public void set(Node node, T value) {
-        check(node);
-        values[node.id()] = value;
-    }
-
-    public int size() {
-        return size;
-    }
-
-    public boolean isNew(Node node) {
-        return node.id() >= size;
-    }
-
-    public void grow(Node upTo) {
-        if (isNew(upTo)) {
-            size = upTo.id() + 1;
-            if (values.length < size) {
-                values = Arrays.copyOf(values, size + 9); // TODO implement a better growth policy
-            }
-        }
-    }
-
-    private void check(Node node) {
-        assert node.graph() == graph : "this node is not part of the graph";
-        assert !isNew(node) : "this node was added to the graph after creating the node map : " + node;
-    }
-
-    public Iterable<Entry<Node, T>> entries() {
-        return new Iterable<Entry<Node, T>>() {
-            @Override
-            public Iterator<Entry<Node, T>> iterator() {
-                return new Iterator<Entry<Node, T>>() {
-                    int i = 0;
-                    @Override
-                    public boolean hasNext() {
-                        forward();
-                        return i < NodeMap.this.values.length;
-                    }
-
-                    @SuppressWarnings("unchecked")
-                    @Override
-                    public Entry<Node, T> next() {
-                        final int pos = i;
-                        Node key = NodeMap.this.graph.getNode(pos);
-                        T value = (T) NodeMap.this.values[pos];
-                        i++;
-                        forward();
-                        return new SimpleEntry<Node, T>(key, value){
-                            private static final long serialVersionUID = 7813842391085737738L;
-                            @Override
-                            public T setValue(T v) {
-                                T oldv = super.setValue(v);
-                                NodeMap.this.values[pos] = v;
-                                return oldv;
-                            }
-                        };
-                    }
-
-                    @Override
-                    public void remove() {
-                        throw new UnsupportedOperationException();
-                    }
-
-                    private void forward() {
-                        while (i < NodeMap.this.values.length && (NodeMap.this.graph.getNode(i) == null || NodeMap.this.values[i] == null)) {
-                            i++;
-                        }
-                    }
-                };
-            }
-        };
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeSuccessorList.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-public final class NodeSuccessorList<T extends Node> extends NodeList<T> {
-
-    private final Node self;
-
-    public NodeSuccessorList(Node self, int initialSize) {
-        super(initialSize);
-        this.self = self;
-    }
-
-    protected NodeSuccessorList(Node self) {
-        this.self = self;
-    }
-
-    public NodeSuccessorList(Node self, T[] elements) {
-        super(elements);
-        assert self.usages() == null;
-        this.self = self;
-    }
-
-    @Override
-    protected void update(T oldNode, T newNode) {
-        self.updatePredecessors(oldNode, newNode);
-    }
-
-    @Override
-    public boolean add(T node) {
-        self.incModCount();
-        return super.add(node);
-    }
-
-    @Override
-    public T remove(int index) {
-        self.incModCount();
-        return super.remove(index);
-    }
-
-    @Override
-    public boolean remove(Object node) {
-        self.incModCount();
-        return super.remove(node);
-    }
-
-    @Override
-    public void clear() {
-        self.incModCount();
-        super.clear();
-    }
-
-    @Override
-    void copy(NodeList<T> other) {
-        self.incModCount();
-        super.copy(other);
-    }
-
-    @Override
-    public void setAll(NodeList<T> values) {
-        self.incModCount();
-        super.setAll(values);
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeSuccessorsIterable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import com.oracle.graal.graph.NodeClass.NodeClassIterator;
-import com.oracle.graal.graph.iterators.*;
-
-public abstract class NodeSuccessorsIterable extends NodeIterable<Node> {
-    @Override
-    public abstract NodeClassIterator iterator();
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeUsagesList.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.*;
-
-import com.oracle.graal.graph.iterators.*;
-
-public final class NodeUsagesList extends NodeIterable<Node> {
-
-    protected static final Node[] EMPTY_NODE_ARRAY = new Node[0];
-
-    protected Node[] nodes = EMPTY_NODE_ARRAY;
-    private int size;
-    private int modCount;
-
-    NodeUsagesList() {
-        this.size = 0;
-        this.nodes = EMPTY_NODE_ARRAY;
-    }
-
-    NodeUsagesList(Node[] nodes) {
-        this.size = nodes.length;
-        this.nodes = nodes;
-    }
-
-    public int size() {
-        return size;
-    }
-
-    @Override
-    public boolean isEmpty() {
-        return size == 0;
-    }
-
-    @Override
-    public boolean isNotEmpty() {
-        return size > 0;
-    }
-
-    @Override
-    public int count() {
-        return size;
-    }
-
-    protected void incModCount() {
-        modCount++;
-    }
-
-    public boolean add(Node node) {
-        incModCount();
-        if (size == nodes.length) {
-            nodes = Arrays.copyOf(nodes, nodes.length * 2 + 1);
-        }
-        nodes[size++] = node;
-        return true;
-    }
-
-    void copyAndClear(NodeUsagesList other) {
-        incModCount();
-        other.incModCount();
-        nodes = other.nodes;
-        size = other.size;
-        nodes = EMPTY_NODE_ARRAY;
-        size = 0;
-    }
-
-    public void clear() {
-        incModCount();
-        nodes = EMPTY_NODE_ARRAY;
-        size = 0;
-    }
-
-    boolean remove(Node node) {
-        int i = 0;
-        incModCount();
-        while (i < size && nodes[i] != node) {
-            i++;
-        }
-        if (i < size) {
-            i++;
-            while (i < size) {
-                nodes[i - 1] = nodes[i];
-                i++;
-            }
-            nodes[--size] = null;
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    boolean replaceFirst(Node node, Node other) {
-        for (int i = 0; i < size; i++) {
-            if (nodes[i] == node) {
-                nodes[i] = other;
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public Iterator<Node> iterator() {
-        return new Iterator<Node>() {
-            private final int expectedModCount = NodeUsagesList.this.modCount;
-            private int index = 0;
-
-            @Override
-            public boolean hasNext() {
-                assert expectedModCount == NodeUsagesList.this.modCount;
-                return index < NodeUsagesList.this.size;
-            }
-
-            @Override
-            public Node next() {
-                assert expectedModCount == NodeUsagesList.this.modCount;
-                return NodeUsagesList.this.nodes[index++];
-            }
-
-            @Override
-            public void remove() {
-                throw new UnsupportedOperationException();
-            }
-        };
-    }
-
-    @Override
-    public boolean contains(Node other) {
-        for (int i = 0; i < size; i++) {
-            if (nodes[i] == other) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public List<Node> snapshot() {
-        return Arrays.asList(Arrays.copyOf(NodeUsagesList.this.nodes, NodeUsagesList.this.size));
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder str = new StringBuilder();
-        str.append('[');
-        for (int i = 0; i < size; i++) {
-            if (i > 0) {
-                str.append(", ");
-            }
-            str.append(nodes[i]);
-        }
-        str.append(']');
-        return str.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/NodeWorkList.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-import java.util.ArrayDeque;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-
-public class NodeWorkList implements Iterable<Node> {
-    private final NodeBitMap visited;
-    private final NodeBitMap inQueue;
-    private final Queue<Node> worklist;
-    private int iterationLimit = Integer.MAX_VALUE;
-    private Node firstNoChange;
-    private Node lastPull;
-    private Node lastChain;
-
-    public NodeWorkList(Graph graph) {
-        this(graph, false, -1);
-    }
-
-    public NodeWorkList(Graph graph, boolean fill, int iterationLimitPerNode) {
-        visited = graph.createNodeBitMap();
-        inQueue = graph.createNodeBitMap();
-        if (fill) {
-            ArrayDeque<Node> deque = new ArrayDeque<>(graph.getNodeCount());
-            for (Node node : graph.getNodes()) {
-                deque.add(node);
-            }
-            worklist = deque;
-        } else {
-            worklist = new ArrayDeque<>();
-        }
-        if (iterationLimitPerNode > 0) {
-            iterationLimit = iterationLimitPerNode * graph.getNodeCount();
-        }
-    }
-
-    public void addAll(Iterable<? extends Node> nodes) {
-        for (Node node : nodes) {
-            this.add(node);
-        }
-    }
-
-    public void add(Node node) {
-        if (node != null) {
-            if (visited.isNew(node)) {
-                visited.grow(node);
-                inQueue.grow(node);
-            }
-            if (!visited.isMarked(node)) {
-                addAgain(node);
-            }
-        }
-    }
-
-    public void addAgain(Node node) {
-        if (visited.isNew(node)) {
-            visited.grow(node);
-            inQueue.grow(node);
-        }
-        if (node != null && !inQueue.isMarked(node)) {
-            if (lastPull == node) {
-                if (firstNoChange == null) {
-                    firstNoChange = node;
-                    lastChain = node;
-                } else if (node == firstNoChange) {
-                    throw new InfiniteWorkException("ReAdded " + node);
-                } else {
-                    lastChain = node;
-                }
-            } else {
-                firstNoChange = null;
-            }
-            visited.mark(node);
-            inQueue.mark(node);
-            worklist.add(node);
-        }
-    }
-
-    public void clearVisited() {
-        visited.clearAll();
-    }
-
-    public void replaced(Node newNode, Node oldNode) {
-        this.replaced(newNode, oldNode, false);
-    }
-
-    public void replaced(Node newNode, Node oldNode, boolean add) {
-        worklist.remove(oldNode);
-        if (newNode == null) {
-            return;
-        }
-        if (add) {
-            this.add(newNode);
-        }
-        for (Node n : newNode.usages()) {
-            addAgain(n);
-        }
-    }
-
-    public boolean isMarked(Node node) {
-        return visited.isMarked(node);
-    }
-
-    public boolean isNew(Node node) {
-        return visited.isNew(node);
-    }
-
-    public boolean isEmpty() {
-        return worklist.isEmpty();
-    }
-
-    public boolean isInQueue(Node node) {
-        return !inQueue.isNew(node) && inQueue.isMarked(node);
-    }
-
-    private class QueueConsumingIterator implements Iterator<Node> {
-        private final Queue<Node> queue;
-
-        public QueueConsumingIterator(Queue<Node> queue) {
-            this.queue = queue;
-        }
-
-        @Override
-        public boolean hasNext() {
-            dropDeleted();
-            return iterationLimit > 0 && !queue.isEmpty();
-        }
-
-        @Override
-        public Node next() {
-            if (iterationLimit-- <= 0) {
-                throw new NoSuchElementException();
-            }
-            dropDeleted();
-            Node node = queue.remove();
-            if (lastPull != lastChain) {
-                firstNoChange = null;
-            }
-            lastPull = node;
-            inQueue.clear(node);
-            return node;
-        }
-
-        private void dropDeleted() {
-            while (!queue.isEmpty() && queue.peek().isDeleted()) {
-                queue.remove();
-            }
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    @Override
-    public Iterator<Node> iterator() {
-        return new QueueConsumingIterator(worklist);
-    }
-
-    private static class UnmarkedNodeIterator implements Iterator<Node> {
-        private final NodeBitMap visited;
-        private Iterator<Node> nodes;
-        private Node nextNode;
-
-        public UnmarkedNodeIterator(NodeBitMap visited, Iterator<Node> nodes) {
-            this.visited = visited;
-            this.nodes = nodes;
-            forward();
-        }
-
-        private void forward() {
-            do {
-                if (!nodes.hasNext()) {
-                    nextNode = null;
-                    return;
-                }
-                nextNode = nodes.next();
-            } while (visited.isMarked(nextNode));
-        }
-
-        @Override
-        public boolean hasNext() {
-            return nextNode != null;
-        }
-
-        @Override
-        public Node next() {
-            try {
-                return nextNode;
-            } finally {
-                forward();
-            }
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-
-    }
-
-    public Iterable<Node> unmarkedNodes() {
-        return new Iterable<Node>() {
-            @Override
-            public Iterator<Node> iterator() {
-                return new UnmarkedNodeIterator(visited, visited.graph().getNodes().iterator());
-            }
-        };
-    }
-
-    public static class InfiniteWorkException extends RuntimeException {
-        private static final long serialVersionUID = -5319329402219396658L;
-        public InfiniteWorkException() {
-            super();
-        }
-        public InfiniteWorkException(String message) {
-            super(message);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/VerificationError.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph;
-
-
-/**
- * This error represents a failed verification of a node . It must only be used for conditions that should never occur during normal operation.
- */
-public class VerificationError extends GraalInternalError {
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 8459607567446819822L;
-
-    /**
-     * This constructor creates a {@link VerificationError} with a message assembled via {@link String#format(String, Object...)}.
-     * It always uses the ENGLISH locale in order to always generate the same output.
-     * @param msg the message that will be associated with the error, in String.format syntax
-     * @param args parameters to String.format - parameters that implement {@link Iterable} will be expanded into a [x, x, ...] representation.
-     */
-    public VerificationError(String msg, Object... args) {
-        super(msg, args);
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/FilteredNodeIterable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.iterators;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-
-public class FilteredNodeIterable<T extends Node> extends NodeIterable<T> {
-    private final NodeIterable<T> nodeIterable;
-    private NodePredicate predicate = NodePredicates.alwaysTrue();
-    private NodePredicate until = NodePredicates.isNull();
-    public FilteredNodeIterable(NodeIterable<T> nodeIterable) {
-        this.nodeIterable = nodeIterable;
-    }
-    public FilteredNodeIterable<T> and(NodePredicate nodePredicate) {
-        this.predicate = this.predicate.and(nodePredicate);
-        return this;
-    }
-    public FilteredNodeIterable<T> or(NodePredicate nodePredicate) {
-        this.predicate = this.predicate.or(nodePredicate);
-        return this;
-    }
-    @Override
-    public NodeIterable<T> until(final T u) {
-        until = until.or(NodePredicates.equals(u));
-        return this;
-    }
-    @Override
-    public NodeIterable<T> until(final Class<? extends T> clazz) {
-        until = until.or(NodePredicates.isA(clazz));
-        return this;
-    }
-    @Override
-    public Iterator<T> iterator() {
-        final Iterator<T> iterator = nodeIterable.iterator();
-        return new PredicatedProxyNodeIterator<>(until, iterator, predicate);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public <F extends T> FilteredNodeIterable<F> filter(Class<F> clazz) {
-        return (FilteredNodeIterable<F>) this.and(NodePredicates.isA(clazz));
-    }
-
-    @Override
-    public FilteredNodeIterable<T> filter(NodePredicate p) {
-        return this.and(p);
-    }
-
-    @Override
-    public FilteredNodeIterable<T> filterInterface(Class< ? > iface) {
-        return this.and(NodePredicates.isAInterface(iface));
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.iterators;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-
-public abstract class NodeIterable<T extends Node> implements Iterable<T> {
-    public NodeIterable<T> until(final T u) {
-        return new FilteredNodeIterable<>(this).until(u);
-    }
-    public NodeIterable<T> until(final Class<? extends T> clazz) {
-        return new FilteredNodeIterable<>(this).until(clazz);
-    }
-    @SuppressWarnings("unchecked")
-    public <F extends T> FilteredNodeIterable<F> filter(Class<F> clazz) {
-        return (FilteredNodeIterable<F>) new FilteredNodeIterable<>(this).and(NodePredicates.isA(clazz));
-    }
-    public FilteredNodeIterable<T> filterInterface(Class<?> iface) {
-        return new FilteredNodeIterable<>(this).and(NodePredicates.isAInterface(iface));
-    }
-    public FilteredNodeIterable<T> filter(NodePredicate predicate) {
-        return new FilteredNodeIterable<>(this).and(predicate);
-    }
-    public List<T> snapshot() {
-        ArrayList<T> list = new ArrayList<>();
-        for (T n : this) {
-            list.add(n);
-        }
-        return list;
-    }
-    public T first() {
-        Iterator<T> iterator = iterator();
-        if (iterator.hasNext()) {
-            return iterator.next();
-        }
-        return null;
-    }
-    public int count() {
-        int count = 0;
-        Iterator<T> iterator = iterator();
-        while (iterator.hasNext()) {
-            iterator.next();
-            count++;
-        }
-        return count;
-    }
-    public boolean isEmpty() {
-        return count() == 0;
-    }
-    public boolean isNotEmpty() {
-        return iterator().hasNext();
-    }
-    public boolean contains(T node) {
-        return this.filter(NodePredicates.equals(node)).isNotEmpty();
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodeIterator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.iterators;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-
-public abstract class NodeIterator<T extends Node> implements Iterator<T>{
-    protected T current;
-    protected abstract void forward();
-    @Override
-    public boolean hasNext() {
-        forward();
-        return current != null;
-    }
-    @Override
-    public T next() {
-        forward();
-        T ret = current;
-        if (current == null) {
-            throw new NoSuchElementException();
-        }
-        current = null;
-        return ret;
-    }
-    @Override
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicate.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.iterators;
-
-import com.oracle.graal.graph.*;
-
-public abstract class NodePredicate {
-
-    public abstract boolean apply(Node n);
-
-    public NodePredicate and(NodePredicate np) {
-        return NodePredicates.and(this, np);
-    }
-
-    public NodePredicate or(NodePredicate np) {
-        return NodePredicates.or(this, np);
-    }
-
-    public NodePredicate negate() {
-        return NodePredicates.not(this);
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/NodePredicates.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.iterators;
-
-import com.oracle.graal.graph.*;
-
-public abstract class NodePredicates {
-    private static final TautologyPredicate TAUTOLOGY = new TautologyPredicate();
-    private static final FalsePredicate FALSE = new FalsePredicate();
-    private static final IsNullPredicate IS_NULL = new IsNullPredicate();
-    private static final IsNotNullPredicate IS_NOT_NULL = new IsNotNullPredicate();
-
-    public static NodePredicate alwaysTrue() {
-        return TAUTOLOGY;
-    }
-
-    public static NodePredicate alwaysFalse() {
-        return FALSE;
-    }
-
-    public static NodePredicate isNull() {
-        return IS_NULL;
-    }
-
-    public static NodePredicate isNotNull() {
-        return IS_NOT_NULL;
-    }
-
-    public static NodePredicate equals(Node n) {
-        return new EqualsPredicate(n);
-    }
-
-    public static NodePredicate not(NodePredicate a) {
-        if (a == TAUTOLOGY) {
-            return FALSE;
-        }
-        if (a == FALSE) {
-            return TAUTOLOGY;
-        }
-        if (a == IS_NULL) {
-            return IS_NOT_NULL;
-        }
-        if (a == IS_NOT_NULL) {
-            return IS_NULL;
-        }
-        if (a instanceof NotPredicate) {
-            return ((NotPredicate) a).a;
-        }
-        if (a instanceof PositiveTypePredicate) {
-            return new NegativeTypePredicate((PositiveTypePredicate) a);
-        }
-        if (a instanceof NegativeTypePredicate) {
-            return new PositiveTypePredicate((NegativeTypePredicate) a);
-        }
-        if (a instanceof EqualsPredicate) {
-            return new NotEqualsPredicate(((EqualsPredicate) a).u);
-        }
-        if (a instanceof NotEqualsPredicate) {
-            return new EqualsPredicate(((NotEqualsPredicate) a).u);
-        }
-        return new NotPredicate(a);
-    }
-
-    public static NodePredicate and(NodePredicate a, NodePredicate b) {
-        if (a == TAUTOLOGY) {
-            return b;
-        }
-        if (b == TAUTOLOGY) {
-            return a;
-        }
-        if (a == FALSE || b == FALSE) {
-            return FALSE;
-        }
-        return new AndPredicate(a, b);
-    }
-
-    public static NodePredicate or(NodePredicate a, NodePredicate b) {
-        if (a == FALSE) {
-            return b;
-        }
-        if (b == FALSE) {
-            return a;
-        }
-        if (a == TAUTOLOGY || b == TAUTOLOGY) {
-            return TAUTOLOGY;
-        }
-        return new OrPredicate(a, b);
-    }
-
-    public static NegativeTypePredicate isNotA(Class<? extends Node> clazz) {
-        return new NegativeTypePredicate(clazz);
-    }
-
-    public static PositiveTypePredicate isA(Class<? extends Node> clazz) {
-        return new PositiveTypePredicate(clazz);
-    }
-
-    public static NodePredicate isAInterface(Class<?> iface) {
-        assert iface.isInterface();
-        return new PositiveTypePredicate(iface);
-    }
-
-    public static NodePredicate isNotAInterface(Class<?> iface) {
-        assert iface.isInterface();
-        return new NegativeTypePredicate(iface);
-    }
-
-    private static final class TautologyPredicate extends NodePredicate {
-        @Override
-        public boolean apply(Node n) {
-            return true;
-        }
-    }
-
-    private static final class FalsePredicate extends NodePredicate {
-        @Override
-        public boolean apply(Node n) {
-            return false;
-        }
-    }
-
-    private static final class AndPredicate extends NodePredicate {
-        private final NodePredicate a;
-        private final NodePredicate b;
-        private AndPredicate(NodePredicate a, NodePredicate b) {
-            this.a = a;
-            this.b = b;
-        }
-        @Override
-        public boolean apply(Node n) {
-            return a.apply(n) && b.apply(n);
-        }
-    }
-
-    private static final class NotPredicate extends NodePredicate {
-        private final NodePredicate a;
-        private NotPredicate(NodePredicate n) {
-            this.a = n;
-        }
-        @Override
-        public boolean apply(Node n) {
-            return !a.apply(n);
-        }
-    }
-
-    private static final class OrPredicate extends NodePredicate {
-        private final NodePredicate a;
-        private final NodePredicate b;
-        private OrPredicate(NodePredicate a, NodePredicate b) {
-            this.a = a;
-            this.b = b;
-        }
-        @Override
-        public boolean apply(Node n) {
-            return a.apply(n) || b.apply(n);
-        }
-    }
-
-    private static final class IsNullPredicate extends NodePredicate {
-        @Override
-        public boolean apply(Node n) {
-            return n == null;
-        }
-    }
-
-    private static final class IsNotNullPredicate extends NodePredicate {
-        @Override
-        public boolean apply(Node n) {
-            return n != null;
-        }
-    }
-
-    private static final class EqualsPredicate extends NodePredicate {
-        private final Node u;
-        public EqualsPredicate(Node u) {
-            this.u = u;
-        }
-        @Override
-        public boolean apply(Node n) {
-            return u == n;
-        }
-    }
-
-    private static final class NotEqualsPredicate extends NodePredicate {
-        private final Node u;
-        public NotEqualsPredicate(Node u) {
-            this.u = u;
-        }
-        @Override
-        public boolean apply(Node n) {
-            return u != n;
-        }
-    }
-
-    public static final class PositiveTypePredicate extends NodePredicate {
-        private final Class<?> type;
-        private PositiveTypePredicate or;
-        public PositiveTypePredicate(Class<?> type) {
-            this.type = type;
-        }
-        public PositiveTypePredicate(NegativeTypePredicate a) {
-            type = a.type;
-            if (a.nor != null) {
-                or = new PositiveTypePredicate(a.nor);
-            }
-        }
-        @Override
-        public boolean apply(Node n) {
-            return type.isInstance(n) || (or != null && or.apply(n));
-        }
-        public PositiveTypePredicate or(Class<? extends Node> clazz) {
-            if (or == null) {
-                or = new PositiveTypePredicate(clazz);
-            } else {
-                or.or(clazz);
-            }
-            return this;
-        }
-    }
-
-    public static final class NegativeTypePredicate extends NodePredicate {
-        private final Class<?> type;
-        private NegativeTypePredicate nor;
-        public NegativeTypePredicate(Class<?> type) {
-            this.type = type;
-        }
-        public NegativeTypePredicate(PositiveTypePredicate a) {
-            type = a.type;
-            if (a.or != null) {
-                nor = new NegativeTypePredicate(a.or);
-            }
-        }
-        @Override
-        public boolean apply(Node n) {
-            return !type.isInstance(n) && (nor == null || nor.apply(n));
-        }
-        public NegativeTypePredicate nor(Class<? extends Node> clazz) {
-            if (nor == null) {
-                nor = new NegativeTypePredicate(clazz);
-            } else {
-                nor.nor(clazz);
-            }
-            return this;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/iterators/PredicatedProxyNodeIterator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.iterators;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-
-public final class PredicatedProxyNodeIterator<T extends Node> extends NodeIterator<T> {
-    private final Iterator<T> iterator;
-    private final NodePredicate predicate;
-    private final NodePredicate until;
-    public PredicatedProxyNodeIterator(NodePredicate until, Iterator<T> iterator, NodePredicate predicate) {
-        this.until = until;
-        this.iterator = iterator;
-        this.predicate = predicate;
-    }
-    @Override
-    protected void forward() {
-        while ((current == null || !current.isAlive() || !predicate.apply(current)) && iterator.hasNext()) {
-            current = iterator.next();
-        }
-        if (current != null && (!current.isAlive() || !predicate.apply(current) || until.apply(current))) {
-            current = null;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/graal/graph/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/**
- * This package contains the Node base class and the Graph container class of the Graal IR.
- */
-package com.oracle.graal.graph;
--- a/graal/com.oracle.max.graal.graph/test/com/oracle/graal/graph/test/TestNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.test;
-
-import com.oracle.graal.graph.*;
-
-
-public class TestNode extends Node implements Node.IterableNodeType {
-    @Data private String name;
-
-    public TestNode(String name) {
-        this.name = name;
-    }
-
-
-    public String getName() {
-        return name;
-    }
-}
--- a/graal/com.oracle.max.graal.graph/test/com/oracle/graal/graph/test/TypedNodeIteratorTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.graph.test;
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.graal.graph.*;
-
-
-
-public class TypedNodeIteratorTest {
-
-    @Test
-    public void singleNodeTest() {
-        Graph graph = new Graph();
-        graph.add(new TestNode("a"));
-        assertTrue(graph.hasNode(TestNode.class));
-        assertEquals("a", toString(graph.getNodes(TestNode.class)));
-    }
-
-    @Test
-    public void deletingNodeTest() {
-        TestNode testNode = new TestNode("a");
-        Graph graph = new Graph();
-        graph.add(testNode);
-        testNode.delete();
-        assertEquals("", toString(graph.getNodes(TestNode.class)));
-    }
-
-    @Test
-    public void deleteAndAddTest() {
-        TestNode testNode = new TestNode("b");
-        Graph graph = new Graph();
-        graph.add(new TestNode("a"));
-        graph.add(testNode);
-        testNode.delete();
-        assertEquals("a", toString(graph.getNodes(TestNode.class)));
-        graph.add(new TestNode("c"));
-        assertEquals("ac", toString(graph.getNodes(TestNode.class)));
-    }
-
-    @Test
-    public void iteratorBehaviorTest() {
-        Graph graph = new Graph();
-        graph.add(new TestNode("a"));
-        Iterator<TestNode> iterator = graph.getNodes(TestNode.class).iterator();
-        assertTrue(iterator.hasNext());
-        assertEquals("a", iterator.next().getName());
-        assertFalse(iterator.hasNext());
-        graph.add(new TestNode("b"));
-        assertTrue(iterator.hasNext());
-        assertEquals("b", iterator.next().getName());
-        assertFalse(iterator.hasNext());
-        TestNode c = new TestNode("c");
-        graph.add(c);
-        assertTrue(iterator.hasNext());
-        c.delete();
-        assertFalse(iterator.hasNext());
-    }
-
-    @Test
-    public void complicatedIterationTest() {
-        Graph graph = new Graph();
-        graph.add(new TestNode("a"));
-        for (TestNode tn : graph.getNodes(TestNode.class)) {
-            String name = tn.getName();
-            for (int i = 0; i < name.length(); ++i) {
-                char c = name.charAt(i);
-                if (c == 'a') {
-                    tn.delete();
-                    graph.add(new TestNode("b"));
-                    graph.add(new TestNode("c"));
-                } else if (c == 'b') {
-                    tn.delete();
-                } else if (c == 'c') {
-                    graph.add(new TestNode("d"));
-                    graph.add(new TestNode("e"));
-                    graph.add(new TestNode("d"));
-                    graph.add(new TestNode("e"));
-                    graph.add(new TestNode("e"));
-                    graph.add(new TestNode("d"));
-                    graph.add(new TestNode("e"));
-                    graph.add(new TestNode("d"));
-                } else if (c == 'd') {
-                    for (TestNode tn2 : graph.getNodes(TestNode.class)) {
-                        if (tn2.getName().equals("e")) {
-                            tn2.delete();
-                        } else if (tn2.getName().equals("c")) {
-                            tn2.delete();
-                        }
-                    }
-                } else if (c == 'e') {
-                    fail("All e nodes must have been deleted by visiting the d node");
-                }
-            }
-        }
-        assertEquals("dddd", toString(graph.getNodes(TestNode.class)));
-    }
-
-    @Test
-    public void addingNodeDuringIterationTest() {
-        Graph graph = new Graph();
-        graph.add(new TestNode("a"));
-        StringBuilder sb = new StringBuilder();
-        int z = 0;
-        for (TestNode tn : graph.getNodes(TestNode.class)) {
-            if (z == 0) {
-                graph.add(new TestNode("b"));
-            }
-            sb.append(tn.getName());
-            z++;
-        }
-        assertEquals(2, z);
-        assertEquals("ab", sb.toString());
-        z = 0;
-        for (TestNode tn : graph.getNodes(TestNode.class)) {
-            if (z == 0) {
-                graph.add(new TestNode("c"));
-            }
-            assertNotNull(tn);
-            z++;
-        }
-        assertEquals(3, z);
-    }
-
-    private String toString(Iterable<TestNode> nodes) {
-        StringBuilder sb = new StringBuilder();
-        for (TestNode tn : nodes) {
-            sb.append(tn.getName());
-        }
-        return sb.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/Compiler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.hotspot.bridge.*;
-import com.oracle.graal.hotspot.ri.*;
-
-public interface Compiler {
-
-    CompilerToVM getVMEntries();
-    VMToCompiler getVMExits();
-    GraalCompiler getCompiler();
-    RiType lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
-    HotSpotVMConfig getConfig();
-    GraalRuntime getRuntime();
-    CiTarget getTarget();
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/CompilerImpl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot;
-
-import java.io.*;
-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.graal.compiler.*;
-import com.oracle.graal.compiler.target.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.hotspot.bridge.*;
-import com.oracle.graal.hotspot.logging.*;
-import com.oracle.graal.hotspot.ri.*;
-import com.oracle.graal.hotspot.server.*;
-
-/**
- * Singleton class holding the instance of the GraalCompiler.
- */
-public final class CompilerImpl implements Compiler, Remote {
-
-    private static Compiler theInstance;
-
-    public static Compiler getInstance() {
-        if (theInstance == null) {
-            initialize();
-        }
-        return theInstance;
-    }
-
-    public static synchronized void initialize() {
-        if (theInstance != null) {
-            return;
-        }
-
-        String remote = System.getProperty("graal.remote");
-        if (remote != null) {
-            // remote compilation (will not create a local Compiler)
-            try {
-                System.out.println("Graal compiler started in client/server mode, server: " + remote);
-                Socket socket = new Socket(remote, 1199);
-                ReplacingStreams streams = new ReplacingStreams(socket.getOutputStream(), socket.getInputStream());
-                streams.getInvocation().sendResult(new CompilerToVMImpl());
-
-                theInstance = (Compiler) streams.getInvocation().waitForResult(false);
-            } catch (IOException e1) {
-                System.out.println("Connection to compilation server FAILED.");
-                throw new RuntimeException(e1);
-            } catch (ClassNotFoundException e2) {
-                System.out.println("Connection to compilation server FAILED.");
-                throw new RuntimeException(e2);
-            }
-        } else {
-            // ordinary local compilation
-            theInstance = new CompilerImpl(null);
-        }
-    }
-
-    public static Compiler initializeServer(CompilerToVM entries) {
-        assert theInstance == null;
-        theInstance = new CompilerImpl(entries);
-        return theInstance;
-    }
-
-    private final CompilerToVM vmEntries;
-    private final VMToCompiler vmExits;
-
-    private HotSpotRuntime runtime;
-    private GraalCompiler compiler;
-    private CiTarget target;
-
-    private final HotSpotVMConfig config;
-
-    public HotSpotVMConfig getConfig() {
-        return config;
-    }
-
-    private CompilerImpl(CompilerToVM initialEntries) {
-
-        CompilerToVM entries = initialEntries;
-        // initialize VMEntries
-        if (entries == null) {
-            entries = new CompilerToVMImpl();
-        }
-
-        // initialize VMExits
-        VMToCompiler exits = new VMToCompilerImpl(this);
-
-        // logging, etc.
-        if (CountingProxy.ENABLED) {
-            exits = CountingProxy.getProxy(VMToCompiler.class, exits);
-            entries = CountingProxy.getProxy(CompilerToVM.class, entries);
-        }
-        if (Logger.ENABLED) {
-            exits = LoggingProxy.getProxy(VMToCompiler.class, exits);
-            entries = LoggingProxy.getProxy(CompilerToVM.class, entries);
-        }
-
-        // set the final fields
-        vmEntries = entries;
-        vmExits = exits;
-
-        // initialize compiler
-        config = vmEntries.getConfiguration();
-        config.check();
-    }
-
-    @Override
-    public CiTarget getTarget() {
-        if (target == null) {
-            final int wordSize = 8;
-            final int stackFrameAlignment = 16;
-            target = new CiTarget(new AMD64(), true, stackFrameAlignment, config.vmPageSize, wordSize, true, true, true);
-        }
-
-        return target;
-    }
-
-    /**
-     * Factory method for getting a Graal compiler instance. This method is called via reflection.
-     */
-    public static GraalRuntime getGraalRuntime() {
-        return getInstance().getRuntime();
-    }
-
-    @Override
-    public GraalCompiler getCompiler() {
-        if (compiler == null) {
-            // these options are important - graal will not generate correct code without them
-            GraalOptions.StackShadowPages = config.stackShadowPages;
-
-            RiXirGenerator generator = new HotSpotXirGenerator(config, getTarget(), getRuntime().getGlobalStubRegisterConfig(), this);
-            if (Logger.ENABLED) {
-                generator = LoggingProxy.getProxy(RiXirGenerator.class, generator);
-            }
-
-            Backend backend = Backend.create(target.arch, runtime, target);
-            generator.initialize(backend.newXirAssembler());
-
-            compiler = new GraalCompiler(getRuntime(), getTarget(), backend, generator);
-        }
-        return compiler;
-    }
-
-    @Override
-    public CompilerToVM getVMEntries() {
-        return vmEntries;
-    }
-
-    @Override
-    public VMToCompiler getVMExits() {
-        return vmExits;
-    }
-
-    @Override
-    public RiType lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve) {
-        if (returnType.length() == 1 && vmExits instanceof VMToCompilerImpl) {
-            VMToCompilerImpl exitsNative = (VMToCompilerImpl) vmExits;
-            CiKind kind = CiKind.fromPrimitiveOrVoidTypeChar(returnType.charAt(0));
-            switch(kind) {
-                case Boolean:
-                    return exitsNative.typeBoolean;
-                case Byte:
-                    return exitsNative.typeByte;
-                case Char:
-                    return exitsNative.typeChar;
-                case Double:
-                    return exitsNative.typeDouble;
-                case Float:
-                    return exitsNative.typeFloat;
-                case Illegal:
-                    break;
-                case Int:
-                    return exitsNative.typeInt;
-                case Jsr:
-                    break;
-                case Long:
-                    return exitsNative.typeLong;
-                case Object:
-                    break;
-                case Short:
-                    return exitsNative.typeShort;
-                case Void:
-                    return exitsNative.typeVoid;
-            }
-        }
-        return vmEntries.RiSignature_lookupType(returnType, accessingClass, eagerResolve);
-    }
-
-    @Override
-    public HotSpotRuntime getRuntime() {
-        if (runtime == null) {
-            if (GraalOptions.PrintCFGToFile) {
-//                context.addCompilationObserver(new CFGPrinterObserver());
-            }
-           // if (GraalOptions.PrintIdealGraphLevel != 0 || GraalOptions.Plot || GraalOptions.PlotOnError) {
-             //   CompilationObserver observer;
-               // if (GraalOptions.PrintIdealGraphFile) {
-              //      observer = new IdealGraphPrinterObserver();
-              //  } else {
-              //      observer = new IdealGraphPrinterObserver(GraalOptions.PrintIdealGraphAddress, GraalOptions.PrintIdealGraphPort);
-              //  }
-//                context.addCompilationObserver(observer);
-                // TODO (thomaswue): Install observer.
-           // }
-            runtime = new HotSpotRuntime(config, this);
-        }
-        return runtime;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/CompilerObject.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot;
-
-import java.io.*;
-
-
-/**
- * Parent class for all HotSpot Ri... types.
- */
-public abstract class CompilerObject implements Serializable {
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -4551670987101214877L;
-    protected final Compiler compiler;
-
-    protected CompilerObject(Compiler compiler) {
-        this.compiler = compiler;
-    }
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot;
-
-import java.util.*;
-import java.util.regex.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.printer.*;
-
-
-public class HotSpotDebugConfig implements DebugConfig {
-
-    private final String logFilter;
-    private final String meterFilter;
-    private final String timerFilter;
-    private final String dumpFilter;
-    private final String[] methodFilter;
-    private final List<DebugDumpHandler> dumpHandlers = new ArrayList<>();
-
-    public HotSpotDebugConfig(String logFilter, String meterFilter, String timerFilter, String dumpFilter, String methodFilter) {
-        this.logFilter = logFilter;
-        this.meterFilter = meterFilter;
-        this.timerFilter = timerFilter;
-        this.dumpFilter = dumpFilter;
-        this.methodFilter = methodFilter == null ? null : methodFilter.split(",");
-        if (GraalOptions.PrintIdealGraphFile) {
-            dumpHandlers.add(new IdealGraphPrinterDumpHandler());
-        } else {
-            dumpHandlers.add(new IdealGraphPrinterDumpHandler(GraalOptions.PrintIdealGraphAddress, GraalOptions.PrintIdealGraphPort));
-        }
-        dumpHandlers.add(new CFGPrinterObserver());
-    }
-
-    public boolean isLogEnabled() {
-        return isEnabled(logFilter);
-    }
-
-    public boolean isMeterEnabled() {
-        return isEnabled(meterFilter);
-    }
-
-    public boolean isDumpEnabled() {
-        return isEnabled(dumpFilter);
-    }
-
-    public boolean isTimeEnabled() {
-        return isEnabled(timerFilter);
-    }
-
-    private boolean isEnabled(String filter) {
-        return filter != null && checkContains(Debug.currentScope(), filter) && checkMethodFilter();
-    }
-
-    private static boolean checkContains(String currentScope, String filter) {
-        if (filter.contains("*")) {
-            /*filter = filter.replace("*", ".*");
-            filter = filter.replace("[", "\\[");
-            filter = filter.replace("]", "\\]");
-            filter = filter.replace(":", "\\:");*/
-            return Pattern.matches(filter, currentScope);
-        }
-        return currentScope.contains(filter);
-    }
-
-    private boolean checkMethodFilter() {
-        if (methodFilter == null) {
-            return true;
-        } else {
-            for (Object o : Debug.context()) {
-                if (o instanceof RiMethod) {
-                    String methodName = CiUtil.format("%H.%n", (RiMethod) o);
-                    for (String filter : methodFilter) {
-                        if (methodName.contains(filter)) {
-                            return true;
-                        }
-                    }
-                }
-            }
-            return false;
-        }
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("Debug config:");
-        add(sb, "Log", logFilter);
-        add(sb, "Meter", meterFilter);
-        add(sb, "Time", timerFilter);
-        add(sb, "Dump", dumpFilter);
-        add(sb, "MethodFilter", Arrays.toString(methodFilter));
-        return sb.toString();
-    }
-
-    private static void add(StringBuilder sb, String name, String filter) {
-        if (filter != null) {
-            sb.append(' ');
-            sb.append(name);
-            sb.append('=');
-            sb.append(filter);
-        }
-    }
-
-    @Override
-    public RuntimeException interceptException(Throwable e) {
-        if (e instanceof CiBailout) {
-            return null;
-        }
-        Debug.setConfig(Debug.fixedConfig(true, true, false, false, dumpHandlers));
-        // sync "Exception occured in scope: " with mx/sanitycheck.py::Test.__init__
-        Debug.log(String.format("Exception occured in scope: %s", Debug.currentScope()));
-        for (Object o : Debug.context()) {
-            Debug.log("Context obj %s", o);
-            if (o instanceof Graph) {
-                Graph graph = (Graph) o;
-                Debug.log("Found graph in context: ", graph);
-                Debug.dump(o, "Exception graph");
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public Collection<? extends DebugDumpHandler> dumpHandlers() {
-        return dumpHandlers;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.hotspot;
-
-import java.lang.reflect.*;
-
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.hotspot.logging.*;
-
-public class HotSpotOptions {
-
-    public static void setDefaultOptions() {
-        GraalOptions.MethodEndBreakpointGuards = 2;
-        GraalOptions.ResolveClassBeforeStaticInvoke = false;
-    }
-
-    public static boolean setOption(String option) {
-        if (option.length() == 0) {
-            return false;
-        }
-
-        Object value = null;
-        String fieldName = null;
-        String valueString = null;
-
-        char first = option.charAt(0);
-        if (first == '+' || first == '-') {
-            fieldName = option.substring(1);
-            value = (first == '+');
-        } else {
-            int index = option.indexOf('=');
-            if (index == -1) {
-                fieldName = option;
-                valueString = null;
-            } else {
-                fieldName = option.substring(0, index);
-                valueString = option.substring(index + 1);
-            }
-        }
-
-        Field f;
-        try {
-            f = GraalOptions.class.getField(fieldName);
-
-            if (value == null) {
-                if (f.getType() == Float.TYPE) {
-                    value = Float.parseFloat(valueString);
-                } else if (f.getType() == Double.TYPE) {
-                    value = Double.parseDouble(valueString);
-                } else if (f.getType() == Integer.TYPE) {
-                    value = Integer.parseInt(valueString);
-                } else if (f.getType() == Boolean.TYPE) {
-                    if (valueString == null || valueString.length() == 0) {
-                        value = true;
-                    } else {
-                        value = Boolean.parseBoolean(valueString);
-                    }
-                } else if (f.getType() == String.class) {
-                    if (valueString == null) {
-                        value = "";
-                    } else {
-                        value = valueString;
-                    }
-                }
-            }
-            if (value != null) {
-                f.set(null, value);
-                //Logger.info("Set option " + fieldName + " to " + value);
-            } else {
-                Logger.info("Wrong value \"" + valueString + "\" for option " + fieldName);
-                return false;
-            }
-        } catch (SecurityException e) {
-            Logger.info("Security exception when setting option " + option);
-            return false;
-        } catch (NoSuchFieldException e) {
-            Logger.info("Could not find option " + fieldName);
-            return false;
-        } catch (IllegalArgumentException e) {
-            Logger.info("Illegal value for option " + option);
-            return false;
-        } catch (IllegalAccessException e) {
-            Logger.info("Illegal access exception when setting option " + option);
-            return false;
-        }
-
-        return true;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotProxy.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot;
-
-/**
- * Provides methods to classify the HotSpot-internal identifiers.
- */
-public final class HotSpotProxy {
-
-    private HotSpotProxy() {
-    }
-
-    private enum CompilerObjectType {
-        // this enum needs to have the same values as the one in graal_Compiler.hpp
-        STUB(0x100000000000000L),
-        METHOD(0x200000000000000L),
-        CLASS(0x300000000000000L),
-        SYMBOL(0x400000000000000L),
-        CONSTANT_POOL(0x500000000000000L),
-        CONSTANT(0x600000000000000L),
-        TYPE_MASK(0xf00000000000000L),
-        DUMMY_CONSTANT(0x6ffffffffffffffL);
-
-        public final long bits;
-
-        CompilerObjectType(long bits) {
-            this.bits = bits;
-        }
-    }
-
-    public static final Long DUMMY_CONSTANT_OBJ = CompilerObjectType.DUMMY_CONSTANT.bits;
-
-    private static boolean isType(long id, CompilerObjectType type) {
-        return (id & CompilerObjectType.TYPE_MASK.bits) == type.bits;
-    }
-
-    public static boolean isStub(long id) {
-        return isType(id, CompilerObjectType.STUB);
-    }
-
-    public static boolean isMethod(long id) {
-        return isType(id, CompilerObjectType.METHOD);
-    }
-
-    public static boolean isClass(long id) {
-        return isType(id, CompilerObjectType.CLASS);
-    }
-
-    public static boolean isSymbol(long id) {
-        return isType(id, CompilerObjectType.SYMBOL);
-    }
-
-    public static boolean isConstantPool(long id) {
-        return isType(id, CompilerObjectType.CONSTANT_POOL);
-    }
-
-    public static boolean isConstant(long id) {
-        return isType(id, CompilerObjectType.CONSTANT_POOL);
-    }
-
-    public static String toString(long id) {
-        CompilerObjectType type = null;
-        for (CompilerObjectType t : CompilerObjectType.values()) {
-            if ((id & CompilerObjectType.TYPE_MASK.bits) == t.bits) {
-                type = t;
-            }
-        }
-        long num = id & ~CompilerObjectType.TYPE_MASK.bits;
-        return type + " " + num;
-    }
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiTargetMethod.*;
-import com.oracle.graal.hotspot.logging.*;
-import com.oracle.graal.hotspot.ri.*;
-
-/**
- * CiTargetMethod augmented with HotSpot-specific information.
- */
-public final class HotSpotTargetMethod extends CompilerObject {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 7807321392203253218L;
-    public final CiTargetMethod targetMethod;
-    public final HotSpotMethodResolved method; // used only for methods
-    public final String name; // used only for stubs
-
-    public final Site[] sites;
-    public final ExceptionHandler[] exceptionHandlers;
-
-    public HotSpotTargetMethod(Compiler compiler, HotSpotMethodResolved method, CiTargetMethod targetMethod) {
-        super(compiler);
-        this.method = method;
-        this.targetMethod = targetMethod;
-        this.name = null;
-
-        sites = getSortedSites(targetMethod);
-        if (targetMethod.exceptionHandlers == null) {
-            exceptionHandlers = null;
-        } else {
-            exceptionHandlers = targetMethod.exceptionHandlers.toArray(new ExceptionHandler[targetMethod.exceptionHandlers.size()]);
-        }
-    }
-
-    private HotSpotTargetMethod(Compiler compiler, CiTargetMethod targetMethod, String name) {
-        super(compiler);
-        this.method = null;
-        this.targetMethod = targetMethod;
-        this.name = name;
-
-        sites = getSortedSites(targetMethod);
-        assert targetMethod.exceptionHandlers == null || targetMethod.exceptionHandlers.size() == 0;
-        exceptionHandlers = null;
-    }
-
-    private static Site[] getSortedSites(CiTargetMethod target) {
-        List<?>[] lists = new List<?>[] {target.safepoints, target.dataReferences, target.marks};
-        int count = 0;
-        for (List<?> list : lists) {
-            count += list.size();
-        }
-        Site[] result = new Site[count];
-        int pos = 0;
-        for (List<?> list : lists) {
-            for (Object elem : list) {
-                result[pos++] = (Site) elem;
-            }
-        }
-        Arrays.sort(result, new Comparator<Site>() {
-
-            public int compare(Site s1, Site s2) {
-                if (s1.pcOffset == s2.pcOffset && (s1 instanceof Mark ^ s2 instanceof Mark)) {
-                    return s1 instanceof Mark ? -1 : 1;
-                }
-                return s1.pcOffset - s2.pcOffset;
-            }
-        });
-        if (Logger.ENABLED) {
-            for (Site site : result) {
-                Logger.log(site.pcOffset + ": " + site);
-            }
-        }
-        return result;
-    }
-
-    public static Object installStub(Compiler compiler, CiTargetMethod targetMethod, String name) {
-        return compiler.getVMEntries().installStub(new HotSpotTargetMethod(compiler, targetMethod, name));
-    }
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot;
-
-import com.oracle.max.cri.ci.*;
-
-/**
- * Used to communicate configuration details, runtime offsets, etc. to graal upon compileMethod.
- */
-public final class HotSpotVMConfig extends CompilerObject {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = -4744897993263044184L;
-
-    private HotSpotVMConfig() {
-        super(null);
-    }
-
-    // os information, register layout, code generation, ...
-    public boolean windowsOs;
-    public int codeEntryAlignment;
-    public boolean verifyPointers;
-    public boolean useFastLocking;
-    public boolean useFastNewObjectArray;
-    public boolean useFastNewTypeArray;
-
-    // offsets, ...
-    public int vmPageSize;
-    public int stackShadowPages;
-    public int hubOffset;
-    public int arrayLengthOffset;
-    public int klassStateOffset;
-    public int klassStateFullyInitialized;
-    public int[] arrayOffsets;
-    public int arrayClassElementOffset;
-    public int threadTlabTopOffset;
-    public int threadTlabEndOffset;
-    public int threadObjectOffset;
-    public int instanceHeaderPrototypeOffset;
-    public int threadExceptionOopOffset;
-    public int threadExceptionPcOffset;
-    public int threadMultiNewArrayStorage;
-    public long cardtableStartAddress;
-    public int cardtableShift;
-    public long safepointPollingAddress;
-    public boolean isPollingPageFar;
-    public int classMirrorOffset;
-    public int runtimeCallStackSize;
-    public int klassModifierFlagsOffset;
-    public int klassOopOffset;
-    public int graalMirrorKlassOffset;
-    public int nmethodEntryOffset;
-    public int methodCompiledEntryOffset;
-
-    // methodData information
-    public int methodDataOopDataOffset;
-    public int dataLayoutHeaderSize;
-    public int dataLayoutTagOffset;
-    public int dataLayoutFlagsOffset;
-    public int dataLayoutBCIOffset;
-    public int dataLayoutCellsOffset;
-    public int dataLayoutCellSize;
-    public int bciProfileWidth;
-    public int typeProfileWidth;
-
-    // runtime stubs
-    public long debugStub;
-    public long instanceofStub;
-    public long newInstanceStub;
-    public long unresolvedNewInstanceStub;
-    public long newTypeArrayStub;
-    public long newObjectArrayStub;
-    public long newMultiArrayStub;
-    public long loadKlassStub;
-    public long accessFieldStub;
-    public long resolveStaticCallStub;
-    public long inlineCacheMissStub;
-    public long unwindExceptionStub;
-    public long handleExceptionStub;
-    public long handleDeoptStub;
-    public long monitorEnterStub;
-    public long monitorExitStub;
-    public long fastMonitorEnterStub;
-    public long fastMonitorExitStub;
-    public long verifyPointerStub;
-
-    public void check() {
-        assert vmPageSize >= 16;
-        assert codeEntryAlignment > 0;
-        assert stackShadowPages > 0;
-    }
-
-    public int getArrayOffset(CiKind kind) {
-        return arrayOffsets[getKindNumber(kind)];
-    }
-
-    private static int getKindNumber(CiKind kind) {
-        if (kind == CiKind.Boolean) {
-            return 0;
-        } else if (kind == CiKind.Byte) {
-            return 1;
-        } else if (kind == CiKind.Short) {
-            return 2;
-        } else if (kind == CiKind.Char) {
-            return 3;
-        } else if (kind == CiKind.Int) {
-            return 4;
-        } else if (kind == CiKind.Float) {
-            return 5;
-        } else if (kind == CiKind.Long) {
-            return 6;
-        } else if (kind == CiKind.Double) {
-            return 7;
-        } else if (kind == CiKind.Object) {
-            return 8;
-        } else {
-            throw new RuntimeException(kind + " is not a Java kind");
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.hotspot.bridge;
-
-import java.lang.reflect.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.ri.*;
-
-/**
- * Calls from Java into HotSpot.
- */
-public interface CompilerToVM {
-
-    // Checkstyle: stop
-
-    byte[] RiMethod_code(HotSpotMethodResolved method);
-
-    String RiMethod_signature(HotSpotMethodResolved method);
-
-    RiExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
-
-    boolean RiMethod_hasBalancedMonitors(HotSpotMethodResolved method);
-
-    RiMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
-
-    int RiMethod_invocationCount(HotSpotMethodResolved method);
-
-    HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
-
-    RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
-
-    Object RiConstantPool_lookupConstant(HotSpotTypeResolved pool, int cpi);
-
-    RiMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
-
-    RiType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
-
-    RiField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
-
-    void RiConstantPool_loadReferencedType(HotSpotTypeResolved pool, int cpi, byte byteCode);
-
-    HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode);
-
-    long installStub(HotSpotTargetMethod targetMethod);
-
-    HotSpotVMConfig getConfiguration();
-
-    RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
-
-    boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
-
-    RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
-
-    RiType getPrimitiveArrayType(CiKind kind);
-
-    RiType RiType_arrayOf(HotSpotTypeResolved klass);
-
-    RiType RiType_componentType(HotSpotTypeResolved klass);
-
-    boolean RiType_isInitialized(HotSpotTypeResolved klass);
-
-    RiType getType(Class<?> javaClass);
-
-    RiType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
-
-    RiType RiType_superType(HotSpotTypeResolved klass);
-
-    int getArrayLength(CiConstant array);
-
-    boolean compareConstantObjects(CiConstant x, CiConstant y);
-
-    RiType getRiType(CiConstant constant);
-
-    RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
-
-    boolean RiMethod_hasCompiledCode(HotSpotMethodResolved method);
-
-    int RiMethod_getCompiledCodeSize(HotSpotMethodResolved method);
-
-    RiMethod getRiMethod(Method reflectionMethod);
-
-    long getMaxCallTargetOffset(CiRuntimeCall rtcall);
-
-    String disassembleNative(byte[] code, long address);
-
-    String disassembleJava(HotSpotMethodResolved method);
-
-    Object executeCompiledMethod(HotSpotCompiledMethod method, Object arg1, Object arg2, Object arg3);
-
-    int RiMethod_vtableEntryOffset(HotSpotMethodResolved method);
-
-    // Checkstyle: resume
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.hotspot.bridge;
-
-import java.lang.reflect.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.ri.*;
-import com.oracle.graal.hotspot.server.*;
-
-/**
- * Entries into the HotSpot VM from Java code.
- */
-public class CompilerToVMImpl implements CompilerToVM, Remote {
-
-    // Checkstyle: stop
-
-    @Override
-    public native RiMethod getRiMethod(Method reflectionMethod);
-
-    @Override
-    public native byte[] RiMethod_code(HotSpotMethodResolved method);
-
-    @Override
-    public native String RiMethod_signature(HotSpotMethodResolved method);
-
-    @Override
-    public native RiExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
-
-    @Override
-    public native boolean RiMethod_hasBalancedMonitors(HotSpotMethodResolved method);
-
-    @Override
-    public native RiMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
-
-    @Override
-    public native int RiMethod_invocationCount(HotSpotMethodResolved method);
-
-    @Override
-    public native RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
-
-    @Override
-    public native Object RiConstantPool_lookupConstant(HotSpotTypeResolved pool, int cpi);
-
-    @Override
-    public native RiMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
-
-    @Override
-    public native RiType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
-
-    @Override
-    public native void RiConstantPool_loadReferencedType(HotSpotTypeResolved pool, int cpi, byte byteCode);
-
-    @Override
-    public native RiField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
-
-    @Override
-    public native HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean installCode);
-
-    @Override
-    public native long installStub(HotSpotTargetMethod targetMethod);
-
-    @Override
-    public native HotSpotVMConfig getConfiguration();
-
-    @Override
-    public native RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
-
-    @Override
-    public native boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
-
-    @Override
-    public native RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
-
-    @Override
-    public native RiType getPrimitiveArrayType(CiKind kind);
-
-    @Override
-    public native RiType RiType_arrayOf(HotSpotTypeResolved klass);
-
-    @Override
-    public native RiType RiType_componentType(HotSpotTypeResolved klass);
-
-    @Override
-    public native RiType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
-
-    @Override
-    public native RiType RiType_superType(HotSpotTypeResolved klass);
-
-    @Override
-    public native boolean RiType_isInitialized(HotSpotTypeResolved klass);
-
-    @Override
-    public native HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
-
-    @Override
-    public native RiType getType(Class<?> javaClass);
-
-    @Override
-    public int getArrayLength(CiConstant array) {
-        return Array.getLength(array.asObject());
-    }
-
-    @Override
-    public boolean compareConstantObjects(CiConstant x, CiConstant y) {
-        return x.asObject() == y.asObject();
-    }
-
-    @Override
-    public RiType getRiType(CiConstant constant) {
-        Object o = constant.asObject();
-        if (o == null) {
-            return null;
-        }
-        return getType(o.getClass());
-    }
-
-    @Override
-    public native RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
-
-    @Override
-    public native boolean RiMethod_hasCompiledCode(HotSpotMethodResolved method);
-
-    @Override
-    public native int RiMethod_getCompiledCodeSize(HotSpotMethodResolved method);
-
-    @Override
-    public native long getMaxCallTargetOffset(CiRuntimeCall rtcall);
-
-    @Override
-    public native String disassembleNative(byte[] code, long address);
-
-    @Override
-    public native String disassembleJava(HotSpotMethodResolved method);
-
-    @Override
-    public native Object executeCompiledMethod(HotSpotCompiledMethod method, Object arg1, Object arg2, Object arg3);
-
-    @Override
-    public native int RiMethod_vtableEntryOffset(HotSpotMethodResolved method);
-
-    // Checkstyle: resume
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.hotspot.bridge;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.ri.*;
-
-/**
- * Calls from HotSpot into Java.
- */
-public interface VMToCompiler {
-
-    boolean compileMethod(HotSpotMethodResolved method, int entryBCI, boolean blocking) throws Throwable;
-
-    void shutdownCompiler() throws Throwable;
-
-    void startCompiler() throws Throwable;
-
-    void bootstrap() throws Throwable;
-
-    RiMethod createRiMethodUnresolved(String name, String signature, RiType holder);
-
-    RiSignature createRiSignature(String signature);
-
-    RiField createRiField(RiType holder, String name, RiType type, int offset, int flags);
-
-    RiType createRiType(HotSpotConstantPool pool, String name);
-
-    RiType createRiTypePrimitive(int basicType);
-
-    RiType createRiTypeUnresolved(String name);
-
-    CiConstant createCiConstant(CiKind kind, long value);
-
-    CiConstant createCiConstantFloat(float value);
-
-    CiConstant createCiConstantDouble(double value);
-
-    CiConstant createCiConstantObject(Object object);
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,454 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.hotspot.bridge;
-
-import java.lang.reflect.*;
-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.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.debug.internal.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-import com.oracle.graal.hotspot.ri.*;
-import com.oracle.graal.hotspot.server.*;
-import com.oracle.graal.hotspot.snippets.*;
-import com.oracle.graal.java.*;
-import com.oracle.graal.snippets.*;
-
-/**
- * Exits from the HotSpot VM into Java code.
- */
-public class VMToCompilerImpl implements VMToCompiler, Remote {
-
-    private final Compiler compiler;
-    private int compiledMethodCount;
-    private long totalCompilationTime;
-    private IntrinsifyArrayCopyPhase intrinsifyArrayCopy;
-
-    public final HotSpotTypePrimitive typeBoolean;
-    public final HotSpotTypePrimitive typeChar;
-    public final HotSpotTypePrimitive typeFloat;
-    public final HotSpotTypePrimitive typeDouble;
-    public final HotSpotTypePrimitive typeByte;
-    public final HotSpotTypePrimitive typeShort;
-    public final HotSpotTypePrimitive typeInt;
-    public final HotSpotTypePrimitive typeLong;
-    public final HotSpotTypePrimitive typeVoid;
-
-    ThreadFactory compilerThreadFactory = new ThreadFactory() {
-
-        @Override
-        public Thread newThread(Runnable r) {
-            return new CompilerThread(r);
-        }
-    };
-
-    private final class CompilerThread extends Thread {
-
-        public CompilerThread(Runnable r) {
-            super(r);
-            this.setName("GraalCompilerThread-" + this.getId());
-            this.setDaemon(true);
-        }
-
-        @Override
-        public void run() {
-            if (GraalOptions.Debug) {
-                Debug.enable();
-                HotSpotDebugConfig hotspotDebugConfig = new HotSpotDebugConfig(GraalOptions.Log, GraalOptions.Meter, GraalOptions.Time, GraalOptions.Dump, GraalOptions.MethodFilter);
-                Debug.setConfig(hotspotDebugConfig);
-            }
-            super.run();
-        }
-    }
-
-    private ThreadPoolExecutor compileQueue;
-
-    public VMToCompilerImpl(Compiler compiler) {
-        this.compiler = compiler;
-
-        typeBoolean = new HotSpotTypePrimitive(compiler, CiKind.Boolean);
-        typeChar = new HotSpotTypePrimitive(compiler, CiKind.Char);
-        typeFloat = new HotSpotTypePrimitive(compiler, CiKind.Float);
-        typeDouble = new HotSpotTypePrimitive(compiler, CiKind.Double);
-        typeByte = new HotSpotTypePrimitive(compiler, CiKind.Byte);
-        typeShort = new HotSpotTypePrimitive(compiler, CiKind.Short);
-        typeInt = new HotSpotTypePrimitive(compiler, CiKind.Int);
-        typeLong = new HotSpotTypePrimitive(compiler, CiKind.Long);
-        typeVoid = new HotSpotTypePrimitive(compiler, CiKind.Void);
-    }
-
-    public void startCompiler() throws Throwable {
-        // Make sure TTY is initialized here such that the correct System.out is used for TTY.
-        TTY.initialize();
-        if (GraalOptions.Debug) {
-            Debug.enable();
-            HotSpotDebugConfig hotspotDebugConfig = new HotSpotDebugConfig(GraalOptions.Log, GraalOptions.Meter, GraalOptions.Time, GraalOptions.Dump, GraalOptions.MethodFilter);
-            Debug.setConfig(hotspotDebugConfig);
-        }
-
-        // Install intrinsics.
-        final HotSpotRuntime runtime = (HotSpotRuntime) compiler.getCompiler().runtime;
-        if (GraalOptions.Intrinsify) {
-            Debug.scope("InstallSnippets", new DebugDumpScope("InstallSnippets"), new Runnable() {
-                @Override
-                public void run() {
-                    VMToCompilerImpl.this.intrinsifyArrayCopy = new IntrinsifyArrayCopyPhase(runtime);
-                    GraalIntrinsics.installIntrinsics(runtime, runtime.getCompiler().getTarget(), PhasePlan.DEFAULT);
-                    Snippets.install(runtime, runtime.getCompiler().getTarget(), new SystemSnippets(), PhasePlan.DEFAULT);
-                    Snippets.install(runtime, runtime.getCompiler().getTarget(), new UnsafeSnippets(), PhasePlan.DEFAULT);
-                    Snippets.install(runtime, runtime.getCompiler().getTarget(), new ArrayCopySnippets(), PhasePlan.DEFAULT);
-                }
-            });
-
-        }
-
-        // Create compilation queue.
-        compileQueue = new ThreadPoolExecutor(GraalOptions.Threads, GraalOptions.Threads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), compilerThreadFactory);
-
-        // Create queue status printing thread.
-        if (GraalOptions.PrintQueue) {
-            Thread t = new Thread() {
-
-                @Override
-                public void run() {
-                    while (true) {
-                        TTY.println(compileQueue.toString());
-                        try {
-                            Thread.sleep(1000);
-                        } catch (InterruptedException e) {
-                        }
-                    }
-                }
-            };
-            t.setDaemon(true);
-            t.start();
-        }
-    }
-
-    /**
-     * This method is the first method compiled during bootstrapping. Put any code in there that warms up compiler paths
-     * that are otherwise no exercised during bootstrapping and lead to later deoptimization when application code is
-     * compiled.
-     */
-    @SuppressWarnings("unused")
-    @Deprecated
-    private synchronized void compileWarmup() {
-        // Method is synchronized to exercise the synchronization code in the compiler.
-    }
-
-    public void bootstrap() throws Throwable {
-        TTY.print("Bootstrapping Graal");
-        TTY.flush();
-        long startTime = System.currentTimeMillis();
-
-        // Initialize compile queue with a selected set of methods.
-        Class<Object> objectKlass = Object.class;
-        enqueue(getClass().getDeclaredMethod("compileWarmup"));
-        enqueue(objectKlass.getDeclaredMethod("equals", Object.class));
-        enqueue(objectKlass.getDeclaredMethod("toString"));
-
-        // Compile until the queue is empty.
-        int z = 0;
-        while (compileQueue.getCompletedTaskCount() < Math.max(3, compileQueue.getTaskCount())) {
-            Thread.sleep(100);
-            while (z < compileQueue.getCompletedTaskCount() / 100) {
-                ++z;
-                TTY.print(".");
-                TTY.flush();
-            }
-        }
-
-        TTY.println(" in %d ms", System.currentTimeMillis() - startTime);
-        System.gc();
-    }
-
-    private void enqueue(Method m) throws Throwable {
-        RiMethod riMethod = compiler.getRuntime().getRiMethod(m);
-        assert !Modifier.isAbstract(((HotSpotMethodResolved) riMethod).accessFlags()) && !Modifier.isNative(((HotSpotMethodResolved) riMethod).accessFlags()) : riMethod;
-        compileMethod((HotSpotMethodResolved) riMethod, 0, false);
-    }
-
-    public void shutdownCompiler() throws Throwable {
-        // compiler.getCompiler().context.print();
-        // TODO (thomaswue): Print context results.
-        compileQueue.shutdown();
-
-        if (Debug.isEnabled()) {
-            List<DebugValueMap> topLevelMaps = DebugValueMap.getTopLevelMaps();
-            List<DebugValue> debugValues = KeyRegistry.getDebugValues();
-            if (debugValues.size() > 0) {
-                if (GraalOptions.SummarizeDebugValues) {
-                    printSummary(topLevelMaps, debugValues);
-                } else {
-                    for (DebugValueMap map : topLevelMaps) {
-                        TTY.println("Showing the results for thread: " + map.getName());
-                        map.group();
-                        map.normalize();
-                        printMap(map, debugValues, 0);
-                    }
-                }
-            }
-        }
-
-        if (GraalOptions.PrintCompilationStatistics) {
-            printCompilationStatistics();
-        }
-    }
-
-    private void printCompilationStatistics() {
-        TTY.println("Accumulated compilation statistics");
-        TTY.println("  Compiled methods         : %d", compiledMethodCount);
-        TTY.println("  Total compilation time   : %6.3f s", totalCompilationTime / Math.pow(10, 9));
-    }
-
-    private static void printSummary(List<DebugValueMap> topLevelMaps, List<DebugValue> debugValues) {
-        DebugValueMap result = new DebugValueMap("Summary");
-        for (int i = debugValues.size() - 1; i >= 0; i--) {
-            DebugValue debugValue = debugValues.get(i);
-            int index = debugValue.getIndex();
-            long total = collectTotal(topLevelMaps, index);
-            result.setCurrentValue(index, total);
-        }
-        printMap(result, debugValues, 0);
-    }
-
-    private static long collectTotal(List<DebugValueMap> maps, int index) {
-        long total = 0;
-        for (int i = 0; i < maps.size(); i++) {
-            DebugValueMap map = maps.get(i);
-            // the top level accumulates some counters -> do not process the children if we find a value
-            long value = map.getCurrentValue(index);
-            if (value == 0) {
-                total += collectTotal(map.getChildren(), index);
-            } else {
-                total += value;
-            }
-        }
-        return total;
-    }
-
-
-    private static void printMap(DebugValueMap map, List<DebugValue> debugValues, int level) {
-
-        printIndent(level);
-        TTY.println(map.getName());
-        for (DebugValue value : debugValues) {
-            long l = map.getCurrentValue(value.getIndex());
-            if (l != 0) {
-                printIndent(level + 1);
-                TTY.println(value.getName() + "=" + l);
-            }
-        }
-
-        for (DebugValueMap child : map.getChildren()) {
-            printMap(child, debugValues, level + 1);
-        }
-    }
-
-    private static void printIndent(int level) {
-        for (int i = 0; i < level; ++i) {
-            TTY.print("    ");
-        }
-        TTY.print("|-> ");
-    }
-
-    @Override
-    public boolean compileMethod(final HotSpotMethodResolved method, final int entryBCI, boolean blocking) throws Throwable {
-        try {
-            if (Thread.currentThread() instanceof CompilerThread) {
-                if (method.holder().name().contains("java/util/concurrent")) {
-                    // This is required to avoid deadlocking a compiler thread. The issue is that a
-                    // java.util.concurrent.BlockingQueue is used to implement the compilation worker
-                    // queues. If a compiler thread triggers a compilation, then it may be blocked trying
-                    // to add something to its own queue.
-                    return false;
-                }
-            }
-
-            Runnable runnable = new Runnable() {
-
-                public void run() {
-                    try {
-                        final PhasePlan plan = getDefaultPhasePlan();
-                        GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(compiler.getRuntime());
-                        plan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
-                        long startTime = System.nanoTime();
-                        int index = compiledMethodCount++;
-                        final boolean printCompilation = GraalOptions.PrintCompilation && !TTY.isSuppressed();
-                        if (printCompilation) {
-                            TTY.println(String.format("Graal %4d %-70s %-45s %-50s ...", index, method.holder().name(), method.name(), method.signature().asString()));
-                        }
-
-                        CiTargetMethod result = null;
-                        TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
-                        long nanoTime;
-                        try {
-                            result = Debug.scope("Compiling", new Callable<CiTargetMethod>() {
-                                @Override
-                                public CiTargetMethod call() throws Exception {
-                                    return compiler.getCompiler().compileMethod(method, -1, plan);
-                                }
-                            });
-                        } finally {
-                            filter.remove();
-                            nanoTime = System.nanoTime() - startTime;
-                            totalCompilationTime += nanoTime;
-                            if (printCompilation) {
-                                TTY.println(String.format("Graal %4d %-70s %-45s %-50s | %3d.%dms %4dnodes %5dB", index, "", "", "", nanoTime / 1000000, nanoTime % 1000000, 0, (result != null ? result.targetCodeSize()
-                                                : -1)));
-                            }
-                        }
-                        compiler.getRuntime().installMethod(method, result);
-                    } catch (CiBailout bailout) {
-                        Debug.metric("Bailouts").increment();
-                        if (GraalOptions.ExitVMOnBailout) {
-                            bailout.printStackTrace(TTY.cachedOut);
-                            System.exit(-1);
-                        }
-                    } catch (Throwable t) {
-                        if (GraalOptions.ExitVMOnException) {
-                            t.printStackTrace(TTY.cachedOut);
-                            System.exit(-1);
-                        }
-                    }
-                }
-            };
-
-            if (blocking) {
-                runnable.run();
-            } else {
-                compileQueue.execute(runnable);
-            }
-        } catch (RejectedExecutionException e) {
-            // The compile queue was already shut down.
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public RiMethod createRiMethodUnresolved(String name, String signature, RiType holder) {
-        return new HotSpotMethodUnresolved(compiler, name, signature, holder);
-    }
-
-    @Override
-    public RiSignature createRiSignature(String signature) {
-        return new HotSpotSignature(compiler, signature);
-    }
-
-    @Override
-    public RiField createRiField(RiType holder, String name, RiType type, int offset, int flags) {
-        if (offset != -1) {
-            HotSpotTypeResolved resolved = (HotSpotTypeResolved) holder;
-            return resolved.createRiField(name, type, offset, flags);
-        }
-        return new BaseUnresolvedField(holder, name, type);
-    }
-
-    @Override
-    public RiType createRiType(HotSpotConstantPool pool, String name) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public RiType createRiTypePrimitive(int basicType) {
-        switch (basicType) {
-            case 4:
-                return typeBoolean;
-            case 5:
-                return typeChar;
-            case 6:
-                return typeFloat;
-            case 7:
-                return typeDouble;
-            case 8:
-                return typeByte;
-            case 9:
-                return typeShort;
-            case 10:
-                return typeInt;
-            case 11:
-                return typeLong;
-            case 14:
-                return typeVoid;
-            default:
-                throw new IllegalArgumentException("Unknown basic type: " + basicType);
-        }
-    }
-
-    @Override
-    public RiType createRiTypeUnresolved(String name) {
-        return new HotSpotTypeUnresolved(compiler, name);
-    }
-
-    @Override
-    public CiConstant createCiConstant(CiKind kind, long value) {
-        if (kind == CiKind.Long) {
-            return CiConstant.forLong(value);
-        } else if (kind == CiKind.Int) {
-            return CiConstant.forInt((int) value);
-        } else if (kind == CiKind.Short) {
-            return CiConstant.forShort((short) value);
-        } else if (kind == CiKind.Char) {
-            return CiConstant.forChar((char) value);
-        } else if (kind == CiKind.Byte) {
-            return CiConstant.forByte((byte) value);
-        } else if (kind == CiKind.Boolean) {
-            return (value == 0) ? CiConstant.FALSE : CiConstant.TRUE;
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    @Override
-    public CiConstant createCiConstantFloat(float value) {
-        return CiConstant.forFloat(value);
-    }
-
-    @Override
-    public CiConstant createCiConstantDouble(double value) {
-        return CiConstant.forDouble(value);
-    }
-
-    @Override
-    public CiConstant createCiConstantObject(Object object) {
-        return CiConstant.forObject(object);
-    }
-
-    private PhasePlan getDefaultPhasePlan() {
-        PhasePlan phasePlan = new PhasePlan();
-        if (GraalOptions.Intrinsify) {
-            phasePlan.addPhase(PhasePosition.HIGH_LEVEL, intrinsifyArrayCopy);
-        }
-        return phasePlan;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.logging;
-
-import java.lang.reflect.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import com.oracle.graal.hotspot.server.*;
-
-/**
- * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return
- * values.
- */
-public class CountingProxy<T> implements InvocationHandler {
-
-    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("graal.countcalls"));
-
-    private T delegate;
-
-    private ConcurrentHashMap<Method, AtomicLong> calls = new ConcurrentHashMap<>();
-
-    public CountingProxy(T delegate) {
-        assert ENABLED;
-        System.out.println("Counting proxy for " + delegate.getClass().getSimpleName() + " created");
-        this.delegate = delegate;
-        proxies.add(this);
-    }
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        int argCount = args == null ? 0 : args.length;
-        if (method.getParameterTypes().length != argCount) {
-            throw new RuntimeException("wrong parameter count");
-        }
-        final Object result;
-        if (!calls.containsKey(method)) {
-            calls.putIfAbsent(method, new AtomicLong(0));
-        }
-        AtomicLong count = calls.get(method);
-        count.incrementAndGet();
-        try {
-            if (args == null) {
-                result = method.invoke(delegate);
-            } else {
-                result = method.invoke(delegate, args);
-            }
-        } catch (InvocationTargetException e) {
-            throw e.getCause();
-        }
-        return result;
-    }
-
-    public static <T> T getProxy(Class<T> interf, T delegate) {
-        Class<?>[] interfaces = ReplacingStreams.getAllInterfaces(delegate.getClass());
-        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new CountingProxy<>(delegate));
-        return interf.cast(obj);
-    }
-
-    private static ArrayList<CountingProxy> proxies = new ArrayList<>();
-
-    static {
-        if (ENABLED) {
-            Runtime.getRuntime().addShutdownHook(new Thread() {
-
-                @Override
-                public void run() {
-                    for (CountingProxy proxy : proxies) {
-                        proxy.print();
-                    }
-                }
-            });
-        }
-    }
-
-    protected void print() {
-        long sum = 0;
-        for (Map.Entry<Method, AtomicLong> entry : calls.entrySet()) {
-            Method method = entry.getKey();
-            long count = entry.getValue().get();
-            sum += count;
-            System.out.println(delegate.getClass().getSimpleName() + "." + method.getName() + ": " + count);
-        }
-        System.out.println(delegate.getClass().getSimpleName() + " calls: " + sum);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/Logger.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.logging;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-/**
- * Scoped logging class used to display the call hierarchy of VMEntries/VMExits calls.
- */
-public class Logger {
-
-    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("graal.debug"));
-    private static final int SPACING = 4;
-    private static Deque<Boolean> openStack = new LinkedList<>();
-    private static boolean open = false;
-    private static int level = 0;
-
-    private static final PrintStream out;
-
-    static {
-        PrintStream ps = null;
-        String filename = System.getProperty("graal.info_file");
-        if (filename != null && !"".equals(filename)) {
-            try {
-                ps = new PrintStream(new FileOutputStream(filename));
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-                ps = null;
-            }
-        }
-        out = ps;
-        if (out != null) {
-            out.println("start: " + new Date());
-        }
-    }
-
-    public static void info(String message) {
-        if (ENABLED) {
-            log(message);
-        } else {
-            System.out.println(message);
-        }
-        if (out != null) {
-            out.println(message);
-            out.flush();
-        }
-    }
-
-    public static void log(String message) {
-        if (ENABLED) {
-            for (String line : message.split("\n")) {
-                if (open) {
-                    System.out.println("...");
-                    open = false;
-                }
-                System.out.print(space(level));
-                System.out.println(line);
-            }
-        }
-    }
-
-    public static void startScope(String message) {
-        if (ENABLED) {
-            if (open) {
-                System.out.println("...");
-                open = false;
-            }
-            System.out.print(space(level));
-            System.out.print(message);
-            openStack.push(open);
-            open = true;
-            level++;
-        }
-    }
-
-    public static void endScope(String message) {
-        if (ENABLED) {
-            level--;
-            if (open) {
-                System.out.println(message);
-            } else {
-                System.out.println(space(level) + "..." + message);
-            }
-            open = openStack.pop();
-        }
-    }
-
-    private static String[] spaces = new String[50];
-
-    private static String space(int count) {
-        assert count >= 0;
-        String result;
-        if (count >= spaces.length || spaces[count] == null) {
-            StringBuilder str = new StringBuilder();
-            for (int i = 0; i < count * SPACING; i++) {
-                str.append(' ');
-            }
-            result = str.toString();
-            if (count < spaces.length) {
-                spaces[count] = result;
-            }
-        } else {
-            result = spaces[count];
-        }
-        return result;
-    }
-
-    public static String pretty(Object value) {
-        if (value == null) {
-            return "null";
-        }
-
-        Class<?> klass = value.getClass();
-        if (value instanceof Void) {
-            return "void";
-        } else if (value instanceof String) {
-            return "\"" + value + "\"";
-        } else if (value instanceof Method) {
-            return "method \"" + ((Method) value).getName() + "\"";
-        } else if (value instanceof Class<?>) {
-            return "class \"" + ((Class<?>) value).getSimpleName() + "\"";
-        } else if (value instanceof Integer) {
-            if ((Integer) value < 10) {
-                return value.toString();
-            }
-            return value + " (0x" + Integer.toHexString((Integer) value) + ")";
-        } else if (value instanceof Long) {
-            if ((Long) value < 10) {
-                return value + "l";
-            }
-            return value + "l (0x" + Long.toHexString((Long) value) + "l)";
-        } else if (klass.isArray()) {
-            StringBuilder str = new StringBuilder();
-            int dimensions = 0;
-            while (klass.isArray()) {
-                dimensions++;
-                klass = klass.getComponentType();
-            }
-            str.append(klass.getSimpleName()).append('[').append(Array.getLength(value)).append(']');
-            for (int i = 1; i < dimensions; i++) {
-                str.append("[]");
-            }
-            return str.toString();
-        }
-
-        return value.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/LoggingProxy.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.logging;
-
-import java.lang.reflect.*;
-
-import com.oracle.graal.hotspot.server.*;
-
-/**
- * A java.lang.reflect proxy that hierarchically logs all method invocations along with their parameters and return values.
- */
-public class LoggingProxy<T> implements InvocationHandler {
-
-    private T delegate;
-
-    public LoggingProxy(T delegate) {
-        this.delegate = delegate;
-    }
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        int argCount = args == null ? 0 : args.length;
-        if (method.getParameterTypes().length != argCount) {
-            throw new RuntimeException("wrong parameter count");
-        }
-        StringBuilder str = new StringBuilder();
-        str.append(method.getReturnType().getSimpleName() + " " + method.getDeclaringClass().getSimpleName() + "." + method.getName() + "(");
-        for (int i = 0; i < argCount; i++) {
-            str.append(i == 0 ? "" : ", ");
-            str.append(Logger.pretty(args[i]));
-        }
-        str.append(")");
-        Logger.startScope(str.toString());
-        final Object result;
-        try {
-            if (args == null) {
-                result = method.invoke(delegate);
-            } else {
-                result = method.invoke(delegate, args);
-            }
-        } catch (InvocationTargetException e) {
-            Logger.endScope(" = Exception " + e.getMessage());
-            throw e.getCause();
-        }
-        Logger.endScope(" = " + Logger.pretty(result));
-        return result;
-    }
-
-    /**
-     * The object returned by this method will implement all interfaces that are implemented by delegate.
-     */
-    public static <T> T getProxy(Class<T> interf, T delegate) {
-        Class<?>[] interfaces = ReplacingStreams.getAllInterfaces(delegate.getClass());
-        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new LoggingProxy<>(delegate));
-        return interf.cast(obj);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/logging/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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.
- */
-/**
- * Logging framework for the HotSpot CRI implementation.
- */
-package com.oracle.graal.hotspot.logging;
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ArrayWriteBarrier.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.spi.*;
-
-public final class ArrayWriteBarrier extends WriteBarrier implements LIRLowerable {
-
-    @Input private ValueNode object;
-    @Input private LocationNode location;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public LocationNode location() {
-        return location;
-    }
-
-    public ArrayWriteBarrier(ValueNode object, LocationNode location) {
-        this.object = object;
-        this.location = location;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        CiValue obj = gen.emitLea(gen.makeAddress(location(), object()));
-        generateBarrier(obj, gen);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.nodes;
-
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public final class CurrentThread extends FloatingNode implements LIRLowerable {
-
-    private int threadObjectOffset;
-
-    public CurrentThread(int threadObjectOffset) {
-        super(StampFactory.forKind(CiKind.Object));
-        this.threadObjectOffset = threadObjectOffset;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        generator.setResult(this, generator.emitLoad(new CiAddress(CiKind.Object, AMD64.r15.asValue(generator.target().wordKind), threadObjectOffset), false));
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static Object get(int threadObjectOffset) {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/FieldWriteBarrier.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-public final class FieldWriteBarrier extends WriteBarrier implements LIRLowerable {
-
-    @Input private ValueNode object;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public FieldWriteBarrier(ValueNode object) {
-        this.object = object;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        CiValue obj = generator.newVariable(generator.target().wordKind);
-        generator.emitMove(generator.operand(object()), obj);
-        generateBarrier(obj, generator);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.nodes;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.gen.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.target.amd64.*;
-import com.oracle.graal.java.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * Performs a tail call to the specified target compiled method, with the parameter taken from the supplied FrameState.
- */
-public class TailcallNode extends FixedWithNextNode implements LIRLowerable {
-
-    @Input private final FrameState frameState;
-    @Input private final ValueNode target;
-
-    /**
-     * Creates a TailcallNode.
-     * @param target points to the start of an nmethod
-     * @param frameState the parameters will be taken from this FrameState
-     */
-    public TailcallNode(ValueNode target, FrameState frameState) {
-        super(StampFactory.illegal());
-        this.target = target;
-        this.frameState = frameState;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        LIRGenerator gen = (LIRGenerator) generator;
-        HotSpotVMConfig config = CompilerImpl.getInstance().getConfig();
-        RiResolvedMethod method = frameState.method();
-        boolean isStatic = Modifier.isStatic(method.accessFlags());
-
-        CiKind[] signature = CiUtil.signatureToKinds(method.signature(), isStatic ? null : method.holder().kind(true));
-        CiCallingConvention cc = gen.frameMap().registerConfig.getCallingConvention(CiCallingConvention.Type.JavaCall, signature, gen.target(), false);
-        gen.frameMap().callsMethod(cc, CiCallingConvention.Type.JavaCall); // TODO (aw): I think this is unnecessary for a tail call.
-        List<ValueNode> parameters = new ArrayList<>();
-        for (int i = 0, slot = 0; i < cc.locations.length; i++, slot += FrameStateBuilder.stackSlots(frameState.localAt(slot).kind())) {
-            parameters.add(frameState.localAt(slot));
-        }
-        List<CiValue> argList = gen.visitInvokeArguments(cc, parameters);
-
-        CiValue entry = gen.emitLoad(new CiAddress(CiKind.Long, gen.operand(target), config.nmethodEntryOffset), false);
-
-        gen.append(new AMD64TailcallOp(argList, entry, cc.locations));
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public abstract class WriteBarrier extends FixedWithNextNode {
-
-    public WriteBarrier() {
-        super(StampFactory.illegal());
-    }
-
-    protected void generateBarrier(CiValue obj, LIRGeneratorTool gen) {
-        HotSpotVMConfig config = CompilerImpl.getInstance().getConfig();
-        CiValue base = gen.emitUShr(obj, CiConstant.forInt(config.cardtableShift));
-
-        long startAddress = config.cardtableStartAddress;
-        int displacement = 0;
-        if (((int) startAddress) == startAddress) {
-            displacement = (int) startAddress;
-        } else {
-            base = gen.emitAdd(base, CiConstant.forLong(config.cardtableStartAddress));
-        }
-        gen.emitStore(new CiAddress(CiKind.Boolean, base, displacement), CiConstant.FALSE, false);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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 containing the runtime interface (defined in the CRI project) implementation for HotSpot.
- * There is a class that bridges from the C++ to the Java side (VMExitsNative.java) and one that bridges
- * from the Java to the C++ side (VMEntriesNative.java).
- */
-package com.oracle.graal.hotspot;
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import java.lang.reflect.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Implementation of RiCompiledMethod for HotSpot. Stores a reference to the nmethod which contains the compiled code.
- */
-public class HotSpotCompiledMethod extends CompilerObject implements RiCompiledMethod {
-
-    private static final long serialVersionUID = 156632908220561612L;
-
-    private final RiResolvedMethod method;
-    public long nmethod;
-
-    public HotSpotCompiledMethod(Compiler compiler, RiResolvedMethod method) {
-        super(compiler);
-        this.method = method;
-    }
-
-    @Override
-    public RiResolvedMethod method() {
-        return method;
-    }
-
-    @Override
-    public boolean isValid() {
-        return nmethod != 0;
-    }
-
-    @Override
-    public String toString() {
-        return "compiled method " + method + " @" + nmethod;
-    }
-
-    @Override
-    public Object execute(Object arg1, Object arg2, Object arg3) {
-        assert method.signature().argumentCount(!Modifier.isStatic(method.accessFlags())) == 3;
-        assert method.signature().argumentKindAt(0, false) == CiKind.Object;
-        assert method.signature().argumentKindAt(1, false) == CiKind.Object;
-        assert !Modifier.isStatic(method.accessFlags()) || method.signature().argumentKindAt(2, false) == CiKind.Object;
-        return compiler.getVMEntries().executeCompiledMethod(this, arg1, arg2, arg3);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotConstantPool.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Implementation of RiConstantPool for HotSpot.
- */
-public class HotSpotConstantPool extends CompilerObject implements RiConstantPool {
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -5443206401485234850L;
-    private final HotSpotTypeResolvedImpl type;
-
-    public HotSpotConstantPool(Compiler compiler, HotSpotTypeResolvedImpl type) {
-        super(compiler);
-        this.type = type;
-    }
-
-    @Override
-    public Object lookupConstant(int cpi) {
-        Object constant = compiler.getVMEntries().RiConstantPool_lookupConstant(type, cpi);
-        return constant;
-    }
-
-    @Override
-    public RiSignature lookupSignature(int cpi) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public RiMethod lookupMethod(int cpi, int byteCode) {
-        return compiler.getVMEntries().RiConstantPool_lookupMethod(type, cpi, (byte) byteCode);
-    }
-
-    @Override
-    public RiType lookupType(int cpi, int opcode) {
-        return compiler.getVMEntries().RiConstantPool_lookupType(type, cpi);
-    }
-
-    @Override
-    public RiField lookupField(int cpi, int opcode) {
-        return compiler.getVMEntries().RiConstantPool_lookupField(type, cpi, (byte) opcode);
-    }
-
-    @Override
-    public void loadReferencedType(int cpi, int bytecode) {
-        compiler.getVMEntries().RiConstantPool_loadReferencedType(type, cpi, (byte) bytecode);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotExceptionHandler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-
-
-public final class HotSpotExceptionHandler extends CompilerObject implements RiExceptionHandler {
-    /**
-     *
-     */
-    private static final long serialVersionUID = 7110038548061733686L;
-    private int startBci;
-    private int endBci;
-    private int handlerBci;
-    private int catchClassIndex;
-    private RiType catchClass;
-
-    private HotSpotExceptionHandler() {
-        super(null);
-    }
-
-    @Override
-    public int startBCI() {
-        return startBci;
-    }
-
-    @Override
-    public int endBCI() {
-        return endBci;
-    }
-
-    @Override
-    public int handlerBCI() {
-        return handlerBci;
-    }
-
-    @Override
-    public int catchTypeCPI() {
-        return catchClassIndex;
-    }
-
-    @Override
-    public boolean isCatchAll() {
-        return catchClassIndex == 0;
-    }
-
-    @Override
-    public RiType catchType() {
-        return catchClass;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("HotSpotExceptionHandler[startBci=%d, endBci=%d, handlerBci=%d, catchClassIndex=%d, catchClass=%s", startBci, endBci, handlerBci, catchClassIndex, catchClass);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.hotspot.ri;
-
-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.graal.compiler.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Represents a field in a HotSpot type.
- */
-public class HotSpotField extends CompilerObject implements RiResolvedField {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 7692985878836955683L;
-    private final RiResolvedType holder;
-    private final String name;
-    private final RiType type;
-    private final int offset;
-    private final int accessFlags;
-    private CiConstant constant;                // Constant part only valid for static fields.
-
-    public HotSpotField(Compiler compiler, RiResolvedType holder, String name, RiType type, int offset, int accessFlags) {
-        super(compiler);
-        this.holder = holder;
-        this.name = name;
-        this.type = type;
-        assert offset != -1;
-        this.offset = offset;
-        this.accessFlags = accessFlags;
-    }
-
-    @Override
-    public int accessFlags() {
-        return accessFlags;
-    }
-
-    @Override
-    public CiConstant constantValue(CiConstant receiver) {
-        if (receiver == null) {
-            assert Modifier.isStatic(accessFlags);
-            if (constant == null) {
-                if (holder.isInitialized() && holder.toJava() != System.class) {
-                    if (Modifier.isFinal(accessFlags()) || assumeStaticFieldsFinal(holder.toJava())) {
-                        CiConstant encoding = holder.getEncoding(Representation.StaticFields);
-                        constant = this.kind(false).readUnsafeConstant(encoding.asObject(), offset);
-                    }
-                }
-            }
-            return constant;
-        } else {
-            assert !Modifier.isStatic(accessFlags);
-            // TODO (chaeubl) HotSpot does not trust final non-static fields (see ciField.cpp)
-            if (Modifier.isFinal(accessFlags())) {
-                return this.kind(false).readUnsafeConstant(receiver.asObject(), offset);
-            }
-        }
-        return null;
-    }
-
-    private static boolean assumeStaticFieldsFinal(Class< ? > clazz) {
-        return clazz == GraalOptions.class;
-    }
-
-    @Override
-    public RiResolvedType holder() {
-        return holder;
-    }
-
-    @Override
-    public CiKind kind(boolean architecture) {
-        return type().kind(architecture);
-    }
-
-    @Override
-    public String name() {
-        return name;
-    }
-
-    @Override
-    public RiType type() {
-        return type;
-    }
-
-    public int offset() {
-        return offset;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotField<" + CiUtil.format("%h.%n", this) + ":" + offset + ">";
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        Field javaField = toJava();
-        if (javaField != null) {
-            return javaField.getAnnotation(annotationClass);
-        }
-        return null;
-    }
-
-    private Field toJava() {
-        try {
-            return holder.toJava().getDeclaredField(name);
-        } catch (NoSuchFieldException e) {
-            return null;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethod.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-public abstract class HotSpotMethod extends CompilerObject implements RiMethod {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 7167491397941960839L;
-    protected String name;
-
-    protected HotSpotMethod(Compiler compiler) {
-        super(compiler);
-    }
-
-    @Override
-    public final String name() {
-        return name;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodData.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,577 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import java.util.*;
-
-import sun.misc.*;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-
-public final class HotSpotMethodData extends CompilerObject {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = -8873133496591225071L;
-
-    static {
-        config = CompilerImpl.getInstance().getConfig();
-    }
-
-    // TODO (chaeubl) use same logic as in NodeClass?
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final HotSpotMethodDataAccessor NO_DATA_NO_EXCEPTION_ACCESSOR = new NoMethodData(RiExceptionSeen.FALSE);
-    private static final HotSpotMethodDataAccessor NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR = new NoMethodData(RiExceptionSeen.NOT_SUPPORTED);
-    private static final HotSpotVMConfig config;
-    // sorted by tag
-    private static final HotSpotMethodDataAccessor[] PROFILE_DATA_ACCESSORS = {
-        null, new BitData(), new CounterData(), new JumpData(),
-        new TypeCheckData(), new VirtualCallData(), new RetData(),
-        new BranchData(), new MultiBranchData(), new ArgInfoData()
-    };
-
-    private Object hotspotMirror;
-    private int normalDataSize;
-    private int extraDataSize;
-
-    private HotSpotMethodData(Compiler compiler) {
-        super(compiler);
-        throw new IllegalStateException("this constructor is never actually called, because the objects are allocated from within the VM");
-    }
-
-    public boolean hasNormalData() {
-        return normalDataSize > 0;
-    }
-
-    public boolean hasExtraData() {
-        return extraDataSize > 0;
-    }
-
-    public int getExtraDataBeginOffset() {
-        return normalDataSize;
-    }
-
-    public boolean isWithin(int position) {
-        return position >= 0 && position < normalDataSize + extraDataSize;
-    }
-
-    public HotSpotMethodDataAccessor getNormalData(int position) {
-        if (position >= normalDataSize) {
-            return null;
-        }
-
-        HotSpotMethodDataAccessor result = getData(position);
-        assert result != null : "NO_DATA tag is not allowed";
-        return result;
-    }
-
-    public HotSpotMethodDataAccessor getExtraData(int position) {
-        if (position >= normalDataSize + extraDataSize) {
-            return null;
-        }
-        return getData(position);
-    }
-
-    public static HotSpotMethodDataAccessor getNoDataAccessor(boolean exceptionPossiblyNotRecorded) {
-        if (exceptionPossiblyNotRecorded) {
-            return NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR;
-        } else {
-            return NO_DATA_NO_EXCEPTION_ACCESSOR;
-        }
-    }
-
-    private HotSpotMethodDataAccessor getData(int position) {
-        assert position >= 0 : "out of bounds";
-        int tag = AbstractMethodData.readTag(this, position);
-        assert tag >= 0 && tag < PROFILE_DATA_ACCESSORS.length : "illegal tag";
-        return PROFILE_DATA_ACCESSORS[tag];
-    }
-
-    private int readUnsignedByte(int position, int offsetInBytes) {
-        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getByte(hotspotMirror, fullOffsetInBytes) & 0xFF;
-    }
-
-    private int readUnsignedShort(int position, int offsetInBytes) {
-        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getShort(hotspotMirror, fullOffsetInBytes) & 0xFFFF;
-    }
-
-    private long readUnsignedInt(int position, int offsetInBytes) {
-        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getInt(hotspotMirror, fullOffsetInBytes) & 0xFFFFFFFFL;
-    }
-
-    private int readUnsignedIntAsSignedInt(int position, int offsetInBytes) {
-        long value = readUnsignedInt(position, offsetInBytes);
-        return truncateLongToInt(value);
-    }
-
-    private int readInt(int position, int offsetInBytes) {
-        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getInt(hotspotMirror, fullOffsetInBytes);
-    }
-
-    private Object readObject(int position, int offsetInBytes) {
-        long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getObject(hotspotMirror, fullOffsetInBytes);
-    }
-
-    private static int truncateLongToInt(long value) {
-        return value > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) value;
-    }
-
-    private static int computeFullOffset(int position, int offsetInBytes) {
-        return config.methodDataOopDataOffset + position + offsetInBytes;
-    }
-
-    private static int cellIndexToOffset(int cells) {
-        return config.dataLayoutHeaderSize + cellsToBytes(cells);
-    }
-
-    private static int cellsToBytes(int cells) {
-        return cells * config.dataLayoutCellSize;
-    }
-
-    private abstract static class AbstractMethodData implements HotSpotMethodDataAccessor {
-        private static final int EXCEPTIONS_MASK = 0x80;
-
-        private final int tag;
-        private final int staticSize;
-
-        protected AbstractMethodData(int tag, int staticSize) {
-            this.tag = tag;
-            this.staticSize = staticSize;
-        }
-
-        public int getTag() {
-            return tag;
-        }
-
-        public static int readTag(HotSpotMethodData data, int position) {
-            return data.readUnsignedByte(position, config.dataLayoutTagOffset);
-        }
-
-        @Override
-        public int getBCI(HotSpotMethodData data, int position) {
-            return data.readUnsignedShort(position, config.dataLayoutBCIOffset);
-        }
-
-        @Override
-        public int getSize(HotSpotMethodData data, int position) {
-            return staticSize + getDynamicSize(data, position);
-        }
-
-        @Override
-        public RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
-            return RiExceptionSeen.get((getFlags(data, position) & EXCEPTIONS_MASK) != 0);
-        }
-
-        @Override
-        public RiTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
-            return null;
-        }
-
-        @Override
-        public double getBranchTakenProbability(HotSpotMethodData data, int position) {
-            return -1;
-        }
-
-        @Override
-        public double[] getSwitchProbabilities(HotSpotMethodData data, int position) {
-            return null;
-        }
-
-        @Override
-        public int getExecutionCount(HotSpotMethodData data, int position) {
-            return -1;
-        }
-
-        protected int getFlags(HotSpotMethodData data, int position) {
-            return data.readUnsignedByte(position, config.dataLayoutFlagsOffset);
-        }
-
-        protected int getDynamicSize(@SuppressWarnings("unused") HotSpotMethodData data, @SuppressWarnings("unused") int position) {
-            return 0;
-        }
-    }
-
-    private static class NoMethodData extends AbstractMethodData {
-        private static final int NO_DATA_TAG = 0;
-        private static final int NO_DATA_SIZE = cellIndexToOffset(0);
-
-        private final RiExceptionSeen exceptionSeen;
-
-        protected NoMethodData(RiExceptionSeen exceptionSeen) {
-            super(NO_DATA_TAG, NO_DATA_SIZE);
-            this.exceptionSeen = exceptionSeen;
-        }
-
-        @Override
-        public int getBCI(HotSpotMethodData data, int position) {
-            return -1;
-        }
-
-
-        @Override
-        public RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
-            return exceptionSeen;
-        }
-    }
-
-    private static class BitData extends AbstractMethodData {
-        private static final int BIT_DATA_TAG = 1;
-        private static final int BIT_DATA_SIZE = cellIndexToOffset(0);
-        private static final int BIT_DATA_NULL_SEEN_FLAG = 0x01;
-
-        private BitData() {
-            super(BIT_DATA_TAG, BIT_DATA_SIZE);
-        }
-
-        protected BitData(int tag, int staticSize) {
-            super(tag, staticSize);
-        }
-
-        @SuppressWarnings("unused")
-        public boolean getNullSeen(HotSpotMethodData data, int position) {
-            return (getFlags(data, position) & BIT_DATA_NULL_SEEN_FLAG) != 0;
-        }
-    }
-
-    private static class CounterData extends BitData {
-        private static final int COUNTER_DATA_TAG = 2;
-        private static final int COUNTER_DATA_SIZE = cellIndexToOffset(1);
-        private static final int COUNTER_DATA_COUNT_OFFSET = cellIndexToOffset(0);
-
-        public CounterData() {
-            super(COUNTER_DATA_TAG, COUNTER_DATA_SIZE);
-        }
-
-        protected CounterData(int tag, int staticSize) {
-            super(tag, staticSize);
-        }
-
-        @Override
-        public int getExecutionCount(HotSpotMethodData data, int position) {
-            return getCounterValue(data, position);
-        }
-
-        protected int getCounterValue(HotSpotMethodData data, int position) {
-            return data.readUnsignedIntAsSignedInt(position, COUNTER_DATA_COUNT_OFFSET);
-        }
-    }
-
-    private static class JumpData extends AbstractMethodData {
-        private static final int JUMP_DATA_TAG = 3;
-        private static final int JUMP_DATA_SIZE = cellIndexToOffset(2);
-        protected static final int TAKEN_COUNT_OFFSET = cellIndexToOffset(0);
-        protected static final int TAKEN_DISPLACEMENT_OFFSET = cellIndexToOffset(1);
-
-        public JumpData() {
-            super(JUMP_DATA_TAG, JUMP_DATA_SIZE);
-        }
-
-        protected JumpData(int tag, int staticSize) {
-            super(tag, staticSize);
-        }
-
-        @Override
-        public double getBranchTakenProbability(HotSpotMethodData data, int position) {
-            return getExecutionCount(data, position) != 0 ? 1 : 0;
-        }
-
-        @Override
-        public int getExecutionCount(HotSpotMethodData data, int position) {
-            return data.readUnsignedIntAsSignedInt(position, TAKEN_COUNT_OFFSET);
-        }
-
-        @SuppressWarnings("unused")
-        public int getTakenDisplacement(HotSpotMethodData data, int position) {
-            return data.readInt(position, TAKEN_DISPLACEMENT_OFFSET);
-        }
-    }
-
-    private abstract static class AbstractTypeData extends CounterData {
-        private static final int RECEIVER_TYPE_DATA_ROW_SIZE = cellsToBytes(2);
-        private static final int RECEIVER_TYPE_DATA_SIZE = cellIndexToOffset(1) + RECEIVER_TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
-        private static final int RECEIVER_TYPE_DATA_FIRST_RECEIVER_OFFSET = cellIndexToOffset(1);
-        private static final int RECEIVER_TYPE_DATA_FIRST_COUNT_OFFSET = cellIndexToOffset(2);
-
-        protected AbstractTypeData(int tag) {
-            super(tag, RECEIVER_TYPE_DATA_SIZE);
-        }
-
-        @Override
-        public RiTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
-            int typeProfileWidth = config.typeProfileWidth;
-
-            RiResolvedType[] sparseTypes = new RiResolvedType[typeProfileWidth];
-            double[] counts = new double[typeProfileWidth];
-            long totalCount = 0;
-            int entries = 0;
-
-            for (int i = 0; i < typeProfileWidth; i++) {
-                Object receiverKlassOop = data.readObject(position, getReceiverOffset(i));
-                if (receiverKlassOop != null) {
-                    Object graalMirror = unsafe.getObject(receiverKlassOop, (long) config.graalMirrorKlassOffset);
-                    if (graalMirror == null) {
-                        Class<?> javaClass = (Class<?>) unsafe.getObject(receiverKlassOop, (long) config.classMirrorOffset);
-                        graalMirror = CompilerImpl.getInstance().getVMEntries().getType(javaClass);
-                        assert graalMirror != null : "must not return null";
-                    }
-                    sparseTypes[entries] = (RiResolvedType) graalMirror;
-
-                    long count = data.readUnsignedInt(position, getCountOffset(i));
-                    totalCount += count;
-                    counts[entries] = count;
-
-                    entries++;
-                }
-            }
-
-            totalCount += getTypesNotRecordedExecutionCount(data, position);
-            return createRiTypeProfile(sparseTypes, counts, totalCount, entries);
-        }
-
-        protected long getTypesNotRecordedExecutionCount(HotSpotMethodData data, int position) {
-            // checkcast/aastore/instanceof profiling in the HotSpot template-based interpreter was adjusted so that the counter
-            // is incremented to indicate the polymorphic case instead of decrementing it for failed type checks
-            return getCounterValue(data, position);
-        }
-
-        private static RiTypeProfile createRiTypeProfile(RiResolvedType[] sparseTypes, double[] counts, long totalCount, int entries) {
-            RiResolvedType[] types;
-            double[] probabilities;
-
-            if (entries <= 0 || totalCount < GraalOptions.MatureExecutionsTypeProfile) {
-                return null;
-            } else if (entries < sparseTypes.length) {
-                types = Arrays.copyOf(sparseTypes, entries);
-                probabilities = new double[entries];
-            } else {
-                types = sparseTypes;
-                probabilities = counts;
-            }
-
-            double totalProbability = 0.0;
-            for (int i = 0; i < entries; i++) {
-                double p = counts[i] / totalCount;
-                probabilities[i] = p;
-                totalProbability += p;
-            }
-
-            double notRecordedTypeProbability = entries < config.typeProfileWidth ? 0.0 : Math.min(1.0, Math.max(0.0, 1.0 - totalProbability));
-            return new RiTypeProfile(types, notRecordedTypeProbability, probabilities);
-        }
-
-        private static int getReceiverOffset(int row) {
-            return RECEIVER_TYPE_DATA_FIRST_RECEIVER_OFFSET + row * RECEIVER_TYPE_DATA_ROW_SIZE;
-        }
-
-        protected static int getCountOffset(int row) {
-            return RECEIVER_TYPE_DATA_FIRST_COUNT_OFFSET + row * RECEIVER_TYPE_DATA_ROW_SIZE;
-        }
-    }
-
-    private static class TypeCheckData extends AbstractTypeData {
-        private static final int RECEIVER_TYPE_DATA_TAG = 4;
-
-        public TypeCheckData() {
-            super(RECEIVER_TYPE_DATA_TAG);
-        }
-
-        @Override
-        public int getExecutionCount(HotSpotMethodData data, int position) {
-            return -1;
-        }
-    }
-
-    private static class VirtualCallData extends AbstractTypeData {
-        private static final int VIRTUAL_CALL_DATA_TAG = 5;
-
-        public VirtualCallData() {
-            super(VIRTUAL_CALL_DATA_TAG);
-        }
-
-        @Override
-        public int getExecutionCount(HotSpotMethodData data, int position) {
-            int typeProfileWidth = config.typeProfileWidth;
-
-            long total = 0;
-            for (int i = 0; i < typeProfileWidth; i++) {
-                total += data.readUnsignedInt(position, getCountOffset(i));
-            }
-
-            total += getCounterValue(data, position);
-            return truncateLongToInt(total);
-        }
-    }
-
-    private static class RetData extends CounterData {
-        private static final int RET_DATA_TAG = 6;
-        private static final int RET_DATA_ROW_SIZE = cellsToBytes(3);
-        private static final int RET_DATA_SIZE = cellIndexToOffset(1) + RET_DATA_ROW_SIZE * config.bciProfileWidth;
-
-        public RetData() {
-            super(RET_DATA_TAG, RET_DATA_SIZE);
-        }
-    }
-
-    private static class BranchData extends JumpData {
-        private static final int BRANCH_DATA_TAG = 7;
-        private static final int BRANCH_DATA_SIZE = cellIndexToOffset(3);
-        private static final int NOT_TAKEN_COUNT_OFFSET = cellIndexToOffset(2);
-
-        public BranchData() {
-            super(BRANCH_DATA_TAG, BRANCH_DATA_SIZE);
-        }
-
-        @Override
-        public double getBranchTakenProbability(HotSpotMethodData data, int position) {
-            long takenCount = data.readUnsignedInt(position, TAKEN_COUNT_OFFSET);
-            long notTakenCount = data.readUnsignedInt(position, NOT_TAKEN_COUNT_OFFSET);
-            long total = takenCount + notTakenCount;
-
-            if (total < GraalOptions.MatureExecutionsBranch) {
-                return -1;
-            } else {
-                return takenCount / (double) total;
-            }
-        }
-
-        @Override
-        public int getExecutionCount(HotSpotMethodData data, int position) {
-            long count = data.readUnsignedInt(position, TAKEN_COUNT_OFFSET) + data.readUnsignedInt(position, NOT_TAKEN_COUNT_OFFSET);
-            return truncateLongToInt(count);
-        }
-    }
-
-    private static class ArrayData extends AbstractMethodData {
-        private static final int ARRAY_DATA_LENGTH_OFFSET = cellIndexToOffset(0);
-        protected static final int ARRAY_DATA_START_OFFSET = cellIndexToOffset(1);
-
-        public ArrayData(int tag, int staticSize) {
-            super(tag, staticSize);
-        }
-
-        @Override
-        protected int getDynamicSize(HotSpotMethodData data, int position) {
-            return cellsToBytes(getLength(data, position));
-        }
-
-        protected static int getLength(HotSpotMethodData data, int position) {
-            return data.readInt(position, ARRAY_DATA_LENGTH_OFFSET);
-        }
-    }
-
-    private static class MultiBranchData extends ArrayData {
-        private static final int MULTI_BRANCH_DATA_TAG = 8;
-        private static final int MULTI_BRANCH_DATA_SIZE = cellIndexToOffset(1);
-        private static final int MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS = 2;
-        private static final int MULTI_BRANCH_DATA_ROW_SIZE = cellsToBytes(MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS);
-        private static final int MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(0);
-        private static final int MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(1);
-
-        public MultiBranchData() {
-            super(MULTI_BRANCH_DATA_TAG, MULTI_BRANCH_DATA_SIZE);
-        }
-
-        @Override
-        public double[] getSwitchProbabilities(HotSpotMethodData data, int position) {
-            int arrayLength = getLength(data, position);
-            assert arrayLength > 0 : "switch must have at least the default case";
-            assert arrayLength % MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS == 0 : "array must have full rows";
-
-            int length = arrayLength / MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS;
-            long totalCount = 0;
-            double[] result = new double[length];
-
-            // default case is first in HotSpot but last for the compiler
-            long count = readCount(data, position, 0);
-            totalCount += count;
-            result[length - 1] = count;
-
-            for (int i = 1; i < length; i++) {
-                count = readCount(data, position, i);
-                totalCount += count;
-                result[i - 1] = count;
-            }
-
-            if (totalCount < GraalOptions.MatureExecutionsPerSwitchCase * length) {
-                return null;
-            } else {
-                for (int i = 0; i < length; i++) {
-                    result[i] = result[i] / totalCount;
-                }
-                return result;
-            }
-        }
-
-        private static long readCount(HotSpotMethodData data, int position, int i) {
-            int offset;
-            long count;
-            offset = getCountOffset(i);
-            count = data.readUnsignedInt(position, offset);
-            return count;
-        }
-
-        @Override
-        public int getExecutionCount(HotSpotMethodData data, int position) {
-            int arrayLength = getLength(data, position);
-            assert arrayLength > 0 : "switch must have at least the default case";
-            assert arrayLength % MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS == 0 : "array must have full rows";
-
-            int length = arrayLength / MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS;
-            long totalCount = 0;
-            for (int i = 0; i < length; i++) {
-                int offset = getCountOffset(i);
-                totalCount += data.readUnsignedInt(position, offset);
-            }
-
-            return truncateLongToInt(totalCount);
-        }
-
-        private static int getCountOffset(int index) {
-            return MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET + index * MULTI_BRANCH_DATA_ROW_SIZE;
-        }
-
-        @SuppressWarnings("unused")
-        private static int getDisplacementOffset(int index) {
-            return MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET + index * MULTI_BRANCH_DATA_ROW_SIZE;
-        }
-    }
-
-    private static class ArgInfoData extends ArrayData {
-        private static final int ARG_INFO_DATA_TAG = 9;
-        private static final int ARG_INFO_DATA_SIZE = cellIndexToOffset(1);
-
-        public ArgInfoData() {
-            super(ARG_INFO_DATA_TAG, ARG_INFO_DATA_SIZE);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodDataAccessor.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-
-/**
- * Interface for accessor objects that encapsulate the logic for accessing the different kinds of data in a HotSpot methodDataOop.
- * This interface is similar to the interface {@link RiProfilingInfo}, but most methods require a MethodDataObject and the
- * exact position within the methodData.
- */
-public interface HotSpotMethodDataAccessor {
-    /**
-     * Returns the tag stored in the LayoutData header.
-     * @return An integer >= 0 or -1 if not supported.
-     */
-    int getTag();
-
-    /**
-     * Returns the BCI stored in the LayoutData header.
-     * @return An integer >= 0 and <= Short.MAX_VALUE, or -1 if not supported.
-     */
-    int getBCI(HotSpotMethodData data, int position);
-
-    /**
-     * Computes the size for the specific data at the given position.
-     * @return An integer > 0.
-     */
-    int getSize(HotSpotMethodData data, int position);
-
-    RiTypeProfile getTypeProfile(HotSpotMethodData data, int position);
-    double getBranchTakenProbability(HotSpotMethodData data, int position);
-    double[] getSwitchProbabilities(HotSpotMethodData data, int position);
-    RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position);
-    int getExecutionCount(HotSpotMethodData data, int position);
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolved.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.server.*;
-
-public interface HotSpotMethodResolved extends RiResolvedMethod, Remote {
-
-    RiResolvedMethod uniqueConcreteMethod();
-    void dumpProfile();
-    int vtableEntryOffset();
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,359 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-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.graal.java.bytecode.*;
-
-/**
- * Implementation of RiMethod for resolved HotSpot methods.
- */
-public final class HotSpotMethodResolvedImpl extends HotSpotMethod implements HotSpotMethodResolved {
-
-    private static final long serialVersionUID = -5486975070147586588L;
-
-    /** DO NOT USE IN JAVA CODE! */
-    @SuppressWarnings("unused")
-    @Deprecated
-    private Object javaMirror;
-
-    // cached values
-    private final int codeSize;
-    private final int accessFlags;
-    private final int maxLocals;
-    private final int maxStackSize;
-    private RiSignature signature;
-    private Boolean hasBalancedMonitors;
-    private Map<Object, Object> compilerStorage;
-    private RiResolvedType holder;
-    private HotSpotMethodData methodData;
-    private byte[] code;
-    private boolean canBeInlined;
-    private CiGenericCallback callback;
-    private int compilationComplexity;
-
-    private HotSpotMethodResolvedImpl() {
-        super(null);
-        throw new IllegalStateException("this constructor is never actually called, because the objects are allocated from within the VM");
-    }
-
-    @Override
-    public RiResolvedType holder() {
-        return holder;
-    }
-
-    @Override
-    public int accessFlags() {
-        return accessFlags;
-    }
-
-    @Override
-    public boolean canBeStaticallyBound() {
-        return isLeafMethod() || Modifier.isStatic(accessFlags());
-    }
-
-    @Override
-    public byte[] code() {
-        if (code == null) {
-            code = compiler.getVMEntries().RiMethod_code(this);
-            assert code.length == codeSize : "expected: " + codeSize + ", actual: " + code.length;
-        }
-        return code;
-    }
-
-    @Override
-    public int codeSize() {
-        return codeSize;
-    }
-
-    @Override
-    public RiExceptionHandler[] exceptionHandlers() {
-        return compiler.getVMEntries().RiMethod_exceptionHandlers(this);
-    }
-
-    @Override
-    public boolean hasBalancedMonitors() {
-        if (hasBalancedMonitors == null) {
-            hasBalancedMonitors = compiler.getVMEntries().RiMethod_hasBalancedMonitors(this);
-        }
-        return hasBalancedMonitors;
-    }
-
-    @Override
-    public boolean isClassInitializer() {
-        return "<clinit>".equals(name) && Modifier.isStatic(accessFlags());
-    }
-
-    @Override
-    public boolean isConstructor() {
-        return "<init>".equals(name) && !Modifier.isStatic(accessFlags());
-    }
-
-    @Override
-    public boolean isLeafMethod() {
-        return Modifier.isFinal(accessFlags()) || Modifier.isPrivate(accessFlags());
-    }
-
-    @Override
-    public boolean isOverridden() {
-        throw new UnsupportedOperationException("isOverridden");
-    }
-
-    @Override
-    public boolean noSafepointPolls() {
-        return false;
-    }
-
-    @Override
-    public String jniSymbol() {
-        throw new UnsupportedOperationException("jniSymbol");
-    }
-
-    public CiBitMap[] livenessMap() {
-        return null;
-    }
-
-    @Override
-    public int maxLocals() {
-        return maxLocals;
-    }
-
-    @Override
-    public int maxStackSize() {
-        return maxStackSize;
-    }
-
-    @Override
-    public StackTraceElement toStackTraceElement(int bci) {
-        return CiUtil.toStackTraceElement(this, bci);
-    }
-
-    @Override
-    public RiResolvedMethod uniqueConcreteMethod() {
-        return (RiResolvedMethod) compiler.getVMEntries().RiMethod_uniqueConcreteMethod(this);
-    }
-
-    @Override
-    public RiSignature signature() {
-        if (signature == null) {
-            signature = new HotSpotSignature(compiler, compiler.getVMEntries().RiMethod_signature(this));
-        }
-        return signature;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotMethod<" + CiUtil.format("%h.%n", this) + ">";
-    }
-
-    public boolean hasCompiledCode() {
-        return compiler.getVMEntries().RiMethod_hasCompiledCode(this);
-    }
-
-    public int compiledCodeSize() {
-        return compiler.getVMEntries().RiMethod_getCompiledCodeSize(this);
-    }
-
-    @Override
-    public RiResolvedType accessor() {
-        return null;
-    }
-
-    @Override
-    public String intrinsic() {
-        return null;
-    }
-
-    @Override
-    public int invocationCount() {
-        return compiler.getVMEntries().RiMethod_invocationCount(this);
-    }
-
-    @Override
-    public int compilationComplexity() {
-        if (compilationComplexity <= 0 && codeSize() > 0) {
-            BytecodeStream s = new BytecodeStream(code());
-            int result = 0;
-            int currentBC;
-            while ((currentBC = s.currentBC()) != Bytecodes.END) {
-                result += Bytecodes.compilationComplexity(currentBC);
-                s.next();
-            }
-            assert result > 0;
-            compilationComplexity = result;
-        }
-        return compilationComplexity;
-    }
-
-    @Override
-    public RiProfilingInfo profilingInfo() {
-        if (methodData == null) {
-            methodData = compiler.getVMEntries().RiMethod_methodData(this);
-        }
-
-        if (methodData == null) {
-            return new HotSpotNoProfilingInfo(compiler);
-        } else {
-            return new HotSpotProfilingInfo(compiler, methodData);
-        }
-    }
-
-    @Override
-    public Map<Object, Object> compilerStorage() {
-        if (compilerStorage == null) {
-            compilerStorage = new ConcurrentHashMap<>();
-        }
-        return compilerStorage;
-    }
-
-    @Override
-    public RiConstantPool getConstantPool() {
-        return ((HotSpotTypeResolvedImpl) holder()).constantPool();
-    }
-
-    @Override
-    public void dumpProfile() {
-        TTY.println("profile info for %s", this);
-        TTY.println("canBeStaticallyBound: " + canBeStaticallyBound());
-        TTY.println("invocationCount: " + invocationCount());
-        RiProfilingInfo profilingInfo = this.profilingInfo();
-        for (int i = 0; i < codeSize(); i++) {
-            if (profilingInfo.getExecutionCount(i) != -1) {
-                TTY.println("  executionCount@%d: %d", i, profilingInfo.getExecutionCount(i));
-            }
-
-            if (profilingInfo.getBranchTakenProbability(i) != -1) {
-                TTY.println("  branchProbability@%d: %f", i, profilingInfo.getBranchTakenProbability(i));
-            }
-
-            double[] switchProbabilities = profilingInfo.getSwitchProbabilities(i);
-            if (switchProbabilities != null) {
-                TTY.print("  switchProbabilities@%d:", i);
-                for (int j = 0; j < switchProbabilities.length; j++) {
-                    TTY.print(" %f", switchProbabilities[j]);
-                }
-                TTY.println();
-            }
-
-            if (profilingInfo.getExceptionSeen(i) != RiExceptionSeen.FALSE) {
-                TTY.println("  exceptionSeen@%d: %s", i, profilingInfo.getExceptionSeen(i).name());
-            }
-
-            RiTypeProfile typeProfile = profilingInfo.getTypeProfile(i);
-            if (typeProfile != null) {
-                RiResolvedType[] types = typeProfile.getTypes();
-                double[] probabilities = typeProfile.getProbabilities();
-                if (types != null && probabilities != null) {
-                    assert types.length == probabilities.length : "length must match";
-                    TTY.print("  types@%d:", i);
-                    for (int j = 0; j < types.length; j++) {
-                        TTY.print(" %s (%f)", types[j], probabilities[j]);
-                    }
-                    TTY.println(" not recorded (%f)", typeProfile.getNotRecordedProbability());
-                }
-            }
-        }
-    }
-
-    @Override
-    public Annotation[][] getParameterAnnotations() {
-        if (isConstructor()) {
-            Constructor javaConstructor = toJavaConstructor();
-            return javaConstructor == null ? null : javaConstructor.getParameterAnnotations();
-        }
-        Method javaMethod = toJava();
-        return javaMethod == null ? null : javaMethod.getParameterAnnotations();
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        if (isConstructor()) {
-            Constructor<?> javaConstructor = toJavaConstructor();
-            return javaConstructor == null ? null : javaConstructor.getAnnotation(annotationClass);
-        }
-        Method javaMethod = toJava();
-        return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass);
-    }
-
-    @Override
-    public Type getGenericReturnType() {
-        if (isConstructor()) {
-            return void.class;
-        }
-        Method javaMethod = toJava();
-        return javaMethod == null ? null : javaMethod.getGenericReturnType();
-    }
-
-    @Override
-    public Type[] getGenericParameterTypes() {
-        if (isConstructor()) {
-            Constructor javaConstructor = toJavaConstructor();
-            return javaConstructor == null ? null : javaConstructor.getGenericParameterTypes();
-        }
-        Method javaMethod = toJava();
-        return javaMethod == null ? null : javaMethod.getGenericParameterTypes();
-    }
-
-    private Method toJava() {
-        try {
-            return holder.toJava().getDeclaredMethod(name, CiUtil.signatureToTypes(signature(), holder));
-        } catch (NoSuchMethodException e) {
-            return null;
-        }
-    }
-
-    private Constructor toJavaConstructor() {
-        try {
-            return holder.toJava().getDeclaredConstructor(CiUtil.signatureToTypes(signature(), holder));
-        } catch (NoSuchMethodException e) {
-            return null;
-        }
-    }
-
-    @Override
-    public boolean canBeInlined() {
-        return canBeInlined && callback == null;
-    }
-    public void neverInline() {
-        this.canBeInlined = false;
-    }
-
-    public CiGenericCallback callback() {
-        return callback;
-    }
-    public void setCallback(CiGenericCallback callback) {
-        this.callback = callback;
-    }
-
-    @Override
-    public int vtableEntryOffset() {
-        return compiler.getVMEntries().RiMethod_vtableEntryOffset(this);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodUnresolved.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Implementation of RiMethod for unresolved HotSpot methods.
- */
-public final class HotSpotMethodUnresolved extends HotSpotMethod {
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 5610263481791970079L;
-    private final RiSignature signature;
-    protected RiType holder;
-
-    public HotSpotMethodUnresolved(Compiler compiler, String name, String signature, RiType holder) {
-        super(compiler);
-        this.name = name;
-        this.holder = holder;
-        this.signature = new HotSpotSignature(compiler, signature);
-    }
-
-    @Override
-    public RiSignature signature() {
-        return signature;
-    }
-
-    @Override
-    public RiType holder() {
-        return holder;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotMethod<" + holder.name() + ". " + name + ", unresolved>";
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotNoProfilingInfo.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Dummy profiling information in case that a method was not executed frequently enough so that
- * no profiling information does exist yet.
- */
-public final class HotSpotNoProfilingInfo extends CompilerObject implements RiProfilingInfo {
-    /**
-     *
-     */
-    private static final long serialVersionUID = 4357945025049704109L;
-    // Be optimistic and return false for exceptionSeen. A methodDataOop is allocated in case of a deoptimization.
-    private static final HotSpotMethodDataAccessor noData = HotSpotMethodData.getNoDataAccessor(false);
-
-    public HotSpotNoProfilingInfo(Compiler compiler) {
-        super(compiler);
-    }
-
-    @Override
-    public RiTypeProfile getTypeProfile(int bci) {
-        return noData.getTypeProfile(null, -1);
-    }
-
-    @Override
-    public double getBranchTakenProbability(int bci) {
-        return noData.getBranchTakenProbability(null, -1);
-    }
-
-    @Override
-    public double[] getSwitchProbabilities(int bci) {
-        return noData.getSwitchProbabilities(null, -1);
-    }
-
-    @Override
-    public RiExceptionSeen getExceptionSeen(int bci) {
-        return noData.getExceptionSeen(null, -1);
-    }
-
-    @Override
-    public int getExecutionCount(int bci) {
-        return noData.getExecutionCount(null, -1);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-
-public final class HotSpotProfilingInfo extends CompilerObject implements RiProfilingInfo {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = -8307682725047864875L;
-    private static final DebugMetric metricInsufficentSpace = Debug.metric("InsufficientSpaceForProfilingData");
-
-    private int position;
-    private int hintPosition;
-    private int hintBCI;
-    private HotSpotMethodDataAccessor dataAccessor;
-    private HotSpotMethodData methodData;
-
-    public HotSpotProfilingInfo(Compiler compiler, HotSpotMethodData methodData) {
-        super(compiler);
-        this.methodData = methodData;
-        hintPosition = 0;
-        hintBCI = -1;
-    }
-
-    @Override
-    public RiTypeProfile getTypeProfile(int bci) {
-        findBCI(bci, false);
-        return dataAccessor.getTypeProfile(methodData, position);
-    }
-
-    @Override
-    public double getBranchTakenProbability(int bci) {
-        findBCI(bci, false);
-        return dataAccessor.getBranchTakenProbability(methodData, position);
-    }
-
-    @Override
-    public double[] getSwitchProbabilities(int bci) {
-        findBCI(bci, false);
-        return dataAccessor.getSwitchProbabilities(methodData, position);
-    }
-
-    @Override
-    public RiExceptionSeen getExceptionSeen(int bci) {
-        findBCI(bci, true);
-        return dataAccessor.getExceptionSeen(methodData, position);
-    }
-
-    @Override
-    public int getExecutionCount(int bci) {
-        findBCI(bci, false);
-        return dataAccessor.getExecutionCount(methodData, position);
-    }
-
-    private void findBCI(int targetBCI, boolean searchExtraData) {
-        assert targetBCI >= 0 : "invalid BCI";
-
-        if (methodData.hasNormalData()) {
-            int currentPosition = targetBCI < hintBCI ? 0 : hintPosition;
-            HotSpotMethodDataAccessor currentAccessor;
-            while ((currentAccessor = methodData.getNormalData(currentPosition)) != null) {
-                int currentBCI = currentAccessor.getBCI(methodData, currentPosition);
-                if (currentBCI == targetBCI) {
-                    normalDataFound(currentAccessor, currentPosition, currentBCI);
-                    return;
-                } else if (currentBCI > targetBCI) {
-                    break;
-                }
-                currentPosition = currentPosition + currentAccessor.getSize(methodData, currentPosition);
-            }
-        }
-
-        boolean exceptionPossiblyNotRecorded = false;
-        if (searchExtraData && methodData.hasExtraData()) {
-            int currentPosition = methodData.getExtraDataBeginOffset();
-            HotSpotMethodDataAccessor currentAccessor;
-            while ((currentAccessor = methodData.getExtraData(currentPosition)) != null) {
-                int currentBCI = currentAccessor.getBCI(methodData, currentPosition);
-                if (currentBCI == targetBCI) {
-                    extraDataFound(currentAccessor, currentPosition);
-                    return;
-                }
-                currentPosition = currentPosition + currentAccessor.getSize(methodData, currentPosition);
-            }
-
-            if (!methodData.isWithin(currentPosition)) {
-                exceptionPossiblyNotRecorded = true;
-                metricInsufficentSpace.increment();
-            }
-        }
-
-        noDataFound(exceptionPossiblyNotRecorded);
-    }
-
-    private void normalDataFound(HotSpotMethodDataAccessor data, int pos, int bci) {
-        setCurrentData(data, pos);
-        this.hintPosition = position;
-        this.hintBCI = bci;
-    }
-
-    private void extraDataFound(HotSpotMethodDataAccessor data, int pos) {
-        setCurrentData(data, pos);
-    }
-
-    private void noDataFound(boolean exceptionPossiblyNotRecorded) {
-        HotSpotMethodDataAccessor accessor = HotSpotMethodData.getNoDataAccessor(exceptionPossiblyNotRecorded);
-        setCurrentData(accessor, -1);
-    }
-
-    private void setCurrentData(HotSpotMethodDataAccessor dataAccessor, int position) {
-        this.dataAccessor = dataAccessor;
-        this.position = position;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRegisterConfig.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import static com.oracle.max.asm.target.amd64.AMD64.*;
-
-import java.util.*;
-
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiCallingConvention.Type;
-import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.hotspot.*;
-
-public class HotSpotRegisterConfig implements RiRegisterConfig {
-
-    // be careful - the contents of this array are duplicated in graal_CodeInstaller.cpp
-    private final CiRegister[] allocatable = {
-        rax, rbx, rcx, rdx, rsi, rdi, r8, r9, /* r10, */r11, r12, r13, r14, /*r15*/
-        xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
-        xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
-    };
-
-    private final EnumMap<RegisterFlag, CiRegister[]> categorized = CiRegister.categorize(allocatable);
-
-    private final RiRegisterAttributes[] attributesMap;
-
-    @Override
-    public CiRegister[] getAllocatableRegisters() {
-        return allocatable;
-    }
-
-    @Override
-    public EnumMap<RegisterFlag, CiRegister[]> getCategorizedAllocatableRegisters() {
-        return categorized;
-    }
-
-    @Override
-    public RiRegisterAttributes[] getAttributesMap() {
-        return attributesMap;
-    }
-
-    private final CiRegister[] generalParameterRegisters;
-    private final CiRegister[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7};
-    private final CiRegister[] allParameterRegisters;
-
-    private final CiRegister[] rsaRegs = {
-        rax,  rcx,  rdx,   rbx,   rsp,   rbp,   rsi,   rdi,
-        r8,   r9,   r10,   r11,   r12,   r13,   r14,   r15,
-        xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
-        xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
-    };
-
-    private final CiCalleeSaveLayout registerSaveArea;
-
-    public HotSpotRegisterConfig(HotSpotVMConfig config, boolean globalStubConfig) {
-        if (config.windowsOs) {
-            generalParameterRegisters = new CiRegister[] {rdx, r8, r9, rdi, rsi, rcx};
-        } else {
-            generalParameterRegisters = new CiRegister[] {rsi, rdx, rcx, r8, r9, rdi};
-        }
-
-        if (globalStubConfig) {
-            registerSaveArea = new CiCalleeSaveLayout(0, -1, 8, rsaRegs);
-        } else {
-            registerSaveArea = new CiCalleeSaveLayout(0, 8, 8, new CiRegister[0]);
-        }
-
-        attributesMap = RiRegisterAttributes.createMap(this, AMD64.allRegisters);
-        allParameterRegisters = Arrays.copyOf(generalParameterRegisters, generalParameterRegisters.length + xmmParameterRegisters.length);
-        System.arraycopy(xmmParameterRegisters, 0, allParameterRegisters, generalParameterRegisters.length, xmmParameterRegisters.length);
-    }
-
-    @Override
-    public CiRegister[] getCallerSaveRegisters() {
-        return getAllocatableRegisters();
-    }
-
-    @Override
-    public CiRegister getRegisterForRole(int index) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public CiCallingConvention getCallingConvention(Type type, CiKind[] parameters, CiTarget target, boolean stackOnly) {
-        if (type == Type.NativeCall) {
-            throw new UnsupportedOperationException();
-        }
-        return callingConvention(parameters, type, target, stackOnly);
-    }
-
-    public CiRegister[] getCallingConventionRegisters(Type type, RegisterFlag flag) {
-        return allParameterRegisters;
-    }
-
-    private CiCallingConvention callingConvention(CiKind[] types, Type type, CiTarget target, boolean stackOnly) {
-        CiValue[] locations = new CiValue[types.length];
-
-        int currentGeneral = 0;
-        int currentXMM = 0;
-        int currentStackOffset = 0;
-
-        for (int i = 0; i < types.length; i++) {
-            final CiKind kind = types[i];
-
-            switch (kind) {
-                case Byte:
-                case Boolean:
-                case Short:
-                case Char:
-                case Int:
-                case Long:
-                case Object:
-                    if (!stackOnly && currentGeneral < generalParameterRegisters.length) {
-                        CiRegister register = generalParameterRegisters[currentGeneral++];
-                        locations[i] = register.asValue(kind);
-                    }
-                    break;
-                case Float:
-                case Double:
-                    if (!stackOnly && currentXMM < xmmParameterRegisters.length) {
-                        CiRegister register = xmmParameterRegisters[currentXMM++];
-                        locations[i] = register.asValue(kind);
-                    }
-                    break;
-                default:
-                    throw GraalInternalError.shouldNotReachHere();
-            }
-
-            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);
-    }
-
-    @Override
-    public CiRegister getReturnRegister(CiKind kind) {
-        switch (kind) {
-            case Boolean:
-            case Byte:
-            case Char:
-            case Short:
-            case Int:
-            case Long:
-            case Object:
-                return rax;
-            case Float:
-            case Double:
-                return xmm0;
-            case Void:
-            case Illegal:
-                return null;
-            default:
-                throw new UnsupportedOperationException("no return register for type " + kind);
-        }
-    }
-
-    @Override
-    public CiRegister getScratchRegister() {
-        return r10;
-    }
-
-    @Override
-    public CiRegister getFrameRegister() {
-        return rsp;
-    }
-
-    public CiCalleeSaveLayout getCalleeSaveLayout() {
-        return registerSaveArea;
-    }
-
-    @Override
-    public String toString() {
-        String res = String.format(
-             "Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" +
-             "CallerSave:  " + Arrays.toString(getCallerSaveRegisters()) + "%n" +
-             "CalleeSave:  " + getCalleeSaveLayout() + "%n" +
-             "Scratch:     " + getScratchRegister() + "%n");
-        return res;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,495 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiTargetMethod.Call;
-import com.oracle.max.cri.ci.CiTargetMethod.DataPatch;
-import com.oracle.max.cri.ci.CiTargetMethod.Safepoint;
-import com.oracle.max.cri.ci.CiUtil.RefMapFormatter;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.ri.RiType.Representation;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.phases.PhasePlan.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-import com.oracle.graal.hotspot.nodes.*;
-import com.oracle.graal.java.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.snippets.nodes.*;
-
-/**
- * CRI runtime implementation for the HotSpot VM.
- */
-public class HotSpotRuntime implements GraalRuntime {
-    final HotSpotVMConfig config;
-    final HotSpotRegisterConfig regConfig;
-    private final HotSpotRegisterConfig globalStubRegConfig;
-    private final Compiler compiler;
-
-    public HotSpotRuntime(HotSpotVMConfig config, Compiler compiler) {
-        this.config = config;
-        this.compiler = compiler;
-        regConfig = new HotSpotRegisterConfig(config, false);
-        globalStubRegConfig = new HotSpotRegisterConfig(config, true);
-    }
-
-    @Override
-    public int codeOffset() {
-        return 0;
-    }
-
-
-    public Compiler getCompiler() {
-        return compiler;
-    }
-
-    @Override
-    public String disassemble(byte[] code, long address) {
-        return compiler.getVMEntries().disassembleNative(code, address);
-    }
-
-    @Override
-    public String disassemble(CiTargetMethod tm) {
-        byte[] code = Arrays.copyOf(tm.targetCode(), tm.targetCodeSize());
-        CiTarget target = compiler.getTarget();
-        HexCodeFile hcf = new HexCodeFile(code, 0L, target.arch.name, target.wordSize * 8);
-        HexCodeFile.addAnnotations(hcf, tm.annotations());
-        addExceptionHandlersComment(tm, hcf);
-        CiRegister fp = regConfig.getFrameRegister();
-        RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0);
-        for (Safepoint safepoint : tm.safepoints) {
-            if (safepoint instanceof Call) {
-                Call call = (Call) safepoint;
-                if (call.debugInfo != null) {
-                    hcf.addComment(call.pcOffset + call.size, CiUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString());
-                }
-                addOperandComment(hcf, call.pcOffset, "{" + call.target + "}");
-            } else {
-                if (safepoint.debugInfo != null) {
-                    hcf.addComment(safepoint.pcOffset, CiUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString());
-                }
-                addOperandComment(hcf, safepoint.pcOffset, "{safepoint}");
-            }
-        }
-        for (DataPatch site : tm.dataReferences) {
-            hcf.addOperandComment(site.pcOffset, "{" + site.constant + "}");
-        }
-        return hcf.toEmbeddedString();
-    }
-
-    private static void addExceptionHandlersComment(CiTargetMethod tm, HexCodeFile hcf) {
-        if (!tm.exceptionHandlers.isEmpty()) {
-            String nl = HexCodeFile.NEW_LINE;
-            StringBuilder buf = new StringBuilder("------ Exception Handlers ------").append(nl);
-            for (CiTargetMethod.ExceptionHandler e : tm.exceptionHandlers) {
-                buf.append("    ").
-                    append(e.pcOffset).append(" -> ").
-                    append(e.handlerPos).
-                    append(nl);
-            }
-            hcf.addComment(0, buf.toString());
-        }
-    }
-
-    private static void addOperandComment(HexCodeFile hcf, int pos, String comment) {
-        String oldValue = hcf.addOperandComment(pos, comment);
-        assert oldValue == null : "multiple comments for operand of instruction at " + pos + ": " + comment + ", " + oldValue;
-    }
-
-    @Override
-    public String disassemble(RiResolvedMethod method) {
-        return compiler.getVMEntries().disassembleJava((HotSpotMethodResolved) method);
-    }
-
-    @Override
-    public RiResolvedType asRiType(CiKind kind) {
-        return (RiResolvedType) compiler.getVMEntries().getType(kind.toJavaClass());
-    }
-
-    @Override
-    public RiResolvedType getTypeOf(CiConstant constant) {
-        return (RiResolvedType) compiler.getVMEntries().getRiType(constant);
-    }
-
-    @Override
-    public boolean isExceptionType(RiResolvedType type) {
-        return type.isSubtypeOf((RiResolvedType) compiler.getVMEntries().getType(Throwable.class));
-    }
-
-    @Override
-    public Object registerCompilerStub(CiTargetMethod targetMethod, String name) {
-        return HotSpotTargetMethod.installStub(compiler, targetMethod, name);
-    }
-
-    @Override
-    public int sizeOfLockData() {
-        // TODO shouldn't be hard coded
-        return 8;
-    }
-
-    @Override
-    public int sizeOfBasicObjectLock() {
-        // TODO shouldn't be hard coded
-        return 2 * 8;
-    }
-
-    @Override
-    public int basicObjectLockOffsetInBytes() {
-        return 8;
-    }
-
-    @Override
-    public boolean areConstantObjectsEqual(CiConstant x, CiConstant y) {
-        return compiler.getVMEntries().compareConstantObjects(x, y);
-    }
-
-    @Override
-    public RiRegisterConfig getRegisterConfig(RiMethod method) {
-        return regConfig;
-    }
-
-    /**
-     * HotSpots needs an area suitable for storing a program counter for temporary use during the deoptimization process.
-     */
-    @Override
-    public int getCustomStackAreaSize() {
-        // TODO shouldn't be hard coded
-        return 8;
-    }
-
-    @Override
-    public int getMinimumOutgoingSize() {
-        return config.runtimeCallStackSize;
-    }
-
-    @Override
-    public int getArrayLength(CiConstant array) {
-        return compiler.getVMEntries().getArrayLength(array);
-    }
-
-    @Override
-    public Class<?> asJavaClass(CiConstant c) {
-        return (Class<?>) c.asObject();
-    }
-
-    @Override
-    public Object asJavaObject(CiConstant c) {
-        return c.asObject();
-    }
-
-    @Override
-    public void lower(Node n, CiLoweringTool tool) {
-        if (!GraalOptions.Lower) {
-            return;
-        }
-        StructuredGraph graph = (StructuredGraph) n.graph();
-
-        if (n instanceof ArrayLengthNode) {
-            ArrayLengthNode arrayLengthNode = (ArrayLengthNode) n;
-            SafeReadNode safeReadArrayLength = safeReadArrayLength(arrayLengthNode.graph(), arrayLengthNode.array());
-            graph.replaceFixedWithFixed(arrayLengthNode, safeReadArrayLength);
-            safeReadArrayLength.lower(tool);
-        } else if (n instanceof LoadFieldNode) {
-            LoadFieldNode field = (LoadFieldNode) n;
-            if (field.isVolatile()) {
-                return;
-            }
-            int displacement = ((HotSpotField) field.field()).offset();
-            assert field.kind() != CiKind.Illegal;
-            ReadNode memoryRead = graph.add(new ReadNode(field.field().kind(true).stackKind(), field.object(), LocationNode.create(field.field(), field.field().kind(true), displacement, graph)));
-            memoryRead.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(field.object(), false))));
-            graph.replaceFixedWithFixed(field, memoryRead);
-        } else if (n instanceof StoreFieldNode) {
-            StoreFieldNode storeField = (StoreFieldNode) n;
-            if (storeField.isVolatile()) {
-                return;
-            }
-            HotSpotField field = (HotSpotField) storeField.field();
-            WriteNode memoryWrite = graph.add(new WriteNode(storeField.object(), storeField.value(), LocationNode.create(storeField.field(), storeField.field().kind(true), field.offset(), graph)));
-            memoryWrite.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(storeField.object(), false))));
-            memoryWrite.setStateAfter(storeField.stateAfter());
-            graph.replaceFixedWithFixed(storeField, memoryWrite);
-
-            if (field.kind(true) == CiKind.Object && !memoryWrite.value().isNullConstant()) {
-                graph.addAfterFixed(memoryWrite, graph.add(new FieldWriteBarrier(memoryWrite.object())));
-            }
-        } else if (n instanceof LoadIndexedNode) {
-            LoadIndexedNode loadIndexed = (LoadIndexedNode) n;
-            GuardNode boundsCheck = createBoundsCheck(loadIndexed, tool);
-
-            CiKind elementKind = loadIndexed.elementKind();
-            LocationNode arrayLocation = createArrayLocation(graph, elementKind, loadIndexed.index());
-            ReadNode memoryRead = graph.add(new ReadNode(elementKind.stackKind(), loadIndexed.array(), arrayLocation));
-            memoryRead.setGuard(boundsCheck);
-            graph.replaceFixedWithFixed(loadIndexed, memoryRead);
-        } else if (n instanceof StoreIndexedNode) {
-            StoreIndexedNode storeIndexed = (StoreIndexedNode) n;
-            GuardNode boundsCheck = createBoundsCheck(storeIndexed, tool);
-
-            CiKind elementKind = storeIndexed.elementKind();
-            LocationNode arrayLocation = createArrayLocation(graph, elementKind, storeIndexed.index());
-            ValueNode value = storeIndexed.value();
-            ValueNode array = storeIndexed.array();
-            if (elementKind == CiKind.Object && !value.isNullConstant()) {
-                // Store check!
-                if (array.exactType() != null) {
-                    RiResolvedType elementType = array.exactType().componentType();
-                    if (elementType.superType() != null) {
-                        AnchorNode anchor = graph.add(new AnchorNode());
-                        graph.addBeforeFixed(storeIndexed, anchor);
-                        ConstantNode type = ConstantNode.forCiConstant(elementType.getEncoding(Representation.ObjectHub), this, graph);
-                        value = graph.unique(new CheckCastNode(anchor, type, elementType, value));
-                    } else {
-                        assert elementType.name().equals("Ljava/lang/Object;") : elementType.name();
-                    }
-                } else {
-                    AnchorNode anchor = graph.add(new AnchorNode());
-                    graph.addBeforeFixed(storeIndexed, anchor);
-                    GuardNode guard = (GuardNode) tool.createGuard(graph.unique(new NullCheckNode(array, false)));
-                    ReadNode arrayClass = graph.add(new ReadNode(CiKind.Object, array, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.hubOffset, graph)));
-                    arrayClass.setGuard(guard);
-                    graph.addBeforeFixed(storeIndexed, arrayClass);
-                    ReadNode arrayElementKlass = graph.add(new ReadNode(CiKind.Object, arrayClass, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.arrayClassElementOffset, graph)));
-                    value = graph.unique(new CheckCastNode(anchor, arrayElementKlass, null, value));
-                }
-            }
-            WriteNode memoryWrite = graph.add(new WriteNode(array, value, arrayLocation));
-            memoryWrite.setGuard(boundsCheck);
-            memoryWrite.setStateAfter(storeIndexed.stateAfter());
-
-            graph.replaceFixedWithFixed(storeIndexed, memoryWrite);
-
-            if (elementKind == CiKind.Object && !value.isNullConstant()) {
-                graph.addAfterFixed(memoryWrite, graph.add(new ArrayWriteBarrier(array, arrayLocation)));
-            }
-        } else if (n instanceof UnsafeLoadNode) {
-            UnsafeLoadNode load = (UnsafeLoadNode) n;
-            assert load.kind() != CiKind.Illegal;
-            IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, load.loadKind(), load.displacement(), load.offset(), graph);
-            location.setIndexScalingEnabled(false);
-            ReadNode memoryRead = graph.add(new ReadNode(load.kind(), load.object(), location));
-            memoryRead.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(load.object(), false))));
-            graph.replaceFixedWithFixed(load, memoryRead);
-        } else if (n instanceof UnsafeStoreNode) {
-            UnsafeStoreNode store = (UnsafeStoreNode) n;
-            IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, store.storeKind(), store.displacement(), store.offset(), graph);
-            location.setIndexScalingEnabled(false);
-            WriteNode write = graph.add(new WriteNode(store.object(), store.value(), location));
-            FieldWriteBarrier barrier = graph.add(new FieldWriteBarrier(store.object()));
-            write.setStateAfter(store.stateAfter());
-            graph.replaceFixedWithFixed(store, write);
-            graph.addBeforeFixed(write, barrier);
-        } else if (n instanceof ArrayHeaderSizeNode) {
-            ArrayHeaderSizeNode arrayHeaderSize = (ArrayHeaderSizeNode) n;
-            graph.replaceFloating(arrayHeaderSize, ConstantNode.forLong(config.getArrayOffset(arrayHeaderSize.elementKind()), n.graph()));
-        } else if (n instanceof ReadHubNode) {
-            ReadHubNode objectClassNode = (ReadHubNode) n;
-            LocationNode location = LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.hubOffset, graph);
-            ReadNode memoryRead = graph.add(new ReadNode(CiKind.Object, objectClassNode.object(), location));
-            memoryRead.setGuard((GuardNode) tool.createGuard(graph.unique(new NullCheckNode(objectClassNode.object(), false))));
-            graph.replaceFixed(objectClassNode, memoryRead);
-        }
-    }
-
-    private IndexedLocationNode createArrayLocation(Graph graph, CiKind elementKind, ValueNode index) {
-        return IndexedLocationNode.create(LocationNode.getArrayLocation(elementKind), elementKind, config.getArrayOffset(elementKind), index, graph);
-    }
-
-    private static GuardNode createBoundsCheck(AccessIndexedNode n, CiLoweringTool tool) {
-        return (GuardNode) tool.createGuard(n.graph().unique(new CompareNode(n.index(), Condition.BT, n.length())));
-    }
-
-    @Override
-    public StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List<? extends Node> parameters) {
-        RiType holder = method.holder();
-        String fullName = method.name() + method.signature().asString();
-        String holderName = holder.name();
-        if (holderName.equals("Ljava/lang/Object;")) {
-            if (fullName.equals("getClass()Ljava/lang/Class;")) {
-                ValueNode obj = (ValueNode) parameters.get(0);
-                if (obj.stamp().nonNull() && obj.stamp().exactType() != null) {
-                    StructuredGraph graph = new StructuredGraph();
-                    ValueNode result = ConstantNode.forObject(obj.stamp().exactType().toJava(), this, graph);
-                    ReturnNode ret = graph.add(new ReturnNode(result));
-                    graph.start().setNext(ret);
-                    return graph;
-                }
-                StructuredGraph graph = new StructuredGraph();
-                LocalNode receiver = graph.unique(new LocalNode(CiKind.Object, 0));
-                SafeReadNode klassOop = safeReadHub(graph, receiver);
-                ReadNode result = graph.add(new ReadNode(CiKind.Object, klassOop, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Object, config.classMirrorOffset, graph)));
-                ReturnNode ret = graph.add(new ReturnNode(result));
-                graph.start().setNext(klassOop);
-                klassOop.setNext(ret);
-                return graph;
-            }
-        } else if (holderName.equals("Ljava/lang/Class;")) {
-            if (fullName.equals("getModifiers()I")) {
-                StructuredGraph graph = new StructuredGraph();
-                LocalNode receiver = graph.unique(new LocalNode(CiKind.Object, 0));
-                SafeReadNode klassOop = safeRead(graph, CiKind.Object, receiver, config.klassOopOffset);
-                graph.start().setNext(klassOop);
-                // TODO (thomaswue): Care about primitive classes! Crashes for primitive classes at the moment (klassOop == null)
-                ReadNode result = graph.add(new ReadNode(CiKind.Int, klassOop, LocationNode.create(LocationNode.FINAL_LOCATION, CiKind.Int, config.klassModifierFlagsOffset, graph)));
-                ReturnNode ret = graph.add(new ReturnNode(result));
-                klassOop.setNext(ret);
-                return graph;
-            }
-        } else if (holderName.equals("Ljava/lang/Thread;")) {
-            if (fullName.equals("currentThread()Ljava/lang/Thread;")) {
-                StructuredGraph graph = new StructuredGraph();
-                ReturnNode ret = graph.add(new ReturnNode(graph.unique(new CurrentThread(config.threadObjectOffset))));
-                graph.start().setNext(ret);
-                return graph;
-            }
-        }
-        return null;
-    }
-
-    private SafeReadNode safeReadHub(Graph graph, ValueNode value) {
-        return safeRead(graph, CiKind.Object, value, config.hubOffset);
-    }
-
-    private SafeReadNode safeReadArrayLength(Graph graph, ValueNode value) {
-        return safeRead(graph, CiKind.Int, value, config.arrayLengthOffset);
-    }
-
-    private static SafeReadNode safeRead(Graph graph, CiKind kind, ValueNode value, int offset) {
-        return graph.add(new SafeReadNode(kind, value, LocationNode.create(LocationNode.FINAL_LOCATION, kind, offset, graph)));
-    }
-
-    public RiResolvedType getType(Class<?> clazz) {
-        return (RiResolvedType) compiler.getVMEntries().getType(clazz);
-    }
-
-    public Object asCallTarget(Object target) {
-        return target;
-    }
-
-    public long getMaxCallTargetOffset(CiRuntimeCall rtcall) {
-        return compiler.getVMEntries().getMaxCallTargetOffset(rtcall);
-    }
-
-    public RiResolvedMethod getRiMethod(Method reflectionMethod) {
-        return (RiResolvedMethod) compiler.getVMEntries().getRiMethod(reflectionMethod);
-    }
-
-    @Override
-    public void installMethod(RiResolvedMethod method, CiTargetMethod code) {
-        synchronized (method) {
-            if (((HotSpotMethodResolvedImpl) method).callback() == null) {
-                compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), true);
-            } else {
-                // callback stub is installed.
-            }
-        }
-    }
-
-    @Override
-    public RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code) {
-        return compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, code), false);
-    }
-
-    public void installMethodCallback(RiResolvedMethod method, CiGenericCallback callback) {
-        synchronized (method) {
-            ((HotSpotMethodResolvedImpl) method).setCallback(callback);
-            CiTargetMethod callbackStub = createCallbackStub(method, callback);
-            compiler.getVMEntries().installMethod(new HotSpotTargetMethod(compiler, (HotSpotMethodResolved) method, callbackStub), true);
-        }
-    }
-
-    @Override
-    public RiRegisterConfig getGlobalStubRegisterConfig() {
-        return globalStubRegConfig;
-    }
-
-    private CiTargetMethod createCallbackStub(RiResolvedMethod method, CiGenericCallback callback) {
-        StructuredGraph graph = new StructuredGraph();
-        FrameStateBuilder frameState = new FrameStateBuilder(method, graph, false);
-        ValueNode local0 = frameState.loadLocal(0);
-
-        FrameState initialFrameState = frameState.create(0);
-        graph.start().setStateAfter(initialFrameState);
-
-        ConstantNode callbackNode = ConstantNode.forObject(callback, this, graph);
-
-        RuntimeCallNode runtimeCall = graph.add(new RuntimeCallNode(CiRuntimeCall.GenericCallback, new ValueNode[] {callbackNode, local0}));
-        runtimeCall.setStateAfter(initialFrameState.duplicateModified(0, false, CiKind.Void, runtimeCall));
-
-        @SuppressWarnings("unused")
-        HotSpotCompiledMethod hotSpotCompiledMethod = new HotSpotCompiledMethod(null, null); // initialize class...
-        RiResolvedType compiledMethodClass = getType(HotSpotCompiledMethod.class);
-        RiResolvedField nmethodField = null;
-        for (RiResolvedField field : compiledMethodClass.declaredFields()) {
-            if (field.name().equals("nmethod")) {
-                nmethodField = field;
-                break;
-            }
-        }
-        assert nmethodField != null;
-        LoadFieldNode loadField = graph.add(new LoadFieldNode(runtimeCall, nmethodField));
-
-        CompareNode compare = graph.unique(new CompareNode(loadField, Condition.EQ, ConstantNode.forLong(0, graph)));
-
-        IfNode ifNull = graph.add(new IfNode(compare, 0.01));
-
-        BeginNode beginInvalidated = graph.add(new BeginNode());
-        DeoptimizeNode deoptInvalidated = graph.add(new DeoptimizeNode(DeoptAction.None));
-
-        BeginNode beginTailcall = graph.add(new BeginNode());
-        TailcallNode tailcall = graph.add(new TailcallNode(loadField, initialFrameState));
-        DeoptimizeNode deoptEnd = graph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile));
-
-        graph.start().setNext(runtimeCall);
-        runtimeCall.setNext(loadField);
-        loadField.setNext(ifNull);
-        ifNull.setTrueSuccessor(beginInvalidated);
-        ifNull.setFalseSuccessor(beginTailcall);
-        beginInvalidated.setNext(deoptInvalidated);
-        beginTailcall.setNext(tailcall);
-        tailcall.setNext(deoptEnd);
-
-        CiTargetMethod result = compiler.getCompiler().compileMethod(method, graph, -1, PhasePlan.DEFAULT);
-        return result;
-    }
-
-    @Override
-    public CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph) {
-        final PhasePlan plan = new PhasePlan();
-        GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(compiler.getRuntime());
-        plan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
-        return compiler.getCompiler().compileMethod(method, graph, -1, plan);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotSignature.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-import com.oracle.graal.java.*;
-
-/**
- * Represents a method signature.
- */
-public class HotSpotSignature extends CompilerObject implements RiSignature {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = -2890917956072366116L;
-    private final List<String> arguments = new ArrayList<>();
-    private final String returnType;
-    private final String originalString;
-    private RiType[] argumentTypes;
-    private RiType returnTypeCache;
-
-    public HotSpotSignature(Compiler compiler, String signature) {
-        super(compiler);
-        assert signature.length() > 0;
-        this.originalString = signature;
-
-        if (signature.charAt(0) == '(') {
-            int cur = 1;
-            while (cur < signature.length() && signature.charAt(cur) != ')') {
-                int nextCur = parseSignature(signature, cur);
-                arguments.add(signature.substring(cur, nextCur));
-                cur = nextCur;
-            }
-
-            cur++;
-            int nextCur = parseSignature(signature, cur);
-            returnType = signature.substring(cur, nextCur);
-            assert nextCur == signature.length();
-        } else {
-            returnType = null;
-        }
-    }
-
-    private static int parseSignature(String signature, int start) {
-        int cur = start;
-        char first;
-        do {
-            first = signature.charAt(cur++);
-        } while (first == '[');
-
-        switch (first) {
-            case 'L':
-                while (signature.charAt(cur) != ';') {
-                    cur++;
-                }
-                cur++;
-                break;
-            case 'V':
-            case 'I':
-            case 'B':
-            case 'C':
-            case 'D':
-            case 'F':
-            case 'J':
-            case 'S':
-            case 'Z':
-                break;
-            default:
-                assert false;
-        }
-        return cur;
-    }
-
-    @Override
-    public int argumentCount(boolean withReceiver) {
-        return arguments.size() + (withReceiver ? 1 : 0);
-    }
-
-    @Override
-    public CiKind argumentKindAt(int index, boolean architecture) {
-        return CiKind.fromTypeString(arguments.get(index));
-    }
-
-    @Override
-    public int argumentSlots(boolean withReceiver) {
-        int argSlots = 0;
-        for (int i = 0; i < argumentCount(false); i++) {
-            argSlots += FrameStateBuilder.stackSlots(argumentKindAt(i, false));
-        }
-        return argSlots + (withReceiver ? 1 : 0);
-    }
-
-    @Override
-    public RiType argumentTypeAt(int index, RiResolvedType accessingClass) {
-        if (argumentTypes == null) {
-            argumentTypes = new RiType[arguments.size()];
-        }
-        RiType type = argumentTypes[index];
-        if (type == null || !(type instanceof RiResolvedType)) {
-            type = compiler.lookupType(arguments.get(index), (HotSpotTypeResolved) accessingClass, true);
-            argumentTypes[index] = type;
-        }
-        return type;
-    }
-
-    @Override
-    public String asString() {
-        return originalString;
-    }
-
-    @Override
-    public CiKind returnKind(boolean architecture) {
-        return CiKind.fromTypeString(returnType);
-    }
-
-    @Override
-    public RiType returnType(RiType accessingClass) {
-        if (returnTypeCache == null) {
-            returnTypeCache = compiler.lookupType(returnType, (HotSpotTypeResolved) accessingClass, false);
-        }
-        return returnTypeCache;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotSignature<" + originalString + ">";
-    }
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotType.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Common interface for all HotSpot RiType-implementations.
- */
-public abstract class HotSpotType extends CompilerObject implements RiType {
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -4252886265301910771L;
-    protected String name;
-
-    protected HotSpotType(Compiler compiler) {
-        super(compiler);
-    }
-
-    @Override
-    public final String name() {
-        return name;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Implementation of RiType for primitive HotSpot types.
- */
-public final class HotSpotTypePrimitive extends HotSpotType implements RiResolvedType {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = -6208552348908071473L;
-    private CiKind kind;
-
-
-    public HotSpotTypePrimitive(Compiler compiler, CiKind kind) {
-        super(compiler);
-        this.kind = kind;
-        this.name = kind.toString();
-    }
-
-    @Override
-    public int accessFlags() {
-        assert kind != null && kind.toJavaClass() != null;
-        return Modifier.ABSTRACT | Modifier.FINAL | Modifier.PUBLIC;
-    }
-
-    @Override
-    public RiResolvedType arrayOf() {
-        return (RiResolvedType) compiler.getVMEntries().getPrimitiveArrayType(kind);
-    }
-
-    @Override
-    public RiResolvedType componentType() {
-        return null;
-    }
-
-    @Override
-    public RiResolvedType exactType() {
-        return this;
-    }
-
-    @Override
-    public RiResolvedType superType() {
-        return null;
-    }
-
-    @Override
-    public RiResolvedType leastCommonAncestor(RiResolvedType otherType) {
-        return null;
-    }
-
-    @Override
-    public CiConstant getEncoding(Representation r) {
-        throw GraalInternalError.unimplemented("HotSpotTypePrimitive.getEncoding");
-    }
-
-    @Override
-    public CiKind getRepresentationKind(Representation r) {
-        return kind;
-    }
-
-    @Override
-    public boolean hasFinalizableSubclass() {
-        return false;
-    }
-
-    @Override
-    public boolean hasFinalizer() {
-        return false;
-    }
-
-    @Override
-    public boolean hasSubclass() {
-        return false;
-    }
-
-    @Override
-    public boolean isArrayClass() {
-        return false;
-    }
-
-    @Override
-    public boolean isInitialized() {
-        return true;
-    }
-
-    @Override
-    public boolean isInstance(CiConstant obj) {
-        return false;
-    }
-
-    @Override
-    public boolean isInstanceClass() {
-        return false;
-    }
-
-    @Override
-    public boolean isInterface() {
-        return false;
-    }
-
-    @Override
-    public boolean isSubtypeOf(RiResolvedType other) {
-        return false;
-    }
-
-    @Override
-    public CiKind kind(boolean architecture) {
-        return kind;
-    }
-
-    @Override
-    public RiResolvedMethod resolveMethodImpl(RiResolvedMethod method) {
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotTypePrimitive<" + kind + ">";
-    }
-
-    @Override
-    public RiResolvedType uniqueConcreteSubtype() {
-        return this;
-    }
-
-    @Override
-    public RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method) {
-        return null;
-    }
-
-    @Override
-    public RiResolvedField[] declaredFields() {
-        return null;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return toJava().getAnnotation(annotationClass);
-    }
-
-    @Override
-    public Class< ? > toJava() {
-        return kind.toJavaClass();
-    }
-
-    @Override
-    public RiResolvedType resolve(RiResolvedType accessingClass) {
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolved.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.server.*;
-
-public interface HotSpotTypeResolved extends RiResolvedType, Remote {
-
-    String toString();
-
-    RiConstantPool constantPool();
-
-    int instanceSize();
-
-    RiField createRiField(String name, RiType type, int offset, int flags);
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-
-/**
- * Implementation of RiType for resolved non-primitive HotSpot classes.
- */
-public final class HotSpotTypeResolvedImpl extends HotSpotType implements HotSpotTypeResolved {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 3481514353553840471L;
-    private Class javaMirror;
-    private String simpleName;
-    private int accessFlags;
-    private boolean hasFinalizer;
-    private boolean hasSubclass;
-    private boolean hasFinalizableSubclass;
-    private boolean isArrayClass;
-    private boolean isInstanceClass;
-    private boolean isInterface;
-    private int instanceSize;
-    private HashMap<Long, RiResolvedField> fieldCache;
-    private RiResolvedType superType;
-    private boolean superTypeSet;
-    private RiResolvedField[] fields;
-    private RiConstantPool constantPool;
-    private boolean isInitialized;
-    private RiResolvedType arrayOfType;
-
-    private HotSpotTypeResolvedImpl() {
-        super(null);
-    }
-
-    @Override
-    public int accessFlags() {
-        return accessFlags;
-    }
-
-    @Override
-    public RiResolvedType arrayOf() {
-        if (arrayOfType == null) {
-           arrayOfType = (RiResolvedType) compiler.getVMEntries().RiType_arrayOf(this);
-        }
-        return arrayOfType;
-    }
-
-    @Override
-    public RiResolvedType componentType() {
-        assert isArrayClass();
-        return (RiResolvedType) compiler.getVMEntries().RiType_componentType(this);
-    }
-
-    @Override
-    public RiResolvedType uniqueConcreteSubtype() {
-        if (isArrayClass()) {
-            return Modifier.isFinal(componentType().accessFlags()) ? this : null;
-        } else {
-            return (RiResolvedType) compiler.getVMEntries().RiType_uniqueConcreteSubtype(this);
-        }
-    }
-
-    @Override
-    public RiResolvedType superType() {
-        if (!superTypeSet) {
-            superType = (RiResolvedType) compiler.getVMEntries().RiType_superType(this);
-            superTypeSet = true;
-        }
-        return superType;
-    }
-
-    @Override
-    public RiResolvedType leastCommonAncestor(RiResolvedType otherType) {
-        if (otherType instanceof HotSpotTypePrimitive) {
-            return null;
-        } else {
-            return (RiResolvedType) compiler.getVMEntries().RiType_leastCommonAncestor(this, (HotSpotTypeResolved) otherType);
-        }
-    }
-
-    @Override
-    public RiResolvedType exactType() {
-        if (Modifier.isFinal(accessFlags)) {
-            return this;
-        }
-        return null;
-    }
-
-    @Override
-    public CiConstant getEncoding(Representation r) {
-        switch (r) {
-            case JavaClass:
-                return CiConstant.forObject(javaMirror);
-            case ObjectHub:
-                return CiConstant.forObject(this);
-            case StaticFields:
-                return CiConstant.forObject(javaMirror);
-            case TypeInfo:
-                return CiConstant.forObject(this);
-            default:
-                return null;
-        }
-    }
-
-    @Override
-    public CiKind getRepresentationKind(Representation r) {
-        return CiKind.Object;
-    }
-
-    @Override
-    public boolean hasFinalizableSubclass() {
-        return hasFinalizableSubclass;
-    }
-
-    @Override
-    public boolean hasFinalizer() {
-        return hasFinalizer;
-    }
-
-    @Override
-    public boolean hasSubclass() {
-        return hasSubclass;
-    }
-
-    @Override
-    public boolean isArrayClass() {
-        return isArrayClass;
-    }
-
-    @Override
-    public boolean isInitialized() {
-        if (!isInitialized) {
-            isInitialized = compiler.getVMEntries().RiType_isInitialized(this);
-        }
-        return isInitialized;
-    }
-
-    @Override
-    public boolean isInstance(CiConstant obj) {
-        return javaMirror.isInstance(obj);
-    }
-
-    @Override
-    public boolean isInstanceClass() {
-        return isInstanceClass;
-    }
-
-    @Override
-    public boolean isInterface() {
-        return isInterface;
-    }
-
-    @Override
-    public boolean isSubtypeOf(RiResolvedType other) {
-        if (other instanceof HotSpotTypeResolved) {
-            return compiler.getVMEntries().RiType_isSubtypeOf(this, other);
-        }
-        // No resolved type is a subtype of an unresolved type.
-        return false;
-    }
-
-    @Override
-    public CiKind kind(boolean architecture) {
-        return CiKind.Object;
-    }
-
-    @Override
-    public RiResolvedMethod resolveMethodImpl(RiResolvedMethod method) {
-        assert method instanceof HotSpotMethod;
-        return (RiResolvedMethod) compiler.getVMEntries().RiType_resolveMethodImpl(this, method.name(), method.signature().asString());
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotType<" + simpleName + ", resolved>";
-    }
-
-    @Override
-    public RiConstantPool constantPool() {
-        if (constantPool == null) {
-            constantPool = new HotSpotConstantPool(compiler, this);
-        }
-        return constantPool;
-    }
-
-    @Override
-    public int instanceSize() {
-        return instanceSize;
-    }
-
-    @Override
-    public synchronized RiResolvedField createRiField(String fieldName, RiType type, int offset, int flags) {
-        RiResolvedField result = null;
-
-        long id = offset + ((long) flags << 32);
-
-        // (thomaswue) Must cache the fields, because the local load elimination only works if the objects from two field lookups are equal.
-        if (fieldCache == null) {
-            fieldCache = new HashMap<>(8);
-        } else {
-            result = fieldCache.get(id);
-        }
-
-        if (result == null) {
-            result = new HotSpotField(compiler, this, fieldName, type, offset, flags);
-            fieldCache.put(id, result);
-        } else {
-            assert result.name().equals(fieldName);
-            assert result.accessFlags() == flags;
-        }
-
-        return result;
-    }
-
-    @Override
-    public RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method) {
-        return ((HotSpotMethodResolved) method).uniqueConcreteMethod();
-    }
-
-    @Override
-    public RiResolvedField[] declaredFields() {
-        if (fields == null) {
-            fields = compiler.getVMEntries().RiType_fields(this);
-        }
-        return fields;
-    }
-
-    @Override
-    public Class< ? > toJava() {
-        return javaMirror;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return toJava().getAnnotation(annotationClass);
-    }
-
-    @Override
-    public RiResolvedType resolve(RiResolvedType accessingClass) {
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeUnresolved.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.hotspot.Compiler;
-
-/**
- * Implementation of RiType for unresolved HotSpot classes.
- */
-public class HotSpotTypeUnresolved extends HotSpotType {
-
-    private static final long serialVersionUID = -2320936267633521314L;
-    public final String simpleName;
-    public final int dimensions;
-
-    /**
-     * Creates a new unresolved type for a specified type descriptor.
-     */
-    public HotSpotTypeUnresolved(Compiler compiler, String name) {
-        super(compiler);
-        assert name.length() > 0 : "name cannot be empty";
-
-        int dims = 0;
-        int startIndex = 0;
-        while (name.charAt(startIndex) == '[') {
-            startIndex++;
-            dims++;
-        }
-
-        // Decode name if necessary.
-        if (name.charAt(name.length() - 1) == ';') {
-            assert name.charAt(startIndex) == 'L';
-            this.simpleName = name.substring(startIndex + 1, name.length() - 1);
-            this.name = name;
-        } else {
-            this.simpleName = name;
-            this.name = getFullName(name, dims);
-        }
-
-        this.dimensions = dims;
-    }
-
-    public HotSpotTypeUnresolved(Compiler compiler, String name, int dimensions) {
-        super(compiler);
-        assert dimensions >= 0;
-        this.simpleName = name;
-        this.dimensions = dimensions;
-        this.name = getFullName(name, dimensions);
-    }
-
-    private static String getFullName(String name, int dimensions) {
-        StringBuilder str = new StringBuilder(name.length() + dimensions + 2);
-        for (int i = 0; i < dimensions; i++) {
-            str.append('[');
-        }
-        str.append('L').append(name).append(';');
-        return str.toString();
-    }
-
-    @Override
-    public RiType componentType() {
-        assert dimensions > 0 : "no array class" + name();
-        return new HotSpotTypeUnresolved(compiler, simpleName, dimensions - 1);
-    }
-
-    @Override
-    public RiType arrayOf() {
-        return new HotSpotTypeUnresolved(compiler, simpleName, dimensions + 1);
-    }
-
-    @Override
-    public CiKind kind(boolean architecture) {
-        return CiKind.Object;
-    }
-
-    @Override
-    public int hashCode() {
-        return simpleName.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        return o == this;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotType<" + simpleName + ", unresolved>";
-    }
-
-    @Override
-    public CiKind getRepresentationKind(RiType.Representation r) {
-        return CiKind.Object;
-    }
-
-    @Override
-    public RiResolvedType resolve(RiResolvedType accessingClass) {
-        return (RiResolvedType) compiler.lookupType(name, (HotSpotTypeResolved) accessingClass, true);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1578 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.hotspot.ri.TemplateFlag.*;
-
-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.graal.compiler.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-
-public class HotSpotXirGenerator implements RiXirGenerator {
-
-    // this needs to correspond to graal_CodeInstaller.hpp
-    // @formatter:off
-    private static final Integer MARK_VERIFIED_ENTRY            = 0x0001;
-    private static final Integer MARK_UNVERIFIED_ENTRY          = 0x0002;
-    private static final Integer MARK_OSR_ENTRY                 = 0x0003;
-    private static final Integer MARK_UNWIND_ENTRY              = 0x0004;
-    private static final Integer MARK_EXCEPTION_HANDLER_ENTRY   = 0x0005;
-    private static final Integer MARK_DEOPT_HANDLER_ENTRY       = 0x0006;
-
-    private static final Integer MARK_STATIC_CALL_STUB          = 0x1000;
-
-    private static final Integer MARK_INVOKEINTERFACE           = 0x2001;
-    private static final Integer MARK_INVOKESTATIC              = 0x2002;
-    private static final Integer MARK_INVOKESPECIAL             = 0x2003;
-    private static final Integer MARK_INVOKEVIRTUAL             = 0x2004;
-
-    private static final Integer MARK_IMPLICIT_NULL             = 0x3000;
-    private static final Integer MARK_POLL_NEAR                 = 0x3001;
-    private static final Integer MARK_POLL_RETURN_NEAR          = 0x3002;
-    private static final Integer MARK_POLL_FAR                  = 0x3003;
-    private static final Integer MARK_POLL_RETURN_FAR           = 0x3004;
-
-    // @formatter:on
-
-    private final HotSpotVMConfig config;
-    private final CiTarget target;
-    private final RiRegisterConfig registerConfig;
-    private final Compiler compiler;
-
-    private CiXirAssembler globalAsm;
-
-    public HotSpotXirGenerator(HotSpotVMConfig config, CiTarget target, RiRegisterConfig registerConfig, Compiler compiler) {
-        this.config = config;
-        this.target = target;
-        this.registerConfig = registerConfig;
-        this.compiler = compiler;
-    }
-
-    private XirConstant wordConst(CiXirAssembler asm, long value) {
-        if (target.wordKind == CiKind.Long) {
-            return asm.createConstant(CiConstant.forLong(value));
-        } else {
-            assert target.wordKind == CiKind.Int;
-            return asm.createConstant(CiConstant.forInt((int) value));
-        }
-    }
-
-    private XirArgument wordArg(long value) {
-        if (target.wordKind == CiKind.Long) {
-            return XirArgument.forLong(value);
-        } else {
-            assert target.wordKind == CiKind.Int;
-            return XirArgument.forInt((int) value);
-        }
-    }
-
-    private SimpleTemplates prologueTemplates = new SimpleTemplates(STATIC_METHOD) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart(CiKind.Void);
-            XirOperand framePointer = asm.createRegisterTemp("frame pointer", target.wordKind, AMD64.rbp);
-            XirOperand stackPointer = asm.createRegisterTemp("stack pointer", target.wordKind, AMD64.rsp);
-            XirLabel unverifiedStub = null;
-
-            asm.mark(MARK_OSR_ENTRY);
-            asm.mark(MARK_UNVERIFIED_ENTRY);
-            if (!is(STATIC_METHOD, flags)) {
-                unverifiedStub = asm.createOutOfLineLabel("unverified");
-
-                XirOperand temp = asm.createRegisterTemp("temp (r10)", target.wordKind, AMD64.r10);
-                XirOperand cache = asm.createRegisterTemp("cache (rax)", target.wordKind, AMD64.rax);
-
-                CiCallingConvention conventions = registerConfig.getCallingConvention(JavaCallee, new CiKind[] {CiKind.Object}, target, false);
-                XirOperand receiver = asm.createRegister("receiver", target.wordKind, asRegister(conventions.locations[0]));
-
-                asm.pload(target.wordKind, temp, receiver, asm.i(config.hubOffset), false);
-                asm.jneq(unverifiedStub, cache, temp);
-            }
-            asm.align(config.codeEntryAlignment);
-            asm.mark(MARK_VERIFIED_ENTRY);
-            asm.stackOverflowCheck();
-            asm.push(framePointer);
-            asm.mov(framePointer, stackPointer);
-            // Compensate for the push of framePointer (the XIR instruction pushFrame is not flexible enough to reduce the frame size, wait until XIR goes away to fix this).
-            asm.add(stackPointer, stackPointer,  asm.i(8));
-            asm.pushFrame();
-
-            // -- out of line -------------------------------------------------------
-            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
-            XirOperand exceptionOop = asm.createTemp("exception oop", CiKind.Object);
-            XirLabel unwind = asm.createOutOfLineLabel("unwind");
-            asm.bindOutOfLine(unwind);
-
-            asm.mark(MARK_UNWIND_ENTRY);
-
-            asm.pload(CiKind.Object, exceptionOop, thread, asm.i(config.threadExceptionOopOffset), false);
-            asm.pstore(CiKind.Object, thread, asm.i(config.threadExceptionOopOffset), asm.createConstant(CiConstant.NULL_OBJECT), false);
-            asm.pstore(CiKind.Long, thread, asm.i(config.threadExceptionPcOffset), asm.l(0), false);
-
-            asm.callRuntime(config.unwindExceptionStub, null, exceptionOop);
-            asm.shouldNotReachHere();
-
-            asm.mark(MARK_EXCEPTION_HANDLER_ENTRY);
-            asm.callRuntime(config.handleExceptionStub, null);
-            asm.shouldNotReachHere();
-
-            asm.mark(MARK_DEOPT_HANDLER_ENTRY);
-            asm.callRuntime(config.handleDeoptStub, null);
-            asm.shouldNotReachHere();
-
-            if (!is(STATIC_METHOD, flags)) {
-                asm.bindOutOfLine(unverifiedStub);
-                asm.jmpRuntime(config.inlineCacheMissStub);
-            }
-
-            return asm.finishTemplate(is(STATIC_METHOD, flags) ? "static prologue" : "prologue");
-        }
-    };
-
-    private SimpleTemplates epilogueTemplates = new SimpleTemplates(STATIC_METHOD, SYNCHRONIZED) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart(CiKind.Void);
-            XirOperand framePointer = asm.createRegisterTemp("frame pointer", target.wordKind, AMD64.rbp);
-            XirOperand stackPointer = asm.createRegisterTemp("stack pointer", target.wordKind, AMD64.rsp);
-
-            asm.popFrame();
-            asm.pload(CiKind.Long, framePointer, stackPointer, asm.i(-8), false);
-
-            if (GraalOptions.GenSafepoints) {
-                XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.r10);
-                if (config.isPollingPageFar) {
-                    asm.mov(temp, wordConst(asm, config.safepointPollingAddress));
-                    asm.mark(MARK_POLL_RETURN_FAR);
-                    asm.pload(target.wordKind, temp, temp, true);
-                } else {
-                    XirOperand rip = asm.createRegister("rip", target.wordKind, AMD64.rip);
-                    asm.mark(MARK_POLL_RETURN_NEAR);
-                    asm.pload(target.wordKind, temp, rip, asm.i(0xEFBEADDE), true);
-                }
-            }
-
-            return asm.finishTemplate("epilogue");
-        }
-    };
-
-    private SimpleTemplates safepointTemplates = new SimpleTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart(CiKind.Void);
-
-            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.r10);
-            if (config.isPollingPageFar) {
-                asm.mov(temp, wordConst(asm, config.safepointPollingAddress));
-                asm.mark(MARK_POLL_FAR);
-                asm.pload(target.wordKind, temp, temp, true);
-            } else {
-                XirOperand rip = asm.createRegister("rip", target.wordKind, AMD64.rip);
-                asm.mark(MARK_POLL_NEAR);
-                asm.pload(target.wordKind, temp, rip, asm.i(0xEFBEADDE), true);
-            }
-
-            return asm.finishTemplate("safepoint");
-        }
-    };
-
-    private SimpleTemplates exceptionObjectTemplates = new SimpleTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            XirOperand result = asm.restart(CiKind.Object);
-            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
-
-            asm.pload(CiKind.Object, result, thread, asm.i(config.threadExceptionOopOffset), false);
-            asm.pstore(CiKind.Object, thread, asm.i(config.threadExceptionOopOffset), asm.o(null), false);
-            asm.pstore(CiKind.Long, thread, asm.i(config.threadExceptionPcOffset), asm.l(0), false);
-
-            return asm.finishTemplate("exception object");
-        }
-    };
-
-    private SimpleTemplates invokeInterfaceTemplates = new SimpleTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart();
-            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
-            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
-            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
-            XirOperand tempO = asm.createRegister("tempO", CiKind.Object, AMD64.rax);
-
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-                asm.pload(target.wordKind, temp, receiver, true);
-            }
-            asm.mark(MARK_INVOKEINTERFACE);
-            asm.mov(tempO, asm.createConstant(CiConstant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
-
-            return asm.finishTemplate(addr, "invokeinterface");
-        }
-    };
-
-    private SimpleTemplates invokeVirtualTemplates = new SimpleTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart();
-            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
-            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
-            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
-            XirOperand tempO = asm.createRegister("tempO", CiKind.Object, AMD64.rax);
-
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-                asm.pload(target.wordKind, temp, receiver, true);
-            }
-            asm.mark(MARK_INVOKEVIRTUAL);
-            asm.mov(tempO, asm.createConstant(CiConstant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
-
-            return asm.finishTemplate(addr, "invokevirtual");
-        }
-    };
-
-    private IndexTemplates inlinedInvokeVirtualTemplates = new IndexTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, int vtableEntryOffset) {
-            asm.restart();
-            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
-            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
-            XirOperand method = asm.createRegisterTemp("method", CiKind.Object, AMD64.rbx);
-
-            // load class from receiver
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-            }
-            asm.pload(target.wordKind, temp, receiver, asm.i(config.hubOffset), true);
-            // load vtable entry
-            asm.pload(target.wordKind, method, temp, asm.i(vtableEntryOffset), false);
-            // load entry point from methodOop
-            asm.mark(MARK_IMPLICIT_NULL);
-            asm.pload(target.wordKind, temp, method, asm.i(config.methodCompiledEntryOffset), true);
-            asm.mark(MARK_INVOKEVIRTUAL);
-
-            return asm.finishTemplate(temp, "invokevirtual");
-        }
-    };
-
-    private SimpleTemplates invokeSpecialTemplates = new SimpleTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart();
-            XirParameter receiver = asm.createInputParameter("receiver", CiKind.Object);
-            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
-            XirOperand temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.rax);
-            XirLabel stub = asm.createOutOfLineLabel("call stub");
-
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-                asm.pload(target.wordKind, temp, receiver, true);
-            }
-            asm.mark(MARK_INVOKESPECIAL);
-
-            // -- out of line -------------------------------------------------------
-            asm.bindOutOfLine(stub);
-            XirOperand method = asm.createRegisterTemp("method", target.wordKind, AMD64.rbx);
-            asm.mark(MARK_STATIC_CALL_STUB, XirMark.CALLSITE);
-            asm.mov(method, wordConst(asm, 0));
-            XirLabel dummy = asm.createOutOfLineLabel("dummy");
-            asm.jmp(dummy);
-            asm.bindOutOfLine(dummy);
-
-            return asm.finishTemplate(addr, "invokespecial");
-        }
-    };
-
-    private SimpleTemplates invokeStaticTemplates = new SimpleTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart();
-            XirParameter addr = asm.createConstantInputParameter("addr", target.wordKind);
-
-            XirLabel stub = asm.createOutOfLineLabel("call stub");
-            asm.mark(MARK_INVOKESTATIC);
-
-            // -- out of line -------------------------------------------------------
-            asm.bindOutOfLine(stub);
-            XirOperand method = asm.createRegisterTemp("method", target.wordKind, AMD64.rbx);
-            asm.mark(MARK_STATIC_CALL_STUB, XirMark.CALLSITE);
-            asm.mov(method, wordConst(asm, 0));
-            XirLabel dummy = asm.createOutOfLineLabel("dummy");
-            asm.jmp(dummy);
-            asm.bindOutOfLine(dummy);
-
-            return asm.finishTemplate(addr, "invokestatic");
-        }
-    };
-
-    private SimpleTemplates monitorEnterTemplates = new SimpleTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart(CiKind.Void);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-            XirParameter lock = asm.createInputParameter("lock", target.wordKind);
-
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-                asm.pload(target.wordKind, asm.createTemp("temp", target.wordKind), object, true);
-            }
-
-
-            // (thomaswue) It is important to use for this runtime call the debug info AFTER the monitor enter. Otherwise the monitor object
-            // is not correctly garbage collected.
-            final boolean useInfoAfter = true;
-
-            if (config.useFastLocking) {
-                useRegisters(asm, AMD64.rax, AMD64.rbx);
-                useRegisters(asm, getGeneralParameterRegister(0));
-                useRegisters(asm, getGeneralParameterRegister(1));
-                asm.callRuntime(config.fastMonitorEnterStub, null, useInfoAfter, object, lock);
-            } else {
-                asm.reserveOutgoingStack(target.wordSize * 2);
-                XirOperand rsp = asm.createRegister("rsp", target.wordKind, asRegister(AMD64.RSP));
-                asm.pstore(CiKind.Object, rsp, asm.i(target.wordSize), object, false);
-                asm.pstore(target.wordKind, rsp, asm.i(0), lock, false);
-                asm.callRuntime(config.monitorEnterStub, null, useInfoAfter);
-            }
-
-            return asm.finishTemplate("monitorEnter");
-        }
-    };
-
-    private CiRegister getGeneralParameterRegister(int index) {
-        return registerConfig.getCallingConventionRegisters(CiCallingConvention.Type.RuntimeCall, RegisterFlag.CPU)[index];
-    }
-
-    private SimpleTemplates monitorExitTemplates = new SimpleTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            asm.restart(CiKind.Void);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-            XirParameter lock = asm.createInputParameter("lock", target.wordKind);
-
-            if (config.useFastLocking) {
-                useRegisters(asm, AMD64.rax, AMD64.rbx);
-                useRegisters(asm, getGeneralParameterRegister(0));
-                useRegisters(asm, getGeneralParameterRegister(1));
-                asm.callRuntime(config.fastMonitorExitStub, null, object, lock);
-            } else {
-                asm.reserveOutgoingStack(target.wordSize);
-                asm.pstore(target.wordKind, asm.createRegister("rsp", target.wordKind, asRegister(AMD64.RSP)), asm.i(0), lock, false);
-                asm.callRuntime(config.monitorExitStub, null);
-            }
-
-            return asm.finishTemplate("monitorExit");
-        }
-    };
-
-    private KindTemplates getFieldTemplates = new KindTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
-            XirOperand result = asm.restart(kind);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-
-            XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-            }
-            asm.pload(kind, result, object, fieldOffset, is(NULL_CHECK, flags));
-            return asm.finishTemplate("getfield<" + kind + ">");
-        }
-    };
-
-    private KindTemplates writeBarrierTemplate = new KindTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
-            asm.restart(CiKind.Void);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-
-            // Need temp operand, because the write barrier destroys the object pointer.
-            XirOperand temp = asm.createTemp("temp", target.wordKind);
-            asm.mov(temp, object);
-
-            writeBarrier(asm, temp);
-            return asm.finishTemplate("writeBarrier");
-        }
-    };
-
-    private KindTemplates putFieldTemplates = new KindTemplates(WRITE_BARRIER, NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
-            asm.restart(CiKind.Void);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-            XirParameter value = asm.createInputParameter("value", kind);
-            XirParameter fieldOffset = asm.createConstantInputParameter("fieldOffset", CiKind.Int);
-            if (kind == CiKind.Object) {
-                verifyPointer(asm, value);
-            }
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-            }
-            asm.pstore(kind, object, fieldOffset, value, is(NULL_CHECK, flags));
-            if (is(WRITE_BARRIER, flags) && kind == CiKind.Object) {
-                XirOperand temp = asm.createTemp("temp", target.wordKind);
-                asm.mov(temp, object);
-                writeBarrier(asm, temp);
-            }
-            return asm.finishTemplate("putfield<" + kind + ">");
-        }
-    };
-
-    private final IndexTemplates newInstanceTemplates = new IndexTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, int size) {
-            XirOperand result = asm.restart(target.wordKind);
-            XirOperand type = asm.createInputParameter("type", CiKind.Object);
-
-            XirOperand temp1 = asm.createRegisterTemp("temp1", target.wordKind, AMD64.rcx);
-            XirOperand temp1o = asm.createRegister("temp1o", CiKind.Object, AMD64.rcx);
-            XirOperand temp2 = asm.createRegisterTemp("temp2", target.wordKind, AMD64.rbx);
-            XirOperand temp2i = asm.createRegister("temp2i", CiKind.Int, AMD64.rbx);
-            useRegisters(asm, AMD64.rsi);
-            XirLabel tlabFull = asm.createOutOfLineLabel("tlab full");
-            XirLabel resume = asm.createInlineLabel("resume");
-
-            // check if the class is already initialized
-            asm.pload(CiKind.Int, temp2i, type, asm.i(config.klassStateOffset), false);
-            asm.jneq(tlabFull, temp2i, asm.i(config.klassStateFullyInitialized));
-
-            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
-            asm.pload(target.wordKind, result, thread, asm.i(config.threadTlabTopOffset), false);
-            asm.add(temp1, result, wordConst(asm, size));
-            asm.pload(target.wordKind, temp2, thread, asm.i(config.threadTlabEndOffset), false);
-
-            asm.jgt(tlabFull, temp1, temp2);
-            asm.pstore(target.wordKind, thread, asm.i(config.threadTlabTopOffset), temp1, false);
-
-            asm.bindInline(resume);
-
-            asm.pload(target.wordKind, temp1, type, asm.i(config.instanceHeaderPrototypeOffset), false);
-            asm.pstore(target.wordKind, result, temp1, false);
-            asm.mov(temp1o, type); // need a temporary register since Intel cannot store 64-bit constants to memory
-            asm.pstore(CiKind.Object, result, asm.i(config.hubOffset), temp1o, false);
-
-            if (size > 2 * target.wordSize) {
-                asm.mov(temp1, wordConst(asm, 0));
-                for (int offset = 2 * target.wordSize; offset < size; offset += target.wordSize) {
-                    asm.pstore(target.wordKind, result, asm.i(offset), temp1, false);
-                }
-            }
-
-            // -- out of line -------------------------------------------------------
-            asm.bindOutOfLine(tlabFull);
-            XirOperand arg = asm.createRegisterTemp("runtime call argument", CiKind.Object, AMD64.rdx);
-            asm.mov(arg, type);
-            useRegisters(asm, AMD64.rax);
-            asm.callRuntime(config.newInstanceStub, result);
-            asm.jmp(resume);
-
-            return asm.finishTemplate("new instance");
-        }
-    };
-
-    private SimpleTemplates newObjectArrayCloneTemplates = new SimpleTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            XirOperand result = asm.restart(CiKind.Object);
-            XirParameter lengthParam = asm.createInputParameter("length", CiKind.Int, true);
-            XirParameter src = asm.createInputParameter("src", CiKind.Object);
-
-            // Set up length and hub.
-            XirOperand length = asm.createRegisterTemp("length", CiKind.Int, AMD64.rbx);
-            XirOperand hub = asm.createRegisterTemp("hub", CiKind.Object, AMD64.rdx);
-            asm.pload(CiKind.Object, hub, src, asm.i(config.hubOffset), false);
-            asm.mov(length, lengthParam);
-
-            useRegisters(asm, AMD64.rsi, AMD64.rcx, AMD64.rdi, AMD64.rax);
-            asm.callRuntime(config.newObjectArrayStub, result);
-            return asm.finishTemplate("objectArrayClone");
-        }
-    };
-
-    private SimpleTemplates newObjectArrayTemplates = new SimpleTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            emitNewTypeArray(asm, CiKind.Object, config.useFastNewObjectArray, config.newObjectArrayStub);
-            return asm.finishTemplate("newObjectArray");
-        }
-    };
-
-    private void emitNewTypeArray(CiXirAssembler asm, CiKind kind, boolean useFast, long slowPathStub) {
-        XirOperand result = asm.restart(target.wordKind);
-
-        XirParameter lengthParam = asm.createInputParameter("length", CiKind.Int, true);
-
-        XirOperand length = asm.createRegisterTemp("length", CiKind.Int, AMD64.rbx);
-        XirOperand hub = asm.createRegisterTemp("hub", CiKind.Object, AMD64.rdx);
-
-        // Registers rsi, rcx, rdi, and rax are needed by the runtime call.
-        // Hub needs to be on rdx, length on rbx.
-        XirOperand temp1 = asm.createRegisterTemp("temp1", target.wordKind, AMD64.rcx);
-        XirOperand temp1o = asm.createRegister("temp1o", CiKind.Object, AMD64.rcx);
-        XirOperand temp2 = asm.createRegisterTemp("temp2", target.wordKind, AMD64.rax);
-        XirOperand temp3 = asm.createRegisterTemp("temp3", target.wordKind, AMD64.rdi);
-        XirOperand size = asm.createRegisterTemp("size", CiKind.Int, AMD64.rsi);
-
-        asm.mov(hub, asm.createConstantInputParameter("hub", CiKind.Object));
-        asm.mov(length, lengthParam);
-
-        if (useFast) {
-
-            XirLabel slowPath = asm.createOutOfLineLabel("slowPath");
-
-            XirLabel done = asm.createInlineLabel("done");
-
-            // Check for negative array size.
-            // TODO: Also check for upper bound
-            asm.jlt(slowPath, length, asm.i(0));
-
-            final int aligning = target.wordSize;
-            final int arrayLengthOffset = target.wordSize * 2;
-            final int arrayElementOffset = config.getArrayOffset(kind);
-
-            // Calculate aligned size
-            asm.mov(size, length);
-            int scale = CiUtil.log2(target.sizeInBytes(kind));
-            if (scale != 0) {
-                asm.shl(size, size, asm.i(scale));
-            }
-            asm.add(size, size, asm.i(arrayElementOffset + aligning - 1));
-            long mask = 0xFFFFFFFFL;
-            mask <<= CiUtil.log2(aligning);
-            asm.and(size, size, asm.i((int) mask));
-
-            // Try tlab allocation
-            XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
-            asm.pload(target.wordKind, result, thread, asm.i(config.threadTlabTopOffset), false);
-            asm.add(temp1, result, size);
-            asm.pload(target.wordKind, temp2, thread, asm.i(config.threadTlabEndOffset), false);
-            asm.jgt(slowPath, temp1, temp2);
-            asm.pstore(target.wordKind, thread, asm.i(config.threadTlabTopOffset), temp1, false);
-
-            // Now the new object is in result, store mark word and klass
-            asm.pload(target.wordKind, temp1, hub, asm.i(config.instanceHeaderPrototypeOffset), false);
-            asm.pstore(target.wordKind, result, temp1, false);
-            asm.mov(temp1o, hub); // need a temporary register since Intel cannot store 64-bit constants to memory
-            asm.pstore(CiKind.Object, result, asm.i(config.hubOffset), temp1o, false);
-
-            // Store array length
-            asm.pstore(CiKind.Int, result, asm.i(arrayLengthOffset), length, false);
-
-            // Initialize with 0
-            XirLabel top = asm.createInlineLabel("top");
-            asm.sub(size, size, asm.i(arrayElementOffset));
-            asm.shr(size, size, asm.i(Scale.Times8.log2));
-            asm.jeq(done, size, asm.i(0));
-            asm.xor(temp3, temp3, temp3);
-            asm.bindInline(top);
-            asm.pstore(target.wordKind, result, size, temp3, arrayElementOffset - target.wordSize, Scale.Times8, false);
-            asm.decAndJumpNotZero(top, size);
-
-            asm.bindInline(done);
-
-            // Slow path
-            asm.bindOutOfLine(slowPath);
-            asm.callRuntime(slowPathStub, result);
-            asm.jmp(done);
-        } else {
-            asm.callRuntime(slowPathStub, result);
-        }
-    }
-
-    private KindTemplates newTypeArrayTemplates = new KindTemplates() {
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
-            emitNewTypeArray(asm, kind, config.useFastNewTypeArray, config.newTypeArrayStub);
-            return asm.finishTemplate("newTypeArray<" + kind.toString() + ">");
-        }
-    };
-
-    private final IndexTemplates multiNewArrayTemplate = new IndexTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, int dimensions) {
-            XirOperand result = asm.restart(CiKind.Object);
-
-            XirOperand hub = asm.createRegisterTemp("hub", CiKind.Object, AMD64.rax);
-            XirOperand rank = asm.createRegisterTemp("rank", CiKind.Int, AMD64.rbx);
-            XirOperand sizes = asm.createRegisterTemp("sizes", CiKind.Long, AMD64.rcx);
-            XirOperand thread = asm.createRegisterTemp("thread", CiKind.Long, AMD64.r15);
-            asm.add(sizes, thread, asm.l(config.threadMultiNewArrayStorage));
-            for (int i = 0; i < dimensions; i++) {
-                XirParameter length = asm.createInputParameter("length" + i, CiKind.Int, true);
-                asm.pstore(CiKind.Int, sizes, asm.i(i * target.sizeInBytes(CiKind.Int)), length, false);
-            }
-
-            asm.mov(hub, asm.createConstantInputParameter("hub", CiKind.Object));
-
-            asm.mov(rank, asm.i(dimensions));
-            // not necessary because we already have a temp in rax:  useRegisters(asm, AMD64.rax);
-            asm.callRuntime(config.newMultiArrayStub, result);
-            return asm.finishTemplate("multiNewArray" + dimensions);
-        }
-    };
-
-    private IndexTemplates checkCastTemplates = new IndexTemplates(NULL_CHECK, EXACT_HINTS) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, int hintCount) {
-            asm.restart(CiKind.Void);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-            final XirOperand hub = is(EXACT_HINTS, flags) ? null : asm.createConstantInputParameter("hub", CiKind.Object);
-
-            XirOperand objHub = asm.createTemp("objHub", CiKind.Object);
-
-            XirLabel end = asm.createInlineLabel("end");
-            XirLabel slowPath = asm.createOutOfLineLabel("slow path");
-
-            if (is(NULL_CHECK, flags)) {
-                // null can be cast to anything
-                asm.jeq(end, object, asm.o(null));
-            }
-
-            asm.pload(CiKind.Object, objHub, object, asm.i(config.hubOffset), false);
-            if (hintCount == 0) {
-                assert !is(EXACT_HINTS, flags);
-                checkSubtype(asm, objHub, objHub, hub);
-                asm.jeq(slowPath, objHub, asm.o(null));
-                asm.bindInline(end);
-
-                // -- out of line -------------------------------------------------------
-                asm.bindOutOfLine(slowPath);
-            } else {
-                XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
-                // if we get an exact match: succeed immediately
-                for (int i = 0; i < hintCount; i++) {
-                    XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object);
-                    asm.mov(scratchObject, hintHub);
-                    if (i < hintCount - 1) {
-                        asm.jeq(end, objHub, scratchObject);
-                    } else {
-                        asm.jneq(slowPath, objHub, scratchObject);
-                    }
-                }
-                asm.bindInline(end);
-
-                // -- out of line -------------------------------------------------------
-                asm.bindOutOfLine(slowPath);
-                if (!is(EXACT_HINTS, flags)) {
-                    checkSubtype(asm, objHub, objHub, hub);
-                    asm.jneq(end, objHub, asm.o(null));
-                }
-            }
-            XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
-
-            asm.mov(scratch, wordConst(asm, 2));
-
-            asm.callRuntime(CiRuntimeCall.Deoptimize, null);
-            asm.shouldNotReachHere();
-
-            return asm.finishTemplate("checkcast");
-        }
-    };
-
-    private IndexTemplates instanceOfTemplates = new IndexTemplates(NULL_CHECK, EXACT_HINTS) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, int hintCount) {
-            asm.restart(CiKind.Void);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-            final XirOperand hub = is(EXACT_HINTS, flags) ? null : asm.createConstantInputParameter("hub", CiKind.Object);
-
-            XirOperand objHub = asm.createTemp("objHub", CiKind.Object);
-
-            XirLabel trueSucc = asm.createInlineLabel(XirLabel.TrueSuccessor);
-            XirLabel falseSucc = asm.createInlineLabel(XirLabel.FalseSuccessor);
-
-            if (is(NULL_CHECK, flags)) {
-                // null isn't "instanceof" anything
-                asm.jeq(falseSucc, object, asm.o(null));
-            }
-
-            asm.pload(CiKind.Object, objHub, object, asm.i(config.hubOffset), false);
-            if (hintCount == 0) {
-                assert !is(EXACT_HINTS, flags);
-                checkSubtype(asm, objHub, objHub, hub);
-                asm.jeq(falseSucc, objHub, asm.o(null));
-                asm.jmp(trueSucc);
-            } else {
-                XirLabel slowPath = null;
-                XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
-
-                // if we get an exact match: succeed immediately
-                for (int i = 0; i < hintCount; i++) {
-                    XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object);
-                    asm.mov(scratchObject, hintHub);
-                    if (i < hintCount - 1) {
-                        asm.jeq(trueSucc, objHub, scratchObject);
-                    } else {
-                        if (is(EXACT_HINTS, flags)) {
-                            asm.jneq(falseSucc, objHub, scratchObject);
-                            asm.jmp(trueSucc);
-                        } else {
-                            slowPath = asm.createOutOfLineLabel("slow path");
-                            asm.jneq(slowPath, objHub, scratchObject);
-                            asm.jmp(trueSucc);
-                        }
-                    }
-                }
-
-                // -- out of line -------------------------------------------------------
-                if (slowPath != null) {
-                    asm.bindOutOfLine(slowPath);
-                    checkSubtype(asm, objHub, objHub, hub);
-                    asm.jeq(falseSucc, objHub, asm.o(null));
-                    asm.jmp(trueSucc);
-                }
-            }
-
-            return asm.finishTemplate("instanceof");
-        }
-    };
-
-    private IndexTemplates materializeInstanceOfTemplates = new IndexTemplates(NULL_CHECK, EXACT_HINTS) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, int hintCount) {
-            XirOperand result = asm.restart(CiKind.Int);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-            final XirOperand hub = is(EXACT_HINTS, flags) ? null : asm.createConstantInputParameter("hub", CiKind.Object);
-            XirOperand trueValue = asm.createInputParameter("trueValue", CiKind.Int);
-            XirOperand falseValue = asm.createInputParameter("falseValue", CiKind.Int);
-
-            XirOperand objHub = asm.createTemp("objHub", CiKind.Object);
-
-            XirLabel end = asm.createInlineLabel("end");
-            XirLabel falseSucc = asm.createInlineLabel("ko");
-
-            if (is(NULL_CHECK, flags)) {
-                // null isn't "instanceof" anything
-                asm.jeq(falseSucc, object, asm.o(null));
-            }
-
-            asm.pload(CiKind.Object, objHub, object, asm.i(config.hubOffset), false);
-            asm.mov(result, trueValue);
-
-            if (hintCount == 0) {
-                assert !is(EXACT_HINTS, flags);
-                checkSubtype(asm, objHub, objHub, hub);
-                asm.jneq(end, objHub, asm.o(null));
-                asm.bindInline(falseSucc);
-                asm.mov(result, falseValue);
-                asm.bindInline(end);
-            } else {
-                XirLabel slowPath = null;
-                XirOperand scratchObject = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
-
-                // if we get an exact match: succeed immediately
-                for (int i = 0; i < hintCount; i++) {
-                    XirParameter hintHub = asm.createConstantInputParameter("hintHub" + i, CiKind.Object);
-                    asm.mov(scratchObject, hintHub);
-                    if (i < hintCount - 1) {
-                        asm.jeq(end, objHub, scratchObject);
-                    } else {
-                        if (is(EXACT_HINTS, flags)) {
-                            asm.jeq(end, objHub, scratchObject);
-                        } else {
-                            slowPath = asm.createOutOfLineLabel("slow path");
-                            asm.jeq(end, objHub, scratchObject);
-                            asm.jmp(slowPath);
-                        }
-                    }
-                }
-                asm.bindInline(falseSucc);
-                asm.mov(result, falseValue);
-                asm.bindInline(end);
-
-                // -- out of line -------------------------------------------------------
-                if (slowPath != null) {
-                    asm.bindOutOfLine(slowPath);
-                    checkSubtype(asm, objHub, objHub, hub);
-                    asm.jeq(falseSucc, objHub, asm.o(null));
-                    asm.jmp(end);
-                }
-            }
-
-            return asm.finishTemplate("instanceof");
-        }
-    };
-
-    private XirOperand genArrayLength(CiXirAssembler asm, XirOperand array, boolean implicitNullException) {
-        XirOperand length = asm.createTemp("length", CiKind.Int);
-        genArrayLength(asm, length, array, implicitNullException);
-        return length;
-    }
-
-    private void genArrayLength(CiXirAssembler asm, XirOperand length, XirOperand array, boolean implicitNullException) {
-        if (implicitNullException) {
-            asm.mark(MARK_IMPLICIT_NULL);
-        }
-        asm.pload(CiKind.Int, length, array, asm.i(config.arrayLengthOffset), implicitNullException);
-    }
-
-    private KindTemplates arrayLoadTemplates = new KindTemplates(NULL_CHECK, READ_BARRIER, BOUNDS_CHECK, GIVEN_LENGTH) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
-            XirOperand result = asm.restart(kind);
-            XirParameter array = asm.createInputParameter("array", CiKind.Object);
-            XirParameter index = asm.createInputParameter("index", CiKind.Int, true);
-            XirLabel failBoundsCheck = null;
-            // if the length is known the array cannot be null
-            boolean implicitNullException = is(NULL_CHECK, flags);
-
-            if (is(BOUNDS_CHECK, flags)) {
-                // load the array length and check the index
-                failBoundsCheck = asm.createOutOfLineLabel("failBoundsCheck");
-                XirOperand length;
-                if (is(GIVEN_LENGTH, flags)) {
-                    length = asm.createInputParameter("length", CiKind.Int, true);
-                } else {
-                    length = genArrayLength(asm, array, implicitNullException);
-                }
-                asm.jugteq(failBoundsCheck, index, length);
-                implicitNullException = false;
-            }
-            int elemSize = target.sizeInBytes(kind);
-            if (implicitNullException) {
-                asm.mark(MARK_IMPLICIT_NULL);
-            }
-            asm.pload(kind, result, array, index, config.getArrayOffset(kind), Scale.fromInt(elemSize), implicitNullException);
-            if (is(BOUNDS_CHECK, flags)) {
-                asm.bindOutOfLine(failBoundsCheck);
-                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
-                asm.mov(scratch, wordConst(asm, 0));
-                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
-                asm.shouldNotReachHere();
-            }
-            return asm.finishTemplate("arrayload<" + kind + ">");
-        }
-    };
-
-    private SimpleTemplates getClassTemplates = new SimpleTemplates() {
-       @Override
-       protected XirTemplate create(CiXirAssembler asm, long flags) {
-           XirOperand result = asm.restart(CiKind.Object);
-           XirOperand object = asm.createInputParameter("object", CiKind.Object);
-           asm.pload(CiKind.Object, result, object, asm.i(config.hubOffset), is(NULL_CHECK, flags));
-           asm.pload(CiKind.Object, result, result, asm.i(config.classMirrorOffset), false);
-           return asm.finishTemplate("getClass");
-       }
-    };
-
-    private SimpleTemplates currentThreadTemplates = new SimpleTemplates() {
-       @Override
-       protected XirTemplate create(CiXirAssembler asm, long flags) {
-           XirOperand result = asm.restart(CiKind.Object);
-           XirOperand thread = asm.createRegisterTemp("thread", target.wordKind, AMD64.r15);
-           asm.pload(CiKind.Object, result, thread, asm.i(config.threadObjectOffset), false);
-           return asm.finishTemplate("currentThread");
-       }
-    };
-
-    @Override
-    public XirSnippet genCurrentThread(XirSite site) {
-        return new XirSnippet(currentThreadTemplates.get(site));
-    }
-
-    @Override
-    public XirSnippet genGetClass(XirSite site, XirArgument object) {
-        return new XirSnippet(getClassTemplates.get(site), object);
-    }
-
-    private KindTemplates arrayCopyTemplates = new KindTemplates() {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
-            asm.restart(CiKind.Void);
-            XirParameter src = asm.createInputParameter("src", CiKind.Object);
-            XirParameter srcPos = asm.createInputParameter("srcPos", CiKind.Int, true);
-            XirParameter dest = asm.createInputParameter("dest", CiKind.Object);
-            XirParameter destPos = asm.createInputParameter("destPos", CiKind.Int, true);
-            XirParameter length = asm.createInputParameter("length", CiKind.Int, true);
-
-            XirOperand tempSrc = asm.createTemp("tempSrc", target.wordKind);
-            XirOperand tempDest = asm.createTemp("tempDest", target.wordKind);
-            XirOperand lengthOperand = asm.createRegisterTemp("lengthOperand", CiKind.Int, AMD64.rax);
-
-            XirOperand compHub = null;
-            XirOperand valueHub = null;
-            XirOperand temp = null;
-            XirLabel store = null;
-            XirLabel slowStoreCheck = null;
-
-            if (is(STORE_CHECK, flags) && kind == CiKind.Object) {
-                valueHub = asm.createRegisterTemp("valueHub", target.wordKind, AMD64.rdi);
-                compHub = asm.createRegisterTemp("compHub", target.wordKind, AMD64.rsi);
-                temp = asm.createRegisterTemp("temp", target.wordKind, AMD64.r10);
-            }
-
-            // Calculate the factor for the repeat move instruction.
-            int elementSize = target.sizeInBytes(kind);
-            int factor;
-            boolean wordSize;
-            if (elementSize >= target.wordSize) {
-                assert elementSize % target.wordSize == 0;
-                wordSize = true;
-                factor = elementSize / target.wordSize;
-            } else {
-                factor = elementSize;
-                wordSize = false;
-            }
-
-            // Adjust the length if the factor is not 1.
-            if (factor != 1) {
-                asm.shl(lengthOperand, length, asm.i(CiUtil.log2(factor)));
-            } else {
-                asm.mov(lengthOperand, length);
-            }
-
-            // Set the start and the end pointer.
-            asm.lea(tempSrc, src, srcPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
-            asm.lea(tempDest, dest, destPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
-
-            XirLabel reverse = null;
-            XirLabel normal = null;
-
-            if (is(STORE_CHECK, flags)) {
-                reverse = asm.createInlineLabel("reverse");
-                asm.jneq(reverse, src, dest);
-            }
-
-            if (!is(STORE_CHECK, flags) && !is(INPUTS_DIFFERENT, flags) && !is(INPUTS_SAME, flags)) {
-                normal = asm.createInlineLabel("normal");
-                asm.jneq(normal, src, dest);
-            }
-
-            if (!is(INPUTS_DIFFERENT, flags)) {
-                if (reverse == null) {
-                    reverse = asm.createInlineLabel("reverse");
-                }
-                asm.jlt(reverse, srcPos, destPos);
-            }
-
-            if (!is(STORE_CHECK, flags) && !is(INPUTS_DIFFERENT, flags) && !is(INPUTS_SAME, flags)) {
-                asm.bindInline(normal);
-            }
-
-            // Everything set up => repeat mov.
-            if (wordSize) {
-                asm.repmov(tempSrc, tempDest, lengthOperand);
-            } else {
-                asm.repmovb(tempSrc, tempDest, lengthOperand);
-            }
-
-            if (!is(INPUTS_DIFFERENT, flags) || is(STORE_CHECK, flags)) {
-
-                XirLabel end = asm.createInlineLabel("end");
-                asm.jmp(end);
-
-                // Implement reverse copy, because srcPos < destPos and src == dest.
-                asm.bindInline(reverse);
-
-                if (is(STORE_CHECK, flags)) {
-                    asm.pload(CiKind.Object, compHub, dest, asm.i(config.hubOffset), false);
-                    asm.pload(CiKind.Object, compHub, compHub, asm.i(config.arrayClassElementOffset), false);
-                }
-
-                CiKind copyKind = wordSize ? CiKind.Object : CiKind.Byte;
-                XirOperand tempValue = asm.createTemp("tempValue", copyKind);
-                XirLabel start = asm.createInlineLabel("start");
-                asm.bindInline(start);
-                asm.sub(lengthOperand, lengthOperand, asm.i(1));
-                asm.jlt(end, lengthOperand, asm.i(0));
-
-                Scale scale = wordSize ? Scale.fromInt(target.wordSize) : Scale.Times1;
-                asm.pload(copyKind, tempValue, tempSrc, lengthOperand, 0, scale, false);
-
-                if (is(STORE_CHECK, flags)) {
-                    slowStoreCheck = asm.createOutOfLineLabel("slowStoreCheck");
-                    store = asm.createInlineLabel("store");
-                    asm.jeq(store, tempValue, asm.o(null)); // first check if value is null
-                    asm.pload(CiKind.Object, valueHub, tempValue, asm.i(config.hubOffset), false);
-                    asm.jneq(slowStoreCheck, compHub, valueHub); // then check component hub matches value hub
-                    asm.bindInline(store);
-                }
-
-                asm.pstore(copyKind, tempDest, lengthOperand, tempValue, 0, scale, false);
-
-                asm.jmp(start);
-                asm.bindInline(end);
-            }
-
-            if (kind == CiKind.Object) {
-                // Do write barriers
-                asm.lea(tempDest, dest, destPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
-                asm.shr(tempDest, tempDest, asm.i(config.cardtableShift));
-                asm.pstore(CiKind.Boolean, wordConst(asm, config.cardtableStartAddress), tempDest, asm.b(false), false);
-
-                XirOperand tempDestEnd = tempSrc; // Reuse src temp
-                asm.lea(tempDestEnd, dest, destPos, config.getArrayOffset(kind), Scale.fromInt(elementSize));
-                asm.add(tempDestEnd, tempDestEnd, length);
-                asm.shr(tempDestEnd, tempDestEnd, asm.i(config.cardtableShift));
-
-                // Jump to out-of-line write barrier loop if the array is big.
-                XirLabel writeBarrierLoop = asm.createOutOfLineLabel("writeBarrierLoop");
-                asm.jneq(writeBarrierLoop, tempDest, tempSrc);
-                XirLabel back = asm.createInlineLabel("back");
-                asm.bindInline(back);
-
-                asm.bindOutOfLine(writeBarrierLoop);
-                asm.pstore(CiKind.Boolean, wordConst(asm, config.cardtableStartAddress), tempDestEnd, asm.b(false), false);
-                asm.sub(tempDestEnd, tempDestEnd, asm.i(1));
-                asm.jneq(writeBarrierLoop, tempDestEnd, tempDest);
-                asm.jmp(back);
-            }
-
-            if (is(STORE_CHECK, flags)) {
-                assert kind == CiKind.Object;
-                useRegisters(asm, AMD64.rax);
-                asm.bindOutOfLine(slowStoreCheck);
-                checkSubtype(asm, temp, valueHub, compHub);
-                asm.jneq(store, temp, wordConst(asm, 0));
-                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
-                asm.mov(scratch, wordConst(asm, 0));
-                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
-                asm.jmp(store);
-            }
-
-            return asm.finishTemplate("arraycopy<" + kind + ">");
-        }
-    };
-
-    private KindTemplates arrayStoreTemplates = new KindTemplates(NULL_CHECK, WRITE_BARRIER, BOUNDS_CHECK, STORE_CHECK, GIVEN_LENGTH) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags, CiKind kind) {
-            asm.restart(CiKind.Void);
-            XirParameter array = asm.createInputParameter("array", CiKind.Object);
-            XirParameter index = asm.createInputParameter("index", CiKind.Int, true);
-            XirParameter value = asm.createInputParameter("value", kind, kind != CiKind.Object);
-            XirOperand temp = asm.createTemp("temp", target.wordKind);
-            XirOperand valueHub = null;
-            XirOperand compHub = null;
-            XirLabel store = asm.createInlineLabel("store");
-            XirLabel failBoundsCheck = null;
-            XirLabel slowStoreCheck = null;
-            // if the length is known the array cannot be null
-            boolean implicitNullException = is(NULL_CHECK, flags);
-
-            if (is(BOUNDS_CHECK, flags)) {
-                // load the array length and check the index
-                failBoundsCheck = asm.createOutOfLineLabel("failBoundsCheck");
-                XirOperand length;
-                if (is(GIVEN_LENGTH, flags)) {
-                    length = asm.createInputParameter("length", CiKind.Int);
-                } else {
-                    length = asm.createTemp("length", CiKind.Int);
-                    if (implicitNullException) {
-                        asm.mark(MARK_IMPLICIT_NULL);
-                    }
-                    asm.pload(CiKind.Int, length, array, asm.i(config.arrayLengthOffset), implicitNullException);
-                    implicitNullException = false;
-                }
-                asm.jugteq(failBoundsCheck, index, length);
-
-            }
-            if (is(STORE_CHECK, flags) && kind == CiKind.Object) {
-                slowStoreCheck = asm.createOutOfLineLabel("slowStoreCheck");
-                asm.jeq(store, value, asm.o(null)); // first check if value is null
-                valueHub = asm.createTemp("valueHub", CiKind.Object);
-                compHub = asm.createTemp("compHub", CiKind.Object);
-                if (implicitNullException) {
-                    asm.mark(MARK_IMPLICIT_NULL);
-                }
-                asm.pload(CiKind.Object, compHub, array, asm.i(config.hubOffset), implicitNullException);
-                asm.pload(CiKind.Object, compHub, compHub, asm.i(config.arrayClassElementOffset), false);
-                asm.pload(CiKind.Object, valueHub, value, asm.i(config.hubOffset), false);
-                asm.jneq(slowStoreCheck, compHub, valueHub); // then check component hub matches value hub
-
-                implicitNullException = false;
-            }
-            asm.bindInline(store);
-            int elemSize = target.sizeInBytes(kind);
-
-            if (implicitNullException) {
-                asm.mark(MARK_IMPLICIT_NULL);
-            }
-            int disp = config.getArrayOffset(kind);
-            Scale scale = Scale.fromInt(elemSize);
-            if (kind == CiKind.Object) {
-                verifyPointer(asm, value);
-            }
-            if (is(WRITE_BARRIER, flags) && kind == CiKind.Object) {
-                asm.lea(temp, array, index, disp, scale);
-                asm.pstore(kind, temp, value, implicitNullException);
-                writeBarrier(asm, temp);
-            } else {
-                asm.pstore(kind, array, index, value, disp, scale, implicitNullException);
-            }
-
-            // -- out of line -------------------------------------------------------
-            if (is(BOUNDS_CHECK, flags)) {
-                asm.bindOutOfLine(failBoundsCheck);
-                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
-                asm.mov(scratch, wordConst(asm, 0));
-                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
-                asm.shouldNotReachHere();
-            }
-            if (is(STORE_CHECK, flags) && kind == CiKind.Object) {
-                useRegisters(asm, AMD64.rax);
-                asm.bindOutOfLine(slowStoreCheck);
-                checkSubtype(asm, temp, valueHub, compHub);
-                asm.jneq(store, temp, wordConst(asm, 0));
-                XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
-                asm.mov(scratch, wordConst(asm, 0));
-                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
-                asm.shouldNotReachHere();
-            }
-            return asm.finishTemplate("arraystore<" + kind + ">");
-        }
-    };
-
-    private SimpleTemplates arrayLengthTemplates = new SimpleTemplates(NULL_CHECK) {
-
-        @Override
-        protected XirTemplate create(CiXirAssembler asm, long flags) {
-            XirOperand result = asm.restart(CiKind.Int);
-            XirParameter object = asm.createInputParameter("object", CiKind.Object);
-            if (is(NULL_CHECK, flags)) {
-                asm.mark(MARK_IMPLICIT_NULL);
-            }
-            verifyPointer(asm, object);
-            asm.pload(CiKind.Int, result, object, asm.i(config.arrayLengthOffset), true);
-            return asm.finishTemplate("arrayLength");
-        }
-    };
-
-    private SimpleTemplates typeCheckTemplates = new SimpleTemplates(NULL_CHECK) {
-       @Override
-       protected XirTemplate create(CiXirAssembler asm, long flags) {
-           asm.restart(CiKind.Void);
-           XirParameter objHub = asm.createInputParameter("objectHub", CiKind.Object);
-           XirOperand hub = asm.createConstantInputParameter("hub", CiKind.Object);
-           XirLabel falseSucc = asm.createInlineLabel(XirLabel.FalseSuccessor);
-
-           XirOperand checkHub = asm.createTemp("checkHub", CiKind.Object);
-
-           if (is(NULL_CHECK, flags)) {
-               asm.mark(MARK_IMPLICIT_NULL);
-           }
-
-           asm.mov(checkHub, hub);
-           // if we get an exact match: continue.
-           asm.jneq(falseSucc, objHub, checkHub);
-
-           return asm.finishTemplate("typeCheck");
-       }
-    };
-
-    @Override
-    public XirSnippet genPrologue(XirSite site, RiResolvedMethod method) {
-        boolean staticMethod = Modifier.isStatic(method.accessFlags());
-        return new XirSnippet(staticMethod ? prologueTemplates.get(site, STATIC_METHOD) : prologueTemplates.get(site));
-    }
-
-    @Override
-    public XirSnippet genEpilogue(XirSite site, RiResolvedMethod method) {
-        return new XirSnippet(epilogueTemplates.get(site));
-    }
-
-    @Override
-    public XirSnippet genSafepointPoll(XirSite site) {
-        return new XirSnippet(safepointTemplates.get(site));
-    }
-
-    @Override
-    public XirSnippet genExceptionObject(XirSite site) {
-        return new XirSnippet(exceptionObjectTemplates.get(site));
-    }
-
-    @Override
-    public XirSnippet genResolveClass(XirSite site, RiType type, Representation rep) {
-        throw new CiBailout("Xir ResolveClass not available");
-    }
-
-    @Override
-    public XirSnippet genIntrinsic(XirSite site, XirArgument[] arguments, RiMethod method) {
-        return null;
-    }
-
-    @Override
-    public XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, RiMethod method) {
-        return new XirSnippet(invokeInterfaceTemplates.get(site), receiver, wordArg(0));
-    }
-
-    @Override
-    public XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, RiMethod method, boolean megamorph) {
-        int vtableEntryOffset = 0;
-
-        if (GraalOptions.InlineVTableStubs && (GraalOptions.AlwaysInlineVTableStubs || megamorph)) {
-            HotSpotMethodResolved hsMethod = (HotSpotMethodResolved) method;
-            if (!hsMethod.holder().isInterface()) {
-                vtableEntryOffset = hsMethod.vtableEntryOffset();
-            }
-        }
-        if (vtableEntryOffset > 0) {
-            return new XirSnippet(inlinedInvokeVirtualTemplates.get(site, vtableEntryOffset), receiver);
-        } else {
-            return new XirSnippet(invokeVirtualTemplates.get(site), receiver, wordArg(0));
-        }
-    }
-
-    @Override
-    public XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, RiMethod method) {
-        return new XirSnippet(invokeSpecialTemplates.get(site), receiver, wordArg(0));
-    }
-
-    @Override
-    public XirSnippet genInvokeStatic(XirSite site, RiMethod method) {
-        return new XirSnippet(invokeStaticTemplates.get(site), wordArg(0));
-    }
-
-    @Override
-    public XirSnippet genMonitorEnter(XirSite site, XirArgument receiver, XirArgument lockAddress) {
-        return new XirSnippet(monitorEnterTemplates.get(site), receiver, lockAddress);
-    }
-
-    @Override
-    public XirSnippet genMonitorExit(XirSite site, XirArgument receiver, XirArgument lockAddress) {
-        return new XirSnippet(monitorExitTemplates.get(site), receiver, lockAddress);
-    }
-
-    @Override
-    public XirSnippet genGetField(XirSite site, XirArgument object, RiField field) {
-        return new XirSnippet(getFieldTemplates.get(site, field.kind(false)), object, XirArgument.forInt(((HotSpotField) field).offset()));
-    }
-
-    @Override
-    public XirSnippet genWriteBarrier(XirArgument object) {
-        return new XirSnippet(writeBarrierTemplate.get(null, CiKind.Void), object);
-    }
-
-    @Override
-    public XirSnippet genPutField(XirSite site, XirArgument object, RiField field, XirArgument value) {
-        return new XirSnippet(putFieldTemplates.get(site, field.kind(false)), object, value, XirArgument.forInt(((HotSpotField) field).offset()));
-    }
-
-    @Override
-    public XirSnippet genGetStatic(XirSite site, XirArgument object, RiField field) {
-        return new XirSnippet(getFieldTemplates.get(site, field.kind(false)), object, XirArgument.forInt(((HotSpotField) field).offset()));
-    }
-
-    @Override
-    public XirSnippet genPutStatic(XirSite site, XirArgument object, RiField field, XirArgument value) {
-        return new XirSnippet(putFieldTemplates.get(site, field.kind(false)), object, value, XirArgument.forInt(((HotSpotField) field).offset()));
-    }
-
-    @Override
-    public XirSnippet genNewInstance(XirSite site, RiType type) {
-        int instanceSize = ((HotSpotTypeResolved) type).instanceSize();
-        return new XirSnippet(newInstanceTemplates.get(site, instanceSize), XirArgument.forObject(type));
-    }
-
-    @Override
-    public XirSnippet genNewArray(XirSite site, XirArgument length, CiKind elementKind, RiType componentType, RiType arrayType) {
-        if (elementKind == CiKind.Object) {
-            assert arrayType instanceof RiResolvedType;
-            return new XirSnippet(newObjectArrayTemplates.get(site), length, XirArgument.forObject(arrayType));
-        } else {
-            assert arrayType == null;
-            RiType primitiveArrayType = compiler.getVMEntries().getPrimitiveArrayType(elementKind);
-            return new XirSnippet(newTypeArrayTemplates.get(site, elementKind), length, XirArgument.forObject(primitiveArrayType));
-        }
-    }
-
-    @Override
-    public XirSnippet genNewObjectArrayClone(XirSite site, XirArgument newLength, XirArgument referenceArray) {
-        return new XirSnippet(newObjectArrayCloneTemplates.get(site), newLength, referenceArray);
-    }
-
-    @Override
-    public XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType type) {
-        XirArgument[] params = Arrays.copyOf(lengths, lengths.length + 1);
-        params[lengths.length] = XirArgument.forObject(type);
-        return new XirSnippet(multiNewArrayTemplate.get(site, lengths.length), params);
-    }
-
-    @Override
-    public XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, RiType type, RiResolvedType[] hints, boolean hintsExact) {
-        if (hints == null || hints.length == 0) {
-            return new XirSnippet(checkCastTemplates.get(site, 0), receiver, hub);
-        } else {
-            XirArgument[] params = new XirArgument[hints.length + (hintsExact ? 1 : 2)];
-            int i = 0;
-            params[i++] = receiver;
-            if (!hintsExact) {
-                params[i++] = hub;
-            }
-            for (RiResolvedType hint : hints) {
-                params[i++] = XirArgument.forObject(hint);
-            }
-            XirTemplate template = hintsExact ? checkCastTemplates.get(site, hints.length, EXACT_HINTS) : checkCastTemplates.get(site, hints.length);
-            return new XirSnippet(template, params);
-        }
-    }
-
-    @Override
-    public XirSnippet genInstanceOf(XirSite site, XirArgument object, XirArgument hub, RiType type, RiResolvedType[] hints, boolean hintsExact) {
-        if (hints == null || hints.length == 0) {
-            return new XirSnippet(instanceOfTemplates.get(site, 0), object, hub);
-        } else {
-            XirArgument[] params = new XirArgument[hints.length + (hintsExact ? 1 : 2)];
-            int i = 0;
-            params[i++] = object;
-            if (!hintsExact) {
-                params[i++] = hub;
-            }
-            for (RiResolvedType hint : hints) {
-                params[i++] = XirArgument.forObject(hint);
-            }
-            XirTemplate template = hintsExact ? instanceOfTemplates.get(site, hints.length, EXACT_HINTS) : instanceOfTemplates.get(site, hints.length);
-            return new XirSnippet(template, params);
-        }
-    }
-
-    @Override
-    public XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument object, XirArgument hub, XirArgument trueValue, XirArgument falseValue, RiType type, RiResolvedType[] hints, boolean hintsExact) {
-        if (hints == null || hints.length == 0) {
-            return new XirSnippet(materializeInstanceOfTemplates.get(site, 0), object, hub, trueValue, falseValue);
-        } else {
-            XirArgument[] params = new XirArgument[hints.length + (hintsExact ? 3 : 4)];
-            int i = 0;
-            params[i++] = object;
-            if (!hintsExact) {
-                params[i++] = hub;
-            }
-            params[i++] = trueValue;
-            params[i++] = falseValue;
-            for (RiResolvedType hint : hints) {
-                params[i++] = XirArgument.forObject(hint);
-            }
-            XirTemplate template = hintsExact ? materializeInstanceOfTemplates.get(site, hints.length, EXACT_HINTS) : materializeInstanceOfTemplates.get(site, hints.length);
-            return new XirSnippet(template, params);
-        }
-    }
-
-    @Override
-    public XirSnippet genArrayLoad(XirSite site, XirArgument array, XirArgument index, CiKind elementKind, RiType elementType) {
-        return new XirSnippet(arrayLoadTemplates.get(site, elementKind), array, index);
-    }
-
-    @Override
-    public XirSnippet genArrayStore(XirSite site, XirArgument array, XirArgument index, XirArgument value, CiKind elementKind, RiType elementType) {
-        return new XirSnippet(arrayStoreTemplates.get(site, elementKind), array, index, value);
-    }
-
-    @Override
-    public XirSnippet genArrayCopy(XirSite site, XirArgument src, XirArgument srcPos, XirArgument dest, XirArgument destPos, XirArgument length, RiType elementType, boolean inputsSame, boolean inputsDifferent) {
-        if (elementType == null) {
-            return null;
-        }
-        assert !inputsDifferent || !inputsSame;
-        XirTemplate template = null;
-        if (inputsDifferent) {
-            template = arrayCopyTemplates.get(site, elementType.kind(true), INPUTS_DIFFERENT);
-        } else if (inputsSame) {
-            template = arrayCopyTemplates.get(site, elementType.kind(true), INPUTS_SAME);
-        } else {
-            template = arrayCopyTemplates.get(site, elementType.kind(true));
-        }
-        return new XirSnippet(template, src, srcPos, dest, destPos, length);
-    }
-
-    @Override
-    public XirSnippet genArrayLength(XirSite site, XirArgument array) {
-        return new XirSnippet(arrayLengthTemplates.get(site), array);
-    }
-
-    @Override
-    public XirSnippet genTypeBranch(XirSite site, XirArgument thisHub, XirArgument otherHub, RiType type) {
-        assert type instanceof RiResolvedType;
-        return new XirSnippet(typeCheckTemplates.get(site), thisHub, otherHub);
-    }
-
-    @Override
-    public void initialize(CiXirAssembler asm) {
-        this.globalAsm = asm;
-    }
-
-    private void verifyPointer(CiXirAssembler asm, XirOperand pointer) {
-        if (config.verifyPointers) {
-            // The verify pointer stub wants the argument in a fixed register.
-            XirOperand fixed = asm.createRegisterTemp("fixed", CiKind.Object, AMD64.r13);
-            asm.push(fixed);
-            asm.mov(fixed, pointer);
-            asm.callRuntime(config.verifyPointerStub, null);
-            asm.pop(fixed);
-        }
-    }
-
-    private void checkSubtype(CiXirAssembler asm, XirOperand result, XirOperand objHub, XirOperand hub) {
-        asm.push(objHub);
-        asm.push(hub);
-        asm.callRuntime(config.instanceofStub, null);
-        asm.pop(result);
-        asm.pop(result);
-    }
-
-    private static void useRegisters(CiXirAssembler asm, CiRegister... registers) {
-        if (registers != null) {
-            for (CiRegister register : registers) {
-                asm.createRegisterTemp("reg", CiKind.Illegal, register);
-            }
-        }
-    }
-
-    private void writeBarrier(CiXirAssembler asm, XirOperand base) {
-        asm.shr(base, base, asm.i(config.cardtableShift));
-        asm.pstore(CiKind.Boolean, wordConst(asm, config.cardtableStartAddress), base, asm.b(false), false);
-    }
-
-    public boolean is(TemplateFlag check, long flags) {
-        return (flags & check.bits()) == check.bits();
-    }
-
-    /**
-     * Base class for all the ondemand template generators. It is not normally subclassed directly, but through one of
-     * its subclasses (SimpleTemplates, KindTemplates, IndexTemplates).
-     */
-    private abstract class Templates {
-
-        private ConcurrentHashMap<Long, XirTemplate> templates = new ConcurrentHashMap<>();
-        private final long mask;
-
-        /**
-         * Each flag passed to this method will cause templates with and without it to be generated.
-         */
-        public Templates(TemplateFlag... flags) {
-            this.mask = getBits((int) INDEX_MASK, null, flags);
-        }
-
-        protected abstract XirTemplate create(CiXirAssembler asm, long flags);
-
-        protected long getBits(int index, XirSite site, TemplateFlag... flags) {
-            long bits = index;
-            if (site != null) {
-                bits |= site.requiresNullCheck() ? NULL_CHECK.bits() : 0;
-                bits |= site.requiresReadBarrier() ? READ_BARRIER.bits() : 0;
-                bits |= site.requiresWriteBarrier() ? WRITE_BARRIER.bits() : 0;
-                bits |= site.requiresArrayStoreCheck() ? STORE_CHECK.bits() : 0;
-                bits |= site.requiresBoundsCheck() ? BOUNDS_CHECK.bits() : 0;
-            }
-            if (flags != null) {
-                for (TemplateFlag flag : flags) {
-                    bits |= flag.bits();
-                }
-            }
-            return bits;
-        }
-
-        protected XirTemplate getInternal(long flags) {
-            long maskedFlags = flags & mask;
-            XirTemplate template = templates.get(maskedFlags);
-            if (template == null) {
-                template = create(HotSpotXirGenerator.this.globalAsm.copy(), maskedFlags);
-                templates.put(maskedFlags, template);
-            }
-            return template;
-        }
-    }
-
-    private abstract class SimpleTemplates extends Templates {
-
-        public SimpleTemplates(TemplateFlag... flags) {
-            super(flags);
-        }
-
-        public XirTemplate get(XirSite site, TemplateFlag... flags) {
-            return getInternal(getBits(0, site, flags));
-        }
-    }
-
-    private abstract class IndexTemplates extends Templates {
-
-        public IndexTemplates(TemplateFlag... flags) {
-            super(flags);
-        }
-
-        @Override
-        protected final XirTemplate create(CiXirAssembler asm, long flags) {
-            return create(asm, flags & FLAGS_MASK, (int) (flags & INDEX_MASK));
-        }
-
-        protected abstract XirTemplate create(CiXirAssembler asm, long flags, int index);
-
-        public XirTemplate get(XirSite site, int size, TemplateFlag... flags) {
-            return getInternal(getBits(size, site, flags));
-        }
-    }
-
-    private abstract class KindTemplates extends Templates {
-
-        public KindTemplates(TemplateFlag... flags) {
-            super(flags);
-        }
-
-        @Override
-        protected final XirTemplate create(CiXirAssembler asm, long flags) {
-            return create(asm, flags & FLAGS_MASK, CiKind.VALUES[(int) (flags & INDEX_MASK)]);
-        }
-
-        protected abstract XirTemplate create(CiXirAssembler asm, long flags, CiKind kind);
-
-        public XirTemplate get(XirSite site, CiKind kind, TemplateFlag... flags) {
-            return getInternal(getBits(kind.ordinal(), site, flags));
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/ri/TemplateFlag.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.ri;
-
-enum TemplateFlag {
-    NULL_CHECK, READ_BARRIER, WRITE_BARRIER, STORE_CHECK, BOUNDS_CHECK, GIVEN_LENGTH, INPUTS_DIFFERENT, INPUTS_SAME, STATIC_METHOD, SYNCHRONIZED, EXACT_HINTS;
-
-    private static final long FIRST_FLAG = 0x0000000100000000L;
-    public static final long FLAGS_MASK = 0x0000FFFF00000000L;
-    public static final long INDEX_MASK = 0x00000000FFFFFFFFL;
-
-    public long bits() {
-        assert ((FIRST_FLAG << ordinal()) & FLAGS_MASK) != 0;
-        return FIRST_FLAG << ordinal();
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/CompilationServer.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.server;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-import javax.net.*;
-
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.hotspot.Compiler;
-import com.oracle.graal.hotspot.bridge.*;
-import com.oracle.graal.hotspot.logging.*;
-
-/**
- * Server side of the client/server compilation model. The server listens for connections on the hardcoded port 1199.
- */
-public class CompilationServer implements Runnable {
-
-    public static void main(String[] args) throws Exception {
-        new CompilationServer(false).run();
-    }
-
-    public interface ConnectionObserver {
-
-        void connectionStarted(Compiler compiler);
-
-        void connectionFinished(Compiler compiler);
-    }
-
-    private final boolean multiple;
-    private final ArrayList<ConnectionObserver> observers = new ArrayList<>();
-
-    /**
-     * Creates a new Compilation server. The server is activated by calling {@link #run()} directly or via a new
-     * {@link Thread}.
-     *
-     * @param multiple true if the server should server should serve an infinite amount of consecutive connections,
-     *            false if it should terminate after the first connection ends.
-     */
-    public CompilationServer(boolean multiple) {
-        this.multiple = multiple;
-        HotSpotOptions.setDefaultOptions();
-    }
-
-    public void addConnectionObserver(ConnectionObserver observer) {
-        observers.add(observer);
-    }
-
-    public void removeConnectionObserver(ConnectionObserver observer) {
-        observers.remove(observer);
-    }
-
-    public void run() {
-        final ServerSocket serverSocket;
-        try {
-            serverSocket = ServerSocketFactory.getDefault().createServerSocket(1199);
-        } catch (IOException e) {
-            throw new RuntimeException("Couldn't create compilation server", e);
-        }
-        do {
-            Socket socket = null;
-            try {
-                Logger.log("Compilation server ready, waiting for client to connect...");
-                socket = serverSocket.accept();
-                Logger.log("Connected to " + socket.getRemoteSocketAddress());
-
-                ReplacingStreams streams = new ReplacingStreams(socket.getOutputStream(), socket.getInputStream());
-
-                // get the VMEntries proxy from the client
-                CompilerToVM entries = (CompilerToVM) streams.getInvocation().waitForResult(false);
-
-                // return the initialized compiler to the client
-                Compiler compiler = CompilerImpl.initializeServer(entries);
-                compiler.getCompiler();
-                streams.getInvocation().sendResult(compiler);
-
-                for (ConnectionObserver observer : observers) {
-                    observer.connectionStarted(compiler);
-                }
-
-                streams.getInvocation().waitForResult(true);
-
-                for (ConnectionObserver observer : observers) {
-                    observer.connectionFinished(compiler);
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (ClassNotFoundException e) {
-                throw new RuntimeException(e);
-            } finally {
-                if (socket != null) {
-                    try {
-                        socket.close();
-                    } catch (IOException e) {
-                    }
-                }
-            }
-        } while (multiple);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/InvocationSocket.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.server;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.graal.hotspot.logging.*;
-
-/**
- * A collection of java.lang.reflect proxies that communicate over a socket connection.
- *
- * Calling a method sends the method name and the parameters through the socket. Afterwards this class waits for a
- * result. While waiting for a result three types of objects can arrive through the socket: a method invocation, a
- * method result or an exception. Method invocation can thus be recursive.
- */
-public class InvocationSocket {
-
-    private static final boolean DEBUG = false;
-    private static final boolean COUNT_CALLS = false;
-
-    private static final HashSet<String> cachedMethodNames = new HashSet<>();
-    private static final HashSet<String> forbiddenMethodNames = new HashSet<>();
-
-    static {
-        cachedMethodNames.add("name");
-        cachedMethodNames.add("kind");
-        cachedMethodNames.add("isResolved");
-        cachedMethodNames.add("getVMEntries");
-        cachedMethodNames.add("exactType");
-        cachedMethodNames.add("isInitialized");
-        forbiddenMethodNames.add("javaClass");
-    }
-
-    private final ObjectOutputStream output;
-    private final ObjectInputStream input;
-
-    private final Map<String, Integer> counts = new HashMap<>();
-
-    public InvocationSocket(ObjectOutputStream output, ObjectInputStream input) {
-        this.output = output;
-        this.input = input;
-
-        if (COUNT_CALLS) {
-            Runtime.getRuntime().addShutdownHook(new Thread() {
-                @Override
-                public void run() {
-                    SortedMap<Integer, String> sorted = new TreeMap<>();
-                    for (Map.Entry<String, Integer> entry : counts.entrySet()) {
-                        sorted.put(entry.getValue(), entry.getKey());
-                    }
-                    for (Map.Entry<Integer, String> entry : sorted.entrySet()) {
-                        System.out.println(entry.getKey() + ": " + entry.getValue());
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Represents one invocation of a method that is transferred via the socket connection.
-     *
-     */
-    private static class Invocation implements Serializable {
-
-        /**
-         * 
-         */
-        private static final long serialVersionUID = -799162779226626066L;
-        public Object receiver;
-        public String methodName;
-        public Object[] args;
-
-        public Invocation(Object receiver, String methodName, Object[] args) {
-            this.receiver = receiver;
-            this.methodName = methodName;
-            this.args = args;
-        }
-    }
-
-    /**
-     * Represents the result of an invocation that is transferred via the socket connection.
-     *
-     */
-    private static class Result implements Serializable {
-
-        /**
-         * 
-         */
-        private static final long serialVersionUID = -7496058356272415814L;
-        public Object result;
-
-        public Result(Object result) {
-            this.result = result;
-        }
-    }
-
-    private void incCount(String name, Object[] args) {
-        if (COUNT_CALLS) {
-            String nameAndArgCount = name + (args == null ? 0 : args.length);
-            if (counts.get(nameAndArgCount) != null) {
-                counts.put(nameAndArgCount, counts.get(nameAndArgCount) + 1);
-            } else {
-                counts.put(nameAndArgCount, 1);
-            }
-        }
-    }
-
-    /**
-     * Each instance of this class handles remote invocations for one instance of a Remote class. It will forward all
-     * interface methods to the other end of the socket and cache the results of calls to certain methods.
-     *
-     */
-    public class Handler implements InvocationHandler {
-
-        private final Object receiver;
-        private final HashMap<String, Object> cache = new HashMap<>();
-
-        public Handler(Object receiver) {
-            this.receiver = receiver;
-        }
-
-        @Override
-        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-            // only interface methods can be transferred, java.lang.Object methods
-            if (method.getDeclaringClass() == Object.class) {
-                return method.invoke(receiver, args);
-            }
-            String methodName = method.getName();
-            // check if the result of this zero-arg method was cached
-            if (args == null || args.length == 0) {
-                if (cache.containsKey(methodName)) {
-                    return cache.get(methodName);
-                }
-            }
-            if (forbiddenMethodNames.contains(methodName)) {
-                throw new IllegalAccessException(methodName + " not allowed");
-            }
-            Object result = null;
-            try {
-                if (DEBUG) {
-                    Logger.startScope("invoking remote " + methodName);
-                }
-                incCount(methodName, args);
-
-                output.writeObject(new Invocation(receiver, methodName, args));
-                output.flush();
-                result = waitForResult(false);
-
-                // result caching for selected methods
-                if ((args == null || args.length == 0) && cachedMethodNames.contains(methodName)) {
-                    cache.put(methodName, result);
-                }
-                return result;
-            } catch (Throwable t) {
-                t.printStackTrace();
-                throw t;
-            } finally {
-                if (DEBUG) {
-                    Logger.endScope(" = " + result);
-                }
-            }
-        }
-    }
-
-    /**
-     * Waits for the result of a remote method invocation. Invocations that should be executed in this VM might arrive
-     * while waiting for the result, and these invocations will be executed before again waiting fort he result.
-     */
-    @SuppressWarnings("unused")
-    public Object waitForResult(boolean eofExpected) throws IOException, ClassNotFoundException {
-        while (true) {
-            Object in;
-            try {
-                in = input.readObject();
-            } catch (EOFException e) {
-                if (eofExpected) {
-                    return null;
-                }
-                throw e;
-            }
-            if (in instanceof Result) {
-                return ((Result) in).result;
-            } else if (in instanceof RuntimeException) {
-                throw (RuntimeException) in;
-            } else if (in instanceof Throwable) {
-                throw new RuntimeException((Throwable) in);
-            }
-
-            Invocation invoke = (Invocation) in;
-            Method method = null;
-            for (Class<?> clazz = invoke.receiver.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
-                for (Method m : clazz.getDeclaredMethods()) {
-                    if (invoke.methodName.equals(m.getName())) {
-                        method = m;
-                        break;
-                    }
-                }
-            }
-            if (method == null) {
-                Exception e = new UnsupportedOperationException("unknown method " + invoke.methodName);
-                e.printStackTrace();
-                output.writeObject(e);
-                output.flush();
-            } else {
-                Object result = null;
-                try {
-                    if (invoke.args == null) {
-                        if (DEBUG) {
-                            Logger.startScope("invoking local " + invoke.methodName);
-                        }
-                        result = method.invoke(invoke.receiver);
-                    } else {
-                        if (Logger.ENABLED && DEBUG) {
-                            StringBuilder str = new StringBuilder();
-                            str.append("invoking local " + invoke.methodName + "(");
-                            for (int i = 0; i < invoke.args.length; i++) {
-                                str.append(i == 0 ? "" : ", ");
-                                str.append(Logger.pretty(invoke.args[i]));
-                            }
-                            str.append(")");
-                            Logger.startScope(str.toString());
-                        }
-                        result = method.invoke(invoke.receiver, invoke.args);
-                    }
-                    result = new Result(result);
-                } catch (IllegalArgumentException e) {
-                    System.out.println("error while invoking " + invoke.methodName);
-                    e.getCause().printStackTrace();
-                    result = e.getCause();
-                } catch (InvocationTargetException e) {
-                    System.out.println("error while invoking " + invoke.methodName);
-                    e.getCause().printStackTrace();
-                    result = e.getCause();
-                } catch (IllegalAccessException e) {
-                    System.out.println("error while invoking " + invoke.methodName);
-                    e.getCause().printStackTrace();
-                    result = e.getCause();
-                } finally {
-                    if (DEBUG) {
-                        if (result instanceof Result) {
-                            Logger.endScope(" = " + ((Result) result).result);
-                        } else {
-                            Logger.endScope(" = " + result);
-                        }
-                    }
-                }
-                output.writeObject(result);
-                output.flush();
-            }
-        }
-    }
-
-    /**
-     * Sends a result without invoking a method, used by CompilationServer startup code.
-     */
-    public void sendResult(Object obj) throws IOException {
-        output.writeObject(new Result(obj));
-        output.flush();
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/Remote.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.server;
-
-
-public interface Remote {
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/ReplacingStreams.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.server;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.hotspot.*;
-
-public class ReplacingStreams {
-
-    private IdentityHashMap<Object, Placeholder> objectMap = new IdentityHashMap<>();
-    private ArrayList<Object> objectList = new ArrayList<>();
-
-    private ReplacingOutputStream output;
-    private ReplacingInputStream input;
-
-    private InvocationSocket invocation;
-
-    public ReplacingStreams(OutputStream outputStream, InputStream inputStream) throws IOException {
-        output = new ReplacingOutputStream(new BufferedOutputStream(outputStream));
-        // required, because creating an ObjectOutputStream writes a header, but doesn't flush the stream
-        output.flush();
-        input = new ReplacingInputStream(new BufferedInputStream(inputStream));
-        invocation = new InvocationSocket(output, input);
-
-        addStaticObject(CiValue.IllegalValue);
-        addStaticObject(HotSpotProxy.DUMMY_CONSTANT_OBJ);
-    }
-
-    public void setInvocationSocket(InvocationSocket invocation) {
-        this.invocation = invocation;
-    }
-
-    public ReplacingOutputStream getOutput() {
-        return output;
-    }
-
-    public ReplacingInputStream getInput() {
-        return input;
-    }
-
-    public InvocationSocket getInvocation() {
-        return invocation;
-    }
-
-    private void addStaticObject(Object obj) {
-        int id = objectList.size();
-        objectList.add(obj);
-        objectMap.put(obj, new Placeholder(id));
-    }
-
-    public static class Placeholder implements Serializable {
-
-        /**
-         *
-         */
-        private static final long serialVersionUID = 6071894297788156945L;
-        public final int id;
-
-        public Placeholder(int id) {
-            this.id = id;
-        }
-
-        @Override
-        public String toString() {
-            return "#<" + id + ">";
-        }
-    }
-
-    public static class NewRemoteCallPlaceholder implements Serializable {
-
-        /**
-         *
-         */
-        private static final long serialVersionUID = 3084101671389500206L;
-        public final Class<?>[] interfaces;
-
-        public NewRemoteCallPlaceholder(Class<?>[] interfaces) {
-            this.interfaces = interfaces;
-        }
-    }
-
-    public static class NewDummyPlaceholder implements Serializable {
-
-        /**
-         *
-         */
-        private static final long serialVersionUID = 2692666726573532288L;
-    }
-
-    /**
-     * Replaces certain cir objects that cannot easily be made Serializable.
-     */
-    public class ReplacingInputStream extends ObjectInputStream {
-
-        public ReplacingInputStream(InputStream in) throws IOException {
-            super(in);
-            enableResolveObject(true);
-        }
-
-        @Override
-        protected Object resolveObject(Object obj) throws IOException {
-            // see ReplacingInputStream.replaceObject for details on when these types of objects are created
-
-            if (obj instanceof Placeholder) {
-                Placeholder placeholder = (Placeholder) obj;
-                Object resolvedObj = objectList.get(placeholder.id);
-                return resolvedObj;
-            }
-
-            if (obj instanceof NewRemoteCallPlaceholder) {
-                NewRemoteCallPlaceholder newPlaceholder = (NewRemoteCallPlaceholder) obj;
-                Placeholder placeholder = new Placeholder(objectList.size());
-                Object resolvedObj = Proxy.newProxyInstance(getClass().getClassLoader(), newPlaceholder.interfaces, invocation.new Handler(placeholder));
-                objectMap.put(resolvedObj, placeholder);
-                objectList.add(resolvedObj);
-                return resolvedObj;
-            }
-
-            if (obj instanceof NewDummyPlaceholder) {
-                Object resolvedObj = new Placeholder(objectList.size());
-                objectMap.put(resolvedObj, (Placeholder) resolvedObj);
-                objectList.add(resolvedObj);
-                return resolvedObj;
-            }
-
-            return obj;
-        }
-    }
-
-    /**
-     * Replaces certain cir objects that cannot easily be made Serializable.
-     */
-    public class ReplacingOutputStream extends ObjectOutputStream {
-
-        public ReplacingOutputStream(OutputStream out) throws IOException {
-            super(out);
-            enableReplaceObject(true);
-        }
-
-        @Override
-        protected Object replaceObject(Object obj) throws IOException {
-            // is the object a known instance?
-            Placeholder placeholder = objectMap.get(obj);
-            if (placeholder != null) {
-                return placeholder;
-            }
-
-            // is the object an instance of a class that will always be executed remotely?
-            if (obj instanceof Remote) {
-                return createRemoteCallPlaceholder(obj);
-            }
-
-            // is the object a constant of object type?
-            if (obj.getClass() == CiConstant.class) {
-                CiConstant constant = (CiConstant) obj;
-                if (constant.kind != CiKind.Object) {
-                    return obj;
-                }
-                Object contents = constant.asObject();
-                if (contents == null) {
-                    return obj;
-                }
-                // don't replace if the object already is a placeholder
-                if (contents instanceof Placeholder || contents instanceof Long) {
-                    return obj;
-                }
-                placeholder = objectMap.get(contents);
-                if (placeholder != null) {
-                    return CiConstant.forObject(placeholder);
-                }
-                if (contents instanceof Remote) {
-                    return CiConstant.forObject(createRemoteCallPlaceholder(contents));
-                }
-                return CiConstant.forObject(createDummyPlaceholder(contents));
-            }
-            return obj;
-        }
-    }
-
-    public static Class<?>[] getAllInterfaces(Class<?> clazz) {
-        HashSet<Class< ? >> interfaces = new HashSet<>();
-        getAllInterfaces(clazz, interfaces);
-        return interfaces.toArray(new Class<?>[interfaces.size()]);
-    }
-
-    private static void getAllInterfaces(Class<?> clazz, HashSet<Class<?>> interfaces) {
-        for (Class< ? > iface : clazz.getInterfaces()) {
-            if (!interfaces.contains(iface)) {
-                interfaces.add(iface);
-                getAllInterfaces(iface, interfaces);
-            }
-        }
-        if (clazz.getSuperclass() != null) {
-            getAllInterfaces(clazz.getSuperclass(), interfaces);
-        }
-    }
-
-    private Object createRemoteCallPlaceholder(Object obj) {
-        // collect all interfaces that this object's class implements (proxies only support interfaces)
-        objectMap.put(obj, new Placeholder(objectList.size()));
-        objectList.add(obj);
-        return new NewRemoteCallPlaceholder(getAllInterfaces(obj.getClass()));
-    }
-
-    public Object createDummyPlaceholder(Object obj) {
-        objectMap.put(obj, new Placeholder(objectList.size()));
-        objectList.add(obj);
-        return new NewDummyPlaceholder();
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/server/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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.
- */
-/**
- * Implementation of a compilation server socket that delegates incoming requests to Graal.
- */
-package com.oracle.graal.hotspot.server;
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopySnippets.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,458 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.snippets;
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.hotspot.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-import com.oracle.graal.snippets.*;
-import com.oracle.graal.snippets.nodes.*;
-
-
-public class ArrayCopySnippets implements SnippetsInterface{
-
-    @Snippet
-    public static void arraycopy(byte[] src, int srcPos, byte[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            if ((length & 0x01) == 0) {
-                if ((length & 0x02) == 0) {
-                    if ((length & 0x04) == 0) {
-                        copyLongsDown(src, srcPos, dest, destPos, length >> 3);
-                    } else {
-                        copyIntsDown(src, srcPos, dest, destPos, length >> 2);
-                    }
-                } else {
-                    copyShortsDown(src, srcPos, dest, destPos, length >> 1);
-                }
-            } else {
-                copyBytesDown(src, srcPos, dest, destPos, length);
-            }
-        } else {
-            if ((length & 0x01) == 0) {
-                if ((length & 0x02) == 0) {
-                    if ((length & 0x04) == 0) {
-                        copyLongsUp(src, srcPos, dest, destPos, length >> 3);
-                    } else {
-                        copyIntsUp(src, srcPos, dest, destPos, length >> 2);
-                    }
-                } else {
-                    copyShortsUp(src, srcPos, dest, destPos, length >> 1);
-                }
-            } else {
-                copyBytesUp(src, srcPos, dest, destPos, length);
-            }
-        }
-    }
-
-    @Snippet
-    public static void arraycopy(char[] src, int srcPos, char[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            if ((length & 0x01) == 0) {
-                if ((length & 0x02) == 0) {
-                    copyLongsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
-                } else {
-                    copyIntsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
-                }
-            } else {
-                copyShortsDown(src, srcPos * 2L, dest, destPos * 2L, length);
-            }
-        } else {
-            if ((length & 0x01) == 0) {
-                if ((length & 0x02) == 0) {
-                    copyLongsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
-                } else {
-                    copyIntsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
-                }
-            } else {
-                copyShortsUp(src, srcPos * 2L, dest, destPos * 2L, length);
-            }
-        }
-    }
-
-    @Snippet
-    public static void arraycopy(short[] src, int srcPos, short[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            if ((length & 0x01) == 0) {
-                if ((length & 0x02) == 0) {
-                    copyLongsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
-                } else {
-                    copyIntsDown(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
-                }
-            } else {
-                copyShortsDown(src, srcPos * 2L, dest, destPos * 2L, length);
-            }
-        } else {
-            if ((length & 0x01) == 0) {
-                if ((length & 0x02) == 0) {
-                    copyLongsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 2);
-                } else {
-                    copyIntsUp(src, srcPos * 2L, dest, destPos * 2L, length >> 1);
-                }
-            } else {
-                copyShortsUp(src, srcPos * 2L, dest, destPos * 2L, length);
-            }
-        }
-    }
-
-    @Snippet
-    public static void arraycopy(int[] src, int srcPos, int[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            if ((length & 0x01) == 0) {
-                copyLongsDown(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
-            } else {
-                copyIntsDown(src, srcPos * 4L, dest, destPos * 4L, length);
-            }
-        } else {
-            if ((length & 0x01) == 0) {
-                copyLongsUp(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
-            } else {
-                copyIntsUp(src, srcPos * 4L, dest, destPos * 4L, length);
-            }
-        }
-    }
-
-    @Snippet
-    public static void arraycopy(float[] src, int srcPos, float[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            if ((length & 0x01) == 0) {
-                copyLongsDown(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
-            } else {
-                copyIntsDown(src, srcPos * 4L, dest, destPos * 4L, length);
-            }
-        } else {
-            if ((length & 0x01) == 0) {
-                copyLongsUp(src, srcPos * 4L, dest, destPos * 4L, length >> 1);
-            } else {
-                copyIntsUp(src, srcPos * 4L, dest, destPos * 4L, length);
-            }
-        }
-    }
-
-    @Snippet
-    public static void arraycopy(long[] src, int srcPos, long[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            copyLongsDown(src, srcPos * 8L, dest, destPos * 8L, length);
-        } else {
-            copyLongsUp(src, srcPos * 8L, dest, destPos * 8L, length);
-        }
-    }
-
-    @Snippet
-    public static void arraycopy(double[] src, int srcPos, double[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            copyLongsDown(src, srcPos * 8L, dest, destPos * 8L, length);
-        } else {
-            copyLongsUp(src, srcPos * 8L, dest, destPos * 8L, length);
-        }
-    }
-
-    // Does NOT perform store checks
-    @Snippet
-    public static void arraycopy(Object[] src, int srcPos, Object[] dest, int destPos, int length) {
-        if (src == null || dest == null) {
-            throw new NullPointerException();
-        }
-        if (srcPos < 0 || destPos < 0 || length < 0 || srcPos + length > src.length || destPos + length > dest.length) {
-            throw new IndexOutOfBoundsException();
-        }
-        if (src == dest && srcPos < destPos) { // bad aliased case
-            copyObjectsDown(src, srcPos * 8L, dest, destPos * 8L, length);
-        } else {
-            copyObjectsUp(src, srcPos * 8L, dest, destPos * 8L, length);
-        }
-        if (length > 0) {
-            long header = ArrayHeaderSizeNode.sizeFor(CiKind.Object);
-            int cardShift = CardTableShiftNode.get();
-            long cardStart = CardTableStartNode.get();
-            long dstAddr = GetObjectAddressNode.get(dest);
-            long start = (dstAddr + header + destPos * 8L) >>> cardShift;
-            long end = (dstAddr + header + (destPos + length - 1) * 8L) >>> cardShift;
-            long count = end - start + 1;
-            while (count-- > 0) {
-                DirectStoreNode.store((start + cardStart) + count, false);
-            }
-        }
-    }
-
-    @Snippet
-    public static void copyBytesDown(Object src, int srcPos, Object dest, int destPos, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Byte);
-        for (long i = length - 1; i >= 0; i--) {
-            Byte a = UnsafeLoadNode.load(src, i + (srcPos + header), CiKind.Byte);
-            UnsafeStoreNode.store(dest, i + (destPos + header), a.byteValue(), CiKind.Byte);
-        }
-    }
-
-    @Snippet
-    public static void copyShortsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Short);
-        for (long i = (length - 1) * 2; i >= 0; i -= 2) {
-            Character a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Short);
-            UnsafeStoreNode.store(dest, i + (destOffset + header), a.charValue(), CiKind.Short);
-        }
-    }
-
-    @Snippet
-    public static void copyIntsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Int);
-        for (long i = (length - 1) * 4; i >= 0; i -= 4) {
-            Integer a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Int);
-            UnsafeStoreNode.store(dest, i + (destOffset + header), a.intValue(), CiKind.Int);
-        }
-    }
-
-    @Snippet
-    public static void copyLongsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Long);
-        for (long i = (length - 1) * 8; i >= 0; i -= 8) {
-            Long a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Long);
-            UnsafeStoreNode.store(dest, i + (destOffset + header), a.longValue(), CiKind.Long);
-        }
-    }
-
-    // Does NOT perform store checks
-    @Snippet
-    public static void copyObjectsDown(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Object);
-        for (long i = (length - 1) * 8; i >= 0; i -= 8) {
-            Object a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Object);
-            DirectObjectStoreNode.store(dest, i + (destOffset + header), a);
-        }
-    }
-    /**
-     * Copies {@code length} bytes from {@code src} starting at {@code srcPos} to {@code dest} starting at {@code destPos}.
-     * @param src source object
-     * @param srcPos source offset
-     * @param dest destination object
-     * @param destPos destination offset
-     * @param length number of bytes to copy
-     */
-    @Snippet
-    public static void copyBytesUp(Object src, int srcPos, Object dest, int destPos, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Byte);
-        for (long i = 0; i < length; i++) {
-            Byte a = UnsafeLoadNode.load(src, i + (srcPos + header), CiKind.Byte);
-            UnsafeStoreNode.store(dest, i + (destPos + header), a.byteValue(), CiKind.Byte);
-        }
-    }
-
-    /**
-     * Copies {@code length} shorts from {@code src} starting at offset {@code srcOffset} (in bytes) to {@code dest} starting at offset {@code destOffset} (in bytes).
-     * @param src
-     * @param srcOffset (in bytes)
-     * @param dest
-     * @param destOffset (in bytes)
-     * @param length  (in shorts)
-     */
-    @Snippet
-    public static void copyShortsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Short);
-        for (long i = 0; i < length * 2L; i += 2) {
-            Character a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Short);
-            UnsafeStoreNode.store(dest, i + (destOffset + header), a.charValue(), CiKind.Short);
-        }
-    }
-
-    @Snippet
-    public static void copyIntsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Int);
-        for (long i = 0; i < length * 4L; i += 4) {
-            Integer a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Int);
-            UnsafeStoreNode.store(dest, i + (destOffset + header), a.intValue(), CiKind.Int);
-        }
-    }
-
-    @Snippet
-    public static void copyLongsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Long);
-        for (long i = 0; i < length * 8L; i += 8) {
-            Long a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Long);
-            UnsafeStoreNode.store(dest, i + (destOffset + header), a.longValue(), CiKind.Long);
-        }
-    }
-
-    // Does NOT perform store checks
-    @Snippet
-    public static void copyObjectsUp(Object src, long srcOffset, Object dest, long destOffset, int length)  {
-        long header = ArrayHeaderSizeNode.sizeFor(CiKind.Object);
-        for (long i = 0; i < length * 8L; i += 8) {
-            Object a = UnsafeLoadNode.load(src, i + (srcOffset + header), CiKind.Object);
-            DirectObjectStoreNode.store(dest, i + (destOffset + header), a);
-        }
-    }
-    private static class GetObjectAddressNode extends FixedWithNextNode implements LIRLowerable {
-        @Input private ValueNode object;
-
-        public GetObjectAddressNode(ValueNode obj) {
-            super(StampFactory.forKind(CiKind.Long));
-            this.object = obj;
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static long get(Object array) {
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        public void generate(LIRGeneratorTool gen) {
-            CiValue obj = gen.newVariable(gen.target().wordKind);
-            gen.emitMove(gen.operand(object), obj);
-            gen.setResult(this, obj);
-        }
-    }
-    private static class DirectStoreNode extends FixedWithNextNode implements LIRLowerable {
-        @Input private ValueNode address;
-        @Input private ValueNode value;
-
-        public DirectStoreNode(ValueNode address, ValueNode value) {
-            super(StampFactory.illegal());
-            this.address = address;
-            this.value = value;
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(long address, long value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(long address, boolean value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        public void generate(LIRGeneratorTool gen) {
-            CiValue v = gen.operand(value);
-            gen.emitStore(new CiAddress(v.kind, gen.operand(address)), v, false);
-        }
-    }
-
-    private static class DirectObjectStoreNode extends FixedWithNextNode implements Lowerable {
-        @Input private ValueNode object;
-        @Input private ValueNode value;
-        @Input private ValueNode offset;
-
-        public DirectObjectStoreNode(ValueNode object, ValueNode offset, ValueNode value) {
-            super(StampFactory.illegal());
-            this.object = object;
-            this.value = value;
-            this.offset = offset;
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(Object obj, long offset, long value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(Object obj, long offset, boolean value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(Object obj, long offset, Object value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        public void lower(CiLoweringTool tool) {
-            StructuredGraph graph = (StructuredGraph) this.graph();
-            IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, value.kind(), 0, offset, graph, false);
-            WriteNode write = graph.add(new WriteNode(object, value, location));
-            graph.replaceFixedWithFixed(this, write);
-        }
-    }
-
-    private static class CardTableShiftNode extends ConstantNode {
-        public CardTableShiftNode() {
-            super(CiConstant.forInt(CompilerImpl.getInstance().getConfig().cardtableShift));
-        }
-
-        @NodeIntrinsic
-        public static int get() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    private static class CardTableStartNode extends ConstantNode {
-        public CardTableStartNode() {
-            super(CiConstant.forLong(CompilerImpl.getInstance().getConfig().cardtableStartAddress));
-        }
-
-        @NodeIntrinsic
-        public static long get() {
-            throw new UnsupportedOperationException();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.snippets;
-
-import java.lang.reflect.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.java.*;
-
-public class IntrinsifyArrayCopyPhase extends Phase {
-    private final GraalRuntime runtime;
-    private RiResolvedMethod arrayCopy;
-    private RiResolvedMethod byteArrayCopy;
-    private RiResolvedMethod shortArrayCopy;
-    private RiResolvedMethod charArrayCopy;
-    private RiResolvedMethod intArrayCopy;
-    private RiResolvedMethod longArrayCopy;
-    private RiResolvedMethod floatArrayCopy;
-    private RiResolvedMethod doubleArrayCopy;
-    private RiResolvedMethod objectArrayCopy;
-
-    public IntrinsifyArrayCopyPhase(GraalRuntime runtime) {
-        this.runtime = runtime;
-        try {
-            byteArrayCopy = getArrayCopySnippet(runtime, byte.class);
-            charArrayCopy = getArrayCopySnippet(runtime, char.class);
-            shortArrayCopy = getArrayCopySnippet(runtime, short.class);
-            intArrayCopy = getArrayCopySnippet(runtime, int.class);
-            longArrayCopy = getArrayCopySnippet(runtime, long.class);
-            floatArrayCopy = getArrayCopySnippet(runtime, float.class);
-            doubleArrayCopy = getArrayCopySnippet(runtime, double.class);
-            objectArrayCopy = getArrayCopySnippet(runtime, Object.class);
-            arrayCopy = runtime.getRiMethod(System.class.getDeclaredMethod("arraycopy", Object.class, int.class, Object.class, int.class, int.class));
-        } catch (SecurityException e) {
-            e.printStackTrace();
-        } catch (NoSuchMethodException e) {
-            e.printStackTrace();
-        }
-    }
-
-    private static RiResolvedMethod getArrayCopySnippet(RiRuntime runtime, Class<?> componentClass) throws NoSuchMethodException {
-        Class<?> arrayClass = Array.newInstance(componentClass, 0).getClass();
-        return runtime.getRiMethod(ArrayCopySnippets.class.getDeclaredMethod("arraycopy", arrayClass, int.class, arrayClass, int.class, int.class));
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        boolean hits = false;
-        for (MethodCallTargetNode methodCallTarget : graph.getNodes(MethodCallTargetNode.class)) {
-            RiResolvedMethod targetMethod = methodCallTarget.targetMethod();
-            RiResolvedMethod snippetMethod = null;
-            if (targetMethod == arrayCopy) {
-                ValueNode src = methodCallTarget.arguments().get(0);
-                ValueNode dest = methodCallTarget.arguments().get(2);
-                assert src != null && dest != null;
-                RiResolvedType srcDeclaredType = src.declaredType();
-                RiResolvedType destDeclaredType = dest.declaredType();
-                if (srcDeclaredType != null
-                                && srcDeclaredType.isArrayClass()
-                                && destDeclaredType != null
-                                && destDeclaredType.isArrayClass()) {
-                    CiKind componentKind = srcDeclaredType.componentType().kind(false);
-                    if (srcDeclaredType.componentType() == destDeclaredType.componentType()) {
-                        if (componentKind == CiKind.Int) {
-                            snippetMethod = intArrayCopy;
-                        } else if (componentKind == CiKind.Char) {
-                            snippetMethod = charArrayCopy;
-                        } else if (componentKind == CiKind.Long) {
-                            snippetMethod = longArrayCopy;
-                        } else if (componentKind == CiKind.Byte) {
-                            snippetMethod = byteArrayCopy;
-                        } else if (componentKind == CiKind.Short) {
-                            snippetMethod = shortArrayCopy;
-                        } else if (componentKind == CiKind.Float) {
-                            snippetMethod = floatArrayCopy;
-                        } else if (componentKind == CiKind.Double) {
-                            snippetMethod = doubleArrayCopy;
-                        } else if (componentKind == CiKind.Object) {
-                            snippetMethod = objectArrayCopy;
-                        }
-                    } else if (componentKind == CiKind.Object
-                                    && srcDeclaredType.componentType().isSubtypeOf(destDeclaredType.componentType())) {
-                        snippetMethod = objectArrayCopy;
-                    }
-                }
-            }
-
-            if (snippetMethod != null) {
-                StructuredGraph snippetGraph = (StructuredGraph) snippetMethod.compilerStorage().get(Graph.class);
-                assert snippetGraph != null : "ArrayCopySnippets should be installed";
-                hits = true;
-                Debug.log("%s > Intinsify (%s)", Debug.currentScope(), snippetMethod.signature().argumentTypeAt(0, snippetMethod.holder()).componentType());
-                InliningUtil.inline(methodCallTarget.invoke(), snippetGraph, false);
-            }
-        }
-        if (GraalOptions.OptCanonicalizer && hits) {
-            new CanonicalizerPhase(null, runtime, null).apply(graph);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.snippets;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.snippets.*;
-
-/**
- * Snippets for {@link java.lang.System} methods.
- */
-@ClassSubstitution(java.lang.System.class)
-public class SystemSnippets implements SnippetsInterface {
-
-    public static long currentTimeMillis() {
-        return RuntimeCallNode.performCall(CiRuntimeCall.JavaTimeMillis);
-    }
-
-    public static long nanoTime() {
-        return RuntimeCallNode.performCall(CiRuntimeCall.JavaTimeNanos);
-    }
-
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/UnsafeSnippets.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.snippets;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.util.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.snippets.*;
-
-/**
- * Snippets for {@link sun.misc.Unsafe} methods.
- */
-@ClassSubstitution(sun.misc.Unsafe.class)
-public class UnsafeSnippets implements SnippetsInterface {
-
-    public boolean compareAndSwapObject(Object o, long offset, Object expected, Object x) {
-        return CompareAndSwapNode.compareAndSwap(o, offset, expected, x);
-    }
-
-    public boolean compareAndSwapInt(Object o, long offset, int expected, int x) {
-        return CompareAndSwapNode.compareAndSwap(o, offset, expected, x);
-    }
-
-    public boolean compareAndSwapLong(Object o, long offset, long expected, long x) {
-        return CompareAndSwapNode.compareAndSwap(o, offset, expected, x);
-    }
-
-    public Object getObject(Object o, long offset) {
-        return UnsafeLoadNode.load(o, offset, CiKind.Object);
-    }
-
-    public Object getObjectVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        Object result = getObject(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putObject(Object o, long offset, Object x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Object);
-    }
-
-    public void putObjectVolatile(Object o, long offset, Object x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putObject(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public int getInt(Object o, long offset) {
-        Integer value = UnsafeLoadNode.load(o, offset, CiKind.Int);
-        return value;
-    }
-
-    public int getIntVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        int result = getInt(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putInt(Object o, long offset, int x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Int);
-    }
-
-    public void putIntVolatile(Object o, long offset, int x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putInt(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public boolean getBoolean(Object o, long offset) {
-        @JavacBug(id = 6995200)
-        Boolean result = UnsafeLoadNode.load(o, offset, CiKind.Boolean);
-        return result;
-    }
-
-    public boolean getBooleanVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        boolean result = getBoolean(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putBoolean(Object o, long offset, boolean x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Boolean);
-    }
-
-    public void putBooleanVolatile(Object o, long offset, boolean x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putBoolean(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public byte getByte(Object o, long offset) {
-        @JavacBug(id = 6995200)
-        Byte result = UnsafeLoadNode.load(o, offset, CiKind.Byte);
-        return result;
-    }
-
-    public byte getByteVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        byte result = getByte(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putByte(Object o, long offset, byte x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Byte);
-    }
-
-    public void putByteVolatile(Object o, long offset, byte x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putByte(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public short getShort(Object o, long offset) {
-        @JavacBug(id = 6995200)
-        Short result = UnsafeLoadNode.load(o, offset, CiKind.Short);
-        return result;
-    }
-
-    public short getShortVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        short result = getShort(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putShort(Object o, long offset, short x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Short);
-    }
-
-    public void putShortVolatile(Object o, long offset, short x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putShort(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public char getChar(Object o, long offset) {
-        @JavacBug(id = 6995200)
-        Character result = UnsafeLoadNode.load(o, offset, CiKind.Char);
-        return result;
-    }
-
-    public char getCharVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        char result = getChar(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putChar(Object o, long offset, char x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Char);
-    }
-
-    public void putCharVolatile(Object o, long offset, char x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putChar(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public long getLong(Object o, long offset) {
-        @JavacBug(id = 6995200)
-        Long result = UnsafeLoadNode.load(o, offset, CiKind.Long);
-        return result;
-    }
-
-    public long getLongVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        long result = getLong(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putLong(Object o, long offset, long x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Long);
-    }
-
-    public void putLongVolatile(Object o, long offset, long x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putLong(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public float getFloat(Object o, long offset) {
-        @JavacBug(id = 6995200)
-        Float result = UnsafeLoadNode.load(o, offset, CiKind.Float);
-        return result;
-    }
-
-    public float getFloatVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        float result = getFloat(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putFloat(Object o, long offset, float x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Float);
-    }
-
-    public void putFloatVolatile(Object o, long offset, float x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putFloat(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-
-    public double getDouble(Object o, long offset) {
-        @JavacBug(id = 6995200)
-        Double result = UnsafeLoadNode.load(o, offset, CiKind.Double);
-        return result;
-    }
-
-    public double getDoubleVolatile(Object o, long offset) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_READ);
-        double result = getDouble(o, offset);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_READ);
-        return result;
-    }
-
-    public void putDouble(Object o, long offset, double x) {
-        UnsafeStoreNode.store(o, offset, x, CiKind.Double);
-    }
-
-    public void putDoubleVolatile(Object o, long offset, double x) {
-        MembarNode.get(MemoryBarriers.JMM_PRE_VOLATILE_WRITE);
-        putDouble(o, offset, x);
-        MembarNode.get(MemoryBarriers.JMM_POST_VOLATILE_WRITE);
-    }
-}
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64TailcallOp.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.target.amd64;
-
-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.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.amd64.*;
-import com.oracle.graal.lir.asm.*;
-
-/**
- * Performs a hard-coded tail call to the specified target, which normally should be an RiCompiledCode instance.
- */
-public class AMD64TailcallOp extends AMD64LIRInstruction {
-
-    public AMD64TailcallOp(List<CiValue> parameters, CiValue target, CiValue[] callingConvention) {
-        super("TAILCALL", LIRInstruction.NO_OPERANDS, null, toArray(parameters, target), LIRInstruction.NO_OPERANDS, callingConvention.clone());
-        assert inputs.length == temps.length + 1;
-
-        for (int i = 0; i < temps.length; i++) {
-            assert isRegister(temps[i]) : "too many parameters for tail call";
-            assert sameRegister(temps[i], inputs[i]) : "inputs do not match calling convention";
-        }
-    }
-
-    private static CiValue[] toArray(List<CiValue> parameters, CiValue target) {
-        CiValue[] result = new CiValue[parameters.size() + 1];
-        parameters.toArray(result);
-        result[parameters.size()] = target;
-        return result;
-    }
-
-    @Override
-    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        // destroy the current frame (now the return address is the top of stack)
-        masm.leave();
-
-        // jump to the target method
-        masm.jmp(asRegister(inputs[inputs.length - 1]));
-        masm.ensureUniquePC();
-    }
-
-    @Override
-    protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-        if (mode == OperandMode.Input) {
-            return EnumSet.of(OperandFlag.Register);
-        } else if (mode == OperandMode.Temp) {
-            return EnumSet.of(OperandFlag.Register);
-        }
-        throw GraalInternalError.shouldNotReachHere();
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/BciBlockMapping.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,813 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java;
-
-import static com.oracle.graal.java.bytecode.Bytecodes.*;
-
-import java.util.*;
-
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.java.bytecode.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * Builds a mapping between bytecodes and basic blocks and builds a conservative control flow
- * graph. Note that this class serves a similar role to C1's {@code BlockListBuilder}, but makes fewer assumptions about
- * what the compiler interface provides. It builds all basic blocks for the control flow graph without requiring the
- * compiler interface to provide a bitmap of the beginning of basic blocks. It makes two linear passes; one over the
- * bytecodes to build block starts and successor lists, and one pass over the block map to build the CFG.
- *
- * Note that the CFG built by this class is <i>not</i> connected to the actual {@code BlockBegin} instances; this class
- * does, however, compute and assign the reverse postorder number of the blocks. This comment needs refinement. (MJJ)
- *
- * <H2>More Details on {@link BciBlockMapping#build}</H2>
- *
- * If the method has any exception handlers the {@linkplain #exceptionMap exception map} will be created (TBD).
- *
- * The bytecodes are then scanned linearly looking for bytecodes that contain control transfers, e.g., {@code GOTO},
- * {@code RETURN}, {@code IFGE}, and creating the corresponding entries in {@link #successorMap} and {@link #blockMap}.
- * In addition, if {@link #exceptionMap} is not null, entries are made for any bytecode that can cause an exception.
- * More TBD.
- *
- * Observe that this process finds bytecodes that terminate basic blocks, so the {@link #moveSuccessorLists} method is
- * called to reassign the successors to the {@code BlockBegin} node that actually starts the block.
- *
- * <H3>Example</H3>
- *
- * Consider the following source code:
- *
- * <pre>
- * <code>
- *     public static int test(int arg1, int arg2) {
- *         int x = 0;
- *         while (arg2 > 0) {
- *             if (arg1 > 0) {
- *                 x += 1;
- *             } else if (arg1 < 0) {
- *                 x -= 1;
- *             }
- *         }
- *         return x;
- *     }
- * </code>
- * </pre>
- *
- * This is translated by javac to the following bytecode:
- *
- * <pre>
- * <code>
- *    0:   iconst_0
- *    1:   istore_2
- *    2:   goto    22
- *    5:   iload_0
- *    6:   ifle    15
- *    9:   iinc    2, 1
- *    12:  goto    22
- *    15:  iload_0
- *    16:  ifge    22
- *    19:  iinc    2, -1
- *    22:  iload_1
- *    23:  ifgt    5
- *    26:  iload_2
- *    27:  ireturn
- *    </code>
- * </pre>
- *
- * There are seven basic blocks in this method, 0..2, 5..6, 9..12, 15..16, 19..19, 22..23 and 26..27. Therefore, before
- * the call to {@code moveSuccessorLists}, the {@code blockMap} array has {@code BlockBegin} nodes at indices 0, 5, 9,
- * 15, 19, 22 and 26. The {@code successorMap} array has entries at 2, 6, 12, 16, 23, 27 corresponding to the control
- * transfer bytecodes. The entry at index 6, for example, is a length two array of {@code BlockBegin} nodes for indices
- * 9 and 15, which are the successors for the basic block 5..6. After the call to {@code moveSuccessors}, {@code
- * successorMap} has entries at 0, 5, 9, 15, 19, 22 and 26, i.e, matching {@code blockMap}.
- * <p>
- * Next the blocks are numbered using <a href="http://en.wikipedia.org/wiki/Depth-first_search#Vertex_orderings">reverse
- * post-order</a>. For the above example this results in the numbering 2, 4, 7, 5, 6, 3, 8. Also loop header blocks are
- * detected during the traversal by detecting a repeat visit to a block that is still being processed. This causes the
- * block to be flagged as a loop header and also added to the {@link #loopBlocks} list. The {@code loopBlocks} list
- * contains the blocks at 0, 5, 9, 15, 19, 22, with 22 as the loop header. (N.B. the loop header block is added multiple
- * (4) times to this list). (Should 0 be in? It's not inside the loop).
- *
- * If the {@code computeStoresInLoops} argument to {@code build} is true, the {@code loopBlocks} list is processed to
- * mark all local variables that are stored in the blocks in the list.
- */
-public final class BciBlockMapping {
-
-    public static class Block implements Cloneable {
-        public int startBci;
-        public int endBci;
-        public boolean isExceptionEntry;
-        public boolean isLoopHeader;
-        public int blockID;
-
-        public FixedWithNextNode firstInstruction;
-        public FrameStateBuilder entryState;
-
-        public ArrayList<Block> successors = new ArrayList<>(2);
-        public int normalSuccessors;
-
-        private boolean visited;
-        private boolean active;
-        public long loops;
-
-        public HashMap<JsrScope, Block> jsrAlternatives;
-        public JsrScope jsrScope = JsrScope.EMPTY_SCOPE;
-        public Block jsrSuccessor;
-        public int jsrReturnBci;
-        public Block retSuccessor;
-        public boolean endsWithRet = false;
-
-        public BitMap localsLiveIn;
-        public BitMap localsLiveOut;
-        private BitMap localsLiveGen;
-        private BitMap localsLiveKill;
-
-        public Block copy() {
-            try {
-                Block block = (Block) super.clone();
-                block.successors = new ArrayList<>(successors);
-                return block;
-            } catch (CloneNotSupportedException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder sb = new StringBuilder("B").append(blockID);
-            sb.append('[').append(startBci).append("->").append(endBci);
-            if (isLoopHeader || isExceptionEntry) {
-                sb.append(' ');
-                if (isLoopHeader) {
-                    sb.append('L');
-                }
-                if (isExceptionEntry) {
-                    sb.append('!');
-                }
-            }
-            sb.append(']');
-            return sb.toString();
-        }
-    }
-
-    public static class ExceptionBlock extends Block {
-        public RiExceptionHandler handler;
-        public int deoptBci;
-    }
-
-    /**
-     * The blocks found in this method, in reverse postorder.
-     */
-    public final List<Block> blocks;
-
-    public final RiResolvedMethod method;
-
-    private final BytecodeStream stream;
-
-    private final RiExceptionHandler[] exceptionHandlers;
-
-    private Block[] blockMap;
-
-    public final BitSet canTrap;
-
-    public boolean hasJsrBytecodes;
-
-    public Block startBlock;
-
-    public final boolean useBranchPrediction;
-
-    /**
-     * Creates a new BlockMap instance from bytecode of the given method .
-     * @param method the compiler interface method containing the code
-     */
-    public BciBlockMapping(RiResolvedMethod method, boolean useBranchPrediction) {
-        this.method = method;
-        exceptionHandlers = method.exceptionHandlers();
-        stream = new BytecodeStream(method.code());
-        this.blockMap = new Block[method.codeSize()];
-        this.canTrap = new BitSet(blockMap.length);
-        this.blocks = new ArrayList<>();
-        this.useBranchPrediction = useBranchPrediction;
-    }
-
-    public RiExceptionHandler[] exceptionHandlers() {
-        return exceptionHandlers;
-    }
-
-    /**
-     * Builds the block map and conservative CFG and numbers blocks.
-     */
-    public void build() {
-        makeExceptionEntries();
-        iterateOverBytecodes();
-        addExceptionEdges();
-        if (hasJsrBytecodes) {
-            if (!GraalOptions.SupportJsrBytecodes) {
-                throw new JsrNotSupportedBailout("jsr/ret parsing disabled");
-            }
-            createJsrAlternatives(blockMap[0]);
-        }
-        computeBlockOrder();
-
-        initializeBlockIds();
-
-        startBlock = blockMap[0];
-
-        // Discard big arrays so that they can be GCed
-        blockMap = null;
-
-        if (GraalOptions.OptLivenessAnalysis) {
-            Debug.scope("LivenessAnalysis", new Runnable() {
-                @Override
-                public void run() {
-                    computeLiveness();
-                }
-            });
-        }
-    }
-
-    private void initializeBlockIds() {
-        for (int i = 0; i < blocks.size(); i++) {
-            blocks.get(i).blockID = i;
-        }
-    }
-
-    private void makeExceptionEntries() {
-        // start basic blocks at all exception handler blocks and mark them as exception entries
-        for (RiExceptionHandler h : this.exceptionHandlers) {
-            Block xhandler = makeBlock(h.handlerBCI());
-            xhandler.isExceptionEntry = true;
-        }
-    }
-
-    private void iterateOverBytecodes() {
-        // iterate over the bytecodes top to bottom.
-        // mark the entrypoints of basic blocks and build lists of successors for
-        // all bytecodes that end basic blocks (i.e. goto, ifs, switches, throw, jsr, returns, ret)
-        RiProfilingInfo profilingInfo = method.profilingInfo();
-        Block current = null;
-        stream.setBCI(0);
-        while (stream.currentBC() != Bytecodes.END) {
-            int bci = stream.currentBCI();
-
-            if (current == null || blockMap[bci] != null) {
-                Block b = makeBlock(bci);
-                if (current != null) {
-                    setSuccessors(current.endBci, b);
-                }
-                current = b;
-            }
-            blockMap[bci] = current;
-            current.endBci = bci;
-
-            switch (stream.currentBC()) {
-                case IRETURN: // fall through
-                case LRETURN: // fall through
-                case FRETURN: // fall through
-                case DRETURN: // fall through
-                case ARETURN: // fall through
-                case RETURN: {
-                    current = null;
-                    break;
-                }
-                case ATHROW: {
-                    current = null;
-                    canTrap.set(bci);
-                    break;
-                }
-                case IFEQ:      // fall through
-                case IFNE:      // fall through
-                case IFLT:      // fall through
-                case IFGE:      // fall through
-                case IFGT:      // fall through
-                case IFLE:      // fall through
-                case IF_ICMPEQ: // fall through
-                case IF_ICMPNE: // fall through
-                case IF_ICMPLT: // fall through
-                case IF_ICMPGE: // fall through
-                case IF_ICMPGT: // fall through
-                case IF_ICMPLE: // fall through
-                case IF_ACMPEQ: // fall through
-                case IF_ACMPNE: // fall through
-                case IFNULL:    // fall through
-                case IFNONNULL: {
-                    current = null;
-                    setSuccessors(bci, makeBlock(stream.readBranchDest()), makeBlock(stream.nextBCI()));
-                    break;
-                }
-                case GOTO:
-                case GOTO_W: {
-                    current = null;
-                    setSuccessors(bci, makeBlock(stream.readBranchDest()));
-                    break;
-                }
-                case TABLESWITCH: {
-                    current = null;
-                    BytecodeTableSwitch sw = new BytecodeTableSwitch(stream, bci);
-                    setSuccessors(bci, makeSwitchSuccessors(sw));
-                    break;
-                }
-                case LOOKUPSWITCH: {
-                    current = null;
-                    BytecodeLookupSwitch sw = new BytecodeLookupSwitch(stream, bci);
-                    setSuccessors(bci, makeSwitchSuccessors(sw));
-                    break;
-                }
-                case JSR:
-                case JSR_W: {
-                    hasJsrBytecodes = true;
-                    int target = stream.readBranchDest();
-                    if (target == 0) {
-                        throw new JsrNotSupportedBailout("jsr target bci 0 not allowed");
-                    }
-                    Block b1 = makeBlock(target);
-                    current.jsrSuccessor = b1;
-                    current.jsrReturnBci = stream.nextBCI();
-                    current = null;
-                    setSuccessors(bci, b1);
-                    break;
-                }
-                case RET: {
-                    current.endsWithRet = true;
-                    current = null;
-                    break;
-                }
-                case INVOKEINTERFACE:
-                case INVOKESPECIAL:
-                case INVOKESTATIC:
-                case INVOKEVIRTUAL: {
-                    current = null;
-                    setSuccessors(bci, makeBlock(stream.nextBCI()));
-                    canTrap.set(bci);
-                    break;
-                }
-                case IASTORE:
-                case LASTORE:
-                case FASTORE:
-                case DASTORE:
-                case AASTORE:
-                case BASTORE:
-                case CASTORE:
-                case SASTORE:
-                case IALOAD:
-                case LALOAD:
-                case FALOAD:
-                case DALOAD:
-                case AALOAD:
-                case BALOAD:
-                case CALOAD:
-                case SALOAD:
-                case PUTFIELD:
-                case GETFIELD: {
-                    if (GraalOptions.AllowExplicitExceptionChecks && profilingInfo.getExceptionSeen(bci) != RiExceptionSeen.FALSE) {
-                        canTrap.set(bci);
-                    }
-                }
-            }
-            stream.next();
-        }
-    }
-
-    private Block makeBlock(int startBci) {
-        Block oldBlock = blockMap[startBci];
-        if (oldBlock == null) {
-            Block newBlock = new Block();
-            newBlock.startBci = startBci;
-            blockMap[startBci] = newBlock;
-            return newBlock;
-
-        } else if (oldBlock.startBci != startBci) {
-            // Backward branch into the middle of an already processed block.
-            // Add the correct fall-through successor.
-            Block newBlock = new Block();
-            newBlock.startBci = startBci;
-            newBlock.endBci = oldBlock.endBci;
-            newBlock.successors.addAll(oldBlock.successors);
-            newBlock.normalSuccessors = oldBlock.normalSuccessors;
-
-            oldBlock.endBci = startBci - 1;
-            oldBlock.successors.clear();
-            oldBlock.successors.add(newBlock);
-            oldBlock.normalSuccessors = 1;
-
-            for (int i = startBci; i <= newBlock.endBci; i++) {
-                blockMap[i] = newBlock;
-            }
-            return newBlock;
-
-        } else {
-            return oldBlock;
-        }
-    }
-
-    private Block[] makeSwitchSuccessors(BytecodeSwitch tswitch) {
-        int max = tswitch.numberOfCases();
-        Block[] successors = new Block[max + 1];
-        for (int i = 0; i < max; i++) {
-            successors[i] = makeBlock(tswitch.targetAt(i));
-        }
-        successors[max] = makeBlock(tswitch.defaultTarget());
-        return successors;
-    }
-
-    private void setSuccessors(int predBci, Block... successors) {
-        Block predecessor = blockMap[predBci];
-        assert predecessor.successors.size() == 0;
-        for (Block sux : successors) {
-            if (sux.isExceptionEntry) {
-                throw new CiBailout("Exception handler can be reached by both normal and exceptional control flow");
-            }
-            predecessor.successors.add(sux);
-        }
-        predecessor.normalSuccessors = successors.length;
-    }
-
-    private final HashSet<Block> jsrVisited = new HashSet<>();
-
-    private void createJsrAlternatives(Block block) {
-        jsrVisited.add(block);
-        JsrScope scope = block.jsrScope;
-
-        if (block.endsWithRet) {
-            block.retSuccessor = blockMap[scope.nextReturnAddress()];
-            block.successors.add(block.retSuccessor);
-            assert block.retSuccessor != block.jsrSuccessor;
-        }
-        Debug.log("JSR alternatives block %s  sux %s  jsrSux %s  retSux %s  jsrScope %s", block, block.successors, block.jsrSuccessor, block.retSuccessor, block.jsrScope);
-
-        if (block.jsrSuccessor != null || !scope.isEmpty()) {
-            for (int i = 0; i < block.successors.size(); i++) {
-                Block successor = block.successors.get(i);
-                JsrScope nextScope = scope;
-                if (successor == block.jsrSuccessor) {
-                    nextScope = scope.push(block.jsrReturnBci);
-                }
-                if (successor == block.retSuccessor) {
-                    nextScope = scope.pop();
-                }
-                if (!successor.jsrScope.isPrefixOf(nextScope)) {
-                    throw new JsrNotSupportedBailout("unstructured control flow  (" + successor.jsrScope + " " + nextScope + ")");
-                }
-                if (!nextScope.isEmpty()) {
-                    Block clone;
-                    if (successor.jsrAlternatives != null && successor.jsrAlternatives.containsKey(nextScope)) {
-                        clone = successor.jsrAlternatives.get(nextScope);
-                    } else {
-                        if (successor.jsrAlternatives == null) {
-                            successor.jsrAlternatives = new HashMap<>();
-                        }
-                        clone = successor.copy();
-                        clone.jsrScope = nextScope;
-                        successor.jsrAlternatives.put(nextScope, clone);
-                    }
-                    block.successors.set(i, clone);
-                    if (successor == block.jsrSuccessor) {
-                        block.jsrSuccessor = clone;
-                    }
-                    if (successor == block.retSuccessor) {
-                        block.retSuccessor = clone;
-                    }
-                }
-            }
-        }
-        for (Block successor : block.successors) {
-            if (!jsrVisited.contains(successor)) {
-                createJsrAlternatives(successor);
-            }
-        }
-    }
-
-    private HashMap<RiExceptionHandler, ExceptionBlock> exceptionDispatch = new HashMap<>();
-
-    private Block makeExceptionDispatch(List<RiExceptionHandler> handlers, int index, int bci) {
-        RiExceptionHandler handler = handlers.get(index);
-        if (handler.isCatchAll()) {
-            return blockMap[handler.handlerBCI()];
-        }
-        ExceptionBlock block = exceptionDispatch.get(handler);
-        if (block == null) {
-            block = new ExceptionBlock();
-            block.startBci = -1;
-            block.endBci = -1;
-            block.deoptBci = bci;
-            block.handler = handler;
-            block.successors.add(blockMap[handler.handlerBCI()]);
-            if (index < handlers.size() - 1) {
-                block.successors.add(makeExceptionDispatch(handlers, index + 1, bci));
-            }
-            exceptionDispatch.put(handler, block);
-        }
-        return block;
-    }
-
-    private void addExceptionEdges() {
-        for (int bci = canTrap.nextSetBit(0); bci >= 0; bci = canTrap.nextSetBit(bci + 1)) {
-            Block block = blockMap[bci];
-
-            ArrayList<RiExceptionHandler> handlers = null;
-            for (RiExceptionHandler h : this.exceptionHandlers) {
-                if (h.startBCI() <= bci && bci < h.endBCI()) {
-                    if (handlers == null) {
-                        handlers = new ArrayList<>();
-                    }
-                    handlers.add(h);
-                    if (h.isCatchAll()) {
-                        break;
-                    }
-                }
-            }
-            if (handlers != null) {
-                Block dispatch = makeExceptionDispatch(handlers, 0, bci);
-                block.successors.add(dispatch);
-            }
-        }
-    }
-
-    private void computeBlockOrder() {
-        long loop = computeBlockOrder(blockMap[0]);
-
-        if (loop != 0) {
-            // There is a path from a loop end to the method entry that does not pass the loop header.
-            // Therefore, the loop is non reducible (has more than one entry).
-            // We don't want to compile such methods because the IR only supports structured loops.
-            throw new CiBailout("Non-reducible loop");
-        }
-
-        // Convert postorder to the desired reverse postorder.
-        Collections.reverse(blocks);
-    }
-
-    /**
-     * The next available loop number.
-     */
-    private int nextLoop;
-
-    /**
-     * Mark the block as a loop header, using the next available loop number.
-     * Also checks for corner cases that we don't want to compile.
-     */
-    private void makeLoopHeader(Block block) {
-        if (!block.isLoopHeader) {
-            block.isLoopHeader = true;
-
-            if (block.isExceptionEntry) {
-                // Loops that are implicitly formed by an exception handler lead to all sorts of corner cases.
-                // Don't compile such methods for now, until we see a concrete case that allows checking for correctness.
-                throw new CiBailout("Loop formed by an exception handler");
-            }
-            if (nextLoop >= Long.SIZE) {
-                // This restriction can be removed by using a fall-back to a BitSet in case we have more than 64 loops
-                // Don't compile such methods for now, until we see a concrete case that allows checking for correctness.
-                throw new CiBailout("Too many loops in method");
-            }
-
-            assert block.loops == 0;
-            block.loops = (long) 1 << (long) nextLoop;
-            nextLoop++;
-        }
-        assert Long.bitCount(block.loops) == 1;
-    }
-
-    /**
-     * Depth-first traversal of the control flow graph. The flag {@linkplain Block#visited} is used to
-     * visit every block only once. The flag {@linkplain Block#active} is used to detect cycles (backward
-     * edges).
-     */
-    private long computeBlockOrder(Block block) {
-        if (block.visited) {
-            if (block.active) {
-                // Reached block via backward branch.
-                makeLoopHeader(block);
-            }
-            // Return cached loop information for this block.
-            return block.loops;
-        }
-
-        block.visited = true;
-        block.active = true;
-
-        int loops = 0;
-        for (Block successor : block.successors) {
-            // Recursively process successors.
-            loops |= computeBlockOrder(successor);
-        }
-
-        if (block.isLoopHeader) {
-            assert Long.bitCount(block.loops) == 1;
-            loops &= ~block.loops;
-        }
-
-        block.loops = loops;
-        block.active = false;
-        blocks.add(block);
-
-        return loops;
-    }
-
-
-    private void computeLiveness() {
-        for (Block block : blocks) {
-            computeLocalLiveness(block);
-        }
-
-        boolean changed;
-        int iteration = 0;
-        do {
-            Debug.log("Iteration %d", iteration);
-            changed = false;
-            for (int i = blocks.size() - 1; i >= 0; i--) {
-                Block block = blocks.get(i);
-                Debug.log("  start B%d  [%d, %d]  in: %s  out: %s  gen: %s  kill: %s", block.blockID, block.startBci, block.endBci, block.localsLiveIn, block.localsLiveOut, block.localsLiveGen, block.localsLiveKill);
-
-                boolean blockChanged = (iteration == 0);
-                for (Block sux : block.successors) {
-                    Debug.log("    Successor B%d: %s", sux.blockID, sux.localsLiveIn);
-                    blockChanged = block.localsLiveOut.setUnionWithResult(sux.localsLiveIn) || blockChanged;
-                }
-
-                if (blockChanged) {
-                    block.localsLiveIn.setFrom(block.localsLiveOut);
-                    block.localsLiveIn.setDifference(block.localsLiveKill);
-                    block.localsLiveIn.setUnion(block.localsLiveGen);
-
-                    for (Block sux : block.successors) {
-                        if (sux instanceof ExceptionBlock) {
-                            // Exception handler blocks can be reached from anywhere within the block jumping to them,
-                            // so we conservatively assume local variables require by the exception handler are live both
-                            // at the beginning and end of the block.
-                            blockChanged = block.localsLiveIn.setUnionWithResult(sux.localsLiveIn) || blockChanged;
-                        }
-                    }
-                    Debug.log("  end   B%d  [%d, %d]  in: %s  out: %s  gen: %s  kill: %s", block.blockID, block.startBci, block.endBci, block.localsLiveIn, block.localsLiveOut, block.localsLiveGen, block.localsLiveKill);
-                }
-                changed |= blockChanged;
-            }
-            iteration++;
-        } while (changed);
-    }
-
-    private void computeLocalLiveness(Block block) {
-        block.localsLiveIn = new BitMap(method.maxLocals());
-        block.localsLiveOut = new BitMap(method.maxLocals());
-        block.localsLiveGen = new BitMap(method.maxLocals());
-        block.localsLiveKill = new BitMap(method.maxLocals());
-
-        if (block.startBci < 0 || block.endBci < 0) {
-            return;
-        }
-
-        stream.setBCI(block.startBci);
-        while (stream.currentBCI() <= block.endBci) {
-            switch (stream.currentBC()) {
-                case RETURN:
-                    if (method.isConstructor() && method.holder().superType() == null) {
-                        // return from Object.init implicitly registers a finalizer
-                        // for the receiver if needed, so keep it alive.
-                        loadOne(block, 0);
-                    }
-                    break;
-
-                case LLOAD:
-                case DLOAD:
-                    loadTwo(block, stream.readLocalIndex());
-                    break;
-                case LLOAD_0:
-                case DLOAD_0:
-                    loadTwo(block, 0);
-                    break;
-                case LLOAD_1:
-                case DLOAD_1:
-                    loadTwo(block, 1);
-                    break;
-                case LLOAD_2:
-                case DLOAD_2:
-                    loadTwo(block, 2);
-                    break;
-                case LLOAD_3:
-                case DLOAD_3:
-                    loadTwo(block, 3);
-                    break;
-                case ILOAD:
-                case IINC:
-                case FLOAD:
-                case ALOAD:
-                case RET:
-                    loadOne(block, stream.readLocalIndex());
-                    break;
-                case ILOAD_0:
-                case FLOAD_0:
-                case ALOAD_0:
-                    loadOne(block, 0);
-                    break;
-                case ILOAD_1:
-                case FLOAD_1:
-                case ALOAD_1:
-                    loadOne(block, 1);
-                    break;
-                case ILOAD_2:
-                case FLOAD_2:
-                case ALOAD_2:
-                    loadOne(block, 2);
-                    break;
-                case ILOAD_3:
-                case FLOAD_3:
-                case ALOAD_3:
-                    loadOne(block, 3);
-                    break;
-
-                case LSTORE:
-                case DSTORE:
-                    storeTwo(block, stream.readLocalIndex());
-                    break;
-                case LSTORE_0:
-                case DSTORE_0:
-                    storeTwo(block, 0);
-                    break;
-                case LSTORE_1:
-                case DSTORE_1:
-                    storeTwo(block, 1);
-                    break;
-                case LSTORE_2:
-                case DSTORE_2:
-                    storeTwo(block, 2);
-                    break;
-                case LSTORE_3:
-                case DSTORE_3:
-                    storeTwo(block, 3);
-                    break;
-                case ISTORE:
-                case FSTORE:
-                case ASTORE:
-                    storeOne(block, stream.readLocalIndex());
-                    break;
-                case ISTORE_0:
-                case FSTORE_0:
-                case ASTORE_0:
-                    storeOne(block, 0);
-                    break;
-                case ISTORE_1:
-                case FSTORE_1:
-                case ASTORE_1:
-                    storeOne(block, 1);
-                    break;
-                case ISTORE_2:
-                case FSTORE_2:
-                case ASTORE_2:
-                    storeOne(block, 2);
-                    break;
-                case ISTORE_3:
-                case FSTORE_3:
-                case ASTORE_3:
-                    storeOne(block, 3);
-                    break;
-            }
-            stream.next();
-        }
-    }
-
-    private static void loadTwo(Block block, int local) {
-        loadOne(block, local);
-        loadOne(block, local + 1);
-    }
-
-    private static void loadOne(Block block, int local) {
-        if (!block.localsLiveKill.get(local)) {
-            block.localsLiveGen.set(local);
-        }
-    }
-
-    private static void storeTwo(Block block, int local) {
-        storeOne(block, local);
-        storeOne(block, local + 1);
-    }
-
-    private static void storeOne(Block block, int local) {
-        if (!block.localsLiveGen.get(local)) {
-            block.localsLiveKill.set(local);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,548 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java;
-
-import static com.oracle.graal.nodes.ValueUtil.*;
-import static java.lang.reflect.Modifier.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.Verbosity;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.PhiNode.PhiType;
-import com.oracle.graal.nodes.type.*;
-
-public class FrameStateBuilder {
-    private final RiResolvedMethod method;
-    private final StructuredGraph graph;
-
-    private final ValueNode[] locals;
-    private final ValueNode[] stack;
-    private int stackSize;
-    private boolean rethrowException;
-
-    public FrameStateBuilder(RiResolvedMethod method, StructuredGraph graph, boolean eagerResolve) {
-        assert graph != null;
-        this.method = method;
-        this.graph = graph;
-        this.locals = new ValueNode[method.maxLocals()];
-        // we always need at least one stack slot (for exceptions)
-        this.stack = new ValueNode[Math.max(1, method.maxStackSize())];
-
-        int javaIndex = 0;
-        int index = 0;
-        if (!isStatic(method.accessFlags())) {
-            // add the receiver
-            LocalNode local = graph.unique(new LocalNode(javaIndex, StampFactory.declaredNonNull(method.holder())));
-            storeLocal(javaIndex, local);
-            javaIndex = 1;
-            index = 1;
-        }
-        RiSignature sig = method.signature();
-        int max = sig.argumentCount(false);
-        RiResolvedType accessingClass = method.holder();
-        for (int i = 0; i < max; i++) {
-            RiType type = sig.argumentTypeAt(i, accessingClass);
-            if (eagerResolve) {
-                type = type.resolve(accessingClass);
-            }
-            CiKind kind = type.kind(false).stackKind();
-            Stamp stamp;
-            if (kind == CiKind.Object && type instanceof RiResolvedType) {
-                RiResolvedType resolvedType = (RiResolvedType) type;
-                stamp = StampFactory.declared(resolvedType);
-            } else {
-                stamp = StampFactory.forKind(kind);
-            }
-            LocalNode local = graph.unique(new LocalNode(index, stamp));
-            storeLocal(javaIndex, local);
-            javaIndex += stackSlots(kind);
-            index++;
-        }
-    }
-
-    private FrameStateBuilder(RiResolvedMethod method, StructuredGraph graph, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException) {
-        assert locals.length == method.maxLocals();
-        assert stack.length == Math.max(1, method.maxStackSize());
-
-        this.method = method;
-        this.graph = graph;
-        this.locals = locals;
-        this.stack = stack;
-        this.stackSize = stackSize;
-        this.rethrowException = rethrowException;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("[locals: [");
-        for (int i = 0; i < locals.length; i++) {
-            sb.append(i == 0 ? "" : ",").append(locals[i] == null ? "_" : locals[i].toString(Verbosity.Id));
-        }
-        sb.append("] stack: [");
-        for (int i = 0; i < stackSize; i++) {
-            sb.append(i == 0 ? "" : ",").append(stack[i] == null ? "_" : stack[i].toString(Verbosity.Id));
-        }
-        sb.append("]");
-        if (rethrowException) {
-            sb.append(" rethrowException");
-        }
-        sb.append("]");
-        return sb.toString();
-    }
-
-    public FrameState create(int bci) {
-        return graph.add(new FrameState(method, bci, locals, stack, stackSize, rethrowException, false));
-    }
-
-    public FrameState duplicateWithoutStack(int bci) {
-        return graph.add(new FrameState(method, bci, locals, new ValueNode[0], 0, false, false));
-    }
-
-
-    public FrameStateBuilder copy() {
-        return new FrameStateBuilder(method, graph, Arrays.copyOf(locals, locals.length), Arrays.copyOf(stack, stack.length), stackSize, rethrowException);
-    }
-
-    public FrameStateBuilder copyWithException(ValueNode exceptionObject) {
-        ValueNode[] newStack = new ValueNode[stack.length];
-        newStack[0] = exceptionObject;
-        return new FrameStateBuilder(method, graph, Arrays.copyOf(locals, locals.length), newStack, 1, true);
-    }
-
-
-    public boolean isCompatibleWith(FrameStateBuilder other) {
-        assert method == other.method && graph == other.graph && localsSize() == other.localsSize() : "Can only compare frame states of the same method";
-
-        if (stackSize() != other.stackSize()) {
-            return false;
-        }
-        for (int i = 0; i < stackSize(); i++) {
-            ValueNode x = stackAt(i);
-            ValueNode y = other.stackAt(i);
-            if (x != y && ValueUtil.typeMismatch(x, y)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public void merge(MergeNode block, FrameStateBuilder other) {
-        assert isCompatibleWith(other);
-
-        for (int i = 0; i < localsSize(); i++) {
-            storeLocal(i, merge(localAt(i), other.localAt(i), block));
-        }
-        for (int i = 0; i < stackSize(); i++) {
-            storeStack(i, merge(stackAt(i), other.stackAt(i), block));
-        }
-    }
-
-    private ValueNode merge(ValueNode currentValue, ValueNode otherValue, MergeNode block) {
-        if (currentValue == null) {
-            return null;
-
-        } else if (block.isPhiAtMerge(currentValue)) {
-            if (otherValue == null || currentValue.kind() != otherValue.kind()) {
-                deletePhi(currentValue);
-                return null;
-            }
-            ((PhiNode) currentValue).addInput(otherValue);
-            return currentValue;
-
-        } else if (currentValue != otherValue) {
-            assert !(block instanceof LoopBeginNode) : "Phi functions for loop headers are create eagerly for all locals and stack slots";
-            if (otherValue == null || currentValue.kind() != otherValue.kind()) {
-                return null;
-            }
-
-            PhiNode phi = graph.unique(new PhiNode(currentValue.kind(), block, PhiType.Value));
-            for (int i = 0; i < block.phiPredecessorCount(); i++) {
-                phi.addInput(currentValue);
-            }
-            phi.addInput(otherValue);
-            assert phi.valueCount() == block.phiPredecessorCount() + 1 : "valueCount=" + phi.valueCount() + " predSize= " + block.phiPredecessorCount();
-            return phi;
-
-        } else {
-            return currentValue;
-        }
-    }
-
-    private void deletePhi(Node phi) {
-        if (phi.isDeleted()) {
-            return;
-        }
-        // Collect all phi functions that use this phi so that we can delete them recursively (after we delete ourselfs to avoid circles).
-        List<Node> phiUsages = phi.usages().filter(NodePredicates.isA(PhiNode.class)).snapshot();
-
-        // Remove the phi function from all FrameStates where it is used and then delete it.
-        assert phi.usages().filter(NodePredicates.isNotA(FrameState.class)).filter(NodePredicates.isNotA(PhiNode.class)).isEmpty() : "phi function that gets deletes must only be used in frame states";
-        phi.replaceAtUsages(null);
-        phi.safeDelete();
-
-        for (Node phiUsage : phiUsages) {
-            deletePhi(phiUsage);
-        }
-    }
-
-    public void insertLoopPhis(LoopBeginNode loopBegin) {
-        for (int i = 0; i < localsSize(); i++) {
-            storeLocal(i, createLoopPhi(loopBegin, localAt(i)));
-        }
-        for (int i = 0; i < stackSize(); i++) {
-            storeStack(i, createLoopPhi(loopBegin, stackAt(i)));
-        }
-    }
-
-    private PhiNode createLoopPhi(MergeNode block, ValueNode value) {
-        if (value == null) {
-            return null;
-        }
-        assert !block.isPhiAtMerge(value) : "phi function for this block already created";
-
-        PhiNode phi = graph.unique(new PhiNode(value.kind(), block, PhiType.Value));
-        phi.addInput(value);
-        return phi;
-    }
-
-    public void cleanupDeletedPhis() {
-        for (int i = 0; i < localsSize(); i++) {
-            if (localAt(i) != null && localAt(i).isDeleted()) {
-                assert localAt(i) instanceof PhiNode : "Only phi functions can be deleted during parsing";
-                storeLocal(i, null);
-            }
-        }
-    }
-
-    public void clearNonLiveLocals(BitMap liveness) {
-        if (liveness == null) {
-            return;
-        }
-        assert liveness.size() == locals.length;
-        for (int i = 0; i < locals.length; i++) {
-            if (!liveness.get(i)) {
-                locals[i] = null;
-            }
-        }
-    }
-
-    public boolean rethrowException() {
-        return rethrowException;
-    }
-
-    public void setRethrowException(boolean b) {
-        rethrowException = b;
-    }
-
-
-    /**
-     * Returns the size of the local variables.
-     *
-     * @return the size of the local variables
-     */
-    public int localsSize() {
-        return locals.length;
-    }
-
-    /**
-     * Gets the current size (height) of the stack.
-     */
-    public int stackSize() {
-        return stackSize;
-    }
-
-    /**
-     * Gets the value in the local variables at the specified index, without any sanity checking.
-     *
-     * @param i the index into the locals
-     * @return the instruction that produced the value for the specified local
-     */
-    protected final ValueNode localAt(int i) {
-        return locals[i];
-    }
-
-    /**
-     * Get the value on the stack at the specified stack index.
-     *
-     * @param i the index into the stack, with {@code 0} being the bottom of the stack
-     * @return the instruction at the specified position in the stack
-     */
-    protected final ValueNode stackAt(int i) {
-        return stack[i];
-    }
-
-    /**
-     * Loads the local variable at the specified index, checking that the returned value is non-null
-     * and that two-stack values are properly handled.
-     *
-     * @param i the index of the local variable to load
-     * @return the instruction that produced the specified local
-     */
-    public ValueNode loadLocal(int i) {
-        ValueNode x = locals[i];
-        assert !x.isDeleted();
-        assert !isTwoSlot(x.kind()) || locals[i + 1] == null;
-        assert i == 0 || locals[i - 1] == null || !isTwoSlot(locals[i - 1].kind());
-        return x;
-    }
-
-    /**
-     * Stores a given local variable at the specified index. If the value is a {@linkplain CiKind#isDoubleWord() double word},
-     * then the next local variable index is also overwritten.
-     *
-     * @param i the index at which to store
-     * @param x the instruction which produces the value for the local
-     */
-    public void storeLocal(int i, ValueNode x) {
-        assert x == null || x.kind() != CiKind.Void && x.kind() != CiKind.Illegal : "unexpected value: " + x;
-        locals[i] = x;
-        if (x != null && isTwoSlot(x.kind())) {
-            // if this is a double word, then kill i+1
-            locals[i + 1] = null;
-        }
-        if (x != null && i > 0) {
-            ValueNode p = locals[i - 1];
-            if (p != null && isTwoSlot(p.kind())) {
-                // if there was a double word at i - 1, then kill it
-                locals[i - 1] = null;
-            }
-        }
-    }
-
-    private void storeStack(int i, ValueNode x) {
-        assert x == null || stack[i] == null || x.kind() == stack[i].kind() : "Method does not handle changes from one-slot to two-slot values";
-        stack[i] = x;
-    }
-
-    /**
-     * Pushes an instruction onto the stack with the expected type.
-     * @param kind the type expected for this instruction
-     * @param x the instruction to push onto the stack
-     */
-    public void push(CiKind kind, ValueNode x) {
-        assert !x.isDeleted() && x.kind() != CiKind.Void && x.kind() != CiKind.Illegal;
-        xpush(assertKind(kind, x));
-        if (isTwoSlot(kind)) {
-            xpush(null);
-        }
-    }
-
-    /**
-     * Pushes a value onto the stack without checking the type.
-     * @param x the instruction to push onto the stack
-     */
-    public void xpush(ValueNode x) {
-        assert x == null || (!x.isDeleted() && x.kind() != CiKind.Void && x.kind() != CiKind.Illegal);
-        stack[stackSize++] = x;
-    }
-
-    /**
-     * Pushes a value onto the stack and checks that it is an int.
-     * @param x the instruction to push onto the stack
-     */
-    public void ipush(ValueNode x) {
-        xpush(assertInt(x));
-    }
-
-    /**
-     * Pushes a value onto the stack and checks that it is a float.
-     * @param x the instruction to push onto the stack
-     */
-    public void fpush(ValueNode x) {
-        xpush(assertFloat(x));
-    }
-
-    /**
-     * Pushes a value onto the stack and checks that it is an object.
-     * @param x the instruction to push onto the stack
-     */
-    public void apush(ValueNode x) {
-        xpush(assertObject(x));
-    }
-
-    /**
-     * Pushes a value onto the stack and checks that it is a JSR return address.
-     * @param x the instruction to push onto the stack
-     */
-    public void jpush(ValueNode x) {
-        xpush(assertJsr(x));
-    }
-
-    /**
-     * Pushes a value onto the stack and checks that it is a long.
-     *
-     * @param x the instruction to push onto the stack
-     */
-    public void lpush(ValueNode x) {
-        xpush(assertLong(x));
-        xpush(null);
-    }
-
-    /**
-     * Pushes a value onto the stack and checks that it is a double.
-     * @param x the instruction to push onto the stack
-     */
-    public void dpush(ValueNode x) {
-        xpush(assertDouble(x));
-        xpush(null);
-    }
-
-    public void pushReturn(CiKind kind, ValueNode x) {
-        if (kind != CiKind.Void) {
-            push(kind.stackKind(), x);
-        }
-    }
-
-    /**
-     * Pops an instruction off the stack with the expected type.
-     * @param kind the expected type
-     * @return the instruction on the top of the stack
-     */
-    public ValueNode pop(CiKind kind) {
-        assert kind != CiKind.Void;
-        if (isTwoSlot(kind)) {
-            xpop();
-        }
-        return assertKind(kind, xpop());
-    }
-
-    /**
-     * Pops a value off of the stack without checking the type.
-     * @return x the instruction popped off the stack
-     */
-    public ValueNode xpop() {
-        ValueNode result = stack[--stackSize];
-        assert result == null || !result.isDeleted();
-        return result;
-    }
-
-    /**
-     * Pops a value off of the stack and checks that it is an int.
-     * @return x the instruction popped off the stack
-     */
-    public ValueNode ipop() {
-        return assertInt(xpop());
-    }
-
-    /**
-     * Pops a value off of the stack and checks that it is a float.
-     * @return x the instruction popped off the stack
-     */
-    public ValueNode fpop() {
-        return assertFloat(xpop());
-    }
-
-    /**
-     * Pops a value off of the stack and checks that it is an object.
-     * @return x the instruction popped off the stack
-     */
-    public ValueNode apop() {
-        return assertObject(xpop());
-    }
-
-    /**
-     * Pops a value off of the stack and checks that it is a JSR return address.
-     * @return x the instruction popped off the stack
-     */
-    public ValueNode jpop() {
-        return assertJsr(xpop());
-    }
-
-    /**
-     * Pops a value off of the stack and checks that it is a long.
-     * @return x the instruction popped off the stack
-     */
-    public ValueNode lpop() {
-        assertHigh(xpop());
-        return assertLong(xpop());
-    }
-
-    /**
-     * Pops a value off of the stack and checks that it is a double.
-     * @return x the instruction popped off the stack
-     */
-    public ValueNode dpop() {
-        assertHigh(xpop());
-        return assertDouble(xpop());
-    }
-
-    /**
-     * Pop the specified number of slots off of this stack and return them as an array of instructions.
-     * @param size the number of arguments off of the stack
-     * @return an array containing the arguments off of the stack
-     */
-    public ValueNode[] popArguments(int slotSize, int argSize) {
-        int base = stackSize - slotSize;
-        ValueNode[] r = new ValueNode[argSize];
-        int argIndex = 0;
-        int stackindex = 0;
-        while (stackindex < slotSize) {
-            ValueNode element = stack[base + stackindex];
-            assert element != null;
-            r[argIndex++] = element;
-            stackindex += stackSlots(element.kind());
-        }
-        stackSize = base;
-        return r;
-    }
-
-    /**
-     * Peeks an element from the operand stack.
-     * @param argumentNumber The number of the argument, relative from the top of the stack (0 = top).
-     *        Long and double arguments only count as one argument, i.e., null-slots are ignored.
-     * @return The peeked argument.
-     */
-    public ValueNode peek(int argumentNumber) {
-        int idx = stackSize() - 1;
-        for (int i = 0; i < argumentNumber; i++) {
-            if (stackAt(idx) == null) {
-                idx--;
-                assert isTwoSlot(stackAt(idx).kind());
-            }
-            idx--;
-        }
-        return stackAt(idx);
-    }
-
-    /**
-     * Clears all values on this stack.
-     */
-    public void clearStack() {
-        stackSize = 0;
-    }
-
-    public static int stackSlots(CiKind kind) {
-        return isTwoSlot(kind) ? 2 : 1;
-    }
-
-    public static boolean isTwoSlot(CiKind kind) {
-        assert kind != CiKind.Void && kind != CiKind.Illegal;
-        return kind == CiKind.Long || kind == CiKind.Double;
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-
-public class GraphBuilderConfiguration {
-
-    public static enum ResolvePolicy {
-        Default, EagerForSnippets, Eager,
-    }
-
-    private final boolean useBranchPrediction;
-    private final ResolvePolicy resolving;
-    private final PhasePlan plan;
-    private RiResolvedType[] skippedExceptionTypes;
-
-    public GraphBuilderConfiguration(boolean useBranchPrediction, ResolvePolicy resolving, PhasePlan plan) {
-        this.useBranchPrediction = useBranchPrediction;
-        this.resolving = resolving;
-        this.plan = plan;
-    }
-
-    public boolean useBranchPrediction() {
-        return useBranchPrediction;
-    }
-
-
-    public void setSkippedExceptionTypes(RiResolvedType[] skippedExceptionTypes) {
-        this.skippedExceptionTypes = skippedExceptionTypes;
-    }
-
-    public RiResolvedType[] getSkippedExceptionTypes() {
-        return skippedExceptionTypes;
-    }
-
-    public boolean eagerResolvingForSnippets() {
-        return (resolving == ResolvePolicy.EagerForSnippets || resolving == ResolvePolicy.Eager);
-    }
-
-    public boolean eagerResolving() {
-        return (resolving == ResolvePolicy.Eager);
-    }
-
-    public PhasePlan plan() {
-        return plan;
-    }
-
-    public static GraphBuilderConfiguration getDefault() {
-        return getDefault(null);
-    }
-
-    public static GraphBuilderConfiguration getDefault(PhasePlan plan) {
-        return new GraphBuilderConfiguration(GraalOptions.UseBranchPrediction, ResolvePolicy.Default, plan);
-    }
-
-    public static GraphBuilderConfiguration getSnippetDefault() {
-        return getSnippetDefault(null);
-    }
-
-    public static GraphBuilderConfiguration getSnippetDefault(PhasePlan plan) {
-        return new GraphBuilderConfiguration(false, ResolvePolicy.EagerForSnippets, plan);
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1766 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java;
-
-import static com.oracle.graal.java.bytecode.Bytecodes.*;
-import static java.lang.reflect.Modifier.*;
-
-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.Representation;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.java.BciBlockMapping.Block;
-import com.oracle.graal.java.BciBlockMapping.ExceptionBlock;
-import com.oracle.graal.java.bytecode.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.oracle.graal.nodes.PhiNode.PhiType;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code GraphBuilder} class parses the bytecode of a method and builds the IR graph.
- */
-public final class GraphBuilderPhase extends Phase {
-
-    /**
-     * The minimum value to which {@link GraalOptions#TraceBytecodeParserLevel} must be set to trace
-     * the bytecode instructions as they are parsed.
-     */
-    public static final int TRACELEVEL_INSTRUCTIONS = 1;
-
-    /**
-     * The minimum value to which {@link GraalOptions#TraceBytecodeParserLevel} must be set to trace
-     * the frame state before each bytecode instruction as it is parsed.
-     */
-    public static final int TRACELEVEL_STATE = 2;
-
-    private StructuredGraph currentGraph;
-
-    private final RiRuntime runtime;
-    private RiConstantPool constantPool;
-    private RiExceptionHandler[] exceptionHandlers;
-    private RiResolvedMethod method;
-    private RiProfilingInfo profilingInfo;
-
-    private BytecodeStream stream;           // the bytecode stream
-    private final LogStream log;
-
-    private FrameStateBuilder frameState;          // the current execution state
-    private Block currentBlock;
-
-    private ValueNode methodSynchronizedObject;
-    private ExceptionBlock unwindBlock;
-    private Block returnBlock;
-
-    private FixedWithNextNode lastInstr;                 // the last instruction added
-
-    private BitSet canTrapBitSet;
-
-    public static final Map<RiMethod, StructuredGraph> cachedGraphs = new WeakHashMap<>();
-
-    private final GraphBuilderConfiguration config;
-
-
-    /**
-     * Node that marks the begin of block during bytecode parsing.  When a block is identified the first
-     * time as a jump target, the placeholder is created and used as the successor for the jump.  When the
-     * block is seen the second time, a MergeNode is created to correctly merge the now two different
-     * predecessor states.
-     */
-    private static class BlockPlaceholderNode extends FixedWithNextNode implements Node.IterableNodeType {
-        public BlockPlaceholderNode() {
-            super(StampFactory.illegal());
-        }
-    }
-
-
-    public GraphBuilderPhase(RiRuntime runtime) {
-        this(runtime, GraphBuilderConfiguration.getDefault());
-    }
-
-    public GraphBuilderPhase(RiRuntime runtime, GraphBuilderConfiguration config) {
-        this.config = config;
-        this.runtime = runtime;
-        this.log = GraalOptions.TraceBytecodeParserLevel > 0 ? new LogStream(TTY.out()) : null;
-    }
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        method = graph.method();
-        profilingInfo = method.profilingInfo();
-        assert method.code() != null : "method must contain bytecodes: " + method;
-        this.stream = new BytecodeStream(method.code());
-        this.constantPool = method.getConstantPool();
-        unwindBlock = null;
-        returnBlock = null;
-        methodSynchronizedObject = null;
-        exceptionHandlers = null;
-        this.currentGraph = graph;
-        this.frameState = new FrameStateBuilder(method, graph, config.eagerResolving());
-        build();
-    }
-
-    @Override
-    protected String getDetailedName() {
-        return getName() + " " + CiUtil.format("%H.%n(%p):%r", method);
-    }
-
-    private BciBlockMapping createBlockMap() {
-        BciBlockMapping map = new BciBlockMapping(method, config.useBranchPrediction());
-        map.build();
-        Debug.dump(map, CiUtil.format("After block building %f %R %H.%n(%P)", method));
-
-        return map;
-    }
-
-    private void build() {
-        if (log != null) {
-            log.println();
-            log.println("Compiling " + method);
-        }
-
-        if (GraalOptions.PrintProfilingInformation) {
-            method.dumpProfile();
-        }
-
-        // compute the block map, setup exception handlers and get the entrypoint(s)
-        BciBlockMapping blockMap = createBlockMap();
-        this.canTrapBitSet = blockMap.canTrap;
-
-        exceptionHandlers = blockMap.exceptionHandlers();
-
-        lastInstr = currentGraph.start();
-        if (isSynchronized(method.accessFlags())) {
-            // add a monitor enter to the start block
-            currentGraph.start().setStateAfter(frameState.create(FrameState.BEFORE_BCI));
-            methodSynchronizedObject = synchronizedObject(frameState, method);
-            lastInstr = genMonitorEnter(methodSynchronizedObject);
-        }
-        frameState.clearNonLiveLocals(blockMap.startBlock.localsLiveIn);
-
-        // finish the start block
-        ((AbstractStateSplit) lastInstr).setStateAfter(frameState.create(0));
-        if (blockMap.startBlock.isLoopHeader) {
-            appendGoto(createTarget(blockMap.startBlock, frameState));
-        } else {
-            blockMap.startBlock.firstInstruction = lastInstr;
-            blockMap.startBlock.entryState = frameState;
-        }
-
-        for (Block block : blockMap.blocks) {
-            processBlock(block);
-        }
-        processBlock(returnBlock);
-        processBlock(unwindBlock);
-
-        Debug.dump(currentGraph, "After bytecode parsing");
-
-        connectLoopEndToBegin();
-
-        // remove Placeholders (except for loop exits)
-        for (BlockPlaceholderNode n : currentGraph.getNodes(BlockPlaceholderNode.class)) {
-            currentGraph.removeFixed(n);
-        }
-
-        // remove dead FrameStates
-        for (Node n : currentGraph.getNodes(FrameState.class)) {
-            if (n.usages().size() == 0 && n.predecessor() == null) {
-                n.safeDelete();
-            }
-        }
-
-        if (GraalOptions.CacheGraphs && !currentGraph.hasNode(DeoptimizeNode.class)) {
-            cachedGraphs.put(method, currentGraph.copy());
-        }
-    }
-
-    private Block unwindBlock(int bci) {
-        if (unwindBlock == null) {
-            unwindBlock = new ExceptionBlock();
-            unwindBlock.startBci = -1;
-            unwindBlock.endBci = -1;
-            unwindBlock.deoptBci = bci;
-            unwindBlock.blockID = Integer.MAX_VALUE;
-        }
-        return unwindBlock;
-    }
-
-    private Block returnBlock(int bci) {
-        if (returnBlock == null) {
-            returnBlock = new Block();
-            returnBlock.startBci = bci;
-            returnBlock.endBci = bci;
-            returnBlock.blockID = Integer.MAX_VALUE;
-        }
-        return returnBlock;
-    }
-
-    public BytecodeStream stream() {
-        return stream;
-    }
-
-    public int bci() {
-        return stream.currentBCI();
-    }
-
-    private void loadLocal(int index, CiKind kind) {
-        frameState.push(kind, frameState.loadLocal(index));
-    }
-
-    private void storeLocal(CiKind kind, int index) {
-        frameState.storeLocal(index, frameState.pop(kind));
-    }
-
-    public static boolean covers(RiExceptionHandler handler, int bci) {
-        return handler.startBCI() <= bci && bci < handler.endBCI();
-    }
-
-    public static boolean isCatchAll(RiExceptionHandler handler) {
-        return handler.catchTypeCPI() == 0;
-    }
-
-    private BeginNode handleException(ValueNode exceptionObject, int bci) {
-        assert bci == FrameState.BEFORE_BCI || bci == bci() : "invalid bci";
-
-        if (GraalOptions.UseExceptionProbability) {
-            // be conservative if information was not recorded (could result in endless recompiles otherwise)
-            if (bci != FrameState.BEFORE_BCI && exceptionObject == null && profilingInfo.getExceptionSeen(bci) == RiExceptionSeen.FALSE) {
-                return null;
-            } else {
-                Debug.log("Creating exception edges at %d, exception object=%s, exception seen=%s", bci, exceptionObject, profilingInfo.getExceptionSeen(bci));
-            }
-        }
-
-        RiExceptionHandler firstHandler = null;
-        // join with all potential exception handlers
-        if (exceptionHandlers != null) {
-            for (RiExceptionHandler handler : exceptionHandlers) {
-                if (covers(handler, bci)) {
-                    firstHandler = handler;
-                    break;
-                }
-            }
-        }
-
-        Block dispatchBlock = null;
-        if (firstHandler == null) {
-            dispatchBlock = unwindBlock(bci);
-        } else {
-            for (int i = currentBlock.normalSuccessors; i < currentBlock.successors.size(); i++) {
-                Block block = currentBlock.successors.get(i);
-                if (block instanceof ExceptionBlock && ((ExceptionBlock) block).handler == firstHandler) {
-                    dispatchBlock = block;
-                    break;
-                }
-                if (isCatchAll(firstHandler) && block.startBci == firstHandler.handlerBCI()) {
-                    dispatchBlock = block;
-                    break;
-                }
-            }
-        }
-
-        // TODO (thomaswue): Merge BeginNode with ExceptionObject node to get a correct and uniform FrameState.
-        BeginNode p = currentGraph.add(new BeginNode());
-        p.setStateAfter(frameState.duplicateWithoutStack(bci));
-
-        ValueNode currentExceptionObject;
-        ExceptionObjectNode newObj = null;
-        if (exceptionObject == null) {
-            newObj = currentGraph.add(new ExceptionObjectNode());
-            currentExceptionObject = newObj;
-        } else {
-            currentExceptionObject = exceptionObject;
-        }
-        FrameStateBuilder stateWithException = frameState.copyWithException(currentExceptionObject);
-        if (newObj != null) {
-            newObj.setStateAfter(stateWithException.create(bci));
-        }
-        FixedNode target = createTarget(dispatchBlock, stateWithException);
-        if (exceptionObject == null) {
-            ExceptionObjectNode eObj = (ExceptionObjectNode) currentExceptionObject;
-            eObj.setNext(target);
-            p.setNext(eObj);
-        } else {
-            p.setNext(target);
-        }
-        return p;
-    }
-
-    private void genLoadConstant(int cpi, int opcode) {
-        Object con = lookupConstant(cpi, opcode);
-
-        if (con instanceof RiType) {
-            // this is a load of class constant which might be unresolved
-            RiType riType = (RiType) con;
-            if (riType instanceof RiResolvedType) {
-                frameState.push(CiKind.Object, append(ConstantNode.forCiConstant(((RiResolvedType) riType).getEncoding(Representation.JavaClass), runtime, currentGraph)));
-            } else {
-                append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-                frameState.push(CiKind.Object, append(ConstantNode.forObject(null, runtime, currentGraph)));
-            }
-        } else if (con instanceof CiConstant) {
-            CiConstant constant = (CiConstant) con;
-            frameState.push(constant.kind.stackKind(), appendConstant(constant));
-        } else {
-            throw new Error("lookupConstant returned an object of incorrect type");
-        }
-    }
-
-    private void genLoadIndexed(CiKind kind) {
-        emitExplicitExceptions(frameState.peek(1), frameState.peek(0));
-
-        ValueNode index = frameState.ipop();
-        ValueNode array = frameState.apop();
-        ValueNode length = append(currentGraph.add(new ArrayLengthNode(array)));
-        ValueNode v = append(currentGraph.add(new LoadIndexedNode(array, index, length, kind)));
-        frameState.push(kind.stackKind(), v);
-    }
-
-    private void genStoreIndexed(CiKind kind) {
-        emitExplicitExceptions(frameState.peek(2), frameState.peek(1));
-
-        ValueNode value = frameState.pop(kind.stackKind());
-        ValueNode index = frameState.ipop();
-        ValueNode array = frameState.apop();
-        ValueNode length = append(currentGraph.add(new ArrayLengthNode(array)));
-        StoreIndexedNode result = currentGraph.add(new StoreIndexedNode(array, index, length, kind, value));
-        append(result);
-    }
-
-    private void stackOp(int opcode) {
-        switch (opcode) {
-            case POP: {
-                frameState.xpop();
-                break;
-            }
-            case POP2: {
-                frameState.xpop();
-                frameState.xpop();
-                break;
-            }
-            case DUP: {
-                ValueNode w = frameState.xpop();
-                frameState.xpush(w);
-                frameState.xpush(w);
-                break;
-            }
-            case DUP_X1: {
-                ValueNode w1 = frameState.xpop();
-                ValueNode w2 = frameState.xpop();
-                frameState.xpush(w1);
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                break;
-            }
-            case DUP_X2: {
-                ValueNode w1 = frameState.xpop();
-                ValueNode w2 = frameState.xpop();
-                ValueNode w3 = frameState.xpop();
-                frameState.xpush(w1);
-                frameState.xpush(w3);
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                break;
-            }
-            case DUP2: {
-                ValueNode w1 = frameState.xpop();
-                ValueNode w2 = frameState.xpop();
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                break;
-            }
-            case DUP2_X1: {
-                ValueNode w1 = frameState.xpop();
-                ValueNode w2 = frameState.xpop();
-                ValueNode w3 = frameState.xpop();
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                frameState.xpush(w3);
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                break;
-            }
-            case DUP2_X2: {
-                ValueNode w1 = frameState.xpop();
-                ValueNode w2 = frameState.xpop();
-                ValueNode w3 = frameState.xpop();
-                ValueNode w4 = frameState.xpop();
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                frameState.xpush(w4);
-                frameState.xpush(w3);
-                frameState.xpush(w2);
-                frameState.xpush(w1);
-                break;
-            }
-            case SWAP: {
-                ValueNode w1 = frameState.xpop();
-                ValueNode w2 = frameState.xpop();
-                frameState.xpush(w1);
-                frameState.xpush(w2);
-                break;
-            }
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-
-    }
-
-    private void genArithmeticOp(CiKind result, int opcode, boolean canTrap) {
-        ValueNode y = frameState.pop(result);
-        ValueNode x = frameState.pop(result);
-        boolean isStrictFP = isStrict(method.accessFlags());
-        ArithmeticNode v;
-        switch(opcode){
-            case IADD:
-            case LADD: v = new IntegerAddNode(result, x, y); break;
-            case FADD:
-            case DADD: v = new FloatAddNode(result, x, y, isStrictFP); break;
-            case ISUB:
-            case LSUB: v = new IntegerSubNode(result, x, y); break;
-            case FSUB:
-            case DSUB: v = new FloatSubNode(result, x, y, isStrictFP); break;
-            case IMUL:
-            case LMUL: v = new IntegerMulNode(result, x, y); break;
-            case FMUL:
-            case DMUL: v = new FloatMulNode(result, x, y, isStrictFP); break;
-            case IDIV:
-            case LDIV: v = new IntegerDivNode(result, x, y); break;
-            case FDIV:
-            case DDIV: v = new FloatDivNode(result, x, y, isStrictFP); break;
-            case IREM:
-            case LREM: v = new IntegerRemNode(result, x, y); break;
-            case FREM:
-            case DREM: v = new FloatRemNode(result, x, y, isStrictFP); break;
-            default:
-                throw new GraalInternalError("should not reach");
-        }
-        ValueNode result1 = append(currentGraph.unique(v));
-        if (canTrap) {
-            append(currentGraph.add(new ValueAnchorNode(result1)));
-        }
-        frameState.push(result, result1);
-    }
-
-    private void genNegateOp(CiKind kind) {
-        frameState.push(kind, append(currentGraph.unique(new NegateNode(frameState.pop(kind)))));
-    }
-
-    private void genShiftOp(CiKind kind, int opcode) {
-        ValueNode s = frameState.ipop();
-        ValueNode x = frameState.pop(kind);
-        ShiftNode v;
-        switch(opcode){
-            case ISHL:
-            case LSHL: v = new LeftShiftNode(kind, x, s); break;
-            case ISHR:
-            case LSHR: v = new RightShiftNode(kind, x, s); break;
-            case IUSHR:
-            case LUSHR: v = new UnsignedRightShiftNode(kind, x, s); break;
-            default:
-                throw new GraalInternalError("should not reach");
-        }
-        frameState.push(kind, append(currentGraph.unique(v)));
-    }
-
-    private void genLogicOp(CiKind kind, int opcode) {
-        ValueNode y = frameState.pop(kind);
-        ValueNode x = frameState.pop(kind);
-        LogicNode v;
-        switch(opcode){
-            case IAND:
-            case LAND: v = new AndNode(kind, x, y); break;
-            case IOR:
-            case LOR: v = new OrNode(kind, x, y); break;
-            case IXOR:
-            case LXOR: v = new XorNode(kind, x, y); break;
-            default:
-                throw new GraalInternalError("should not reach");
-        }
-        frameState.push(kind, append(currentGraph.unique(v)));
-    }
-
-    private void genCompareOp(CiKind kind, boolean isUnorderedLess) {
-        ValueNode y = frameState.pop(kind);
-        ValueNode x = frameState.pop(kind);
-        frameState.ipush(append(currentGraph.unique(new NormalizeCompareNode(x, y, isUnorderedLess))));
-    }
-
-    private void genConvert(ConvertNode.Op opcode) {
-        ValueNode input = frameState.pop(opcode.from.stackKind());
-        frameState.push(opcode.to.stackKind(), append(currentGraph.unique(new ConvertNode(opcode, input))));
-    }
-
-    private void genIncrement() {
-        int index = stream().readLocalIndex();
-        int delta = stream().readIncrement();
-        ValueNode x = frameState.loadLocal(index);
-        ValueNode y = append(ConstantNode.forInt(delta, currentGraph));
-        frameState.storeLocal(index, append(currentGraph.unique(new IntegerAddNode(CiKind.Int, x, y))));
-    }
-
-    private void genGoto() {
-        double probability = profilingInfo.getBranchTakenProbability(bci());
-        if (probability < 0) {
-            probability = 1;
-        }
-        appendGoto(createTarget(probability, currentBlock.successors.get(0), frameState));
-        assert currentBlock.normalSuccessors == 1;
-    }
-
-    private void ifNode(ValueNode x, Condition cond, ValueNode y) {
-        assert !x.isDeleted() && !y.isDeleted();
-        assert currentBlock.normalSuccessors == 2 : currentBlock.normalSuccessors;
-        Block trueBlock = currentBlock.successors.get(0);
-        Block falseBlock = currentBlock.successors.get(1);
-        if (trueBlock == falseBlock) {
-            appendGoto(createTarget(trueBlock, frameState));
-            return;
-        }
-
-        double probability = profilingInfo.getBranchTakenProbability(bci());
-        if (probability < 0) {
-            assert probability == -1 : "invalid probability";
-            Debug.log("missing probability in %s at bci %d", method, bci());
-            probability = 0.5;
-        }
-
-        CompareNode condition = currentGraph.unique(new CompareNode(x, cond, y));
-        BeginNode trueSuccessor = createBlockTarget(probability, trueBlock, frameState);
-        BeginNode falseSuccessor = createBlockTarget(1 - probability, falseBlock, frameState);
-        append(currentGraph.add(new IfNode(condition, trueSuccessor, falseSuccessor, probability)));
-    }
-
-    private void genIfZero(Condition cond) {
-        ValueNode y = appendConstant(CiConstant.INT_0);
-        ValueNode x = frameState.ipop();
-        ifNode(x, cond, y);
-    }
-
-    private void genIfNull(Condition cond) {
-        ValueNode y = appendConstant(CiConstant.NULL_OBJECT);
-        ValueNode x = frameState.apop();
-        ifNode(x, cond, y);
-    }
-
-    private void genIfSame(CiKind kind, Condition cond) {
-        ValueNode y = frameState.pop(kind);
-        ValueNode x = frameState.pop(kind);
-        assert !x.isDeleted() && !y.isDeleted();
-        ifNode(x, cond, y);
-    }
-
-    private void genThrow(int bci) {
-        ValueNode exception = frameState.apop();
-        FixedGuardNode node = currentGraph.add(new FixedGuardNode(currentGraph.unique(new NullCheckNode(exception, false))));
-        append(node);
-        append(handleException(exception, bci));
-    }
-
-    private RiType lookupType(int cpi, int bytecode) {
-        eagerResolvingForSnippets(cpi, bytecode);
-        RiType result = constantPool.lookupType(cpi, bytecode);
-        assert !config.eagerResolvingForSnippets() || result instanceof RiResolvedType;
-        return result;
-    }
-
-    private RiMethod lookupMethod(int cpi, int opcode) {
-        eagerResolvingForSnippets(cpi, opcode);
-        RiMethod result = constantPool.lookupMethod(cpi, opcode);
-        assert !config.eagerResolvingForSnippets() || ((result instanceof RiResolvedMethod) && ((RiResolvedMethod) result).holder().isInitialized());
-        return result;
-    }
-
-    private RiField lookupField(int cpi, int opcode) {
-        eagerResolvingForSnippets(cpi, opcode);
-        RiField result = constantPool.lookupField(cpi, opcode);
-        assert !config.eagerResolvingForSnippets() || (result instanceof RiResolvedField && ((RiResolvedField) result).holder().isInitialized());
-        return result;
-    }
-
-    private Object lookupConstant(int cpi, int opcode) {
-        eagerResolving(cpi, opcode);
-        Object result = constantPool.lookupConstant(cpi);
-        assert !config.eagerResolving() || !(result instanceof RiType) || (result instanceof RiResolvedType);
-        return result;
-    }
-
-    private void eagerResolving(int cpi, int bytecode) {
-        if (config.eagerResolving()) {
-            constantPool.loadReferencedType(cpi, bytecode);
-        }
-    }
-
-    private void eagerResolvingForSnippets(int cpi, int bytecode) {
-        if (config.eagerResolvingForSnippets()) {
-            constantPool.loadReferencedType(cpi, bytecode);
-        }
-    }
-
-    private static final RiResolvedType[] EMPTY_TYPE_ARRAY = new RiResolvedType[0];
-
-    private RiResolvedType[] getTypeCheckHints(RiResolvedType type, int maxHints) {
-        if (!GraalOptions.UseTypeCheckHints || Util.isFinalClass(type)) {
-            return new RiResolvedType[] {type};
-        } else {
-            RiResolvedType uniqueSubtype = type.uniqueConcreteSubtype();
-            if (uniqueSubtype != null) {
-                return new RiResolvedType[] {uniqueSubtype};
-            } else {
-                RiTypeProfile typeProfile = profilingInfo.getTypeProfile(bci());
-                if (typeProfile != null) {
-                    double notRecordedTypes = typeProfile.getNotRecordedProbability();
-                    RiResolvedType[] types = typeProfile.getTypes();
-
-                    if (notRecordedTypes == 0 && types != null && types.length > 0 && types.length <= maxHints) {
-                        RiResolvedType[] hints = new RiResolvedType[types.length];
-                        int hintCount = 0;
-                        for (RiResolvedType hint : types) {
-                            if (hint.isSubtypeOf(type)) {
-                                hints[hintCount++] = hint;
-                            }
-                        }
-                        return Arrays.copyOf(hints, Math.min(maxHints, hintCount));
-                    }
-                }
-                return EMPTY_TYPE_ARRAY;
-            }
-        }
-    }
-
-    private void genCheckCast() {
-        int cpi = stream().readCPI();
-        RiType type = lookupType(cpi, CHECKCAST);
-        boolean initialized = type instanceof RiResolvedType;
-        if (initialized) {
-            ConstantNode typeInstruction = genTypeOrDeopt(RiType.Representation.ObjectHub, type, true);
-            ValueNode object = frameState.apop();
-            AnchorNode anchor = currentGraph.add(new AnchorNode());
-            append(anchor);
-            CheckCastNode checkCast;
-            RiResolvedType[] hints = getTypeCheckHints((RiResolvedType) type, 2);
-            checkCast = currentGraph.unique(new CheckCastNode(anchor, typeInstruction, (RiResolvedType) type, object, hints, Util.isFinalClass((RiResolvedType) type)));
-            append(currentGraph.add(new ValueAnchorNode(checkCast)));
-            frameState.apush(checkCast);
-        } else {
-            ValueNode object = frameState.apop();
-            append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new CompareNode(object, Condition.EQ, ConstantNode.forObject(null, runtime, currentGraph))))));
-            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
-        }
-    }
-
-    private void genInstanceOf() {
-        int cpi = stream().readCPI();
-        RiType type = lookupType(cpi, INSTANCEOF);
-        ValueNode object = frameState.apop();
-        if (type instanceof RiResolvedType) {
-            RiResolvedType resolvedType = (RiResolvedType) type;
-            ConstantNode hub = appendConstant(resolvedType.getEncoding(RiType.Representation.ObjectHub));
-
-            RiResolvedType[] hints = getTypeCheckHints(resolvedType, 1);
-            InstanceOfNode instanceOfNode = new InstanceOfNode(hub, (RiResolvedType) type, object, hints, Util.isFinalClass(resolvedType), false);
-            frameState.ipush(append(MaterializeNode.create(currentGraph.unique(instanceOfNode), currentGraph)));
-        } else {
-            BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode());
-            DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile));
-            IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new NullCheckNode(object, true)), trueSucc, deopt, 1));
-            append(ifNode);
-            lastInstr = trueSucc;
-            frameState.ipush(appendConstant(CiConstant.INT_0));
-        }
-    }
-
-    void genNewInstance(int cpi) {
-        RiType type = lookupType(cpi, NEW);
-        if (type instanceof RiResolvedType) {
-            NewInstanceNode n = currentGraph.add(new NewInstanceNode((RiResolvedType) type));
-            frameState.apush(append(n));
-        } else {
-            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
-        }
-    }
-
-    /**
-     * Gets the kind of array elements for the array type code that appears
-     * in a {@link Bytecodes#NEWARRAY} bytecode.
-     * @param code the array type code
-     * @return the kind from the array type code
-     */
-    public static CiKind arrayTypeCodeToKind(int code) {
-        // Checkstyle: stop
-        switch (code) {
-            case 4:  return CiKind.Boolean;
-            case 5:  return CiKind.Char;
-            case 6:  return CiKind.Float;
-            case 7:  return CiKind.Double;
-            case 8:  return CiKind.Byte;
-            case 9:  return CiKind.Short;
-            case 10: return CiKind.Int;
-            case 11: return CiKind.Long;
-            default: throw new IllegalArgumentException("unknown array type code: " + code);
-        }
-        // Checkstyle: resume
-    }
-
-    private void genNewTypeArray(int typeCode) {
-        CiKind kind = arrayTypeCodeToKind(typeCode);
-        RiResolvedType elementType = runtime.asRiType(kind);
-        NewTypeArrayNode nta = currentGraph.add(new NewTypeArrayNode(frameState.ipop(), elementType));
-        frameState.apush(append(nta));
-    }
-
-    private void genNewObjectArray(int cpi) {
-        RiType type = lookupType(cpi, ANEWARRAY);
-        ValueNode length = frameState.ipop();
-        if (type instanceof RiResolvedType) {
-            NewArrayNode n = currentGraph.add(new NewObjectArrayNode((RiResolvedType) type, length));
-            frameState.apush(append(n));
-        } else {
-            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
-        }
-
-    }
-
-    private void genNewMultiArray(int cpi) {
-        RiType type = lookupType(cpi, MULTIANEWARRAY);
-        int rank = stream().readUByte(bci() + 3);
-        ValueNode[] dims = new ValueNode[rank];
-        for (int i = rank - 1; i >= 0; i--) {
-            dims[i] = frameState.ipop();
-        }
-        if (type instanceof RiResolvedType) {
-            FixedWithNextNode n = currentGraph.add(new NewMultiArrayNode((RiResolvedType) type, dims));
-            frameState.apush(append(n));
-        } else {
-            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-            frameState.apush(appendConstant(CiConstant.NULL_OBJECT));
-        }
-    }
-
-    private void genGetField(RiField field) {
-        emitExplicitExceptions(frameState.peek(0), null);
-
-        CiKind kind = field.kind(false);
-        ValueNode receiver = frameState.apop();
-        if ((field instanceof RiResolvedField) && ((RiResolvedField) field).holder().isInitialized()) {
-            LoadFieldNode load = currentGraph.add(new LoadFieldNode(receiver, (RiResolvedField) field));
-            appendOptimizedLoadField(kind, load);
-        } else {
-            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-            frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
-        }
-    }
-
-    public static class ExceptionInfo {
-
-        public final FixedWithNextNode exceptionEdge;
-        public final ValueNode exception;
-
-        public ExceptionInfo(FixedWithNextNode exceptionEdge, ValueNode exception) {
-            this.exceptionEdge = exceptionEdge;
-            this.exception = exception;
-        }
-    }
-
-    private ExceptionInfo emitNullCheck(ValueNode receiver) {
-        BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode());
-        BlockPlaceholderNode falseSucc = currentGraph.add(new BlockPlaceholderNode());
-        IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new NullCheckNode(receiver, false)), trueSucc, falseSucc, 1));
-
-        append(ifNode);
-        lastInstr = trueSucc;
-
-        if (GraalOptions.OmitHotExceptionStacktrace) {
-            ValueNode exception = ConstantNode.forObject(new NullPointerException(), runtime, currentGraph);
-            return new ExceptionInfo(falseSucc, exception);
-        } else {
-            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(CiRuntimeCall.CreateNullPointerException));
-            call.setStateAfter(frameState.create(bci()));
-            falseSucc.setNext(call);
-            return new ExceptionInfo(call, call);
-        }
-    }
-
-    private ExceptionInfo emitBoundsCheck(ValueNode index, ValueNode length) {
-        BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode());
-        BlockPlaceholderNode falseSucc = currentGraph.add(new BlockPlaceholderNode());
-        IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new CompareNode(index, Condition.BT, length)), trueSucc, falseSucc, 1));
-
-        append(ifNode);
-        lastInstr = trueSucc;
-
-        if (GraalOptions.OmitHotExceptionStacktrace) {
-            ValueNode exception = ConstantNode.forObject(new ArrayIndexOutOfBoundsException(), runtime, currentGraph);
-            return new ExceptionInfo(falseSucc, exception);
-        } else {
-            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(CiRuntimeCall.CreateOutOfBoundsException, new ValueNode[] {index}));
-            call.setStateAfter(frameState.create(bci()));
-            falseSucc.setNext(call);
-            return new ExceptionInfo(call, call);
-        }
-    }
-
-    private void emitExplicitExceptions(ValueNode receiver, ValueNode outOfBoundsIndex) {
-        assert receiver != null;
-
-        if (canTrapBitSet.get(bci()) && GraalOptions.AllowExplicitExceptionChecks) {
-            ArrayList<ExceptionInfo> exceptions = new ArrayList<>(2);
-            exceptions.add(emitNullCheck(receiver));
-            if (outOfBoundsIndex != null) {
-                ArrayLengthNode length = currentGraph.add(new ArrayLengthNode(receiver));
-                append(length);
-                exceptions.add(emitBoundsCheck(outOfBoundsIndex, length));
-            }
-            final ExceptionInfo exception;
-            if (exceptions.size() == 1) {
-                exception = exceptions.get(0);
-            } else {
-                assert exceptions.size() > 1;
-                MergeNode merge = currentGraph.add(new MergeNode());
-                PhiNode phi = currentGraph.unique(new PhiNode(CiKind.Object, merge, PhiType.Value));
-                for (ExceptionInfo info : exceptions) {
-                    EndNode end = currentGraph.add(new EndNode());
-                    info.exceptionEdge.setNext(end);
-                    merge.addForwardEnd(end);
-                    phi.addInput(info.exception);
-                }
-                merge.setStateAfter(frameState.create(bci()));
-                exception = new ExceptionInfo(merge, phi);
-            }
-
-            FixedNode entry = handleException(exception.exception, bci());
-            if (entry != null) {
-                exception.exceptionEdge.setNext(entry);
-            } else {
-                exception.exceptionEdge.setNext(createTarget(unwindBlock(bci()), frameState.copyWithException(exception.exception)));
-            }
-            Debug.metric("ExplicitExceptions").increment();
-        }
-    }
-
-    private void genPutField(RiField field) {
-        emitExplicitExceptions(frameState.peek(1), null);
-
-        ValueNode value = frameState.pop(field.kind(false).stackKind());
-        ValueNode receiver = frameState.apop();
-        if (field instanceof RiResolvedField && ((RiResolvedField) field).holder().isInitialized()) {
-            StoreFieldNode store = currentGraph.add(new StoreFieldNode(receiver, (RiResolvedField) field, value));
-            appendOptimizedStoreField(store);
-        } else {
-            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-        }
-    }
-
-    private void genGetStatic(RiField field) {
-        RiType holder = field.holder();
-        boolean isInitialized = (field instanceof RiResolvedField) && ((RiResolvedType) holder).isInitialized();
-        CiConstant constantValue = null;
-        if (isInitialized) {
-            constantValue = ((RiResolvedField) field).constantValue(null);
-        }
-        if (constantValue != null) {
-            frameState.push(constantValue.kind.stackKind(), appendConstant(constantValue));
-        } else {
-            ValueNode container = genTypeOrDeopt(RiType.Representation.StaticFields, holder, isInitialized);
-            CiKind kind = field.kind(false);
-            if (container != null) {
-                LoadFieldNode load = currentGraph.add(new LoadFieldNode(container, (RiResolvedField) field));
-                appendOptimizedLoadField(kind, load);
-            } else {
-                // deopt will be generated by genTypeOrDeopt, not needed here
-                frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
-            }
-        }
-    }
-
-    private void genPutStatic(RiField field) {
-        RiType holder = field.holder();
-        ValueNode container = genTypeOrDeopt(RiType.Representation.StaticFields, holder, field instanceof RiResolvedField && ((RiResolvedType) holder).isInitialized());
-        ValueNode value = frameState.pop(field.kind(false).stackKind());
-        if (container != null) {
-            StoreFieldNode store = currentGraph.add(new StoreFieldNode(container, (RiResolvedField) field, value));
-            appendOptimizedStoreField(store);
-        } else {
-            // deopt will be generated by genTypeOrDeopt, not needed here
-        }
-    }
-
-    private ConstantNode genTypeOrDeopt(RiType.Representation representation, RiType holder, boolean initialized) {
-        if (initialized) {
-            return appendConstant(((RiResolvedType) holder).getEncoding(representation));
-        } else {
-            append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-            return null;
-        }
-    }
-
-    private void appendOptimizedStoreField(StoreFieldNode store) {
-        append(store);
-    }
-
-    private void appendOptimizedLoadField(CiKind kind, LoadFieldNode load) {
-        // append the load to the instruction
-        ValueNode optimized = append(load);
-        frameState.push(kind.stackKind(), optimized);
-    }
-
-    private void genInvokeStatic(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
-            RiResolvedMethod resolvedTarget = (RiResolvedMethod) target;
-            RiResolvedType holder = resolvedTarget.holder();
-            if (!holder.isInitialized() && GraalOptions.ResolveClassBeforeStaticInvoke) {
-                genInvokeDeopt(target, false);
-            } else {
-                ValueNode[] args = frameState.popArguments(resolvedTarget.signature().argumentSlots(false), resolvedTarget.signature().argumentCount(false));
-                appendInvoke(InvokeKind.Static, resolvedTarget, args);
-            }
-        } else {
-            genInvokeDeopt(target, false);
-        }
-    }
-
-    private void genInvokeInterface(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
-            ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
-            genInvokeIndirect(InvokeKind.Interface, (RiResolvedMethod) target, args);
-        } else {
-            genInvokeDeopt(target, true);
-        }
-    }
-
-    private void genInvokeVirtual(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
-            ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
-            genInvokeIndirect(InvokeKind.Virtual, (RiResolvedMethod) target, args);
-        } else {
-            genInvokeDeopt(target, true);
-        }
-
-    }
-
-    private void genInvokeSpecial(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
-            assert target != null;
-            assert target.signature() != null;
-            ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
-            invokeDirect((RiResolvedMethod) target, args);
-        } else {
-            genInvokeDeopt(target, true);
-        }
-    }
-
-    private void genInvokeDeopt(RiMethod unresolvedTarget, boolean withReceiver) {
-        append(currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-        frameState.popArguments(unresolvedTarget.signature().argumentSlots(withReceiver), unresolvedTarget.signature().argumentCount(withReceiver));
-        CiKind kind = unresolvedTarget.signature().returnKind(false);
-        if (kind != CiKind.Void) {
-            frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
-        }
-    }
-
-    private void genInvokeIndirect(InvokeKind invokeKind, RiResolvedMethod target, ValueNode[] args) {
-        ValueNode receiver = args[0];
-        // attempt to devirtualize the call
-        RiResolvedType klass = target.holder();
-
-        // 0. check for trivial cases
-        if (target.canBeStaticallyBound() && !isAbstract(target.accessFlags())) {
-            // check for trivial cases (e.g. final methods, nonvirtual methods)
-            invokeDirect(target, args);
-            return;
-        }
-        // 1. check if the exact type of the receiver can be determined
-        RiResolvedType exact = getExactType(klass, receiver);
-        if (exact != null) {
-            // either the holder class is exact, or the receiver object has an exact type
-            invokeDirect(exact.resolveMethodImpl(target), args);
-            return;
-        }
-        // devirtualization failed, produce an actual invokevirtual
-        appendInvoke(invokeKind, target, args);
-    }
-
-    private void invokeDirect(RiResolvedMethod target, ValueNode[] args) {
-        appendInvoke(InvokeKind.Special, target, args);
-    }
-
-    private void appendInvoke(InvokeKind invokeKind, RiResolvedMethod targetMethod, ValueNode[] args) {
-        CiKind resultType = targetMethod.signature().returnKind(false);
-        if (GraalOptions.DeoptALot) {
-            DeoptimizeNode deoptimize = currentGraph.add(new DeoptimizeNode(DeoptAction.None));
-            deoptimize.setMessage("invoke " + targetMethod.name());
-            append(deoptimize);
-            frameState.pushReturn(resultType, ConstantNode.defaultForKind(resultType, currentGraph));
-        } else {
-            MethodCallTargetNode callTarget = currentGraph.add(new MethodCallTargetNode(invokeKind, targetMethod, args, targetMethod.signature().returnType(method.holder())));
-            BeginNode exceptionEdge = handleException(null, bci());
-            ValueNode result;
-            if (exceptionEdge != null) {
-                InvokeWithExceptionNode invoke = currentGraph.add(new InvokeWithExceptionNode(callTarget, exceptionEdge, bci()));
-                result = append(invoke);
-                frameState.pushReturn(resultType, result);
-                Block nextBlock = currentBlock.successors.get(0);
-
-                assert bci() == currentBlock.endBci;
-                frameState.clearNonLiveLocals(currentBlock.localsLiveOut);
-
-                invoke.setNext(createTarget(nextBlock, frameState));
-                invoke.setStateAfter(frameState.create(nextBlock.startBci));
-            } else {
-                result = appendWithBCI(currentGraph.add(new InvokeNode(callTarget, bci())));
-                frameState.pushReturn(resultType, result);
-            }
-        }
-    }
-
-    private RiResolvedType getExactType(RiResolvedType staticType, ValueNode receiver) {
-        RiResolvedType exact = staticType.exactType();
-        if (exact == null) {
-            exact = receiver.exactType();
-            if (exact == null) {
-                if (receiver.isConstant()) {
-                    exact = runtime.getTypeOf(receiver.asConstant());
-                }
-                if (exact == null) {
-                    RiResolvedType declared = receiver.declaredType();
-                    if (declared != null) {
-                        exact = declared.exactType();
-                    }
-                }
-            }
-        }
-        return exact;
-    }
-
-    private void callRegisterFinalizer() {
-        // append a call to the finalizer registration
-        append(currentGraph.add(new RegisterFinalizerNode(frameState.loadLocal(0))));
-    }
-
-    private void genReturn(ValueNode x) {
-        frameState.clearStack();
-        if (x != null) {
-            frameState.push(x.kind(), x);
-        }
-        appendGoto(createTarget(returnBlock(bci()), frameState));
-    }
-
-    private MonitorEnterNode genMonitorEnter(ValueNode x) {
-        MonitorEnterNode monitorEnter = currentGraph.add(new MonitorEnterNode(x));
-        appendWithBCI(monitorEnter);
-        return monitorEnter;
-    }
-
-    private MonitorExitNode genMonitorExit(ValueNode x) {
-        MonitorExitNode monitorExit = currentGraph.add(new MonitorExitNode(x));
-        appendWithBCI(monitorExit);
-        return monitorExit;
-    }
-
-    private void genJsr(int dest) {
-        Block successor = currentBlock.jsrSuccessor;
-        assert successor.startBci == dest : successor.startBci + " != " + dest + " @" + bci();
-        JsrScope scope = currentBlock.jsrScope;
-        if (!successor.jsrScope.pop().equals(scope)) {
-            throw new JsrNotSupportedBailout("unstructured control flow (internal limitation)");
-        }
-        if (successor.jsrScope.nextReturnAddress() != stream().nextBCI()) {
-            throw new JsrNotSupportedBailout("unstructured control flow (internal limitation)");
-        }
-        frameState.push(CiKind.Jsr, ConstantNode.forJsr(stream().nextBCI(), currentGraph));
-        appendGoto(createTarget(successor, frameState));
-    }
-
-    private void genRet(int localIndex) {
-        Block successor = currentBlock.retSuccessor;
-        ValueNode local = frameState.loadLocal(localIndex);
-        JsrScope scope = currentBlock.jsrScope;
-        int retAddress = scope.nextReturnAddress();
-        append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new CompareNode(local, Condition.EQ, ConstantNode.forJsr(retAddress, currentGraph))))));
-        if (!successor.jsrScope.equals(scope.pop())) {
-            throw new JsrNotSupportedBailout("unstructured control flow (ret leaves more than one scope)");
-        }
-        appendGoto(createTarget(successor, frameState));
-    }
-
-    private void genTableswitch() {
-        int bci = bci();
-        ValueNode value = frameState.ipop();
-        BytecodeTableSwitch ts = new BytecodeTableSwitch(stream(), bci);
-
-        int nofCases = ts.numberOfCases() + 1; // including default case
-        assert currentBlock.normalSuccessors == nofCases;
-
-        double[] probabilities = switchProbability(nofCases, bci);
-        TableSwitchNode tableSwitch = currentGraph.add(new TableSwitchNode(value, ts.lowKey(), probabilities));
-        for (int i = 0; i < nofCases; ++i) {
-            tableSwitch.setBlockSuccessor(i, createBlockTarget(probabilities[i], currentBlock.successors.get(i), frameState));
-        }
-        append(tableSwitch);
-    }
-
-    private double[] switchProbability(int numberOfCases, int bci) {
-        double[] prob = profilingInfo.getSwitchProbabilities(bci);
-        if (prob != null) {
-            assert prob.length == numberOfCases;
-        } else {
-            Debug.log("Missing probability (switch) in %s at bci %d", method, bci);
-            prob = new double[numberOfCases];
-            for (int i = 0; i < numberOfCases; i++) {
-                prob[i] = 1.0d / numberOfCases;
-            }
-        }
-        return prob;
-    }
-
-    private void genLookupswitch() {
-        int bci = bci();
-        ValueNode value = frameState.ipop();
-        BytecodeLookupSwitch ls = new BytecodeLookupSwitch(stream(), bci);
-
-        int nofCases = ls.numberOfCases() + 1; // including default case
-        assert currentBlock.normalSuccessors == nofCases;
-
-        int[] keys = new int[nofCases - 1];
-        for (int i = 0; i < nofCases - 1; ++i) {
-            keys[i] = ls.keyAt(i);
-        }
-        double[] probabilities = switchProbability(nofCases, bci);
-        LookupSwitchNode lookupSwitch = currentGraph.add(new LookupSwitchNode(value, keys, probabilities));
-        for (int i = 0; i < nofCases; ++i) {
-            lookupSwitch.setBlockSuccessor(i, createBlockTarget(probabilities[i], currentBlock.successors.get(i), frameState));
-        }
-        append(lookupSwitch);
-    }
-
-    private ConstantNode appendConstant(CiConstant constant) {
-        return ConstantNode.forCiConstant(constant, runtime, currentGraph);
-    }
-
-    private ValueNode append(FixedNode fixed) {
-        lastInstr.setNext(fixed);
-        lastInstr = null;
-        return fixed;
-    }
-
-    private ValueNode append(FixedWithNextNode x) {
-        return appendWithBCI(x);
-    }
-
-    private static ValueNode append(ValueNode v) {
-        return v;
-    }
-
-    private ValueNode appendWithBCI(FixedWithNextNode x) {
-        assert x.predecessor() == null : "instruction should not have been appended yet";
-        assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")";
-        lastInstr.setNext(x);
-        lastInstr = x;
-        return x;
-    }
-
-    private FixedNode createTarget(double probability, Block block, FrameStateBuilder stateAfter) {
-        assert probability >= 0 && probability <= 1;
-        if (probability == 0 && config.useBranchPrediction()) {
-            return currentGraph.add(new DeoptimizeNode(DeoptAction.InvalidateReprofile));
-        } else {
-            return createTarget(block, stateAfter);
-        }
-    }
-
-    private FixedNode createTarget(Block block, FrameStateBuilder stateAfter) {
-        assert block != null && stateAfter != null;
-        assert !block.isExceptionEntry || stateAfter.stackSize() == 1;
-
-        if (block.firstInstruction == null) {
-            // This is the first time we see this block as a branch target.
-            // Create and return a placeholder that later can be replaced with a MergeNode when we see this block again.
-            block.firstInstruction = currentGraph.add(new BlockPlaceholderNode());
-            block.entryState = stateAfter.copy();
-            block.entryState.clearNonLiveLocals(block.localsLiveIn);
-
-            Debug.log("createTarget %s: first visit, result: %s", block, block.firstInstruction);
-            return block.firstInstruction;
-        }
-
-        // We already saw this block before, so we have to merge states.
-        if (!block.entryState.isCompatibleWith(stateAfter)) {
-            throw new CiBailout("stacks do not match; bytecodes would not verify");
-        }
-
-        if (block.firstInstruction instanceof LoopBeginNode) {
-            assert block.isLoopHeader && currentBlock.blockID >= block.blockID : "must be backward branch";
-            // Backward loop edge. We need to create a special LoopEndNode and merge with the loop begin node created before.
-            LoopBeginNode loopBegin = (LoopBeginNode) block.firstInstruction;
-            LoopEndNode result = currentGraph.add(new LoopEndNode(loopBegin));
-            block.entryState.merge(loopBegin, stateAfter);
-
-            Debug.log("createTarget %s: merging backward branch to loop header %s, result: %s", block, loopBegin, result);
-            return result;
-        }
-        assert currentBlock == null || currentBlock.blockID < block.blockID : "must not be backward branch";
-        assert block.firstInstruction.next() == null : "bytecodes already parsed for block";
-
-        if (block.firstInstruction instanceof BlockPlaceholderNode) {
-            // This is the second time we see this block. Create the actual MergeNode and the End Node for the already existing edge.
-            // For simplicity, we leave the placeholder in the graph and just append the new nodes after the placeholder.
-            BlockPlaceholderNode placeholder = (BlockPlaceholderNode) block.firstInstruction;
-
-            // The EndNode for the already existing edge.
-            EndNode end = currentGraph.add(new EndNode());
-            // The MergeNode that replaces the placeholder.
-            MergeNode mergeNode  = currentGraph.add(new MergeNode());
-            FixedNode next = placeholder.next();
-
-            placeholder.setNext(end);
-            mergeNode.addForwardEnd(end);
-            mergeNode.setNext(next);
-
-            block.firstInstruction = mergeNode;
-        }
-
-        MergeNode mergeNode = (MergeNode) block.firstInstruction;
-
-        // The EndNode for the newly merged edge.
-        EndNode result = currentGraph.add(new EndNode());
-        block.entryState.merge(mergeNode, stateAfter);
-        mergeNode.addForwardEnd(result);
-
-        Debug.log("createTarget %s: merging state, result: %s", block, result);
-        return result;
-    }
-
-    /**
-     * Returns a block begin node with the specified state.  If the specified probability is 0, the block
-     * deoptimizes immediately.
-     */
-    private BeginNode createBlockTarget(double probability, Block block, FrameStateBuilder stateAfter) {
-        FixedNode target = createTarget(probability, block, stateAfter);
-        assert !(target instanceof BeginNode);
-        BeginNode begin = currentGraph.add(new BeginNode());
-        begin.setNext(target);
-
-        assert !(target instanceof DeoptimizeNode && begin.stateAfter() != null) :
-            "We are not allowed to set the stateAfter of the begin node, because we have to deoptimize to a bci _before_ the actual if, so that the interpreter can update the profiling information.";
-        return begin;
-    }
-
-    private ValueNode synchronizedObject(FrameStateBuilder state, RiResolvedMethod target) {
-        if (isStatic(target.accessFlags())) {
-            return append(ConstantNode.forCiConstant(target.holder().getEncoding(Representation.JavaClass), runtime, currentGraph));
-        } else {
-            return state.loadLocal(0);
-        }
-    }
-
-    private void processBlock(Block block) {
-        // Ignore blocks that have no predecessors by the time it their bytecodes are parsed
-        if (block == null || block.firstInstruction == null) {
-            Debug.log("Ignoring block %s", block);
-            return;
-        }
-        Debug.log("Parsing block %s  firstInstruction: %s  loopHeader: %b", block, block.firstInstruction, block.isLoopHeader);
-
-        lastInstr = block.firstInstruction;
-        frameState = block.entryState;
-        currentBlock = block;
-
-        frameState.cleanupDeletedPhis();
-        if (lastInstr instanceof MergeNode) {
-            int bci = block.startBci;
-            if (block instanceof ExceptionBlock) {
-                bci = ((ExceptionBlock) block).deoptBci;
-            }
-            ((MergeNode) lastInstr).setStateAfter(frameState.create(bci));
-        }
-
-        if (block == returnBlock) {
-            frameState.setRethrowException(false);
-            createReturn();
-        } else if (block == unwindBlock) {
-            frameState.setRethrowException(false);
-            createUnwind();
-        } else if (block instanceof ExceptionBlock) {
-            createExceptionDispatch((ExceptionBlock) block);
-        } else {
-            frameState.setRethrowException(false);
-            iterateBytecodesForBlock(block);
-        }
-    }
-
-    private void connectLoopEndToBegin() {
-        for (LoopBeginNode begin : currentGraph.getNodes(LoopBeginNode.class)) {
-            if (begin.loopEnds().isEmpty()) {
-                // Remove loop header without loop ends.
-                // This can happen with degenerated loops like this one:
-                // for (;;) {
-                //     try {
-                //         break;
-                //     } catch (UnresolvedException iioe) {
-                //     }
-                // }
-                assert begin.forwardEndCount() == 1;
-                currentGraph.reduceDegenerateLoopBegin(begin);
-            } else {
-                // Delete unnecessary loop phi functions, i.e., phi functions where all inputs are either the same or the phi itself.
-                for (PhiNode phi : begin.stateAfter().values().filter(PhiNode.class).snapshot()) {
-                    checkRedundantPhi(phi);
-                }
-            }
-        }
-    }
-
-    private static void checkRedundantPhi(PhiNode phiNode) {
-        if (phiNode.isDeleted() || phiNode.valueCount() == 1) {
-            return;
-        }
-
-        ValueNode singleValue = phiNode.singleValue();
-        if (singleValue != null) {
-            Collection<PhiNode> phiUsages = phiNode.usages().filter(PhiNode.class).snapshot();
-            ((StructuredGraph) phiNode.graph()).replaceFloating(phiNode, singleValue);
-            for (PhiNode phi : phiUsages) {
-                checkRedundantPhi(phi);
-            }
-        }
-    }
-
-    private void createUnwind() {
-        synchronizedEpilogue(FrameState.AFTER_EXCEPTION_BCI);
-        UnwindNode unwindNode = currentGraph.add(new UnwindNode(frameState.apop()));
-        append(unwindNode);
-    }
-
-    private void createReturn() {
-        if (method.isConstructor() && method.holder().superType() == null) {
-            callRegisterFinalizer();
-        }
-        CiKind returnKind = method.signature().returnKind(false).stackKind();
-        ValueNode x = returnKind == CiKind.Void ? null : frameState.pop(returnKind);
-        assert frameState.stackSize() == 0;
-
-        // TODO (gdub) remove this when FloatingRead can handle this case
-        if (Modifier.isSynchronized(method.accessFlags())) {
-            append(currentGraph.add(new ValueAnchorNode(x)));
-            assert !frameState.rethrowException();
-        }
-
-        synchronizedEpilogue(FrameState.AFTER_BCI);
-        ReturnNode returnNode = currentGraph.add(new ReturnNode(x));
-        append(returnNode);
-    }
-
-    private void synchronizedEpilogue(int bci) {
-        if (Modifier.isSynchronized(method.accessFlags())) {
-            MonitorExitNode monitorExit = genMonitorExit(methodSynchronizedObject);
-            monitorExit.setStateAfter(frameState.create(bci));
-            assert !frameState.rethrowException();
-        }
-    }
-
-    private void createExceptionDispatch(ExceptionBlock block) {
-        if (block.handler == null) {
-            assert frameState.stackSize() == 1 : "only exception object expected on stack, actual size: " + frameState.stackSize();
-            createUnwind();
-        } else {
-            assert frameState.stackSize() == 1 : frameState;
-
-            RiType catchType = block.handler.catchType();
-            if (config.eagerResolving()) {
-                catchType = lookupType(block.handler.catchTypeCPI(), INSTANCEOF);
-            }
-            boolean initialized = (catchType instanceof RiResolvedType);
-            if (initialized && config.getSkippedExceptionTypes() != null) {
-                RiResolvedType resolvedCatchType = (RiResolvedType) catchType;
-                for (RiResolvedType skippedType : config.getSkippedExceptionTypes()) {
-                    initialized &= !resolvedCatchType.isSubtypeOf(skippedType);
-                    if (!initialized) {
-                        break;
-                    }
-                }
-            }
-
-            ConstantNode typeInstruction = genTypeOrDeopt(RiType.Representation.ObjectHub, catchType, initialized);
-            if (typeInstruction != null) {
-                Block nextBlock = block.successors.size() == 1 ? unwindBlock(block.deoptBci) : block.successors.get(1);
-                FixedNode catchSuccessor = createTarget(block.successors.get(0), frameState);
-                FixedNode nextDispatch = createTarget(nextBlock, frameState);
-                ValueNode exception = frameState.stackAt(0);
-                IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new InstanceOfNode(typeInstruction, (RiResolvedType) catchType, exception, false)), catchSuccessor, nextDispatch, 0.5));
-                append(ifNode);
-            }
-        }
-    }
-
-    private void appendGoto(FixedNode target) {
-        if (lastInstr != null) {
-            lastInstr.setNext(target);
-        }
-    }
-
-    private static boolean isBlockEnd(Node n) {
-        return trueSuccessorCount(n) > 1 || n instanceof ReturnNode || n instanceof UnwindNode || n instanceof DeoptimizeNode;
-    }
-
-    private static int trueSuccessorCount(Node n) {
-        if (n == null) {
-            return 0;
-        }
-        int i = 0;
-        for (Node s : n.successors()) {
-            if (Util.isFixed(s)) {
-                i++;
-            }
-        }
-        return i;
-    }
-
-    private void iterateBytecodesForBlock(Block block) {
-        if (block.isLoopHeader) {
-            // Create the loop header block, which later will merge the backward branches of the loop.
-            EndNode preLoopEnd = currentGraph.add(new EndNode());
-            LoopBeginNode loopBegin = currentGraph.add(new LoopBeginNode());
-            lastInstr.setNext(preLoopEnd);
-            // Add the single non-loop predecessor of the loop header.
-            loopBegin.addForwardEnd(preLoopEnd);
-            lastInstr = loopBegin;
-
-            // Create phi functions for all local variables and operand stack slots.
-            frameState.insertLoopPhis(loopBegin);
-            loopBegin.setStateAfter(frameState.create(block.startBci));
-
-            // We have seen all forward branches. All subsequent backward branches will merge to the loop header.
-            // This ensures that the loop header has exactly one non-loop predecessor.
-            block.firstInstruction = loopBegin;
-            // We need to preserve the frame state builder of the loop header so that we can merge values for
-            // phi functions, so make a copy of it.
-            block.entryState = frameState.copy();
-
-            Debug.log("  created loop header %s", loopBegin);
-        }
-        assert lastInstr.next() == null : "instructions already appended at block " + block;
-        Debug.log("  frameState: %s", frameState);
-
-        int endBCI = stream.endBCI();
-
-        stream.setBCI(block.startBci);
-        int bci = block.startBci;
-        while (bci < endBCI) {
-            // read the opcode
-            int opcode = stream.currentBC();
-            traceState();
-            traceInstruction(bci, opcode, bci == block.startBci);
-            processBytecode(bci, opcode);
-
-            if (lastInstr == null || isBlockEnd(lastInstr) || lastInstr.next() != null) {
-                break;
-            }
-
-            stream.next();
-            bci = stream.currentBCI();
-            if (lastInstr instanceof StateSplit) {
-                StateSplit stateSplit = (StateSplit) lastInstr;
-                if (stateSplit.stateAfter() == null && stateSplit.needsStateAfter()) {
-                    stateSplit.setStateAfter(frameState.create(bci));
-                }
-            }
-            if (bci < endBCI) {
-                if (bci > block.endBci) {
-                    assert !block.successors.get(0).isExceptionEntry;
-                    assert block.normalSuccessors == 1;
-                    // we fell through to the next block, add a goto and break
-                    appendGoto(createTarget(block.successors.get(0), frameState));
-                    break;
-                }
-            }
-        }
-    }
-
-    private void traceState() {
-        if (GraalOptions.TraceBytecodeParserLevel >= TRACELEVEL_STATE && !TTY.isSuppressed()) {
-            log.println(String.format("|   state [nr locals = %d, stack depth = %d, method = %s]", frameState.localsSize(), frameState.stackSize(), method));
-            for (int i = 0; i < frameState.localsSize(); ++i) {
-                ValueNode value = frameState.localAt(i);
-                log.println(String.format("|   local[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().javaName, value));
-            }
-            for (int i = 0; i < frameState.stackSize(); ++i) {
-                ValueNode value = frameState.stackAt(i);
-                log.println(String.format("|   stack[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().javaName, value));
-            }
-        }
-    }
-
-    private void processBytecode(int bci, int opcode) {
-        int cpi;
-
-        // Checkstyle: stop
-        switch (opcode) {
-            case NOP            : /* nothing to do */ break;
-            case ACONST_NULL    : frameState.apush(appendConstant(CiConstant.NULL_OBJECT)); break;
-            case ICONST_M1      : frameState.ipush(appendConstant(CiConstant.INT_MINUS_1)); break;
-            case ICONST_0       : frameState.ipush(appendConstant(CiConstant.INT_0)); break;
-            case ICONST_1       : frameState.ipush(appendConstant(CiConstant.INT_1)); break;
-            case ICONST_2       : frameState.ipush(appendConstant(CiConstant.INT_2)); break;
-            case ICONST_3       : frameState.ipush(appendConstant(CiConstant.INT_3)); break;
-            case ICONST_4       : frameState.ipush(appendConstant(CiConstant.INT_4)); break;
-            case ICONST_5       : frameState.ipush(appendConstant(CiConstant.INT_5)); break;
-            case LCONST_0       : frameState.lpush(appendConstant(CiConstant.LONG_0)); break;
-            case LCONST_1       : frameState.lpush(appendConstant(CiConstant.LONG_1)); break;
-            case FCONST_0       : frameState.fpush(appendConstant(CiConstant.FLOAT_0)); break;
-            case FCONST_1       : frameState.fpush(appendConstant(CiConstant.FLOAT_1)); break;
-            case FCONST_2       : frameState.fpush(appendConstant(CiConstant.FLOAT_2)); break;
-            case DCONST_0       : frameState.dpush(appendConstant(CiConstant.DOUBLE_0)); break;
-            case DCONST_1       : frameState.dpush(appendConstant(CiConstant.DOUBLE_1)); break;
-            case BIPUSH         : frameState.ipush(appendConstant(CiConstant.forInt(stream.readByte()))); break;
-            case SIPUSH         : frameState.ipush(appendConstant(CiConstant.forInt(stream.readShort()))); break;
-            case LDC            : // fall through
-            case LDC_W          : // fall through
-            case LDC2_W         : genLoadConstant(stream.readCPI(), opcode); break;
-            case ILOAD          : loadLocal(stream.readLocalIndex(), CiKind.Int); break;
-            case LLOAD          : loadLocal(stream.readLocalIndex(), CiKind.Long); break;
-            case FLOAD          : loadLocal(stream.readLocalIndex(), CiKind.Float); break;
-            case DLOAD          : loadLocal(stream.readLocalIndex(), CiKind.Double); break;
-            case ALOAD          : loadLocal(stream.readLocalIndex(), CiKind.Object); break;
-            case ILOAD_0        : // fall through
-            case ILOAD_1        : // fall through
-            case ILOAD_2        : // fall through
-            case ILOAD_3        : loadLocal(opcode - ILOAD_0, CiKind.Int); break;
-            case LLOAD_0        : // fall through
-            case LLOAD_1        : // fall through
-            case LLOAD_2        : // fall through
-            case LLOAD_3        : loadLocal(opcode - LLOAD_0, CiKind.Long); break;
-            case FLOAD_0        : // fall through
-            case FLOAD_1        : // fall through
-            case FLOAD_2        : // fall through
-            case FLOAD_3        : loadLocal(opcode - FLOAD_0, CiKind.Float); break;
-            case DLOAD_0        : // fall through
-            case DLOAD_1        : // fall through
-            case DLOAD_2        : // fall through
-            case DLOAD_3        : loadLocal(opcode - DLOAD_0, CiKind.Double); break;
-            case ALOAD_0        : // fall through
-            case ALOAD_1        : // fall through
-            case ALOAD_2        : // fall through
-            case ALOAD_3        : loadLocal(opcode - ALOAD_0, CiKind.Object); break;
-            case IALOAD         : genLoadIndexed(CiKind.Int   ); break;
-            case LALOAD         : genLoadIndexed(CiKind.Long  ); break;
-            case FALOAD         : genLoadIndexed(CiKind.Float ); break;
-            case DALOAD         : genLoadIndexed(CiKind.Double); break;
-            case AALOAD         : genLoadIndexed(CiKind.Object); break;
-            case BALOAD         : genLoadIndexed(CiKind.Byte  ); break;
-            case CALOAD         : genLoadIndexed(CiKind.Char  ); break;
-            case SALOAD         : genLoadIndexed(CiKind.Short ); break;
-            case ISTORE         : storeLocal(CiKind.Int, stream.readLocalIndex()); break;
-            case LSTORE         : storeLocal(CiKind.Long, stream.readLocalIndex()); break;
-            case FSTORE         : storeLocal(CiKind.Float, stream.readLocalIndex()); break;
-            case DSTORE         : storeLocal(CiKind.Double, stream.readLocalIndex()); break;
-            case ASTORE         : storeLocal(CiKind.Object, stream.readLocalIndex()); break;
-            case ISTORE_0       : // fall through
-            case ISTORE_1       : // fall through
-            case ISTORE_2       : // fall through
-            case ISTORE_3       : storeLocal(CiKind.Int, opcode - ISTORE_0); break;
-            case LSTORE_0       : // fall through
-            case LSTORE_1       : // fall through
-            case LSTORE_2       : // fall through
-            case LSTORE_3       : storeLocal(CiKind.Long, opcode - LSTORE_0); break;
-            case FSTORE_0       : // fall through
-            case FSTORE_1       : // fall through
-            case FSTORE_2       : // fall through
-            case FSTORE_3       : storeLocal(CiKind.Float, opcode - FSTORE_0); break;
-            case DSTORE_0       : // fall through
-            case DSTORE_1       : // fall through
-            case DSTORE_2       : // fall through
-            case DSTORE_3       : storeLocal(CiKind.Double, opcode - DSTORE_0); break;
-            case ASTORE_0       : // fall through
-            case ASTORE_1       : // fall through
-            case ASTORE_2       : // fall through
-            case ASTORE_3       : storeLocal(CiKind.Object, opcode - ASTORE_0); break;
-            case IASTORE        : genStoreIndexed(CiKind.Int   ); break;
-            case LASTORE        : genStoreIndexed(CiKind.Long  ); break;
-            case FASTORE        : genStoreIndexed(CiKind.Float ); break;
-            case DASTORE        : genStoreIndexed(CiKind.Double); break;
-            case AASTORE        : genStoreIndexed(CiKind.Object); break;
-            case BASTORE        : genStoreIndexed(CiKind.Byte  ); break;
-            case CASTORE        : genStoreIndexed(CiKind.Char  ); break;
-            case SASTORE        : genStoreIndexed(CiKind.Short ); break;
-            case POP            : // fall through
-            case POP2           : // fall through
-            case DUP            : // fall through
-            case DUP_X1         : // fall through
-            case DUP_X2         : // fall through
-            case DUP2           : // fall through
-            case DUP2_X1        : // fall through
-            case DUP2_X2        : // fall through
-            case SWAP           : stackOp(opcode); break;
-            case IADD           : // fall through
-            case ISUB           : // fall through
-            case IMUL           : genArithmeticOp(CiKind.Int, opcode, false); break;
-            case IDIV           : // fall through
-            case IREM           : genArithmeticOp(CiKind.Int, opcode, true); break;
-            case LADD           : // fall through
-            case LSUB           : // fall through
-            case LMUL           : genArithmeticOp(CiKind.Long, opcode, false); break;
-            case LDIV           : // fall through
-            case LREM           : genArithmeticOp(CiKind.Long, opcode, true); break;
-            case FADD           : // fall through
-            case FSUB           : // fall through
-            case FMUL           : // fall through
-            case FDIV           : // fall through
-            case FREM           : genArithmeticOp(CiKind.Float, opcode, false); break;
-            case DADD           : // fall through
-            case DSUB           : // fall through
-            case DMUL           : // fall through
-            case DDIV           : // fall through
-            case DREM           : genArithmeticOp(CiKind.Double, opcode, false); break;
-            case INEG           : genNegateOp(CiKind.Int); break;
-            case LNEG           : genNegateOp(CiKind.Long); break;
-            case FNEG           : genNegateOp(CiKind.Float); break;
-            case DNEG           : genNegateOp(CiKind.Double); break;
-            case ISHL           : // fall through
-            case ISHR           : // fall through
-            case IUSHR          : genShiftOp(CiKind.Int, opcode); break;
-            case IAND           : // fall through
-            case IOR            : // fall through
-            case IXOR           : genLogicOp(CiKind.Int, opcode); break;
-            case LSHL           : // fall through
-            case LSHR           : // fall through
-            case LUSHR          : genShiftOp(CiKind.Long, opcode); break;
-            case LAND           : // fall through
-            case LOR            : // fall through
-            case LXOR           : genLogicOp(CiKind.Long, opcode); break;
-            case IINC           : genIncrement(); break;
-            case I2L            : genConvert(ConvertNode.Op.I2L); break;
-            case I2F            : genConvert(ConvertNode.Op.I2F); break;
-            case I2D            : genConvert(ConvertNode.Op.I2D); break;
-            case L2I            : genConvert(ConvertNode.Op.L2I); break;
-            case L2F            : genConvert(ConvertNode.Op.L2F); break;
-            case L2D            : genConvert(ConvertNode.Op.L2D); break;
-            case F2I            : genConvert(ConvertNode.Op.F2I); break;
-            case F2L            : genConvert(ConvertNode.Op.F2L); break;
-            case F2D            : genConvert(ConvertNode.Op.F2D); break;
-            case D2I            : genConvert(ConvertNode.Op.D2I); break;
-            case D2L            : genConvert(ConvertNode.Op.D2L); break;
-            case D2F            : genConvert(ConvertNode.Op.D2F); break;
-            case I2B            : genConvert(ConvertNode.Op.I2B); break;
-            case I2C            : genConvert(ConvertNode.Op.I2C); break;
-            case I2S            : genConvert(ConvertNode.Op.I2S); break;
-            case LCMP           : genCompareOp(CiKind.Long, false); break;
-            case FCMPL          : genCompareOp(CiKind.Float, true); break;
-            case FCMPG          : genCompareOp(CiKind.Float, false); break;
-            case DCMPL          : genCompareOp(CiKind.Double, true); break;
-            case DCMPG          : genCompareOp(CiKind.Double, false); break;
-            case IFEQ           : genIfZero(Condition.EQ); break;
-            case IFNE           : genIfZero(Condition.NE); break;
-            case IFLT           : genIfZero(Condition.LT); break;
-            case IFGE           : genIfZero(Condition.GE); break;
-            case IFGT           : genIfZero(Condition.GT); break;
-            case IFLE           : genIfZero(Condition.LE); break;
-            case IF_ICMPEQ      : genIfSame(CiKind.Int, Condition.EQ); break;
-            case IF_ICMPNE      : genIfSame(CiKind.Int, Condition.NE); break;
-            case IF_ICMPLT      : genIfSame(CiKind.Int, Condition.LT); break;
-            case IF_ICMPGE      : genIfSame(CiKind.Int, Condition.GE); break;
-            case IF_ICMPGT      : genIfSame(CiKind.Int, Condition.GT); break;
-            case IF_ICMPLE      : genIfSame(CiKind.Int, Condition.LE); break;
-            case IF_ACMPEQ      : genIfSame(CiKind.Object, Condition.EQ); break;
-            case IF_ACMPNE      : genIfSame(CiKind.Object, Condition.NE); break;
-            case GOTO           : genGoto(); break;
-            case JSR            : genJsr(stream.readBranchDest()); break;
-            case RET            : genRet(stream.readLocalIndex()); break;
-            case TABLESWITCH    : genTableswitch(); break;
-            case LOOKUPSWITCH   : genLookupswitch(); break;
-            case IRETURN        : genReturn(frameState.ipop()); break;
-            case LRETURN        : genReturn(frameState.lpop()); break;
-            case FRETURN        : genReturn(frameState.fpop()); break;
-            case DRETURN        : genReturn(frameState.dpop()); break;
-            case ARETURN        : genReturn(frameState.apop()); break;
-            case RETURN         : genReturn(null); break;
-            case GETSTATIC      : cpi = stream.readCPI(); genGetStatic(lookupField(cpi, opcode)); break;
-            case PUTSTATIC      : cpi = stream.readCPI(); genPutStatic(lookupField(cpi, opcode)); break;
-            case GETFIELD       : cpi = stream.readCPI(); genGetField(lookupField(cpi, opcode)); break;
-            case PUTFIELD       : cpi = stream.readCPI(); genPutField(lookupField(cpi, opcode)); break;
-            case INVOKEVIRTUAL  : cpi = stream.readCPI(); genInvokeVirtual(lookupMethod(cpi, opcode)); break;
-            case INVOKESPECIAL  : cpi = stream.readCPI(); genInvokeSpecial(lookupMethod(cpi, opcode)); break;
-            case INVOKESTATIC   : cpi = stream.readCPI(); genInvokeStatic(lookupMethod(cpi, opcode)); break;
-            case INVOKEINTERFACE: cpi = stream.readCPI(); genInvokeInterface(lookupMethod(cpi, opcode)); break;
-            case NEW            : genNewInstance(stream.readCPI()); break;
-            case NEWARRAY       : genNewTypeArray(stream.readLocalIndex()); break;
-            case ANEWARRAY      : genNewObjectArray(stream.readCPI()); break;
-            case ARRAYLENGTH    : genArrayLength(); break;
-            case ATHROW         : genThrow(stream.currentBCI()); break;
-            case CHECKCAST      : genCheckCast(); break;
-            case INSTANCEOF     : genInstanceOf(); break;
-            case MONITORENTER   : genMonitorEnter(frameState.apop()); break;
-            case MONITOREXIT    : genMonitorExit(frameState.apop()); break;
-            case MULTIANEWARRAY : genNewMultiArray(stream.readCPI()); break;
-            case IFNULL         : genIfNull(Condition.EQ); break;
-            case IFNONNULL      : genIfNull(Condition.NE); break;
-            case GOTO_W         : genGoto(); break;
-            case JSR_W          : genJsr(stream.readBranchDest()); break;
-            case BREAKPOINT:
-                throw new CiBailout("concurrent setting of breakpoint");
-            default:
-                throw new CiBailout("Unsupported opcode " + opcode + " (" + nameOf(opcode) + ") [bci=" + bci + "]");
-        }
-        // Checkstyle: resume
-    }
-
-    private void traceInstruction(int bci, int opcode, boolean blockStart) {
-        if (GraalOptions.TraceBytecodeParserLevel >= TRACELEVEL_INSTRUCTIONS && !TTY.isSuppressed()) {
-            StringBuilder sb = new StringBuilder(40);
-            sb.append(blockStart ? '+' : '|');
-            if (bci < 10) {
-                sb.append("  ");
-            } else if (bci < 100) {
-                sb.append(' ');
-            }
-            sb.append(bci).append(": ").append(Bytecodes.nameOf(opcode));
-            for (int i = bci + 1; i < stream.nextBCI(); ++i) {
-                sb.append(' ').append(stream.readUByte(i));
-            }
-            if (!currentBlock.jsrScope.isEmpty()) {
-                sb.append(' ').append(currentBlock.jsrScope);
-            }
-            log.println(sb.toString());
-        }
-    }
-
-    private void genArrayLength() {
-        frameState.ipush(append(currentGraph.add(new ArrayLengthNode(frameState.apop()))));
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java;
-
-import com.oracle.max.cri.ci.*;
-
-
-public class JsrNotSupportedBailout extends CiBailout{
-    private static final long serialVersionUID = -7476925652727154272L;
-
-    public JsrNotSupportedBailout(String reason) {
-        super(reason);
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/JsrScope.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java;
-
-public class JsrScope {
-
-    public static final JsrScope EMPTY_SCOPE = new JsrScope();
-
-    private final long scope;
-
-    private JsrScope(long scope) {
-        this.scope = scope;
-    }
-
-    public JsrScope() {
-        this.scope = 0;
-    }
-
-    public int nextReturnAddress() {
-        return (int) (scope & 0xffff);
-    }
-
-    public JsrScope push(int jsrReturnBci) {
-        if ((scope & 0xffff000000000000L) != 0) {
-            throw new JsrNotSupportedBailout("only four jsr nesting levels are supported");
-        }
-        return new JsrScope((scope << 16) | jsrReturnBci);
-    }
-
-    public boolean isEmpty() {
-        return scope == 0;
-    }
-
-    public boolean isPrefixOf(JsrScope other) {
-        return (scope & other.scope) == scope;
-    }
-
-    public JsrScope pop() {
-        return new JsrScope(scope >>> 16);
-    }
-
-    @Override
-    public int hashCode() {
-        return (int) (scope ^ (scope >>> 32));
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        return obj != null && getClass() == obj.getClass() && scope == ((JsrScope) obj).scope;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        long tmp = scope;
-        sb.append(" [");
-        while (tmp != 0) {
-            sb.append(", ").append(tmp & 0xffff);
-            tmp = tmp >>> 16;
-        }
-        sb.append(']');
-        return sb.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeLookupSwitch.java	Thu Mar 08 19:11:12 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.oracle.graal.java.bytecode;
-
-/**
- * A utility for processing {@link Bytecodes#LOOKUPSWITCH} bytecodes.
- */
-public class BytecodeLookupSwitch extends BytecodeSwitch {
-    private static final int OFFSET_TO_NUMBER_PAIRS = 4;
-    private static final int OFFSET_TO_FIRST_PAIR_MATCH = 8;
-    private static final int OFFSET_TO_FIRST_PAIR_OFFSET = 12;
-    private static final int PAIR_SIZE = 8;
-
-    /**
-     * Constructor for a {@link BytecodeStream}.
-     * @param stream the {@code BytecodeStream} containing the switch instruction
-     * @param bci the index in the stream of the switch instruction
-     */
-    public BytecodeLookupSwitch(BytecodeStream stream, int bci) {
-        super(stream, bci);
-    }
-
-    @Override
-    public int defaultOffset() {
-        return stream.readInt(alignedBci);
-    }
-
-    @Override
-    public int offsetAt(int i) {
-        return stream.readInt(alignedBci + OFFSET_TO_FIRST_PAIR_OFFSET + PAIR_SIZE * i);
-    }
-
-    @Override
-    public int keyAt(int i) {
-        return stream.readInt(alignedBci + OFFSET_TO_FIRST_PAIR_MATCH + PAIR_SIZE * i);
-    }
-
-    @Override
-    public int numberOfCases() {
-        return stream.readInt(alignedBci + OFFSET_TO_NUMBER_PAIRS);
-    }
-
-    @Override
-    public int size() {
-        return alignedBci + OFFSET_TO_FIRST_PAIR_MATCH + PAIR_SIZE * numberOfCases() - bci;
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeStream.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java.bytecode;
-
-/**
- * A utility class that makes iterating over bytecodes and reading operands
- * simpler and less error prone. For example, it handles the {@link Bytecodes#WIDE} instruction
- * and wide variants of instructions internally.
- */
-public final class BytecodeStream {
-
-    private final byte[] code;
-    private int opcode;
-    private int curBCI;
-    private int nextBCI;
-
-    /**
-     * Creates a new {@code BytecodeStream} for the specified bytecode.
-     * @param code the array of bytes that contains the bytecode
-     */
-    public BytecodeStream(byte[] code) {
-        assert code != null;
-        this.code = code;
-        setBCI(0);
-    }
-
-    /**
-     * Advances to the next bytecode.
-     */
-    public void next() {
-        setBCI(nextBCI);
-    }
-
-    /**
-     * Gets the next bytecode index (no side-effects).
-     * @return the next bytecode index
-     */
-    public int nextBCI() {
-        return nextBCI;
-    }
-
-    /**
-     * Gets the current bytecode index.
-     * @return the current bytecode index
-     */
-    public int currentBCI() {
-        return curBCI;
-    }
-
-    /**
-     * Gets the bytecode index of the end of the code.
-     * @return the index of the end of the code
-     */
-    public int endBCI() {
-        return code.length;
-    }
-
-    /**
-     * Gets the current opcode. This method will never return the
-     * {@link Bytecodes#WIDE WIDE} opcode, but will instead
-     * return the opcode that is modified by the {@code WIDE} opcode.
-     * @return the current opcode; {@link Bytecodes#END} if at or beyond the end of the code
-     */
-    public int currentBC() {
-        if (opcode == Bytecodes.WIDE) {
-            return Bytes.beU1(code, curBCI + 1);
-        } else {
-            return opcode;
-        }
-    }
-
-    /**
-     * Reads the index of a local variable for one of the load or store instructions.
-     * The WIDE modifier is handled internally.
-     * @return the index of the local variable
-     */
-    public int readLocalIndex() {
-        // read local variable index for load/store
-        if (opcode == Bytecodes.WIDE) {
-            return Bytes.beU2(code, curBCI + 2);
-        }
-        return Bytes.beU1(code, curBCI + 1);
-    }
-
-    /**
-     * Read the delta for an {@link Bytecodes#IINC} bytecode.
-     * @return the delta for the {@code IINC}
-     */
-    public int readIncrement() {
-        // read the delta for the iinc bytecode
-        if (opcode == Bytecodes.WIDE) {
-            return Bytes.beS2(code, curBCI + 4);
-        }
-        return Bytes.beS1(code, curBCI + 2);
-    }
-
-    /**
-     * Read the destination of a {@link Bytecodes#GOTO} or {@code IF} instructions.
-     * @return the destination bytecode index
-     */
-    public int readBranchDest() {
-        // reads the destination for a branch bytecode
-        if (opcode == Bytecodes.GOTO_W || opcode == Bytecodes.JSR_W) {
-            return curBCI + Bytes.beS4(code, curBCI + 1);
-        } else {
-            return curBCI + Bytes.beS2(code, curBCI + 1);
-        }
-    }
-
-    /**
-     * Read a signed 4-byte integer from the bytecode stream at the specified bytecode index.
-     * @param bci the bytecode index
-     * @return the integer value
-     */
-    public int readInt(int bci) {
-        // reads a 4-byte signed value
-        return Bytes.beS4(code, bci);
-    }
-
-    /**
-     * Reads an unsigned, 1-byte value from the bytecode stream at the specified bytecode index.
-     * @param bci the bytecode index
-     * @return the byte
-     */
-    public int readUByte(int bci) {
-        return Bytes.beU1(code, bci);
-    }
-
-    /**
-     * Reads a constant pool index for the current instruction.
-     * @return the constant pool index
-     */
-    public char readCPI() {
-        if (opcode == Bytecodes.LDC) {
-            return (char) Bytes.beU1(code, curBCI + 1);
-        }
-        return (char) Bytes.beU2(code, curBCI + 1);
-    }
-
-    /**
-     * Reads a signed, 1-byte value for the current instruction (e.g. BIPUSH).
-     * @return the byte
-     */
-    public byte readByte() {
-        return code[curBCI + 1];
-    }
-
-    /**
-     * Reads a signed, 2-byte short for the current instruction (e.g. SIPUSH).
-     * @return the short value
-     */
-    public short readShort() {
-        return (short) Bytes.beS2(code, curBCI + 1);
-    }
-
-    /**
-     * Sets the bytecode index to the specified value.
-     * If {@code bci} is beyond the end of the array, {@link #currentBC} will return
-     * {@link Bytecodes#END} and other methods may throw {@link ArrayIndexOutOfBoundsException}.
-     * @param bci the new bytecode index
-     */
-    public void setBCI(int bci) {
-        curBCI = bci;
-        if (curBCI < code.length) {
-            opcode = Bytes.beU1(code, bci);
-            nextBCI = bci + lengthOf();
-        } else {
-            opcode = Bytecodes.END;
-            nextBCI = curBCI;
-        }
-    }
-
-    /**
-     * Gets the length of the current bytecode.
-     */
-    private int lengthOf() {
-        int length = Bytecodes.lengthOf(opcode);
-        if (length == 0) {
-            switch (opcode) {
-                case Bytecodes.TABLESWITCH: {
-                    return new BytecodeTableSwitch(this, curBCI).size();
-                }
-                case Bytecodes.LOOKUPSWITCH: {
-                    return new BytecodeLookupSwitch(this, curBCI).size();
-                }
-                case Bytecodes.WIDE: {
-                    int opc = Bytes.beU1(code, curBCI + 1);
-                    if (opc == Bytecodes.RET) {
-                        return 4;
-                    } else if (opc == Bytecodes.IINC) {
-                        return 6;
-                    } else {
-                        return 4; // a load or store bytecode
-                    }
-                }
-                default:
-                    throw new Error("unknown variable-length bytecode: " + opcode);
-            }
-        }
-        return length;
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeSwitch.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java.bytecode;
-
-/**
- * An abstract class that provides the state and methods common to {@link Bytecodes#LOOKUPSWITCH}
- * and {@link Bytecodes#TABLESWITCH} instructions.
- */
-public abstract class BytecodeSwitch {
-    /**
-     * The {@link BytecodeStream} containing the bytecode array.
-     */
-    protected final BytecodeStream stream;
-    /**
-     * Index of start of switch instruction.
-     */
-    protected final int bci;
-    /**
-     * Index of the start of the additional data for the switch instruction, aligned to a multiple of four from the method start.
-     */
-    protected final int alignedBci;
-
-    /**
-     * Constructor for a {@link BytecodeStream}.
-     * @param stream the {@code BytecodeStream} containing the switch instruction
-     * @param bci the index in the stream of the switch instruction
-     */
-    public BytecodeSwitch(BytecodeStream stream, int bci) {
-        this.stream = stream;
-        this.bci = bci;
-        this.alignedBci = (bci + 4) & 0xfffffffc;
-    }
-
-    /**
-     * Gets the current bytecode index.
-     * @return the current bytecode index
-     */
-    public int bci() {
-        return bci;
-    }
-
-    /**
-     * Gets the index of the instruction denoted by the {@code i}'th switch target.
-     * @param i index of the switch target
-     * @return the index of the instruction denoted by the {@code i}'th switch target
-     */
-    public int targetAt(int i) {
-        return bci + offsetAt(i);
-    }
-
-    /**
-     * Gets the index of the instruction for the default switch target.
-     * @return the index of the instruction for the default switch target
-     */
-    public int defaultTarget() {
-        return bci + defaultOffset();
-    }
-
-    /**
-     * Gets the offset from the start of the switch instruction to the default switch target.
-     * @return the offset to the default switch target
-     */
-    public abstract int defaultOffset();
-
-    /**
-     * Gets the key at {@code i}'th switch target index.
-     * @param i the switch target index
-     * @return the key at {@code i}'th switch target index
-     */
-    public abstract int keyAt(int i);
-
-    /**
-     * Gets the offset from the start of the switch instruction for the {@code i}'th switch target.
-     * @param i the switch target index
-     * @return the offset to the {@code i}'th switch target
-     */
-    public abstract int offsetAt(int i);
-
-    /**
-     * Gets the number of switch targets.
-     * @return the number of switch targets
-     */
-    public abstract int numberOfCases();
-
-    /**
-     * Gets the total size in bytes of the switch instruction.
-     * @return the total size in bytes of the switch instruction
-     */
-    public abstract int size();
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/BytecodeTableSwitch.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java.bytecode;
-
-/**
- * A utility for processing {@link Bytecodes#TABLESWITCH} bytecodes.
- */
-public class BytecodeTableSwitch extends BytecodeSwitch {
-    private static final int OFFSET_TO_LOW_KEY = 4;
-    private static final int OFFSET_TO_HIGH_KEY = 8;
-    private static final int OFFSET_TO_FIRST_JUMP_OFFSET = 12;
-    private static final int JUMP_OFFSET_SIZE = 4;
-
-    /**
-     * Constructor for a {@link BytecodeStream}.
-     * @param stream the {@code BytecodeStream} containing the switch instruction
-     * @param bci the index in the stream of the switch instruction
-     */
-    public BytecodeTableSwitch(BytecodeStream stream, int bci) {
-        super(stream, bci);
-    }
-
-    /**
-     * Gets the low key of the table switch.
-     * @return the low key
-     */
-    public int lowKey() {
-        return stream.readInt(alignedBci + OFFSET_TO_LOW_KEY);
-    }
-
-    /**
-     * Gets the high key of the table switch.
-     * @return the high key
-     */
-    public int highKey() {
-        return stream.readInt(alignedBci + OFFSET_TO_HIGH_KEY);
-    }
-
-    @Override
-    public int keyAt(int i) {
-        return lowKey() + i;
-    }
-
-    @Override
-    public int defaultOffset() {
-        return stream.readInt(alignedBci);
-    }
-
-    @Override
-    public int offsetAt(int i) {
-        return stream.readInt(alignedBci + OFFSET_TO_FIRST_JUMP_OFFSET + JUMP_OFFSET_SIZE * i);
-    }
-
-    @Override
-    public int numberOfCases() {
-        return highKey() - lowKey() + 1;
-    }
-
-    @Override
-    public int size() {
-        return alignedBci + OFFSET_TO_FIRST_JUMP_OFFSET + JUMP_OFFSET_SIZE * numberOfCases() - bci;
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/Bytecodes.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,940 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java.bytecode;
-
-import static com.oracle.graal.java.bytecode.Bytecodes.Flags.*;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.regex.*;
-
-/**
- * The definitions of the bytecodes that are valid input to the compiler and
- * related utility methods. This comprises two groups: the standard Java
- * bytecodes defined by <a href=
- * "http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html">
- * Java Virtual Machine Specification</a>, and a set of <i>extended</i>
- * bytecodes that support low-level programming, for example, memory barriers.
- *
- * The extended bytecodes are one or three bytes in size. The one-byte bytecodes
- * follow the values in the standard set, with no gap. The three-byte extended
- * bytecodes share a common first byte and carry additional instruction-specific
- * information in the second and third bytes.
- */
-public class Bytecodes {
-    public static final int NOP                  =   0; // 0x00
-    public static final int ACONST_NULL          =   1; // 0x01
-    public static final int ICONST_M1            =   2; // 0x02
-    public static final int ICONST_0             =   3; // 0x03
-    public static final int ICONST_1             =   4; // 0x04
-    public static final int ICONST_2             =   5; // 0x05
-    public static final int ICONST_3             =   6; // 0x06
-    public static final int ICONST_4             =   7; // 0x07
-    public static final int ICONST_5             =   8; // 0x08
-    public static final int LCONST_0             =   9; // 0x09
-    public static final int LCONST_1             =  10; // 0x0A
-    public static final int FCONST_0             =  11; // 0x0B
-    public static final int FCONST_1             =  12; // 0x0C
-    public static final int FCONST_2             =  13; // 0x0D
-    public static final int DCONST_0             =  14; // 0x0E
-    public static final int DCONST_1             =  15; // 0x0F
-    public static final int BIPUSH               =  16; // 0x10
-    public static final int SIPUSH               =  17; // 0x11
-    public static final int LDC                  =  18; // 0x12
-    public static final int LDC_W                =  19; // 0x13
-    public static final int LDC2_W               =  20; // 0x14
-    public static final int ILOAD                =  21; // 0x15
-    public static final int LLOAD                =  22; // 0x16
-    public static final int FLOAD                =  23; // 0x17
-    public static final int DLOAD                =  24; // 0x18
-    public static final int ALOAD                =  25; // 0x19
-    public static final int ILOAD_0              =  26; // 0x1A
-    public static final int ILOAD_1              =  27; // 0x1B
-    public static final int ILOAD_2              =  28; // 0x1C
-    public static final int ILOAD_3              =  29; // 0x1D
-    public static final int LLOAD_0              =  30; // 0x1E
-    public static final int LLOAD_1              =  31; // 0x1F
-    public static final int LLOAD_2              =  32; // 0x20
-    public static final int LLOAD_3              =  33; // 0x21
-    public static final int FLOAD_0              =  34; // 0x22
-    public static final int FLOAD_1              =  35; // 0x23
-    public static final int FLOAD_2              =  36; // 0x24
-    public static final int FLOAD_3              =  37; // 0x25
-    public static final int DLOAD_0              =  38; // 0x26
-    public static final int DLOAD_1              =  39; // 0x27
-    public static final int DLOAD_2              =  40; // 0x28
-    public static final int DLOAD_3              =  41; // 0x29
-    public static final int ALOAD_0              =  42; // 0x2A
-    public static final int ALOAD_1              =  43; // 0x2B
-    public static final int ALOAD_2              =  44; // 0x2C
-    public static final int ALOAD_3              =  45; // 0x2D
-    public static final int IALOAD               =  46; // 0x2E
-    public static final int LALOAD               =  47; // 0x2F
-    public static final int FALOAD               =  48; // 0x30
-    public static final int DALOAD               =  49; // 0x31
-    public static final int AALOAD               =  50; // 0x32
-    public static final int BALOAD               =  51; // 0x33
-    public static final int CALOAD               =  52; // 0x34
-    public static final int SALOAD               =  53; // 0x35
-    public static final int ISTORE               =  54; // 0x36
-    public static final int LSTORE               =  55; // 0x37
-    public static final int FSTORE               =  56; // 0x38
-    public static final int DSTORE               =  57; // 0x39
-    public static final int ASTORE               =  58; // 0x3A
-    public static final int ISTORE_0             =  59; // 0x3B
-    public static final int ISTORE_1             =  60; // 0x3C
-    public static final int ISTORE_2             =  61; // 0x3D
-    public static final int ISTORE_3             =  62; // 0x3E
-    public static final int LSTORE_0             =  63; // 0x3F
-    public static final int LSTORE_1             =  64; // 0x40
-    public static final int LSTORE_2             =  65; // 0x41
-    public static final int LSTORE_3             =  66; // 0x42
-    public static final int FSTORE_0             =  67; // 0x43
-    public static final int FSTORE_1             =  68; // 0x44
-    public static final int FSTORE_2             =  69; // 0x45
-    public static final int FSTORE_3             =  70; // 0x46
-    public static final int DSTORE_0             =  71; // 0x47
-    public static final int DSTORE_1             =  72; // 0x48
-    public static final int DSTORE_2             =  73; // 0x49
-    public static final int DSTORE_3             =  74; // 0x4A
-    public static final int ASTORE_0             =  75; // 0x4B
-    public static final int ASTORE_1             =  76; // 0x4C
-    public static final int ASTORE_2             =  77; // 0x4D
-    public static final int ASTORE_3             =  78; // 0x4E
-    public static final int IASTORE              =  79; // 0x4F
-    public static final int LASTORE              =  80; // 0x50
-    public static final int FASTORE              =  81; // 0x51
-    public static final int DASTORE              =  82; // 0x52
-    public static final int AASTORE              =  83; // 0x53
-    public static final int BASTORE              =  84; // 0x54
-    public static final int CASTORE              =  85; // 0x55
-    public static final int SASTORE              =  86; // 0x56
-    public static final int POP                  =  87; // 0x57
-    public static final int POP2                 =  88; // 0x58
-    public static final int DUP                  =  89; // 0x59
-    public static final int DUP_X1               =  90; // 0x5A
-    public static final int DUP_X2               =  91; // 0x5B
-    public static final int DUP2                 =  92; // 0x5C
-    public static final int DUP2_X1              =  93; // 0x5D
-    public static final int DUP2_X2              =  94; // 0x5E
-    public static final int SWAP                 =  95; // 0x5F
-    public static final int IADD                 =  96; // 0x60
-    public static final int LADD                 =  97; // 0x61
-    public static final int FADD                 =  98; // 0x62
-    public static final int DADD                 =  99; // 0x63
-    public static final int ISUB                 = 100; // 0x64
-    public static final int LSUB                 = 101; // 0x65
-    public static final int FSUB                 = 102; // 0x66
-    public static final int DSUB                 = 103; // 0x67
-    public static final int IMUL                 = 104; // 0x68
-    public static final int LMUL                 = 105; // 0x69
-    public static final int FMUL                 = 106; // 0x6A
-    public static final int DMUL                 = 107; // 0x6B
-    public static final int IDIV                 = 108; // 0x6C
-    public static final int LDIV                 = 109; // 0x6D
-    public static final int FDIV                 = 110; // 0x6E
-    public static final int DDIV                 = 111; // 0x6F
-    public static final int IREM                 = 112; // 0x70
-    public static final int LREM                 = 113; // 0x71
-    public static final int FREM                 = 114; // 0x72
-    public static final int DREM                 = 115; // 0x73
-    public static final int INEG                 = 116; // 0x74
-    public static final int LNEG                 = 117; // 0x75
-    public static final int FNEG                 = 118; // 0x76
-    public static final int DNEG                 = 119; // 0x77
-    public static final int ISHL                 = 120; // 0x78
-    public static final int LSHL                 = 121; // 0x79
-    public static final int ISHR                 = 122; // 0x7A
-    public static final int LSHR                 = 123; // 0x7B
-    public static final int IUSHR                = 124; // 0x7C
-    public static final int LUSHR                = 125; // 0x7D
-    public static final int IAND                 = 126; // 0x7E
-    public static final int LAND                 = 127; // 0x7F
-    public static final int IOR                  = 128; // 0x80
-    public static final int LOR                  = 129; // 0x81
-    public static final int IXOR                 = 130; // 0x82
-    public static final int LXOR                 = 131; // 0x83
-    public static final int IINC                 = 132; // 0x84
-    public static final int I2L                  = 133; // 0x85
-    public static final int I2F                  = 134; // 0x86
-    public static final int I2D                  = 135; // 0x87
-    public static final int L2I                  = 136; // 0x88
-    public static final int L2F                  = 137; // 0x89
-    public static final int L2D                  = 138; // 0x8A
-    public static final int F2I                  = 139; // 0x8B
-    public static final int F2L                  = 140; // 0x8C
-    public static final int F2D                  = 141; // 0x8D
-    public static final int D2I                  = 142; // 0x8E
-    public static final int D2L                  = 143; // 0x8F
-    public static final int D2F                  = 144; // 0x90
-    public static final int I2B                  = 145; // 0x91
-    public static final int I2C                  = 146; // 0x92
-    public static final int I2S                  = 147; // 0x93
-    public static final int LCMP                 = 148; // 0x94
-    public static final int FCMPL                = 149; // 0x95
-    public static final int FCMPG                = 150; // 0x96
-    public static final int DCMPL                = 151; // 0x97
-    public static final int DCMPG                = 152; // 0x98
-    public static final int IFEQ                 = 153; // 0x99
-    public static final int IFNE                 = 154; // 0x9A
-    public static final int IFLT                 = 155; // 0x9B
-    public static final int IFGE                 = 156; // 0x9C
-    public static final int IFGT                 = 157; // 0x9D
-    public static final int IFLE                 = 158; // 0x9E
-    public static final int IF_ICMPEQ            = 159; // 0x9F
-    public static final int IF_ICMPNE            = 160; // 0xA0
-    public static final int IF_ICMPLT            = 161; // 0xA1
-    public static final int IF_ICMPGE            = 162; // 0xA2
-    public static final int IF_ICMPGT            = 163; // 0xA3
-    public static final int IF_ICMPLE            = 164; // 0xA4
-    public static final int IF_ACMPEQ            = 165; // 0xA5
-    public static final int IF_ACMPNE            = 166; // 0xA6
-    public static final int GOTO                 = 167; // 0xA7
-    public static final int JSR                  = 168; // 0xA8
-    public static final int RET                  = 169; // 0xA9
-    public static final int TABLESWITCH          = 170; // 0xAA
-    public static final int LOOKUPSWITCH         = 171; // 0xAB
-    public static final int IRETURN              = 172; // 0xAC
-    public static final int LRETURN              = 173; // 0xAD
-    public static final int FRETURN              = 174; // 0xAE
-    public static final int DRETURN              = 175; // 0xAF
-    public static final int ARETURN              = 176; // 0xB0
-    public static final int RETURN               = 177; // 0xB1
-    public static final int GETSTATIC            = 178; // 0xB2
-    public static final int PUTSTATIC            = 179; // 0xB3
-    public static final int GETFIELD             = 180; // 0xB4
-    public static final int PUTFIELD             = 181; // 0xB5
-    public static final int INVOKEVIRTUAL        = 182; // 0xB6
-    public static final int INVOKESPECIAL        = 183; // 0xB7
-    public static final int INVOKESTATIC         = 184; // 0xB8
-    public static final int INVOKEINTERFACE      = 185; // 0xB9
-    public static final int XXXUNUSEDXXX         = 186; // 0xBA
-    public static final int NEW                  = 187; // 0xBB
-    public static final int NEWARRAY             = 188; // 0xBC
-    public static final int ANEWARRAY            = 189; // 0xBD
-    public static final int ARRAYLENGTH          = 190; // 0xBE
-    public static final int ATHROW               = 191; // 0xBF
-    public static final int CHECKCAST            = 192; // 0xC0
-    public static final int INSTANCEOF           = 193; // 0xC1
-    public static final int MONITORENTER         = 194; // 0xC2
-    public static final int MONITOREXIT          = 195; // 0xC3
-    public static final int WIDE                 = 196; // 0xC4
-    public static final int MULTIANEWARRAY       = 197; // 0xC5
-    public static final int IFNULL               = 198; // 0xC6
-    public static final int IFNONNULL            = 199; // 0xC7
-    public static final int GOTO_W               = 200; // 0xC8
-    public static final int JSR_W                = 201; // 0xC9
-    public static final int BREAKPOINT           = 202; // 0xCA
-
-    public static final int ILLEGAL = 255;
-    public static final int END = 256;
-
-    /**
-     * The last opcode defined by the JVM specification. To iterate over all JVM bytecodes:
-     * <pre>
-     *     for (int opcode = 0; opcode <= Bytecodes.LAST_JVM_OPCODE; ++opcode) {
-     *         //
-     *     }
-     * </pre>
-     */
-    public static final int LAST_JVM_OPCODE = JSR_W;
-
-    /**
-     * A collection of flags describing various bytecode attributes.
-     */
-    static class Flags {
-
-        /**
-         * Denotes an instruction that ends a basic block and does not let control flow fall through to its lexical successor.
-         */
-        static final int STOP = 0x00000001;
-
-        /**
-         * Denotes an instruction that ends a basic block and may let control flow fall through to its lexical successor.
-         * In practice this means it is a conditional branch.
-         */
-        static final int FALL_THROUGH = 0x00000002;
-
-        /**
-         * Denotes an instruction that has a 2 or 4 byte operand that is an offset to another instruction in the same method.
-         * This does not include the {@link Bytecodes#TABLESWITCH} or {@link Bytecodes#LOOKUPSWITCH} instructions.
-         */
-        static final int BRANCH = 0x00000004;
-
-        /**
-         * Denotes an instruction that reads the value of a static or instance field.
-         */
-        static final int FIELD_READ = 0x00000008;
-
-        /**
-         * Denotes an instruction that writes the value of a static or instance field.
-         */
-        static final int FIELD_WRITE = 0x00000010;
-
-        /**
-         * Denotes an instruction that is not defined in the JVM specification.
-         */
-        static final int EXTENSION = 0x00000020;
-
-        /**
-         * Denotes an instruction that can cause a trap.
-         */
-        static final int TRAP        = 0x00000080;
-        /**
-         * Denotes an instruction that is commutative.
-         */
-        static final int COMMUTATIVE = 0x00000100;
-        /**
-         * Denotes an instruction that is associative.
-         */
-        static final int ASSOCIATIVE = 0x00000200;
-        /**
-         * Denotes an instruction that loads an operand.
-         */
-        static final int LOAD        = 0x00000400;
-        /**
-         * Denotes an instruction that stores an operand.
-         */
-        static final int STORE       = 0x00000800;
-        /**
-         * Denotes the 4 INVOKE* instructions.
-         */
-        static final int INVOKE       = 0x00001000;
-    }
-
-    // Performs a sanity check that none of the flags overlap.
-    static {
-        int allFlags = 0;
-        try {
-            for (Field field : Flags.class.getDeclaredFields()) {
-                int flagsFilter = Modifier.FINAL | Modifier.STATIC;
-                if ((field.getModifiers() & flagsFilter) == flagsFilter && !field.isSynthetic()) {
-                    assert field.getType() == int.class : "Field is not int : " + field;
-                    final int flag = field.getInt(null);
-                    assert flag != 0;
-                    assert (flag & allFlags) == 0 : field.getName() + " has a value conflicting with another flag";
-                    allFlags |= flag;
-                }
-            }
-        } catch (Exception e) {
-            throw new InternalError(e.toString());
-        }
-    }
-
-    /**
-     * An array that maps from a bytecode value to a {@link String} for the corresponding instruction mnemonic.
-     * This will include the root instruction for the three-byte extended instructions.
-     */
-    private static final String[] nameArray = new String[256];
-
-    /**
-     * An array that maps from a bytecode value to the set of {@link Flags} for the corresponding instruction.
-     */
-    private static final int[] flagsArray = new int[256];
-
-    /**
-     * An array that maps from a bytecode value to the length in bytes for the corresponding instruction.
-     */
-    private static final int[] lengthArray = new int[256];
-
-    /**
-     * An array that maps from a bytecode value to the estimated complexity of the bytecode in terms of generated machine code.
-     */
-    private static final int[] compilationComplexityArray = new int[256];
-
-    // Checkstyle: stop
-    static {
-        def(NOP                 , "nop"             , "b"    , 0);
-        def(ACONST_NULL         , "aconst_null"     , "b"    , 0);
-        def(ICONST_M1           , "iconst_m1"       , "b"    , 0);
-        def(ICONST_0            , "iconst_0"        , "b"    , 0);
-        def(ICONST_1            , "iconst_1"        , "b"    , 0);
-        def(ICONST_2            , "iconst_2"        , "b"    , 0);
-        def(ICONST_3            , "iconst_3"        , "b"    , 0);
-        def(ICONST_4            , "iconst_4"        , "b"    , 0);
-        def(ICONST_5            , "iconst_5"        , "b"    , 0);
-        def(LCONST_0            , "lconst_0"        , "b"    , 0);
-        def(LCONST_1            , "lconst_1"        , "b"    , 0);
-        def(FCONST_0            , "fconst_0"        , "b"    , 0);
-        def(FCONST_1            , "fconst_1"        , "b"    , 0);
-        def(FCONST_2            , "fconst_2"        , "b"    , 0);
-        def(DCONST_0            , "dconst_0"        , "b"    , 0);
-        def(DCONST_1            , "dconst_1"        , "b"    , 0);
-        def(BIPUSH              , "bipush"          , "bc"   , 0);
-        def(SIPUSH              , "sipush"          , "bcc"  , 0);
-        def(LDC                 , "ldc"             , "bi"   , 0, TRAP);
-        def(LDC_W               , "ldc_w"           , "bii"  , 0, TRAP);
-        def(LDC2_W              , "ldc2_w"          , "bii"  , 0, TRAP);
-        def(ILOAD               , "iload"           , "bi"   , 0, LOAD);
-        def(LLOAD               , "lload"           , "bi"   , 0, LOAD);
-        def(FLOAD               , "fload"           , "bi"   , 0, LOAD);
-        def(DLOAD               , "dload"           , "bi"   , 0, LOAD);
-        def(ALOAD               , "aload"           , "bi"   , 0, LOAD);
-        def(ILOAD_0             , "iload_0"         , "b"    , 0, LOAD);
-        def(ILOAD_1             , "iload_1"         , "b"    , 0, LOAD);
-        def(ILOAD_2             , "iload_2"         , "b"    , 0, LOAD);
-        def(ILOAD_3             , "iload_3"         , "b"    , 0, LOAD);
-        def(LLOAD_0             , "lload_0"         , "b"    , 0, LOAD);
-        def(LLOAD_1             , "lload_1"         , "b"    , 0, LOAD);
-        def(LLOAD_2             , "lload_2"         , "b"    , 0, LOAD);
-        def(LLOAD_3             , "lload_3"         , "b"    , 0, LOAD);
-        def(FLOAD_0             , "fload_0"         , "b"    , 0, LOAD);
-        def(FLOAD_1             , "fload_1"         , "b"    , 0, LOAD);
-        def(FLOAD_2             , "fload_2"         , "b"    , 0, LOAD);
-        def(FLOAD_3             , "fload_3"         , "b"    , 0, LOAD);
-        def(DLOAD_0             , "dload_0"         , "b"    , 0, LOAD);
-        def(DLOAD_1             , "dload_1"         , "b"    , 0, LOAD);
-        def(DLOAD_2             , "dload_2"         , "b"    , 0, LOAD);
-        def(DLOAD_3             , "dload_3"         , "b"    , 0, LOAD);
-        def(ALOAD_0             , "aload_0"         , "b"    , 0, LOAD);
-        def(ALOAD_1             , "aload_1"         , "b"    , 0, LOAD);
-        def(ALOAD_2             , "aload_2"         , "b"    , 0, LOAD);
-        def(ALOAD_3             , "aload_3"         , "b"    , 0, LOAD);
-        def(IALOAD              , "iaload"          , "b"    , 0, TRAP);
-        def(LALOAD              , "laload"          , "b"    , 0, TRAP);
-        def(FALOAD              , "faload"          , "b"    , 0, TRAP);
-        def(DALOAD              , "daload"          , "b"    , 0, TRAP);
-        def(AALOAD              , "aaload"          , "b"    , 0, TRAP);
-        def(BALOAD              , "baload"          , "b"    , 0, TRAP);
-        def(CALOAD              , "caload"          , "b"    , 0, TRAP);
-        def(SALOAD              , "saload"          , "b"    , 0, TRAP);
-        def(ISTORE              , "istore"          , "bi"   , 0, STORE);
-        def(LSTORE              , "lstore"          , "bi"   , 0, STORE);
-        def(FSTORE              , "fstore"          , "bi"   , 0, STORE);
-        def(DSTORE              , "dstore"          , "bi"   , 0, STORE);
-        def(ASTORE              , "astore"          , "bi"   , 0, STORE);
-        def(ISTORE_0            , "istore_0"        , "b"    , 0, STORE);
-        def(ISTORE_1            , "istore_1"        , "b"    , 0, STORE);
-        def(ISTORE_2            , "istore_2"        , "b"    , 0, STORE);
-        def(ISTORE_3            , "istore_3"        , "b"    , 0, STORE);
-        def(LSTORE_0            , "lstore_0"        , "b"    , 0, STORE);
-        def(LSTORE_1            , "lstore_1"        , "b"    , 0, STORE);
-        def(LSTORE_2            , "lstore_2"        , "b"    , 0, STORE);
-        def(LSTORE_3            , "lstore_3"        , "b"    , 0, STORE);
-        def(FSTORE_0            , "fstore_0"        , "b"    , 0, STORE);
-        def(FSTORE_1            , "fstore_1"        , "b"    , 0, STORE);
-        def(FSTORE_2            , "fstore_2"        , "b"    , 0, STORE);
-        def(FSTORE_3            , "fstore_3"        , "b"    , 0, STORE);
-        def(DSTORE_0            , "dstore_0"        , "b"    , 0, STORE);
-        def(DSTORE_1            , "dstore_1"        , "b"    , 0, STORE);
-        def(DSTORE_2            , "dstore_2"        , "b"    , 0, STORE);
-        def(DSTORE_3            , "dstore_3"        , "b"    , 0, STORE);
-        def(ASTORE_0            , "astore_0"        , "b"    , 0, STORE);
-        def(ASTORE_1            , "astore_1"        , "b"    , 0, STORE);
-        def(ASTORE_2            , "astore_2"        , "b"    , 0, STORE);
-        def(ASTORE_3            , "astore_3"        , "b"    , 0, STORE);
-        def(IASTORE             , "iastore"         , "b"    , 3, TRAP);
-        def(LASTORE             , "lastore"         , "b"    , 3, TRAP);
-        def(FASTORE             , "fastore"         , "b"    , 3, TRAP);
-        def(DASTORE             , "dastore"         , "b"    , 3, TRAP);
-        def(AASTORE             , "aastore"         , "b"    , 4, TRAP);
-        def(BASTORE             , "bastore"         , "b"    , 3, TRAP);
-        def(CASTORE             , "castore"         , "b"    , 3, TRAP);
-        def(SASTORE             , "sastore"         , "b"    , 3, TRAP);
-        def(POP                 , "pop"             , "b"    , 0);
-        def(POP2                , "pop2"            , "b"    , 0);
-        def(DUP                 , "dup"             , "b"    , 0);
-        def(DUP_X1              , "dup_x1"          , "b"    , 0);
-        def(DUP_X2              , "dup_x2"          , "b"    , 0);
-        def(DUP2                , "dup2"            , "b"    , 0);
-        def(DUP2_X1             , "dup2_x1"         , "b"    , 0);
-        def(DUP2_X2             , "dup2_x2"         , "b"    , 0);
-        def(SWAP                , "swap"            , "b"    , 0);
-        def(IADD                , "iadd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(LADD                , "ladd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(FADD                , "fadd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(DADD                , "dadd"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(ISUB                , "isub"            , "b"    , 1);
-        def(LSUB                , "lsub"            , "b"    , 1);
-        def(FSUB                , "fsub"            , "b"    , 1);
-        def(DSUB                , "dsub"            , "b"    , 1);
-        def(IMUL                , "imul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(LMUL                , "lmul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(FMUL                , "fmul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(DMUL                , "dmul"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(IDIV                , "idiv"            , "b"    , 1, TRAP);
-        def(LDIV                , "ldiv"            , "b"    , 1, TRAP);
-        def(FDIV                , "fdiv"            , "b"    , 1);
-        def(DDIV                , "ddiv"            , "b"    , 1);
-        def(IREM                , "irem"            , "b"    , 1, TRAP);
-        def(LREM                , "lrem"            , "b"    , 1, TRAP);
-        def(FREM                , "frem"            , "b"    , 1);
-        def(DREM                , "drem"            , "b"    , 1);
-        def(INEG                , "ineg"            , "b"    , 1);
-        def(LNEG                , "lneg"            , "b"    , 1);
-        def(FNEG                , "fneg"            , "b"    , 1);
-        def(DNEG                , "dneg"            , "b"    , 1);
-        def(ISHL                , "ishl"            , "b"    , 1);
-        def(LSHL                , "lshl"            , "b"    , 1);
-        def(ISHR                , "ishr"            , "b"    , 1);
-        def(LSHR                , "lshr"            , "b"    , 1);
-        def(IUSHR               , "iushr"           , "b"    , 1);
-        def(LUSHR               , "lushr"           , "b"    , 1);
-        def(IAND                , "iand"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(LAND                , "land"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(IOR                 , "ior"             , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(LOR                 , "lor"             , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(IXOR                , "ixor"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(LXOR                , "lxor"            , "b"    , 1, COMMUTATIVE | ASSOCIATIVE);
-        def(IINC                , "iinc"            , "bic"  , 1, LOAD | STORE);
-        def(I2L                 , "i2l"             , "b"    , 1);
-        def(I2F                 , "i2f"             , "b"    , 1);
-        def(I2D                 , "i2d"             , "b"    , 1);
-        def(L2I                 , "l2i"             , "b"    , 1);
-        def(L2F                 , "l2f"             , "b"    , 1);
-        def(L2D                 , "l2d"             , "b"    , 1);
-        def(F2I                 , "f2i"             , "b"    , 1);
-        def(F2L                 , "f2l"             , "b"    , 1);
-        def(F2D                 , "f2d"             , "b"    , 1);
-        def(D2I                 , "d2i"             , "b"    , 1);
-        def(D2L                 , "d2l"             , "b"    , 1);
-        def(D2F                 , "d2f"             , "b"    , 1);
-        def(I2B                 , "i2b"             , "b"    , 1);
-        def(I2C                 , "i2c"             , "b"    , 1);
-        def(I2S                 , "i2s"             , "b"    , 1);
-        def(LCMP                , "lcmp"            , "b"    , 1);
-        def(FCMPL               , "fcmpl"           , "b"    , 1);
-        def(FCMPG               , "fcmpg"           , "b"    , 1);
-        def(DCMPL               , "dcmpl"           , "b"    , 1);
-        def(DCMPG               , "dcmpg"           , "b"    , 1);
-        def(IFEQ                , "ifeq"            , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IFNE                , "ifne"            , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IFLT                , "iflt"            , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IFGE                , "ifge"            , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IFGT                , "ifgt"            , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IFLE                , "ifle"            , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IF_ICMPEQ           , "if_icmpeq"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(IF_ICMPNE           , "if_icmpne"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(IF_ICMPLT           , "if_icmplt"       , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IF_ICMPGE           , "if_icmpge"       , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IF_ICMPGT           , "if_icmpgt"       , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IF_ICMPLE           , "if_icmple"       , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IF_ACMPEQ           , "if_acmpeq"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(IF_ACMPNE           , "if_acmpne"       , "boo"  , 2, COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(GOTO                , "goto"            , "boo"  , 1, STOP | BRANCH);
-        def(JSR                 , "jsr"             , "boo"  , 0, STOP | BRANCH);
-        def(RET                 , "ret"             , "bi"   , 0, STOP);
-        def(TABLESWITCH         , "tableswitch"     , ""     , 4, STOP);
-        def(LOOKUPSWITCH        , "lookupswitch"    , ""     , 4, STOP);
-        def(IRETURN             , "ireturn"         , "b"    , 1, TRAP | STOP);
-        def(LRETURN             , "lreturn"         , "b"    , 1, TRAP | STOP);
-        def(FRETURN             , "freturn"         , "b"    , 1, TRAP | STOP);
-        def(DRETURN             , "dreturn"         , "b"    , 1, TRAP | STOP);
-        def(ARETURN             , "areturn"         , "b"    , 1, TRAP | STOP);
-        def(RETURN              , "return"          , "b"    , 1, TRAP | STOP);
-        def(GETSTATIC           , "getstatic"       , "bjj"  , 2, TRAP | FIELD_READ);
-        def(PUTSTATIC           , "putstatic"       , "bjj"  , 2, TRAP | FIELD_WRITE);
-        def(GETFIELD            , "getfield"        , "bjj"  , 2, TRAP | FIELD_READ);
-        def(PUTFIELD            , "putfield"        , "bjj"  , 2, TRAP | FIELD_WRITE);
-        def(INVOKEVIRTUAL       , "invokevirtual"   , "bjj"  , 7, TRAP | INVOKE);
-        def(INVOKESPECIAL       , "invokespecial"   , "bjj"  , 5, TRAP | INVOKE);
-        def(INVOKESTATIC        , "invokestatic"    , "bjj"  , 5, TRAP | INVOKE);
-        def(INVOKEINTERFACE     , "invokeinterface" , "bjja_", 7, TRAP | INVOKE);
-        def(XXXUNUSEDXXX        , "xxxunusedxxx"    , ""     , 0);
-        def(NEW                 , "new"             , "bii"  , 6, TRAP);
-        def(NEWARRAY            , "newarray"        , "bc"   , 6, TRAP);
-        def(ANEWARRAY           , "anewarray"       , "bii"  , 6, TRAP);
-        def(ARRAYLENGTH         , "arraylength"     , "b"    , 2, TRAP);
-        def(ATHROW              , "athrow"          , "b"    , 5, TRAP | STOP);
-        def(CHECKCAST           , "checkcast"       , "bii"  , 3, TRAP);
-        def(INSTANCEOF          , "instanceof"      , "bii"  , 4, TRAP);
-        def(MONITORENTER        , "monitorenter"    , "b"    , 5, TRAP);
-        def(MONITOREXIT         , "monitorexit"     , "b"    , 5, TRAP);
-        def(WIDE                , "wide"            , ""     , 0);
-        def(MULTIANEWARRAY      , "multianewarray"  , "biic" , 6, TRAP);
-        def(IFNULL              , "ifnull"          , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(IFNONNULL           , "ifnonnull"       , "boo"  , 2, FALL_THROUGH | BRANCH);
-        def(GOTO_W              , "goto_w"          , "boooo", 1, STOP | BRANCH);
-        def(JSR_W               , "jsr_w"           , "boooo", 0, STOP | BRANCH);
-        def(BREAKPOINT          , "breakpoint"      , "b"    , 0, TRAP);
-    }
-    // Checkstyle: resume
-
-    /**
-     * Determines if an opcode is commutative.
-     * @param opcode the opcode to check
-     * @return {@code true} iff commutative
-     */
-    public static boolean isCommutative(int opcode) {
-        return (flagsArray[opcode & 0xff] & COMMUTATIVE) != 0;
-    }
-
-    /**
-     * Gets the length of an instruction denoted by a given opcode.
-     *
-     * @param opcode an instruction opcode
-     * @return the length of the instruction denoted by {@code opcode}. If {@code opcode} is an illegal instruction or denotes a
-     *         variable length instruction (e.g. {@link #TABLESWITCH}), then 0 is returned.
-     */
-    public static int lengthOf(int opcode) {
-        return lengthArray[opcode & 0xff];
-    }
-
-    /**
-     * Gets the compilation complexity for a given opcode.
-     * @param opcode an opcode
-     * @return a value >= 0
-     */
-    public static int compilationComplexity(int opcode) {
-        return compilationComplexityArray[opcode & 0xff];
-    }
-
-    /**
-     * Gets the lower-case mnemonic for a given opcode.
-     *
-     * @param opcode an opcode
-     * @return the mnemonic for {@code opcode} or {@code "<illegal opcode: " + opcode + ">"} if {@code opcode} is not a legal opcode
-     */
-    public static String nameOf(int opcode) throws IllegalArgumentException {
-        String name = nameArray[opcode & 0xff];
-        if (name == null) {
-            return "<illegal opcode: " + opcode + ">";
-        }
-        return name;
-    }
-
-    /**
-     * Allocation-free version of {@linkplain #nameOf(int)}.
-     * @param opcode an opcode.
-     * @return the mnemonic for {@code opcode} or {@code "<illegal opcode>"} if {@code opcode} is not a legal opcode.
-     */
-    public static String baseNameOf(int opcode) {
-        String name = nameArray[opcode & 0xff];
-        if (name == null) {
-            return "<illegal opcode>";
-        }
-        return name;
-    }
-
-    /**
-     * Gets the opcode corresponding to a given mnemonic.
-     *
-     * @param name an opcode mnemonic
-     * @return the opcode corresponding to {@code mnemonic}
-     * @throws IllegalArgumentException if {@code name} does not denote a valid opcode
-     */
-    public static int valueOf(String name) {
-        for (int opcode = 0; opcode < nameArray.length; ++opcode) {
-            if (name.equalsIgnoreCase(nameArray[opcode])) {
-                return opcode;
-            }
-        }
-        throw new IllegalArgumentException("No opcode for " + name);
-    }
-
-    /**
-     * Determines if a given opcode denotes an instruction that can cause an implicit exception.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} can cause an implicit exception, {@code false} otherwise
-     */
-    public static boolean canTrap(int opcode) {
-        return (flagsArray[opcode & 0xff] & TRAP) != 0;
-    }
-
-    /**
-     * Determines if a given opcode denotes an instruction that loads a local variable to the operand stack.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} loads a local variable to the operand stack, {@code false} otherwise
-     */
-    public static boolean isLoad(int opcode) {
-        return (flagsArray[opcode & 0xff] & LOAD) != 0;
-    }
-
-    /**
-     * Determines if a given opcode denotes an instruction that ends a basic block and does not let control flow fall
-     * through to its lexical successor.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} properly ends a basic block
-     */
-    public static boolean isStop(int opcode) {
-        return (flagsArray[opcode & 0xff] & STOP) != 0;
-    }
-
-    /**
-     * Determines if a given opcode denotes an instruction that stores a value to a local variable
-     * after popping it from the operand stack.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} stores a value to a local variable, {@code false} otherwise
-     */
-    public static boolean isInvoke(int opcode) {
-        return (flagsArray[opcode & 0xff] & INVOKE) != 0;
-    }
-
-    /**
-     * Determines if a given opcode denotes an instruction that stores a value to a local variable
-     * after popping it from the operand stack.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} stores a value to a local variable, {@code false} otherwise
-     */
-    public static boolean isStore(int opcode) {
-        return (flagsArray[opcode & 0xff] & STORE) != 0;
-    }
-
-    /**
-     * Determines if a given opcode is an instruction that delimits a basic block.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} delimits a basic block
-     */
-    public static boolean isBlockEnd(int opcode) {
-        return (flagsArray[opcode & 0xff] & (STOP | FALL_THROUGH)) != 0;
-    }
-
-    /**
-     * Determines if a given opcode is an instruction that has a 2 or 4 byte operand that is an offset to another
-     * instruction in the same method. This does not include the {@linkplain #TABLESWITCH switch} instructions.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} is a branch instruction with a single operand
-     */
-    public static boolean isBranch(int opcode) {
-        return (flagsArray[opcode & 0xff] & BRANCH) != 0;
-    }
-
-    /**
-     * Determines if a given opcode denotes a conditional branch.
-     * @param opcode
-     * @return {@code true} iff {@code opcode} is a conditional branch
-     */
-    public static boolean isConditionalBranch(int opcode) {
-        return (flagsArray[opcode & 0xff] & FALL_THROUGH) != 0;
-    }
-
-    /**
-     * Determines if a given opcode denotes a standard bytecode. A standard bytecode is
-     * defined in the JVM specification.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} iff {@code opcode} is a standard bytecode
-     */
-    public static boolean isStandard(int opcode) {
-        return (flagsArray[opcode & 0xff] & EXTENSION) == 0;
-    }
-
-    /**
-     * Determines if a given opcode denotes an extended bytecode.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} if {@code opcode} is an extended bytecode
-     */
-    public static boolean isExtended(int opcode) {
-        return (flagsArray[opcode & 0xff] & EXTENSION) != 0;
-    }
-
-    /**
-     * Determines if a given opcode is a three-byte extended bytecode.
-     *
-     * @param opcode an opcode to test
-     * @return {@code true} if {@code (opcode & ~0xff) != 0}
-     */
-    public static boolean isThreeByteExtended(int opcode) {
-        return (opcode & ~0xff) != 0;
-    }
-
-    /**
-     * Gets the arithmetic operator name for a given opcode. If {@code opcode} does not denote an
-     * arithmetic instruction, then the {@linkplain #nameOf(int) name} of the opcode is returned
-     * instead.
-     *
-     * @param op an opcode
-     * @return the arithmetic operator name
-     */
-    public static String operator(int op) {
-        // Checkstyle: stop
-        switch (op) {
-            // arithmetic ops
-            case IADD : // fall through
-            case LADD : // fall through
-            case FADD : // fall through
-            case DADD : return "+";
-            case ISUB : // fall through
-            case LSUB : // fall through
-            case FSUB : // fall through
-            case DSUB : return "-";
-            case IMUL : // fall through
-            case LMUL : // fall through
-            case FMUL : // fall through
-            case DMUL : return "*";
-            case IDIV : // fall through
-            case LDIV : // fall through
-            case FDIV : // fall through
-            case DDIV : return "/";
-            case IREM : // fall through
-            case LREM : // fall through
-            case FREM : // fall through
-            case DREM : return "%";
-            // shift ops
-            case ISHL : // fall through
-            case LSHL : return "<<";
-            case ISHR : // fall through
-            case LSHR : return ">>";
-            case IUSHR: // fall through
-            case LUSHR: return ">>>";
-            // logic ops
-            case IAND : // fall through
-            case LAND : return "&";
-            case IOR  : // fall through
-            case LOR  : return "|";
-            case IXOR : // fall through
-            case LXOR : return "^";
-        }
-        // Checkstyle: resume
-        return nameOf(op);
-    }
-
-    /**
-     * Defines a bytecode by entering it into the arrays that record its name, length and flags.
-     *
-     * @param name instruction name (should be lower case)
-     * @param format encodes the length of the instruction
-     * @param flagsArray the set of {@link Flags} associated with the instruction
-     */
-    private static void def(int opcode, String name, String format, int compilationComplexity) {
-        def(opcode, name, format, compilationComplexity, 0);
-    }
-
-    /**
-     * Defines a bytecode by entering it into the arrays that record its name, length and flags.
-     *
-     * @param name instruction name (lower case)
-     * @param format encodes the length of the instruction
-     * @param flags the set of {@link Flags} associated with the instruction
-     */
-    private static void def(int opcode, String name, String format, int compilationComplexity, int flags) {
-        assert nameArray[opcode] == null : "opcode " + opcode + " is already bound to name " + nameArray[opcode];
-        nameArray[opcode] = name;
-        int instructionLength = format.length();
-        lengthArray[opcode] = instructionLength;
-        compilationComplexityArray[opcode] = compilationComplexity;
-        Bytecodes.flagsArray[opcode] = flags;
-
-        assert !isConditionalBranch(opcode) || isBranch(opcode) : "a conditional branch must also be a branch";
-    }
-
-    /**
-     * Utility for ensuring that the extended opcodes are contiguous and follow on directly
-     * from the standard JVM opcodes. If these conditions do not hold for the input source
-     * file, then it is modified 'in situ' to fix the problem.
-     *
-     * @param args {@code args[0]} is the path to this source file
-     */
-    public static void main(String[] args) throws Exception {
-        Method findWorkspaceDirectory = Class.forName("com.sun.max.ide.JavaProject").getDeclaredMethod("findWorkspaceDirectory");
-        File base = new File((File) findWorkspaceDirectory.invoke(null), "com.oracle.max.cri/src");
-        File file = new File(base, Bytecodes.class.getName().replace('.', File.separatorChar) + ".java").getAbsoluteFile();
-
-        Pattern opcodeDecl = Pattern.compile("(\\s*public static final int )(\\w+)(\\s*=\\s*)(\\d+)(;.*)");
-
-        BufferedReader br = new BufferedReader(new FileReader(file));
-        CharArrayWriter buffer = new CharArrayWriter((int) file.length());
-        PrintWriter out = new PrintWriter(buffer);
-        String line;
-        int lastExtendedOpcode = BREAKPOINT;
-        boolean modified = false;
-        int section = 0;
-        while ((line = br.readLine()) != null) {
-            if (section == 0) {
-                if (line.equals("    // Start extended bytecodes")) {
-                    section = 1;
-                }
-            } else if (section == 1) {
-                if (line.equals("    // End extended bytecodes")) {
-                    section = 2;
-                } else {
-                    Matcher matcher = opcodeDecl.matcher(line);
-                    if (matcher.matches()) {
-                        String name = matcher.group(2);
-                        String value = matcher.group(4);
-                        int opcode = Integer.parseInt(value);
-                        if (nameArray[opcode] == null || !nameArray[opcode].equalsIgnoreCase(name)) {
-                            throw new RuntimeException("Missing definition of name and flags for " + opcode + ":" + name + " -- " + nameArray[opcode]);
-                        }
-                        if (opcode != lastExtendedOpcode + 1) {
-                            System.err.println("Fixed declaration of opcode " + name + " to be " + (lastExtendedOpcode + 1) + " (was " + value + ")");
-                            opcode = lastExtendedOpcode + 1;
-                            line = line.substring(0, matcher.start(4)) + opcode + line.substring(matcher.end(4));
-                            modified = true;
-                        }
-
-                        if (opcode >= 256) {
-                            throw new RuntimeException("Exceeded maximum opcode value with " + name);
-                        }
-
-                        lastExtendedOpcode = opcode;
-                    }
-                }
-            }
-
-            out.println(line);
-        }
-        if (section == 0) {
-            throw new RuntimeException("Did not find line starting extended bytecode declarations:\n\n    // Start extended bytecodes");
-        } else if (section == 1) {
-            throw new RuntimeException("Did not find line ending extended bytecode declarations:\n\n    // End extended bytecodes");
-        }
-
-        if (modified) {
-            out.flush();
-            FileWriter fileWriter = new FileWriter(file);
-            fileWriter.write(buffer.toCharArray());
-            fileWriter.close();
-
-            System.out.println("Modified: " + file);
-        }
-
-
-        // Uncomment to print out visitor method declarations:
-//        for (int opcode = 0; opcode < flags.length; ++opcode) {
-//            if (isExtension(opcode)) {
-//                String visitorParams = length(opcode) == 1 ? "" : "int index";
-//                System.out.println("@Override");
-//                System.out.println("protected void " + name(opcode) + "(" + visitorParams + ") {");
-//                System.out.println("}");
-//                System.out.println();
-//            }
-//        }
-
-        // Uncomment to print out visitor method declarations:
-//        for (int opcode = 0; opcode < flags.length; ++opcode) {
-//            if (isExtension(opcode)) {
-//                System.out.println("case " + name(opcode).toUpperCase() + ": {");
-//                String arg = "";
-//                int length = length(opcode);
-//                if (length == 2) {
-//                    arg = "readUnsigned1()";
-//                } else if (length == 3) {
-//                    arg = "readUnsigned2()";
-//                }
-//                System.out.println("    bytecodeVisitor." + name(opcode) + "(" + arg + ");");
-//                System.out.println("    break;");
-//                System.out.println("}");
-//            }
-//        }
-
-    }
-}
--- a/graal/com.oracle.max.graal.java/src/com/oracle/graal/java/bytecode/Bytes.java	Thu Mar 08 19:11:12 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.oracle.graal.java.bytecode;
-
-/**
- * A collection of utility methods for dealing with bytes, particularly in byte arrays.
- */
-public class Bytes {
-    /**
-     * Gets a signed 1-byte value.
-     * @param data the array containing the data
-     * @param bci the start index of the value to retrieve
-     * @return the signed 1-byte value at index {@code bci} in array {@code data}
-     */
-    public static int beS1(byte[] data, int bci) {
-        return data[bci];
-    }
-
-    /**
-     * Gets a signed 2-byte big-endian value.
-     * @param data the array containing the data
-     * @param bci the start index of the value to retrieve
-     * @return the signed 2-byte, big-endian, value at index {@code bci} in array {@code data}
-     */
-    public static int beS2(byte[] data, int bci) {
-        return (data[bci] << 8) | (data[bci + 1] & 0xff);
-    }
-
-    /**
-     * Gets an unsigned 1-byte value.
-     * @param data the array containing the data
-     * @param bci the start index of the value to retrieve
-     * @return the unsigned 1-byte value at index {@code bci} in array {@code data}
-     */
-    public static int beU1(byte[] data, int bci) {
-        return data[bci] & 0xff;
-    }
-
-    /**
-     * Gets an unsigned 2-byte big-endian value.
-     * @param data the array containing the data
-     * @param bci the start index of the value to retrieve
-     * @return the unsigned 2-byte, big-endian, value at index {@code bci} in array {@code data}
-     */
-    public static int beU2(byte[] data, int bci) {
-        return ((data[bci] & 0xff) << 8) | (data[bci + 1] & 0xff);
-    }
-
-    /**
-     * Gets a signed 4-byte big-endian value.
-     * @param data the array containing the data
-     * @param bci the start index of the value to retrieve
-     * @return the signed 4-byte, big-endian, value at index {@code bci} in array {@code data}
-     */
-    public static int beS4(byte[] data, int bci) {
-        return (data[bci] << 24) | ((data[bci + 1] & 0xff) << 16) | ((data[bci + 2] & 0xff) << 8) | (data[bci + 3] & 0xff);
-    }
-
-    /**
-     * Gets either a signed 2-byte or a signed 4-byte big-endian value.
-     * @param data the array containing the data
-     * @param bci the start index of the value to retrieve
-     * @param fourByte if true, this method will return a 4-byte value
-     * @return the signed 2 or 4-byte, big-endian, value at index {@code bci} in array {@code data}
-     */
-    public static int beSVar(byte[] data, int bci, boolean fourByte) {
-        if (fourByte) {
-            return beS4(data, bci);
-        } else {
-            return beS2(data, bci);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/ConvertJTT.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt;
-
-import java.io.*;
-import java.nio.charset.*;
-import java.nio.file.*;
-import java.util.*;
-
-/**
- * Simple Utility to convert java tester tests from the proprietary test format into JUnit - tests.
- */
-public class ConvertJTT {
-
-    public static void main(String[] args) throws IOException {
-        String targetPath = "graalvm/graal/com.oracle.graal.tests/src/com/oracle/max/graal/jtt";
-        String sourcePath = "maxine/com.oracle.max.vm/test/jtt";
-
-        File target = new File(targetPath);
-        for (File dir : new File(sourcePath).listFiles()) {
-            if (dir.isDirectory()) {
-                String packageName = dir.getName();
-                if (packageName.equals("exbytecode") || packageName.equals("max")) {
-                    continue;
-                }
-                File targetDir = new File(target, packageName);
-                for (File file : dir.listFiles()) {
-                    if (file.getName().endsWith(".java")) {
-                        targetDir.mkdirs();
-                        try {
-                            processFile(file.toPath(), new File(targetDir, file.getName()).toPath(), packageName);
-                        } catch (RuntimeException e) {
-                            e.printStackTrace();
-                            System.out.println("in file " + file.getAbsolutePath());
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    public static class Run {
-
-        public String input;
-        public String output;
-
-        public Run(String input, String output) {
-            this.input = input;
-            this.output = output;
-        }
-
-        @Override
-        public String toString() {
-            return String.format("%16s = %s", input, output);
-        }
-    }
-
-    private static void processFile(Path file, Path target, String packageName) throws IOException {
-        List<String> lines = Files.readAllLines(file, Charset.forName("UTF-8"));
-        Iterator<String> iter = lines.iterator();
-
-        ArrayList<String> output = new ArrayList<>();
-        ArrayList<Run> runs = new ArrayList<>();
-
-        String line;
-        boolean javaHarness = false;
-        while (iter.hasNext()) {
-            line = iter.next();
-            if (line.startsWith(" * Copyright (c) ")) {
-                output.add(" * Copyright (c) " + line.substring(17, 21) + ", 2012, Oracle and/or its affiliates. All rights reserved.");
-            } else if (line.contains("@Runs:")) {
-                line = line.substring(line.indexOf("@Runs:") + 6).trim();
-                if (line.endsWith(";")) {
-                    line = line.substring(0, line.length() - 1);
-                }
-                String[] runStrings;
-                if (charCount(line, ';') == charCount(line, '=') - 1) {
-                    runStrings = line.split(";");
-                } else if (charCount(line, ',') == charCount(line, '=') - 1) {
-                    runStrings = line.split(",");
-                } else if (charCount(line, ',', ';') == charCount(line, '=') - 1) {
-                    runStrings = line.split("[,;]");
-                } else {
-                    throw new RuntimeException("invalid run line: " + line);
-                }
-                for (String runString : runStrings) {
-                    String[] split = runString.split("=");
-                    if (split.length != 2) {
-                        throw new RuntimeException("invalid run string: " + runString);
-                    }
-                    Run run = new Run(split[0].trim(), split[1].trim());
-                    runs.add(run);
-                }
-            } else if (line.contains("@Harness:")) {
-                if (line.contains("@Harness: java")) {
-                    javaHarness = true;
-                }
-            } else if (line.startsWith("package jtt.")) {
-                output.add("package com.oracle.graal.jtt." + packageName + ";");
-                output.add("");
-                output.add("import org.junit.*;");
-            } else if (line.contains("@NEVER_INLINE")) {
-                output.add("// " + line);
-            } else if (line.startsWith("import com.sun.max.annotate.")) {
-                // do nothing
-            } else if (line.equals("}")) {
-                if (runs != null) {
-                    int n = 0;
-                    for (Run run : runs) {
-                        processRun(output, run, n++);
-                    }
-                    runs = null;
-                }
-                output.add(line);
-            } else {
-// line = line.replace(oldClassName, newClassName);
-                line = line.replace(" jtt.", " com.oracle.graal.jtt.");
-                output.add(line);
-            }
-        }
-        if (!javaHarness) {
-            throw new RuntimeException("no java harness");
-        }
-        if (runs != null) {
-            throw new RuntimeException("no ending brace found");
-        }
-
-        Files.write(target, output, Charset.forName("UTF-8"));
-    }
-
-    private static void processRun(ArrayList<String> output, Run run, int n) {
-        if (run.output.startsWith("!")) {
-            output.add("    @Test(expected = " + run.output.substring(1).replace("jtt.", "com.oracle.graal.jtt.").replace('$', '.') + ".class)");
-            output.add("    public void run" + n + "() throws Throwable {");
-            output.add("        test(" + parameters(run.input) + ");");
-            output.add("    }");
-            output.add("");
-        } else {
-            output.add("    @Test");
-            output.add("    public void run" + n + "() throws Throwable {");
-            String result = parameters(run.output);
-            if (result.endsWith("f") || result.endsWith("d") || result.endsWith("F") || result.endsWith("D")) {
-                output.add("        Assert.assertEquals(" + result + ", test(" + parameters(run.input) + "), 0);");
-            } else {
-                output.add("        Assert.assertEquals(" + result + ", test(" + parameters(run.input) + "));");
-            }
-            output.add("    }");
-            output.add("");
-        }
-    }
-
-    private static String parameters(String params) {
-        if (params.startsWith("(")) {
-            StringBuilder str = new StringBuilder();
-            String[] split = params.substring(1, params.length() - 1).split(",");
-            for (int i = 0; i < split.length; i++) {
-                str.append(i == 0 ? "" : ", ").append(parameters(split[i].trim()));
-            }
-            return str.toString();
-        } else if (params.startsWith("`")) {
-            return params.substring(1);
-        } else {
-            if (params.length() <= 1) {
-                return params;
-            } else {
-                if (params.endsWith("s")) {
-                    return "((short) " + params.substring(0, params.length() - 1) + ")";
-                } else if (params.endsWith("c")) {
-                    return "((char) " + params.substring(0, params.length() - 1) + ")";
-                } else if (params.endsWith("b")) {
-                    return "((byte) " + params.substring(0, params.length() - 1) + ")";
-                }
-            }
-            return params.replace("jtt.", "com.oracle.graal.jtt.");
-        }
-    }
-
-    private static int charCount(String str, char ch1) {
-        int count = 0;
-        for (int i = 0; i < str.length(); i++) {
-            if (str.charAt(i) == ch1) {
-                count++;
-            }
-        }
-        return count;
-    }
-
-    private static int charCount(String str, char ch1, char ch2) {
-        int count = 0;
-        for (int i = 0; i < str.length(); i++) {
-            if (str.charAt(i) == ch1 || str.charAt(i) == ch2) {
-                count++;
-            }
-        }
-        return count;
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aaload {
-
-    static Object[] array = {null, null, ""};
-
-    public static Object test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(null, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("", test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aaload_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aaload_1 {
-
-    static Object[][] array = {{null}, {null}, {""}};
-
-    public static Object test(int arg) {
-        return array[arg][0];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(null, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("", test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aastore {
-
-    static Object[] param = {new Object(), null, "h"};
-    static Object[] array1 = {null, null, null};
-    static String[] array2 = {null, null, null};
-
-    public static int test(boolean a, int indx) {
-        Object[] array = a ? array1 : array2;
-        Object val;
-        val = param[indx];
-        array[indx] = val;
-        return indx;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(true, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(true, 1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(true, 2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1, test(false, 1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(2, test(false, 2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_0.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aload_0 {
-
-    public static Object test(Object arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("x", test("x"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aload_1 {
-
-    @SuppressWarnings("unused")
-    public static Object test(int i, Object arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(1, null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("x", test(1, "x"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aload_2 {
-
-    @SuppressWarnings("unused")
-    public static Object test(int i, int j, Object arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(1, 1, null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("x", test(1, 1, "x"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_aload_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aload_3 {
-
-    @SuppressWarnings("unused")
-    public static Object test(int i, int j, int k, Object arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("x", test(1, 1, 1, "x"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(null, test(1, 1, 1, null));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_anewarray.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_anewarray {
-
-    @SuppressWarnings("unused")
-    public static int test(int a) {
-        final BC_anewarray[] v = new BC_anewarray[3];
-        if (v != null) {
-            return a;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_areturn.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_areturn {
-
-    public static Object test(Object a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("", test(""));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("this", test("this"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_arraylength.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_arraylength {
-
-    static int[] array1 = {1, 2, 3};
-    static char[] array2 = {'a', 'b', 'c', 'd'};
-    static Object[] array3 = new Object[5];
-    static Object[][] array4 = new Object[5][5];
-
-    public static int test(int arg) {
-        if (arg == 1) {
-            return array1.length;
-        }
-        if (arg == 2) {
-            return array2.length;
-        }
-        if (arg == 3) {
-            return array3.length;
-        }
-        if (arg == 4) {
-            return array4[0].length;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(4, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(5, test(3));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(5, test(4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(42, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_athrow.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_athrow {
-
-    static Throwable throwable = new Throwable();
-
-    public static int test(int arg) throws Throwable {
-        if (arg == 2) {
-            throw throwable;
-        }
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test(expected = java.lang.Throwable.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_baload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_baload {
-
-    static boolean[] array = {true, false, true, false};
-
-    public static boolean test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_bastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_bastore {
-
-    static boolean[] array = {false, false, false, false};
-
-    public static boolean test(int arg, boolean val) {
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0, true));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1, false));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2, true));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3, false));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_caload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_caload {
-
-    static char[] array = {'\000', 'a', ' ', 10000};
-
-    public static char test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 0), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 97), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 32), test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((char) 10000), test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_castore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_castore {
-
-    static char[] array = {0, 0, 0, 0};
-
-    public static char test(int arg, char val) {
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 97), test(0, ((char) 97)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 65), test(1, ((char) 65)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 42), test(2, ((char) 42)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((char) 120), test(3, ((char) 120)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_checkcast01 {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new BC_checkcast01();
-
-    public static int test(int arg) {
-        Object obj;
-        if (arg == 2) {
-            obj = object2;
-        } else if (arg == 3) {
-            obj = object3;
-        } else if (arg == 4) {
-            obj = object4;
-        } else {
-            obj = null;
-        }
-        final BC_checkcast01 bc = (BC_checkcast01) obj;
-        if (bc != null) {
-            return arg;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_checkcast02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_checkcast02 {
-
-    static Object[] o1 = {new Object()};
-    static String[] o2 = {""};
-    static BC_checkcast02[] o3 = {new BC_checkcast02()};
-
-    public static int test(int arg) {
-        Object obj = null;
-        if (arg == 0) {
-            obj = o1;
-        }
-        if (arg == 1) {
-            obj = o2;
-        }
-        if (arg == 2) {
-            obj = o3;
-        }
-        Object[] r = (Object[]) obj;
-        return r == null ? -1 : -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2f.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_d2f {
-
-    public static float test(double d) {
-        return (float) d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0.0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0f, test(1.0d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1.06f, test(-1.06d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i01.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_d2i01 {
-
-    public static int test(double d) {
-        return (int) d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-1.06d));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-156, test(-156.82743d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2i02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_d2i02 {
-
-    private static double[] inputs = {-1.3e44d, Double.NEGATIVE_INFINITY, Double.NaN, Double.POSITIVE_INFINITY, 1.3e44d};
-
-    public static int test(int i) {
-        return (int) inputs[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2147483648, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2147483648, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2147483647, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(2147483647, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l01.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_d2l01 {
-
-    public static long test(double d) {
-        return (long) d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1L, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1L, test(-1.06d));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-156L, test(-156.82743d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_d2l02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_d2l02 {
-
-    private static double[] inputs = {-1.3e44d, Double.NEGATIVE_INFINITY, Double.NaN, Double.POSITIVE_INFINITY, 1.3e44d};
-
-    public static long test(int i) {
-        return (long) inputs[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-9223372036854775808L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-9223372036854775808L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(9223372036854775807L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(9223372036854775807L, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dadd.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dadd {
-
-    public static double test(double a, double b) {
-        return a + b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0d, 0.0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2.0d, test(1.0d, 1.0d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(307.54d, test(253.11d, 54.43d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_daload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_daload {
-
-    static double[] array = {0.0, -1.1, 4.32, 6.06};
-
-    public static double test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1.1d, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(4.32d, test(2), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(6.06d, test(3), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dastore {
-
-    static double[] array = {0, 0, 0, 0};
-
-    public static double test(int arg, double val) {
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.01d, test(0, 0.01d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1.4d, test(1, -1.4d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.01d, test(2, 0.01d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1.4d, test(3, -1.4d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp01 {
-
-    public static boolean test(double a, double b) {
-        return a < b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0d, -0.1d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(78.00d, 78.001d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp02 {
-
-    public static boolean test(double a) {
-        return (a / a) < 0.0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(-0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp03 {
-
-    public static boolean test(double a) {
-        return (a / a) > 0.0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(-0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp04 {
-
-    public static boolean test(double a) {
-        return (a / a) <= 0.0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(-0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp05 {
-
-    public static boolean test(double a) {
-        return (a / a) >= 0.0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp06 {
-
-    public static boolean test(double a) {
-        return 0.0 < (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp07.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp07 {
-
-    public static boolean test(double a) {
-        return 0.0 > (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp08.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp08 {
-
-    public static boolean test(double a) {
-        return 0.0 <= (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp09.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp09 {
-
-    public static boolean test(double a) {
-        return 0.0 >= (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0d));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0d));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0d));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dcmp10.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dcmp10 {
-
-    public static boolean test(int x) {
-        double a = 0;
-        double b = 0;
-        switch (x) {
-            case 0:
-                a = Double.POSITIVE_INFINITY;
-                b = 1;
-                break;
-            case 1:
-                a = 1;
-                b = Double.POSITIVE_INFINITY;
-                break;
-            case 2:
-                a = Double.NEGATIVE_INFINITY;
-                b = 1;
-                break;
-            case 3:
-                a = 1;
-                b = Double.NEGATIVE_INFINITY;
-                break;
-            case 4:
-                a = Double.NEGATIVE_INFINITY;
-                b = Double.NEGATIVE_INFINITY;
-                break;
-            case 5:
-                a = Double.NEGATIVE_INFINITY;
-                b = Double.POSITIVE_INFINITY;
-                break;
-            case 6:
-                a = Double.NaN;
-                b = Double.POSITIVE_INFINITY;
-                break;
-            case 7:
-                a = 1;
-                b = Double.NaN;
-                break;
-            case 8:
-                a = 1;
-                b = -0.0d / 0.0d;
-                break;
-        }
-        return a <= b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ddiv.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ddiv {
-
-    public static double test(double a, double b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(31.1D, test(311.0D, 10D), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dmul.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dmul {
-
-    public static double test(double a, double b) {
-        return a * b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3110.0D, test(311.0D, 10D), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(22.4D, test(11.2D, 2.0D), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dneg {
-
-    public static double test(double a, double b, int which) {
-        double result1 = -a;
-        double result2 = -b;
-        double result = 0.0;
-        if (which == 0) {
-            result = result1;
-        } else {
-            result = result2;
-        }
-        return result;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-0.0d, test(0.0d, 1.0d, 0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.01d, test(-1.01d, -2.01d, 0), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-7263.8734d, test(7263.8734d, 8263.8734d, 0), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1.0d, test(0.0d, 1.0d, 1), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(2.01d, test(-1.01d, -2.01d, 1), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-8263.8734d, test(7263.8734d, 8263.8734d, 1), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dneg2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dneg2 {
-
-// @NEVER_INLINE
-    public static double test(double a) {
-        return 1 / (-a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(-0.0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0.0d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_drem.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-public class BC_drem {
-
-    public static double test(double a, double b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1.0D, test(311.0D, 10D), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.2D, test(11.2D, 2.0D), 0.000000000000001);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dreturn.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dreturn {
-
-    public static double test(double a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.1d, test(1.1d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1.4d, test(-1.4d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(256.33d, test(256.33d), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(1000.001d, test(1000.001d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dsub {
-
-    public static double test(double a, double b) {
-        return a - b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0d, 0.0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0.0d, test(1.0d, 1.0d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(198.68d, test(253.11d, 54.43d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_dsub2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_dsub2 {
-
-    public static double test(double a) {
-        return 1.0 / (0.0 - a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(0.0d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2d.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_f2d {
-
-    public static double test(float d) {
-        return d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0d, test(1.0f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-2.00d, test(-2.00f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i01.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_f2i01 {
-
-    public static int test(float d) {
-        return (int) d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-1.06f));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-156, test(-156.82743f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2i02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_f2i02 {
-
-    private static float[] inputs = {-1.3e22f, Float.NEGATIVE_INFINITY, Float.NaN, Float.POSITIVE_INFINITY, 1.3e22f};
-
-    public static int test(int i) {
-        return (int) inputs[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2147483648, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2147483648, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2147483647, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(2147483647, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l01.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_f2l01 {
-
-    public static long test(float d) {
-        return (long) d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1L, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1L, test(-1.06f));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-156L, test(-156.82743f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_f2l02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_f2l02 {
-
-    private static float[] inputs = {-1.3e22f, Float.NEGATIVE_INFINITY, Float.NaN, Float.POSITIVE_INFINITY, 1.3e22f};
-
-    public static long test(int i) {
-        return (long) inputs[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-9223372036854775808L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-9223372036854775808L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(9223372036854775807L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(9223372036854775807L, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fadd.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fadd {
-
-    public static float test(float a, float b) {
-        return a + b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0.0f, 0.0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2.0f, test(1.0f, 1.0f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(307.54f, test(253.11f, 54.43f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_faload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_faload {
-
-    static float[] array = {0.0f, -1.1f, 4.32f, 6.06f};
-
-    public static float test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1.1f, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(4.32f, test(2), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(6.06f, test(3), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fastore {
-
-    static float[] array = {0, 0, 0, 0};
-
-    public static float test(int arg, float val) {
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.01f, test(0, 0.01f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1.4f, test(1, -1.4f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.01f, test(2, 0.01f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1.4f, test(3, -1.4f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp01 {
-
-    public static boolean test(float a, float b) {
-        return a < b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0f, -0.1f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(78.00f, 78.001f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp02 {
-
-    public static boolean test(float a) {
-        return (a / a) < 0.0f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp03 {
-
-    public static boolean test(float a) {
-        return (a / a) > 0.0f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp04 {
-
-    public static boolean test(float a) {
-        return (a / a) <= 0.0f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp05 {
-
-    public static boolean test(float a) {
-        return (a / a) >= 0.0f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp06 {
-
-    public static boolean test(float a) {
-        return 0.0f < (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp07.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp07 {
-
-    public static boolean test(float a) {
-        return 0.0f > (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp08.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp08 {
-
-    public static boolean test(float a) {
-        return 0.0f <= (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp09.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp09 {
-
-    public static boolean test(float a) {
-        return 0.0f >= (a / a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.0f));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fcmp10.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fcmp10 {
-
-    public static boolean test(int x) {
-        float a = 0;
-        float b = 0;
-        switch (x) {
-            case 0:
-                a = Float.POSITIVE_INFINITY;
-                b = 1;
-                break;
-            case 1:
-                a = 1;
-                b = Float.POSITIVE_INFINITY;
-                break;
-            case 2:
-                a = Float.NEGATIVE_INFINITY;
-                b = 1;
-                break;
-            case 3:
-                a = 1;
-                b = Float.NEGATIVE_INFINITY;
-                break;
-            case 4:
-                a = Float.NEGATIVE_INFINITY;
-                b = Float.NEGATIVE_INFINITY;
-                break;
-            case 5:
-                a = Float.NEGATIVE_INFINITY;
-                b = Float.POSITIVE_INFINITY;
-                break;
-            case 6:
-                a = Float.NaN;
-                b = Float.POSITIVE_INFINITY;
-                break;
-            case 7:
-                a = 1;
-                b = Float.NaN;
-                break;
-            case 8:
-                a = 1;
-                b = -0.0f / 0.0f;
-                break;
-        }
-        return a <= b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fdiv.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fdiv {
-
-    public static float test(float a, float b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(31.1f, test(311.0f, 10f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fload {
-
-    public static float test(float arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1f, test(-1f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1.01f, test(-1.01f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fload_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fload_2 {
-
-    @SuppressWarnings("unused")
-    public static float test(float i, float arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1f, test(0f, -1f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1.01f, test(0f, -1.01f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fmul.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fmul {
-
-    public static float test(float a, float b) {
-        return a * b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3110.0f, test(311.0f, 10f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(22.4f, test(11.2f, 2.0f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fneg.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fneg {
-
-    public static float test(float a) {
-        return -a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-0.0f, test(0.0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.01f, test(-1.01f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-7263.8734f, test(7263.8734f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_frem.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-public class BC_frem {
-
-    public static float test(float a, float b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1.0f, test(311.0f, 10f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0.5f, test(12.5f, 6.0f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_freturn.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_freturn {
-
-    public static float test(float a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0.0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.1f, test(1.1f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1.4f, test(-1.4f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(256.33f, test(256.33f), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(1000.001f, test(1000.001f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_fsub.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_fsub {
-
-    public static float test(float a, float b) {
-        return a - b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0.0f, 0.0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0.0f, test(1.0f, 1.0f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(198.68f, test(253.11f, 54.43f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getfield {
-
-    private static BC_getfield object = new BC_getfield();
-
-    private int field = 13;
-
-    public static int test() {
-        return object.field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(13, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_b.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_b {
-
-    private static byte field = 11;
-
-    public static byte test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 11), test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_c.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_c {
-
-    private static char field = 11;
-
-    public static char test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 11), test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_d.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_d {
-
-    private static double field = 11;
-
-    public static double test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11d, test(), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_f.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_f {
-
-    private static float field = 11;
-
-    public static float test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11f, test(), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_i.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_i {
-
-    private static int field = 11;
-
-    public static int test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_l.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_l {
-
-    private static long field = 11;
-
-    public static long test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11L, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_s.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_s {
-
-    private static short field = 11;
-
-    public static short test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 11), test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getstatic_z.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_getstatic_z {
-
-    private static boolean field = true;
-
-    public static boolean test() {
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2b.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_i2b {
-
-    public static byte test(int a) {
-        return (byte) a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) -1), test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 2), test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) -1), test(255));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((byte) -128), test(128));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2c.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_i2c {
-
-    public static char test(int a) {
-        return (char) a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 65535), test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 645), test(645));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 65535), test(65535));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2d.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_i2d {
-
-    public static double test(int a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0d, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-34.0d, test(-34), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2f.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_i2f {
-
-    public static float test(int a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0f, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-34.0f, test(-34), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2l.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_i2l {
-
-    public static long test(int a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2L, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3L, test(3));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1L, test(-1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647L, test(-2147483647));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-2147483648L, test(-2147483648));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(2147483647L, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_i2s.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_i2s {
-
-    public static short test(int a) {
-        return (short) a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) -1), test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) 34), test(34));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) -1), test(65535));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((short) -32768), test(32768));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iadd {
-
-    public static int test(int a, int b) {
-        return a + b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(0, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(100, test(33, 67));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(1, -1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647, test(-2147483648, 1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-2147483648, test(2147483647, 1));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(2147483647, test(-2147483647, -2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iadd2 {
-
-    public static int test(byte a, byte b) {
-        return a + b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(((byte) 1), ((byte) 2)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(((byte) 0), ((byte) -1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(100, test(((byte) 33), ((byte) 67)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(((byte) 1), ((byte) -1)));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-127, test(((byte) -128), ((byte) 1)));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(128, test(((byte) 127), ((byte) 1)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iadd3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iadd3 {
-
-    public static int test(short a, short b) {
-        return a + b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(((short) 1), ((short) 2)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(((short) 0), ((short) -1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(100, test(((short) 33), ((short) 67)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(((short) 1), ((short) -1)));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-127, test(((short) -128), ((short) 1)));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(128, test(((short) 127), ((short) 1)));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-32767, test(((short) -32768), ((short) 1)));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(32768, test(((short) 32767), ((short) 1)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iaload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iaload {
-
-    static int[] array = {0, -1, 4, 1000000000};
-
-    public static int test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(4, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000000000, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iand.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iand {
-
-    public static int test(int a, int b) {
-        return a & b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(0, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(31, test(31, 63));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4, test(6, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(-2147483648, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iastore {
-
-    static int[] array = {0, 0, 0, 0};
-
-    public static int test(int arg, int val) {
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(11, test(2, 11));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-14, test(3, -14));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iconst.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iconst {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return 0;
-        }
-        if (arg == 1) {
-            return 1;
-        }
-        if (arg == 2) {
-            return 2;
-        }
-        if (arg == 3) {
-            return 3;
-        }
-        if (arg == 4) {
-            return 4;
-        }
-        if (arg == 5) {
-            return 5;
-        }
-        return 375;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(5, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(375, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_idiv {
-
-    public static int test(int a, int b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2, test(2, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(64, test(256, 4));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(19, test(135, 7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_idiv2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_idiv2 {
-
-    public static int test(int a, int b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2147483648, test(-2147483648, -1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2147483648, test(-2147483648, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifeq {
-
-    public static int test(int a) {
-        int n = 0;
-        if (a == 0) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a != 0) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifeq_2 {
-
-    public static boolean test(int a) {
-        return a == 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifeq_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifeq_3 {
-
-    public static boolean test(int a) {
-        return a != 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifge {
-
-    public static int test(int a) {
-        int n = 0;
-        if (a >= 0) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a < 0) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-2, test(-1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifge_2 {
-
-    public static boolean test(int a, int b) {
-        return a >= b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0, 1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1, 0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(1, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0, -100));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(-1, 0));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(-12, -12));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifge_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifge_3 {
-
-    public static boolean test(int a, int b) {
-        return a < b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0, 1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1, 0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(1, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0, -100));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(-1, 0));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(-12, -12));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifgt.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifgt {
-
-    public static int test(int a) {
-        int n = 0;
-        if (a > 0) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a <= 0) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-2, test(-1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ificmplt1 {
-
-    public static int test(int a) {
-        return a < 1 ? 12 : 13;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(12, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(13, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(13, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmplt2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ificmplt2 {
-
-    public static int test(int a) {
-        return a > 1 ? 13 : 12;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(12, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(12, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(13, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ificmpne1 {
-
-    public static int test(int a) {
-        return a == 1 ? 12 : 13;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(13, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(12, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(13, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ificmpne2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ificmpne2 {
-
-    public static int test(int a) {
-        return a != 1 ? 13 : 12;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(13, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(12, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(13, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifle.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifle {
-
-    public static int test(int a) {
-        int n = 0;
-        if (a <= 0) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a > 0) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(-1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iflt.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iflt {
-
-    public static int test(int a) {
-        int n = 0;
-        if (a < 0) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a >= 0) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(-1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifne.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifne {
-
-    public static int test(int a) {
-        int n = 0;
-        if (a != 0) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a == 0) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifnonnull {
-
-    public static int test(Object a) {
-        int n = 0;
-        if (a == null) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a != null) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2, test(""));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifnonnull_2 {
-
-    public static boolean test(Object a) {
-        return a != null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(""));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnonnull_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifnonnull_3 {
-
-    public static int test(Object a) {
-        if (a != null) {
-            return 1;
-        }
-        return 2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(""));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifnull {
-
-    public static int test(Object a) {
-        int n = 0;
-        if (a != null) {
-            n += 1;
-        } else {
-            n -= 1;
-        }
-        if (a == null) {
-            n -= 1;
-        } else {
-            n += 1;
-        }
-        return n;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(""));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifnull_2 {
-
-    public static boolean test(Object a) {
-        return a == null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(""));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ifnull_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ifnull_3 {
-
-    public static int test(Object a) {
-        if (a == null) {
-            return 1;
-        }
-        return 2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(""));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iinc_1 {
-
-    public static int test(int a) {
-        int arg = a;
-        arg += 1;
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(3, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(5, test(4));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(-1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iinc_2 {
-
-    public static int test(int a) {
-        int arg = a;
-        arg += 2;
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(4, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(6, test(4));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iinc_3 {
-
-    public static int test(int a) {
-        int arg = a;
-        arg += 51;
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(52, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(53, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(55, test(4));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(50, test(-1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iinc_4.java	Thu Mar 08 19:11:12 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iinc_4 {
-
-    public static int test(int a) {
-        int arg = a;
-        arg += 512;
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(513, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(514, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(516, test(4));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(511, test(-1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iload_0 {
-
-    public static int test(int arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(-1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000345, test(1000345));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iload_0_1 {
-
-    public static int test(int arg) {
-        return arg + 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(-1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000346, test(1000345));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_0_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iload_0_2 {
-
-    public static int test(int arg) {
-        int i = arg;
-        return i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(-1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000345, test(1000345));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iload_1 {
-
-    @SuppressWarnings("unused")
-    public static int test(int i, int arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(1, 2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000345, test(1, 1000345));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_1_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iload_1_1 {
-
-    public static int test(int i) {
-        int arg = 0;
-        return i + arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(-1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000345, test(1000345));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iload_2 {
-
-    @SuppressWarnings("unused")
-    public static int test(int i, int j, int arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 1, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1, 1, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(1, 1, 2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000345, test(1, 1, 1000345));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iload_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iload_3 {
-
-    @SuppressWarnings("unused")
-    public static int test(int i, int j, int k, int arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 1, 1, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1, 1, 1, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(1, 1, 1, 2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000345, test(1, 1, 1, 1000345));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_imul.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_imul {
-
-    public static int test(int a, int b) {
-        return a * b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(0, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2211, test(33, 67));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1, test(1, -1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483648, test(-2147483648, 1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-2147483647, test(2147483647, -1));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-2147483648, test(-2147483648, -1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ineg.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ineg {
-
-    public static int test(int a) {
-        return -a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(-1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-7263, test(7263));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-2147483648, test(-2147483648));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_instanceof.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_instanceof {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new BC_instanceof();
-
-    public static boolean test(int arg) {
-        Object obj;
-        if (arg == 2) {
-            obj = object2;
-        } else if (arg == 3) {
-            obj = object3;
-        } else if (arg == 4) {
-            obj = object4;
-        } else {
-            obj = null;
-        }
-        return obj instanceof BC_instanceof;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokeinterface.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_invokeinterface {
-
-    public interface ITest {
-
-        int id(int a);
-    }
-
-    static class IClass implements ITest {
-
-        public int id(int a) {
-            return a;
-        }
-    }
-
-    static ITest object = new IClass();
-
-    public static int test(int a) {
-        return object.id(a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_invokespecial {
-
-    static BC_invokespecial object = new BC_invokespecial();
-
-    public static int test(int a) {
-        return object.id(a);
-    }
-
-    @SuppressWarnings("static-method")
-    private int id(int i) {
-        return i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokespecial2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_invokespecial2 {
-
-    static BC_invokespecial2 object = new BC_invokespecial2();
-
-    public static int test(int a) {
-        return 3 + object.id(a);
-    }
-
-    @SuppressWarnings("static-method")
-    private int id(int i) {
-        return 4 + i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(7, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(8, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(9, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(10, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(3, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokestatic.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_invokestatic {
-
-    public static int test(int a) {
-        return id(a);
-    }
-
-    public static int id(int i) {
-        return i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_invokevirtual.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_invokevirtual {
-
-    static BC_invokevirtual object = new BC_invokevirtual();
-
-    public static int test(int a) {
-        return object.id(a);
-    }
-
-    public int id(int i) {
-        return i;
-    }
-
-    public static void main(String[] args) {
-        test(0);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ior.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ior {
-
-    public static int test(int a, int b) {
-        return a | b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(0, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(63, test(31, 63));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(6, test(6, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647, test(-2147483648, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_irem {
-
-    public static int test(int a, int b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(2, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(256, 4));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2, test(135, 7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_irem2 {
-
-    public static int test(int a, int b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(-2147483648, -1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(-2147483648, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_irem3.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_irem3 {
-
-    public static int test(int a) {
-        return a % 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(1000));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(-2147483648));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ireturn.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ireturn {
-
-    public static int test(int a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(256, test(256));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ishl {
-
-    public static int test(int a, int b) {
-        return a << b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(0, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(62, test(31, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(96, test(6, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(-2147483648, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ishr.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ishr {
-
-    public static int test(int a, int b) {
-        return a >> b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(16, test(67, 2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(15, test(31, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(6, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-32768, test(-2147483648, 16));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_isub.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_isub {
-
-    public static int test(int a, int b) {
-        return a - b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(1, -2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(0, 1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(100, test(33, -67));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(1, 1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647, test(-2147483648, -1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-2147483648, test(2147483647, -1));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(2147483647, test(-2147483647, 2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_iushr.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_iushr {
-
-    public static int test(int a, int b) {
-        return a >>> b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(16, test(67, 2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(15, test(31, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(6, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(32768, test(-2147483648, 16));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ixor.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ixor {
-
-    public static int test(int a, int b) {
-        return a ^ b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(0, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(32, test(31, 63));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2, test(6, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647, test(-2147483648, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2d.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_l2d {
-
-    public static double test(long a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0D, test(0L), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0D, test(1L), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-74652389.00D, test(-74652389L), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2f.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_l2f {
-
-    public static float test(long a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0L), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0f, test(1L), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-74652389.00f, test(-74652389L), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- * TODO: test roundoff behavior
- */
-public class BC_l2i {
-
-    public static int test(long a) {
-        return (int) a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(1L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3, test(3L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1, test(-1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647, test(-2147483647L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-2147483648, test(-2147483648L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(2147483647, test(2147483647L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_l2i_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_l2i_2 {
-
-    static Object[] array = {null};
-
-    public static Object test(long a) {
-        long arg = a;
-        arg = arg << 32;
-        return array[(int) arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(1L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(null, test(123456789L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ladd {
-
-    public static long test(long a, long b) {
-        return a + b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1L, test(0L, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(100L, test(33L, 67L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0L, test(1L, -1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647L, test(-2147483648L, 1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(2147483648L, test(2147483647L, 1L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-2147483649L, test(-2147483647L, -2L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ladd2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ladd2 {
-
-    public static long test(int a, int b) {
-        return a + (long) b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3L, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1L, test(0, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(100L, test(33, 67));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0L, test(1, -1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647L, test(-2147483648, 1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(2147483648L, test(2147483647, 1));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-2147483649L, test(-2147483647, -2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_laload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_laload {
-
-    static long[] array = {0L, -1L, 4L, 1000000000000L};
-
-    public static long test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(4L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1000000000000L, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_land.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_land {
-
-    public static long test(long a, long b) {
-        return a & b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(0L, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(31L, test(31L, 63L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4L, test(6L, 4L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0L, test(-2147483648L, 1L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lastore {
-
-    static long[] array = {0, 0, 0, 0};
-
-    public static long test(int arg, long val) {
-        final long[] array2 = arg == -2 ? null : BC_lastore.array;
-        array2[arg] = val;
-        return array2[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0, 0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1L, test(1, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(11L, test(2, 11L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-14L, test(3, -14L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lcmp.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lcmp {
-
-    public static boolean test(long a, long b) {
-        return a < b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0L, -1L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(77L, 78L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1L, 0L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldc_01 {
-
-    public static int test() {
-        return -123;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-123, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldc_02 {
-
-    public static float test() {
-        return -2.4f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2.4f, test(), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldc_03 {
-
-    public static long test() {
-        return -123L;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-123L, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldc_04 {
-
-    public static String test() {
-        return "xyz";
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("xyz", test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldc_05 {
-
-    public static double test() {
-        return -2.33d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2.33d, test(), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldc_06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldc_06 {
-
-    public static String test() {
-        return test2().getName();
-    }
-
-    static Class<BC_ldc_06> test2() {
-        return BC_ldc_06.class;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.bytecode.BC_ldc_06", test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldiv {
-
-    public static long test(long a, long b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-2L, test(2L, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(64L, test(256L, 4L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(19L, test(135L, 7L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_ldiv2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldiv2 {
-
-    public static long test(long a, long b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-9223372036854775808L, test(-9223372036854775808L, -1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-9223372036854775808L, test(-9223372036854775808L, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_0.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lload_0 {
-
-    public static long test(long arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(1L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-3L, test(-3L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(10000L, test(10000L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("unused")
-public class BC_lload_01 {
-
-    public static long test(int i) {
-        return test1(null);
-    }
-
-    public static int test1(Object o0) {
-        long x = 1;
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(-3));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0L, test(100));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lload_1 {
-
-    @SuppressWarnings("unused")
-    public static long test(int i, long arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(1, 1L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-3L, test(1, -3L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(10000L, test(1, 10000L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lload_2 {
-
-    @SuppressWarnings("unused")
-    public static long test(int i, int j, long arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(1, 1, 1L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-3L, test(1, 1, -3L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(10000L, test(1, 1, 10000L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lload_3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lload_3 {
-
-    @SuppressWarnings("unused")
-    public static long test(int i, int j, int k, long arg) {
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(1, 1, 1, 1L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-3L, test(1, 1, 1, -3L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(10000L, test(1, 1, 1, 10000L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lmul.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lmul {
-
-    public static long test(long a, long b) {
-        return a * b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(0L, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2211L, test(33L, 67L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1L, test(1L, -1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483648L, test(-2147483648L, 1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-2147483647L, test(2147483647L, -1L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(2147483648L, test(-2147483648L, -1L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(1000000000000L, test(1000000L, 1000000L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lneg.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lneg {
-
-    public static long test(long a) {
-        return -a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1L, test(-1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-7263L, test(7263L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2147483648L, test(-2147483648L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lookupswitch01 {
-
-    public static int test(int a) {
-        switch (a) {
-            case 67:
-                return 0;
-            case 97:
-                return 1;
-            case 107:
-                return 2;
-            case 133:
-                return 3;
-            case 212:
-                return 4;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(42, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(42, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(66));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(67));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(42, test(68));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(42, test(96));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(1, test(97));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(42, test(98));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(42, test(106));
-    }
-
-    @Test
-    public void run9() throws Throwable {
-        Assert.assertEquals(2, test(107));
-    }
-
-    @Test
-    public void run10() throws Throwable {
-        Assert.assertEquals(42, test(108));
-    }
-
-    @Test
-    public void run11() throws Throwable {
-        Assert.assertEquals(42, test(132));
-    }
-
-    @Test
-    public void run12() throws Throwable {
-        Assert.assertEquals(3, test(133));
-    }
-
-    @Test
-    public void run13() throws Throwable {
-        Assert.assertEquals(42, test(134));
-    }
-
-    @Test
-    public void run14() throws Throwable {
-        Assert.assertEquals(42, test(211));
-    }
-
-    @Test
-    public void run15() throws Throwable {
-        Assert.assertEquals(4, test(212));
-    }
-
-    @Test
-    public void run16() throws Throwable {
-        Assert.assertEquals(42, test(213));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lookupswitch02 {
-
-    public static int test(int a) {
-        final int b = a;
-        switch (b) {
-            case 67:
-                return 0;
-            case 97:
-                return 1;
-            case 107:
-                return 2;
-            case 133:
-                return 3;
-            case 212:
-                return 4;
-            case -122:
-                return 5;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(42, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(42, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(66));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(67));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(42, test(68));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(42, test(96));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(1, test(97));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(42, test(98));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(42, test(106));
-    }
-
-    @Test
-    public void run9() throws Throwable {
-        Assert.assertEquals(2, test(107));
-    }
-
-    @Test
-    public void run10() throws Throwable {
-        Assert.assertEquals(42, test(108));
-    }
-
-    @Test
-    public void run11() throws Throwable {
-        Assert.assertEquals(42, test(132));
-    }
-
-    @Test
-    public void run12() throws Throwable {
-        Assert.assertEquals(3, test(133));
-    }
-
-    @Test
-    public void run13() throws Throwable {
-        Assert.assertEquals(42, test(134));
-    }
-
-    @Test
-    public void run14() throws Throwable {
-        Assert.assertEquals(42, test(211));
-    }
-
-    @Test
-    public void run15() throws Throwable {
-        Assert.assertEquals(4, test(212));
-    }
-
-    @Test
-    public void run16() throws Throwable {
-        Assert.assertEquals(42, test(213));
-    }
-
-    @Test
-    public void run17() throws Throwable {
-        Assert.assertEquals(42, test(-121));
-    }
-
-    @Test
-    public void run18() throws Throwable {
-        Assert.assertEquals(5, test(-122));
-    }
-
-    @Test
-    public void run19() throws Throwable {
-        Assert.assertEquals(42, test(-123));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lookupswitch03 {
-
-    public static int test(int a) {
-        final int b = a + 10;
-        switch (b) {
-            case 77:
-                return 0;
-            case 107:
-                return 1;
-            case 117:
-                return 2;
-            case 143:
-                return 3;
-            case 222:
-                return 4;
-            case -112:
-                return 5;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(42, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(42, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(66));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(67));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(42, test(68));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(42, test(96));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(1, test(97));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(42, test(98));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(42, test(106));
-    }
-
-    @Test
-    public void run9() throws Throwable {
-        Assert.assertEquals(2, test(107));
-    }
-
-    @Test
-    public void run10() throws Throwable {
-        Assert.assertEquals(42, test(108));
-    }
-
-    @Test
-    public void run11() throws Throwable {
-        Assert.assertEquals(42, test(132));
-    }
-
-    @Test
-    public void run12() throws Throwable {
-        Assert.assertEquals(3, test(133));
-    }
-
-    @Test
-    public void run13() throws Throwable {
-        Assert.assertEquals(42, test(134));
-    }
-
-    @Test
-    public void run14() throws Throwable {
-        Assert.assertEquals(42, test(211));
-    }
-
-    @Test
-    public void run15() throws Throwable {
-        Assert.assertEquals(4, test(212));
-    }
-
-    @Test
-    public void run16() throws Throwable {
-        Assert.assertEquals(42, test(213));
-    }
-
-    @Test
-    public void run17() throws Throwable {
-        Assert.assertEquals(42, test(-121));
-    }
-
-    @Test
-    public void run18() throws Throwable {
-        Assert.assertEquals(5, test(-122));
-    }
-
-    @Test
-    public void run19() throws Throwable {
-        Assert.assertEquals(42, test(-123));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lookupswitch04 {
-
-    public static int test(int a) {
-        final int b = a + 8;
-        final int c = b + 2;
-        switch (c) {
-            case 77:
-                return 0;
-            case 107:
-                return 1;
-            case 117:
-                return 2;
-            case 143:
-                return 3;
-            case 222:
-                return 4;
-            case -112:
-                return 5;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(42, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(42, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(66));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(67));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(42, test(68));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(42, test(96));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(1, test(97));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(42, test(98));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(42, test(106));
-    }
-
-    @Test
-    public void run9() throws Throwable {
-        Assert.assertEquals(2, test(107));
-    }
-
-    @Test
-    public void run10() throws Throwable {
-        Assert.assertEquals(42, test(108));
-    }
-
-    @Test
-    public void run11() throws Throwable {
-        Assert.assertEquals(42, test(132));
-    }
-
-    @Test
-    public void run12() throws Throwable {
-        Assert.assertEquals(3, test(133));
-    }
-
-    @Test
-    public void run13() throws Throwable {
-        Assert.assertEquals(42, test(134));
-    }
-
-    @Test
-    public void run14() throws Throwable {
-        Assert.assertEquals(42, test(211));
-    }
-
-    @Test
-    public void run15() throws Throwable {
-        Assert.assertEquals(4, test(212));
-    }
-
-    @Test
-    public void run16() throws Throwable {
-        Assert.assertEquals(42, test(213));
-    }
-
-    @Test
-    public void run17() throws Throwable {
-        Assert.assertEquals(42, test(-121));
-    }
-
-    @Test
-    public void run18() throws Throwable {
-        Assert.assertEquals(5, test(-122));
-    }
-
-    @Test
-    public void run19() throws Throwable {
-        Assert.assertEquals(42, test(-123));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lookupswitch05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lookupswitch05 {
-
-    public static Object test(int a) {
-        switch (a) {
-            default:
-                return new String();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("", test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lor.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lor {
-
-    public static long test(long a, long b) {
-        return a | b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1L, test(0L, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(63L, test(31L, 63L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(6L, test(6L, 4L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647L, test(-2147483648L, 1L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lrem {
-
-    public static long test(long a, long b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(2L, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0L, test(256L, 4L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2L, test(135L, 7L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lrem2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lrem2 {
-
-    public static long test(long a, long b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(-9223372036854775808L, -1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(-9223372036854775808L, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lreturn.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lreturn {
-
-    public static long test(long a) {
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1L, test(1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1L, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(256L, test(256L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(1000000000000L, test(1000000000000L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshl.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lshl {
-
-    public static long test(long a, int b) {
-        return a << b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4L, test(1L, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(0L, -1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(62L, test(31L, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(96L, test(6L, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-4294967296L, test(-2147483648L, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lshr.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lshr {
-
-    public static long test(long a, int b) {
-        return a >> b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(1L, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(16L, test(67L, 2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(15L, test(31L, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0L, test(6L, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-32768L, test(-2147483648L, 16));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lsub.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lsub {
-
-    public static long test(long a, long b) {
-        return a - b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3L, test(1L, -2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1L, test(0L, 1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(100L, test(33L, -67L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0L, test(1L, 1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647L, test(-2147483648L, -1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(2147483648L, test(2147483647L, -1L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-2147483649L, test(-2147483647L, 2L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lushr.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lushr {
-
-    public static long test(long a, int b) {
-        return a >>> b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(1L, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(16L, test(67L, 2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(15L, test(31L, 1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0L, test(6L, 4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(281474976677888L, test(-2147483648L, 16));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lxor.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lxor {
-
-    public static long test(long a, long b) {
-        return a ^ b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1L, test(0L, -1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(32L, test(31L, 63L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2L, test(6L, 4L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-2147483647L, test(-2147483648L, 1L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_monitorenter {
-
-    static BC_monitorenter object = new BC_monitorenter();
-
-    public static int test(int arg) {
-        synchronized (object) {
-            return arg;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-2, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_monitorenter02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_monitorenter02 {
-
-    static BC_monitorenter02 object = new BC_monitorenter02();
-
-    public static int test(int arg, int arg2) {
-        int result = arg;
-        synchronized (object) {
-            result = arg / arg2;
-        }
-        synchronized (object) {
-            result = arg / arg2;
-        }
-        return result;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0, 1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1, 1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-2, test(-2, 1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_multianewarray01 {
-
-    public static int test(int a) {
-        final BC_multianewarray01[][] v = new BC_multianewarray01[3][3];
-        return v != null ? a : -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_multianewarray02 {
-
-    public static int test(int a) {
-        final BC_multianewarray02[][][][] v = new BC_multianewarray02[3][3][3][3];
-        return v != null ? a : -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_multianewarray03 {
-
-    public static int test(int a) {
-        final BC_multianewarray03[][][][] v = new BC_multianewarray03[a][a][a][a];
-        return v.length + v[0].length + v[0][0].length + v[0][0][0].length;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(8, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_multianewarray04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_multianewarray04 {
-
-    public static int test(int a) {
-        int i = 1;
-
-        i += test_byte(a);
-        i += test_boolean(a);
-        i += test_char(a);
-        i += test_short(a);
-        i += test_int(a);
-        i += test_float(a);
-        i += test_long(a);
-        i += test_double(a);
-
-        return i;
-    }
-
-    private static int test_double(int a) {
-        double[][] b2 = new double[a][a];
-        double[][][] b3 = new double[a][a][a];
-        double[][][][] b4 = new double[a][a][a][a];
-        double[][][][][] b5 = new double[a][a][a][a][a];
-        double[][][][][][] b6 = new double[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    private static int test_long(int a) {
-        long[][] b2 = new long[a][a];
-        long[][][] b3 = new long[a][a][a];
-        long[][][][] b4 = new long[a][a][a][a];
-        long[][][][][] b5 = new long[a][a][a][a][a];
-        long[][][][][][] b6 = new long[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    private static int test_float(int a) {
-        float[][] b2 = new float[a][a];
-        float[][][] b3 = new float[a][a][a];
-        float[][][][] b4 = new float[a][a][a][a];
-        float[][][][][] b5 = new float[a][a][a][a][a];
-        float[][][][][][] b6 = new float[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    private static int test_int(int a) {
-        int[][] b2 = new int[a][a];
-        int[][][] b3 = new int[a][a][a];
-        int[][][][] b4 = new int[a][a][a][a];
-        int[][][][][] b5 = new int[a][a][a][a][a];
-        int[][][][][][] b6 = new int[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    private static int test_short(int a) {
-        short[][] b2 = new short[a][a];
-        short[][][] b3 = new short[a][a][a];
-        short[][][][] b4 = new short[a][a][a][a];
-        short[][][][][] b5 = new short[a][a][a][a][a];
-        short[][][][][][] b6 = new short[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    private static int test_char(int a) {
-        char[][] b2 = new char[a][a];
-        char[][][] b3 = new char[a][a][a];
-        char[][][][] b4 = new char[a][a][a][a];
-        char[][][][][] b5 = new char[a][a][a][a][a];
-        char[][][][][][] b6 = new char[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    private static int test_boolean(int a) {
-        boolean[][] b2 = new boolean[a][a];
-        boolean[][][] b3 = new boolean[a][a][a];
-        boolean[][][][] b4 = new boolean[a][a][a][a];
-        boolean[][][][][] b5 = new boolean[a][a][a][a][a];
-        boolean[][][][][][] b6 = new boolean[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    private static int test_byte(int a) {
-        byte[][] b2 = new byte[a][a];
-        byte[][][] b3 = new byte[a][a][a];
-        byte[][][][] b4 = new byte[a][a][a][a];
-        byte[][][][][] b5 = new byte[a][a][a][a][a];
-        byte[][][][][][] b6 = new byte[a][a][a][a][a][a];
-        return b2.length + b3.length + b4.length + b5.length + b6.length;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(41, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(81, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_new.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_new {
-
-    @SuppressWarnings("unused")
-    public static int test(int a) {
-        new BC_new();
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_newarray.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_newarray {
-
-    public static int test(int a) {
-        if (new boolean[3] == null) {
-            return -1;
-        }
-        if (new char[3] == null) {
-            return -1;
-        }
-        if (new float[3] == null) {
-            return -1;
-        }
-        if (new double[3] == null) {
-            return -1;
-        }
-        if (new byte[3] == null) {
-            return -1;
-        }
-        if (new short[3] == null) {
-            return -1;
-        }
-        if (new int[3] == null) {
-            return -1;
-        }
-        if (new long[3] == null) {
-            return -1;
-        }
-
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putfield.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_putfield {
-
-    private static BC_putfield object = new BC_putfield();
-
-    private int field;
-
-    public static int test(int arg) {
-        object.field = arg;
-        return object.field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_putstatic.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_putstatic {
-
-    private static int field;
-
-    public static int test(int a) {
-        field = a;
-        return field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_saload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_saload {
-
-    static short[] array = {0, -1, 4, 10000};
-
-    public static short test(int arg) {
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 0), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) -1), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) 4), test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((short) 10000), test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_sastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_sastore {
-
-    static short[] array = {0, 0, 0, 0};
-
-    public static short test(int arg, short val) {
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 0), test(0, ((short) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) -1), test(1, ((short) -1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) 11), test(2, ((short) 11)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((short) -14), test(3, ((short) -14)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_tableswitch {
-
-    public static int test(int a) {
-        switch (a) {
-            case 0:
-                return 10;
-            case 1:
-                return 20;
-            case 2:
-                return 30;
-            case 4:
-                return 40;
-            case 5:
-                return 50;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(42, test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(20, test(1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(30, test(2));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(42, test(3));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(40, test(4));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(50, test(5));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(42, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_tableswitch2 {
-
-    public static int test(int a) {
-        switch (a) {
-            case 5:
-                return 55;
-            case 6:
-                return 66;
-            case 7:
-                return 77;
-        }
-        return 11;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(55, test(5));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(66, test(6));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(77, test(7));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(11, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_tableswitch3 {
-
-    public static int test(int a) {
-        switch (a) {
-            case -2:
-                return 22;
-            case -1:
-                return 11;
-            case 0:
-                return 33;
-            case 1:
-                return 77;
-        }
-        return 99;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(22, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(99, test(-3));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(99, test(-4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(77, test(1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(99, test(2));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(99, test(10));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_tableswitch4.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_tableswitch4 {
-
-    public static int test(int a) {
-        switch (a) {
-            case -5:
-                return 55;
-            case -4:
-                return 44;
-            case -3:
-                return 33;
-        }
-        return 11;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(55, test(-5));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(44, test(-4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(33, test(-3));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(11, test(-8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_wide01 {
-
-    @SuppressWarnings("unused")
-    public static int test(int arg) {
-
-        // Checkstyle: stop
-        long i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15;
-        long j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
-        long k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15;
-        long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15;
-        long m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15;
-        long n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15;
-        long o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15;
-        long p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15;
-        long q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15;
-        long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
-        // Checkstyle: resume
-
-        int i255 = 10;
-        return arg + i255 + 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(12, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_wide02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.bytecode;
-
-import org.junit.*;
-
-/*
- */
-public class BC_wide02 {
-
-    @SuppressWarnings("unused")
-    public static int test(int arg) {
-
-        // Checkstyle: stop
-        long i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15;
-        long j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
-        long k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15;
-        long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15;
-        long m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15;
-        long n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15;
-        long o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15;
-        long p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15;
-        long q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15;
-        long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
-        // Checkstyle: resume
-
-        int i255 = 9;
-        i255++;
-        return arg + i255 + 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(12, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload0.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_aaload0 {
-
-    static Object[] array = {null, null, ""};
-
-    public static Object test(int arg) {
-        final Object[] obj = arg == -2 ? null : array;
-        return obj[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(null, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aaload1 {
-
-    static Object[] array = {null, null, ""};
-
-    public static Object test(int arg) {
-        final Object[] obj = arg == -2 ? null : array;
-        try {
-            return obj[arg];
-        } catch (NullPointerException e) {
-            return null;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(-2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(null, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore0.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_aastore0 {
-
-    static Object[] param = {new Object(), null, "h"};
-    static Object[] arr = {null, null, null};
-    static String[] arr2 = {null, null, null};
-
-    public static int test(boolean a, int indx) {
-        Object[] array = a ? arr : arr2;
-        Object val;
-        if (indx == -2) {
-            array = null;
-            val = null;
-        } else {
-            val = param[indx];
-        }
-        array[indx] = val;
-        return indx;
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(true, -2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(true, -1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(true, 0));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1, test(true, 1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(2, test(true, 2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run5() throws Throwable {
-        test(true, 3);
-    }
-
-    @Test(expected = java.lang.ArrayStoreException.class)
-    public void run6() throws Throwable {
-        test(false, 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(1, test(false, 1));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(2, test(false, 2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run9() throws Throwable {
-        test(false, 3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_aastore1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_aastore1 {
-
-    static Object[] param = {new Object(), null, "h"};
-    static Object[] arr = {null, null, null};
-    static String[] arr2 = {null, null, null};
-
-    public static int test(boolean a, int indx) {
-        try {
-            Object[] array = a ? arr : arr2;
-            Object val;
-            if (indx == -2) {
-                array = null;
-                val = null;
-            } else {
-                val = param[indx];
-            }
-            array[indx] = val;
-            return indx;
-        } catch (NullPointerException e) {
-            return 5;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5, test(true, -2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(true, -1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(true, 0));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1, test(true, 1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(2, test(true, 2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run5() throws Throwable {
-        test(true, 3);
-    }
-
-    @Test(expected = java.lang.ArrayStoreException.class)
-    public void run6() throws Throwable {
-        test(false, 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(1, test(false, 1));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(2, test(false, 2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run9() throws Throwable {
-        test(false, 3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_anewarray.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_anewarray {
-
-    @SuppressWarnings("unused")
-    public static int test(int a) {
-        final BC_anewarray[] v = new BC_anewarray[a];
-        if (v != null) {
-            return a;
-        }
-        return -1;
-    }
-
-    @Test(expected = java.lang.NegativeArraySizeException.class)
-    public void run0() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_arraylength.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_arraylength {
-
-    static int[] arr = {1, 2, 3};
-    static char[] arr2 = {'a', 'b', 'c', 'd'};
-    static Object[] arr3 = new Object[5];
-
-    @SuppressWarnings("all")
-    public static int test(int arg) {
-        if (arg == 0) {
-            int[] array = null;
-            return array.length;
-        }
-        if (arg == 1) {
-            return arr.length;
-        }
-        if (arg == 2) {
-            return arr2.length;
-        }
-        if (arg == 3) {
-            return arr3.length;
-        }
-        return 42;
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(3, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(4, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(5, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(42, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow0.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_athrow0 {
-
-    static Throwable throwable = new Throwable();
-
-    public static int test(int arg) throws Throwable {
-        if (arg == 2) {
-            throw throwable;
-        }
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.Throwable.class)
-    public void run1() throws Throwable {
-        test(2);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_athrow1 {
-
-    static Throwable throwable = new Throwable();
-
-    public static int test(int arg) throws Throwable {
-        if (arg == 2) {
-            throw throwable;
-        }
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test(expected = java.lang.Throwable.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_athrow2 {
-
-    static Throwable throwable = new Throwable();
-
-    public static int test(int arg) throws Throwable {
-        if (arg == 2) {
-            throw throwable;
-        } else if (arg == 3) {
-            throw null;
-        }
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.Throwable.class)
-    public void run1() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_athrow3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_athrow3 {
-
-    static Throwable throwable = new Throwable();
-
-    public static int test(int arg) throws Throwable {
-        if (arg == 2) {
-            throw2();
-        } else if (arg == 3) {
-            throw1();
-        }
-        return arg;
-    }
-
-    private static void throw2() throws Throwable {
-        throw throwable;
-    }
-
-    private static void throw1() throws Throwable {
-        throw null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.Throwable.class)
-    public void run1() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_baload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_baload {
-
-    static boolean[] arr = {true, false, true, false};
-
-    public static boolean test(int arg) {
-        final boolean[] array = arg == -2 ? null : arr;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_bastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_bastore {
-
-    static boolean[] arr = {false, false, false, false};
-
-    public static boolean test(int arg, boolean val) {
-        final boolean[] array = arg == -2 ? null : arr;
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2, true);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1, false);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(0, true));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4, true);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_caload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_caload {
-
-    static char[] arr = {'\000', 'a', ' ', 10000};
-
-    public static char test(int arg) {
-        final char[] array = arg == -2 ? null : arr;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 0), test(0));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_castore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_castore {
-
-    static char[] arr = {0, 0, 0, 0};
-
-    public static char test(int arg, char val) {
-        final char[] array = arg == -2 ? null : arr;
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2, ((char) 97));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1, ((char) 99));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 97), test(0, ((char) 97)));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4, ((char) 97));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_checkcast {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new BC_checkcast();
-
-    public static int test(int arg) {
-        Object obj = null;
-        if (arg == 2) {
-            obj = object2;
-        }
-        if (arg == 3) {
-            obj = object3;
-        }
-        if (arg == 4) {
-            obj = object4;
-        }
-        final BC_checkcast bc = (BC_checkcast) obj;
-        if (bc == null) {
-            return arg;
-        }
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run1() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run2() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_checkcast1 {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new BC_checkcast1();
-
-    public static int test(int arg) {
-        Object obj = null;
-        if (arg == 2) {
-            obj = object2;
-        }
-        if (arg == 3) {
-            obj = object3;
-        }
-        if (arg == 4) {
-            obj = object4;
-        }
-        final BC_checkcast1 bc = (BC_checkcast1) obj;
-        if (bc == null) {
-            return arg;
-        }
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run1() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run2() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_checkcast2 {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new com.oracle.graal.jtt.except.BC_checkcast2();
-
-    public static int test(int arg) {
-        Object obj;
-        if (arg == 2) {
-            obj = object2;
-        } else if (arg == 3) {
-            obj = object3;
-        } else if (arg == 4) {
-            obj = object4;
-        } else {
-            obj = null;
-        }
-        final BC_checkcast2 bc = (BC_checkcast2) obj;
-        if (bc != null) {
-            return arg;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast3.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_checkcast3 {
-
-    static Object[] o1 = {new Object()};
-    static String[] o2 = {""};
-    static BC_checkcast3[] o3 = {new BC_checkcast3()};
-
-    public static int test(int arg) {
-        Object obj = null;
-        if (arg == 0) {
-            obj = o1;
-        }
-        if (arg == 1) {
-            obj = o2;
-        }
-        if (arg == 2) {
-            obj = o3;
-        }
-        Object[] r = (BC_checkcast3[]) obj;
-        return r == null ? -1 : -1;
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast4.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class BC_checkcast4 {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new BC_checkcast4();
-
-    public static int test(int arg) {
-        Object obj;
-        if (arg == 2) {
-            obj = object2;
-        } else if (arg == 3) {
-            obj = object3;
-        } else if (arg == 4) {
-            obj = object4;
-        } else {
-            obj = null;
-        }
-        final BC_checkcast4 bc = (BC_checkcast4) obj;
-        if (bc != null) {
-            return arg;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast5.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_checkcast5 {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new BC_checkcast5();
-
-    public static int test(int arg) {
-        Object obj;
-        if (arg == 2) {
-            obj = object2;
-        } else if (arg == 3) {
-            obj = object3;
-        } else if (arg == 4) {
-            obj = object4;
-        } else {
-            obj = null;
-        }
-        try {
-            final BC_checkcast5 bc = (BC_checkcast5) obj;
-            if (bc != null) {
-                return arg;
-            }
-        } catch (ClassCastException e) {
-            return -5;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-5, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-5, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_checkcast6.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class BC_checkcast6 {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new BC_checkcast6();
-
-    public static int test(int arg) {
-        Object obj;
-        if (arg == 2) {
-            obj = object2;
-        } else if (arg == 3) {
-            obj = object3;
-        } else if (arg == 4) {
-            obj = object4;
-        } else {
-            obj = null;
-        }
-        try {
-            final BC_checkcast6 bc = (BC_checkcast6) obj;
-            if (bc != null) {
-                return arg;
-            }
-        } catch (ClassCastException e) {
-            return -5;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-5, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-5, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_daload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_daload {
-
-    static double[] arr = {0.0, -1.1, 4.32, 6.06};
-
-    public static double test(int arg) {
-        final double[] array = arg == -2 ? null : arr;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.0d, test(0), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_dastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_dastore {
-
-    static double[] arr = {0, 0, 0, 0};
-
-    public static double test(int arg, double val) {
-        final double[] array = arg == -2 ? null : arr;
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2, 0.01d);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1, -1.4d);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.01d, test(0, 0.01d), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4, 0.01d);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_faload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_faload {
-
-    static float[] arr = {0.0f, -1.1f, 4.32f, 6.06f};
-
-    public static float test(int arg) {
-        final float[] array = arg == -2 ? null : arr;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.0f, test(0), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_fastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_fastore {
-
-    static float[] arr = {0, 0, 0, 0};
-
-    public static float test(int arg, float val) {
-        final float[] array = arg == -2 ? null : arr;
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2, 0.01f);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1, -1.4f);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.01f, test(0, 0.01f), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4, 0.01f);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_getfield.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_getfield {
-
-    private static BC_getfield object = new BC_getfield();
-
-    private int field = 13;
-
-    public static int test(int arg) {
-        final BC_getfield obj = (arg == 3) ? null : object;
-        return obj.field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(13, test(0));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run1() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_iaload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_iaload {
-
-    static int[] arr = {0, -1, 4, 1000000000};
-
-    public static int test(int arg) {
-        final int[] array = arg == -2 ? null : arr;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_iastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_iastore {
-
-    static int[] arr = {0, 0, 0, 0};
-
-    public static int test(int arg, int val) {
-        final int[] array = arg == -2 ? null : arr;
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2, 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1, 3);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(0, 0));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4, 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_idiv {
-
-    public static int test(int a, int b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 2));
-    }
-
-    @Test(expected = java.lang.ArithmeticException.class)
-    public void run1() throws Throwable {
-        test(11, 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_idiv2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_idiv2 {
-
-    public static int test(int a, int b) {
-        try {
-            return a / b;
-        } catch (Exception e) {
-            return -11;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-11, test(11, 0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokespecial01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public class BC_invokespecial01 {
-
-    private static final BC_invokespecial01 obj = new BC_invokespecial01();
-
-    public static boolean test(int arg) {
-        BC_invokespecial01 object = null;
-        if (arg == 0) {
-            object = obj;
-        }
-        return object.method();
-    }
-
-    private boolean method() {
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_invokevirtual01 {
-
-    private static final BC_invokevirtual01 obj = new BC_invokevirtual01();
-
-    public static boolean test(int arg) {
-        BC_invokevirtual01 object = null;
-        if (arg == 0) {
-            object = obj;
-        }
-        return object.method();
-    }
-
-    public boolean method() {
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_invokevirtual02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public class BC_invokevirtual02 {
-
-    private static final BC_invokevirtual02 obj = new BC_invokevirtual02();
-
-    public static boolean test(int arg) {
-        BC_invokevirtual02 object = null;
-        if (arg == 0) {
-            object = obj;
-        }
-        return object.method();
-    }
-
-    public final boolean method() {
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_irem.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_irem {
-
-    public static int test(int a, int b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(1, 2));
-    }
-
-    @Test(expected = java.lang.ArithmeticException.class)
-    public void run1() throws Throwable {
-        test(11, 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_laload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_laload {
-
-    static long[] arr = {0L, -1L, 4L, 1000000000000L};
-
-    public static long test(int arg) {
-        final long[] array = arg == -2 ? null : arr;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0L, test(0));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_lastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_lastore {
-
-    static long[] arr = {0, 0, 0, 0};
-
-    public static long test(int arg, long val) {
-        final long[] array = arg == -2 ? null : arr;
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2, 0L);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1, 3L);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0L, test(0, 0L));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4, 0L);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_ldiv {
-
-    public static long test(long a, long b) {
-        return a / b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(1L, 2L));
-    }
-
-    @Test(expected = java.lang.ArithmeticException.class)
-    public void run1() throws Throwable {
-        test(11L, 0L);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_ldiv2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_ldiv2 {
-
-    public static long test(long a, long b) {
-        try {
-            return a / b;
-        } catch (Exception e) {
-            return -11;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(1L, 2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-11L, test(11L, 0L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_lrem.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_lrem {
-
-    public static long test(long a, long b) {
-        return a % b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(1L, 2L));
-    }
-
-    @Test(expected = java.lang.ArithmeticException.class)
-    public void run1() throws Throwable {
-        test(11L, 0L);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_monitorenter.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_monitorenter {
-
-    static com.oracle.graal.jtt.bytecode.BC_monitorenter object = new com.oracle.graal.jtt.bytecode.BC_monitorenter();
-
-    public static boolean test(boolean arg) {
-        final Object o = arg ? object : null;
-        synchronized (o) {
-            return arg;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(true));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run1() throws Throwable {
-        test(false);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_multianewarray.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_multianewarray {
-
-    @SuppressWarnings("unused")
-    public static int test(int a, int b) {
-        final BC_multianewarray[][] v = new BC_multianewarray[a][b];
-        if (v != null) {
-            return a;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1, 1));
-    }
-
-    @Test(expected = java.lang.NegativeArraySizeException.class)
-    public void run2() throws Throwable {
-        test(-1, 0);
-    }
-
-    @Test(expected = java.lang.NegativeArraySizeException.class)
-    public void run3() throws Throwable {
-        test(0, -1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_newarray.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class BC_newarray {
-
-    public static int test(int a) {
-        if (new boolean[a] == null) {
-            return -1;
-        }
-        if (new char[a] == null) {
-            return -1;
-        }
-        if (new float[a] == null) {
-            return -1;
-        }
-        if (new double[a] == null) {
-            return -1;
-        }
-        if (new byte[a] == null) {
-            return -1;
-        }
-        if (new short[a] == null) {
-            return -1;
-        }
-        if (new int[a] == null) {
-            return -1;
-        }
-        if (new long[a] == null) {
-            return -1;
-        }
-
-        return a;
-    }
-
-    @Test(expected = java.lang.NegativeArraySizeException.class)
-    public void run0() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_putfield.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_putfield {
-
-    private static BC_putfield object = new BC_putfield();
-
-    private int field;
-
-    public static int test(int arg) {
-        final BC_putfield obj = arg == 3 ? null : object;
-        obj.field = arg;
-        return obj.field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run1() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_saload.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_saload {
-
-    static short[] arr = {0, -1, 4, 10000};
-
-    public static short test(int arg) {
-        final short[] array = arg == -2 ? null : arr;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) 0), test(0));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/BC_sastore.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class BC_sastore {
-
-    static short[] arr = {0, 0, 0, 0};
-
-    public static short test(int arg, short val) {
-        final short[] array = arg == -2 ? null : arr;
-        array[arg] = val;
-        return array[arg];
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(-2, ((short) 0));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(-1, ((short) 3));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) 0), test(0, ((short) 0)));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(4, ((short) 0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Loop01 {
-
-    public static int test(int arg) {
-        int accum = 0;
-        for (int i = 0; i < arg; i++) {
-            try {
-                accum += div(20, i);
-            } catch (ArithmeticException e) {
-                accum -= 100;
-            }
-        }
-        return accum;
-    }
-
-    static int div(int a, int b) {
-        return a / (b % 3);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-170, test(4));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-150, test(5));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-140, test(6));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-240, test(7));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-700, test(30));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Loop02 {
-
-    public static int test(int arg) {
-        int accum = 0;
-        for (int i = 0; i < arg; i++) {
-            try {
-                accum += div(20, i);
-            } catch (IllegalArgumentException e) {
-                accum -= 100;
-            }
-        }
-        return accum;
-    }
-
-    static int div(int a, int b) {
-        if (b % 3 == 0) {
-            throw new IllegalArgumentException();
-        }
-        return a / (b % 3);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-170, test(4));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-150, test(5));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-140, test(6));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-240, test(7));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-700, test(30));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Loop03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Loop03 {
-
-    public static int test(int arg) {
-        int accum = 0;
-        for (int i = 0; i < arg; i++) {
-            try {
-                accum += div(20, i);
-            } catch (Catch_Loop03_Exception1 e) {
-                accum -= 100;
-            }
-        }
-        return accum;
-    }
-
-    static int div(int a, int b) {
-        if (b % 3 == 0) {
-            throw new Catch_Loop03_Exception1();
-        }
-        return a / (b % 3);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-170, test(4));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-150, test(5));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-140, test(6));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-240, test(7));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-700, test(30));
-    }
-
-}
-
-@SuppressWarnings("serial")
-class Catch_Loop03_Exception1 extends RuntimeException {
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_1.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NASE_1 {
-
-    @SuppressWarnings("unused")
-    public static int test(int a) {
-        try {
-            int[] v = new int[a];
-            if (v != null) {
-                return v.length;
-            }
-            return -1;
-        } catch (NegativeArraySizeException e) {
-            return 100;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(100, test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(100, test(-34));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(20, test(20));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NASE_2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NASE_2 {
-
-    @SuppressWarnings("unused")
-    public static int test(int a) {
-        try {
-            Catch_NASE_2[] v = new Catch_NASE_2[a];
-            if (v != null) {
-                return v.length;
-            }
-            return -1;
-        } catch (NegativeArraySizeException e) {
-            return 100;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(100, test(-1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(100, test(-34));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(20, test(20));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_00.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_00 {
-
-    public static int test(int a) {
-        int[] array = a > 0 ? new int[3] : null;
-        try {
-            return array.length;
-        } catch (NullPointerException npe) {
-            return -1;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(-3));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3, test(1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_01 {
-
-    public static int test(int a) {
-        try {
-            if (a >= 0) {
-                throw new NullPointerException();
-            }
-        } catch (NullPointerException npe) {
-            return a;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_02 {
-
-    public static int test(int a) {
-        try {
-            throwNPE(a);
-        } catch (NullPointerException npe) {
-            return a;
-        }
-        return -1;
-    }
-
-    private static void throwNPE(int a) {
-        if (a >= 0) {
-            throw new NullPointerException();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_03 {
-
-    @SuppressWarnings("all")
-    public static int test(int a) {
-        try {
-            if (a >= 0) {
-                final Object o = null;
-                return o.hashCode();
-            }
-        } catch (NullPointerException npe) {
-            return a;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_04 {
-
-    private int field = 45;
-
-    @SuppressWarnings("all")
-    public static int test(int a) {
-        try {
-            if (a >= 0) {
-                final Catch_NPE_04 obj = null;
-                return obj.field;
-            }
-        } catch (NullPointerException npe) {
-            return a;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_05 {
-
-    private int field = 45;
-
-    public static int test(int a) {
-        try {
-            return throwNPE(a);
-        } catch (NullPointerException npe) {
-            return a;
-        }
-    }
-
-    @SuppressWarnings("all")
-    private static int throwNPE(int a) {
-        if (a >= 0) {
-            final Catch_NPE_05 obj = null;
-            return obj.field;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_06 {
-
-    public static int test(String string) {
-        try {
-            return string.hashCode();
-        } catch (NullPointerException npe) {
-            return -1;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(""));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(null));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_07.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-
-public class Catch_NPE_07 {
-
-    @SuppressWarnings("serial")
-    public static class MyThrowable extends Throwable {
-    }
-
-    @SuppressWarnings("unused")
-    public static int foo(Throwable t) {
-        try {
-            throw t;
-        } catch (Throwable t1) {
-            if (t1 == null) {
-                return -1;
-            }
-            if (t1 instanceof NullPointerException) {
-                return 0;
-            }
-            if (t1 instanceof MyThrowable) {
-                return 1;
-            }
-            return -2;
-        }
-    }
-
-    public static int test(int i) {
-        Throwable t = (i == 0) ? null : new MyThrowable();
-        try {
-            return foo(t);
-        } catch (Throwable t1) {
-            return -3;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_08.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_08 {
-
-    public static int test(int a) {
-        try {
-            throwNPE(a);
-        } catch (NullPointerException npe) {
-            return a;
-        }
-        return -1;
-    }
-
-    @SuppressWarnings("unused")
-    private static void throwNPE(int a) {
-        throw null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-2, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_09.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_09 {
-
-    public static int test(int a) {
-        int r = 0;
-        try {
-            r = 0;
-            throwNPE(a);
-            r = 1;
-            throwNPE(a - 1);
-        } catch (NullPointerException e) {
-            return r + 10;
-        }
-        return r;
-    }
-
-    private static void throwNPE(int a) {
-        if (a == 0) {
-            throw null;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_10.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_10 {
-
-    public static int test(int a) {
-        int r = 0;
-        try {
-            r = 0;
-            if (a == 0) {
-                throw null;
-            }
-            r = 1;
-            if (a - 1 == 0) {
-                throw null;
-            }
-        } catch (NullPointerException e) {
-            return r + 10;
-        }
-        return r;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_NPE_11.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_NPE_11 {
-
-    public static int test(int a) {
-        int r = 0;
-        try {
-            r = 0;
-            throwE(a);
-            r = 1;
-            throwE(a - 1);
-        } catch (ArithmeticException e) {
-            return r + 10;
-        }
-        return r;
-    }
-
-    private static int throwE(int a) {
-        return 1 / a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_StackOverflowError_01 {
-
-    private static void recurse() {
-        recurse();
-    }
-
-    public static int test() throws StackOverflowError {
-        recurse();
-        return -1;
-    }
-
-    @Test(expected = java.lang.StackOverflowError.class)
-    public void run0() throws Throwable {
-        test();
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_StackOverflowError_02 {
-
-    private static void recurse() {
-        recurse();
-    }
-
-    public static int test() {
-        try {
-            recurse();
-        } catch (StackOverflowError stackOverflowError) {
-            // tests that the guard page was reset and a second SOE can be handled
-            recurse();
-        }
-        return -1;
-    }
-
-    @Test(expected = java.lang.StackOverflowError.class)
-    public void run0() throws Throwable {
-        test();
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_StackOverflowError_03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/**
- * Some basic checking of the stack trace produced after a StackOverflowError.
- */
-public class Catch_StackOverflowError_03 {
-
-    private static final int PASS = 0;
-    private static final int FAIL = 1;
-
-    private static void recurseA() {
-        recurseB();
-    }
-
-    private static void recurseB() {
-        recurseA();
-    }
-
-    public static int test() {
-        try {
-            recurseA();
-        } catch (StackOverflowError stackOverflowError) {
-            // Check that a method does not appear to be calling itself in the stack trace
-            // and check that recurse* is only called by either recurse* or test
-            StackTraceElement[] elements = null;
-            elements = stackOverflowError.getStackTrace();
-            if (elements.length == 0) {
-                // Not much we can do about this perfectly legal situation
-                return PASS;
-            }
-            String lastMethodName = elements[0].getMethodName();
-            for (int i = 1; i < elements.length; ++i) {
-                String methodName = elements[i].getMethodName();
-
-                // Skip top-of-stack until we find a method with name "recurse*".
-                if (!methodName.startsWith("recurse")) {
-                    continue;
-                }
-
-                // We reached the test method => done.
-                if (methodName.equals("test")) {
-                    break;
-                }
-
-                // Stack elements must alternate between recurseA and recurseB
-                if (lastMethodName.equals(methodName) || (!methodName.equals("recurseA") && !methodName.equals("recurseB"))) {
-                    return FAIL;
-                }
-
-                lastMethodName = methodName;
-            }
-
-            return PASS;
-        }
-
-        return FAIL;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Two01 {
-
-    public static String test(int arg) {
-        try {
-            throwSomething(arg);
-        } catch (NullPointerException e) {
-            return e.getClass().getName();
-        } catch (ArithmeticException e) {
-            return e.getClass().getName();
-        }
-        return "none";
-    }
-
-    private static void throwSomething(int arg) {
-        if (arg == 0) {
-            throw new NullPointerException();
-        }
-        if (arg == 1) {
-            throw new ArithmeticException();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("java.lang.NullPointerException", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("java.lang.ArithmeticException", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("none", test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Two02 {
-
-    public static String test(int arg) {
-        try {
-            throwSomething(arg + 10);
-        } catch (NullPointerException e) {
-            return e.getClass().getName();
-        } catch (ArithmeticException e) {
-            return e.getClass().getName();
-        }
-        return "none" + (arg + 10);
-    }
-
-    private static void throwSomething(int arg) {
-        if (arg == 10) {
-            throw new NullPointerException();
-        }
-        if (arg == 11) {
-            throw new ArithmeticException();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("java.lang.NullPointerException", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("java.lang.ArithmeticException", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("none13", test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Two03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Two03 {
-
-    public static String test(int arg) {
-        int r = 0;
-        try {
-            r = 1;
-            throwSomething(r + arg);
-            r = 2;
-            throwSomething(r + arg);
-            r = 3;
-            throwSomething(r + arg);
-            r = 4;
-        } catch (NullPointerException e) {
-            return e.getClass().getName() + r;
-        } catch (ArithmeticException e) {
-            return e.getClass().getName() + r;
-        }
-        return "none" + r;
-    }
-
-    private static void throwSomething(int arg) {
-        if (arg == 5) {
-            throw new NullPointerException();
-        }
-        if (arg == 6) {
-            throw new ArithmeticException();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("none4", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("none4", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("java.lang.NullPointerException3", test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Unresolved {
-
-    public static boolean executed;
-
-    public static int test(int arg) {
-        executed = false;
-        try {
-            helper1(arg);
-            helper2(arg);
-        } catch (Catch_Unresolved_Exception1 e) {
-            return 1;
-        } catch (Catch_Unresolved_Exception2 e) {
-            return 2;
-        }
-        return 0;
-    }
-
-    private static void helper1(int arg) {
-        if (executed) {
-            throw new IllegalStateException("helper1 may only be called once");
-        }
-        executed = true;
-        if (arg == 1) {
-            throw new Catch_Unresolved_Exception1();
-        } else if (arg == 2) {
-            throw new Catch_Unresolved_Exception2();
-        }
-    }
-
-    private static void helper2(int arg) {
-        if (arg != 0) {
-            throw new IllegalStateException("helper2 can only be called if arg==0");
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-}
-
-@SuppressWarnings("serial")
-class Catch_Unresolved_Exception1 extends RuntimeException {
-}
-
-@SuppressWarnings("serial")
-class Catch_Unresolved_Exception2 extends RuntimeException {
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Unresolved01 {
-
-    public static boolean executed;
-
-    public static int test(int arg) {
-        executed = false;
-        try {
-            helper1(arg);
-        } catch (Catch_Unresolved_Exception3 e) {
-            return 1;
-        } catch (Catch_Unresolved_Exception4 e) {
-            return 2;
-        }
-        return 0;
-    }
-
-    private static void helper1(int arg) {
-        if (executed) {
-            throw new IllegalStateException("helper1 may only be called once");
-        }
-        executed = true;
-        if (arg == 1) {
-            throw new Catch_Unresolved_Exception3();
-        } else if (arg == 2) {
-            throw new Catch_Unresolved_Exception4();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-}
-
-@SuppressWarnings("serial")
-class Catch_Unresolved_Exception3 extends RuntimeException {
-}
-
-@SuppressWarnings("serial")
-class Catch_Unresolved_Exception4 extends RuntimeException {
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Unresolved02 {
-
-    public static boolean executed;
-    public static int value;
-
-    public static int test(int arg) {
-        executed = false;
-        int result = 0;
-        try {
-            result = value + helper1(arg) + helper2(arg);
-        } catch (Catch_Unresolved02_Exception1 e) {
-            return 1 + result;
-        } catch (Catch_Unresolved02_Exception2 e) {
-            return 2 + result;
-        }
-        return result;
-    }
-
-    private static int helper1(int arg) {
-        if (executed) {
-            throw new IllegalStateException("helper1 may only be called once");
-        }
-        executed = true;
-        if (arg == 1) {
-            throw new Catch_Unresolved02_Exception1();
-        } else if (arg == 2) {
-            throw new Catch_Unresolved02_Exception2();
-        }
-        return 0;
-    }
-
-    private static int helper2(int arg) {
-        if (arg != 0) {
-            throw new IllegalStateException("helper2 can only be called if arg==0");
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-}
-
-@SuppressWarnings("serial")
-class Catch_Unresolved02_Exception1 extends RuntimeException {
-}
-
-@SuppressWarnings("serial")
-class Catch_Unresolved02_Exception2 extends RuntimeException {
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Catch_Unresolved03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Catch_Unresolved03 {
-
-    public static boolean executed;
-    public static int value;
-
-    public static int test(int arg) {
-        executed = false;
-        int result = 0;
-        try {
-            result = value + helper1(arg) + helper2(arg);
-        } catch (Catch_Unresolved03_Exception1 e) {
-            if (arg == 1) {
-                return 1;
-            }
-            return new Catch_Unresolved03_UnresolvedClass().value();
-        }
-        return result;
-    }
-
-    private static int helper1(int arg) {
-        if (executed) {
-            throw new IllegalStateException("helper1 may only be called once");
-        }
-        executed = true;
-        if (arg == 1 || arg == 2) {
-            throw new Catch_Unresolved03_Exception1();
-        }
-        return 0;
-    }
-
-    private static int helper2(int arg) {
-        if (arg != 0) {
-            throw new IllegalStateException("helper2 can only be called if arg==0");
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-}
-
-@SuppressWarnings("serial")
-class Catch_Unresolved03_Exception1 extends RuntimeException {
-}
-
-class Catch_Unresolved03_UnresolvedClass {
-
-    public int value() {
-        return 2;
-    }
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Locals.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Except_Locals {
-
-    public static int test(String a, String b) {
-        int x = 0;
-        try {
-            x = 1;
-            a.toString();
-            x = 2;
-            b.toString();
-        } catch (NullPointerException e) {
-            // System.out.println(x);
-            return x;
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(null, null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test("", null));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test("", ""));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Except_Synchronized01 {
-
-    static final Except_Synchronized01 object = new Except_Synchronized01();
-
-    final int x = 1;
-
-    public static int test(int i) throws Exception {
-        if (i == 0) {
-            return 0;
-        }
-        return object.test2(i);
-    }
-
-    @SuppressWarnings("all")
-    public synchronized int test2(int i) throws Exception {
-        try {
-            Except_Synchronized01 object = null;
-            return object.x;
-        } catch (NullPointerException e) {
-            return 2;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Except_Synchronized02 {
-
-    static final Except_Synchronized02 object = new Except_Synchronized02();
-
-    final int x = 1;
-
-    public static int test(int i) throws Exception {
-        if (i == 0) {
-            return 0;
-        }
-        return object.test2(i);
-    }
-
-    @SuppressWarnings("all")
-    public synchronized int test2(int i) throws Exception {
-        while (true) {
-            try {
-                Except_Synchronized02 object = null;
-                return object.x;
-            } catch (NullPointerException e) {
-                return 2;
-            }
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Except_Synchronized03 {
-
-    static final Except_Synchronized03 object = new Except_Synchronized03();
-
-    int x = 1;
-
-    public static int test(int i) throws Exception {
-        if (i == 0) {
-            return 0;
-        }
-        return object.test2(i);
-    }
-
-    @SuppressWarnings("all")
-    public synchronized int test2(int i) throws Exception {
-        while (true) {
-            try {
-                synchronized (this) {
-                    Except_Synchronized03 object = null;
-                    return object.x;
-                }
-            } catch (NullPointerException e) {
-                return 2;
-            }
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Except_Synchronized04 {
-
-    static final Except_Synchronized04 object = new Except_Synchronized04();
-
-    final int x = 1;
-
-    public static int test(int i) throws Exception {
-        if (i == 0) {
-            return 0;
-        }
-        return object.test2(i);
-    }
-
-    @SuppressWarnings("all")
-    public int test2(int i) throws Exception {
-        try {
-            synchronized (Except_Synchronized04.class) {
-                Except_Synchronized04 object = null;
-                return object.x;
-            }
-        } catch (NullPointerException e) {
-            return 2;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Except_Synchronized05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public class Except_Synchronized05 {
-
-    Object field;
-
-    public static int test(int arg) {
-        Except_Synchronized05 obj = new Except_Synchronized05();
-        int a = obj.bar(arg) != null ? 1 : 0;
-        int b = obj.baz(arg) != null ? 1 : 0;
-        return a + b;
-    }
-
-    public synchronized Object bar(int arg) {
-        try {
-            String f = foo1(arg);
-            if (f == null) {
-                field = new Object();
-            }
-        } catch (NullPointerException e) {
-            // do nothing
-        }
-        return field;
-    }
-
-    public Object baz(int arg) {
-        synchronized (this) {
-            try {
-                String f = foo1(arg);
-                if (f == null) {
-                    field = new Object();
-                }
-            } catch (NullPointerException e) {
-                // do nothing
-            }
-            return field;
-        }
-    }
-
-    private String foo1(int arg) {
-        if (arg == 0) {
-            throw null;
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Finally01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Finally01 {
-
-    @SuppressWarnings("all")
-    public static int test(int arg) {
-        try {
-            return 0;
-        } finally {
-            return -1;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Finally02.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class Finally02 {
-
-    public static int test() {
-        try {
-            a();
-        } finally {
-            b();
-        }
-
-        return c();
-    }
-
-// @NEVER_INLINE
-    static int a() {
-        return 0;
-    }
-
-// @NEVER_INLINE
-    static int b() {
-        return -3;
-    }
-
-    static int c() {
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_AIOOBE_00.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class StackTrace_AIOOBE_00 {
-
-    private static int[] array = new int[3];
-
-    public static int test(int a) {
-        try {
-            return array[a];
-        } catch (ArrayIndexOutOfBoundsException npe) {
-            for (StackTraceElement e : npe.getStackTrace()) {
-                if (e.getClassName().equals(StackTrace_AIOOBE_00.class.getName()) && e.getMethodName().equals("test")) {
-                    return -1;
-                }
-            }
-        }
-        return -2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_CCE_00.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class StackTrace_CCE_00 {
-
-    static Object object2 = new Object();
-    static Object object3 = "";
-    static Object object4 = new StackTrace_CCE_00();
-
-    public static int test(int arg) {
-        Object obj = null;
-        if (arg == 2) {
-            obj = object2;
-        }
-        if (arg == 3) {
-            obj = object3;
-        }
-        if (arg == 4) {
-            obj = object4;
-        }
-        try {
-            final StackTrace_CCE_00 bc = (StackTrace_CCE_00) obj;
-            if (bc == null) {
-                return arg;
-            }
-            return arg;
-        } catch (ClassCastException npe) {
-            for (StackTraceElement e : npe.getStackTrace()) {
-                if (e.getClassName().equals(StackTrace_CCE_00.class.getName()) && e.getMethodName().equals("test")) {
-                    return -100;
-                }
-            }
-            return -200;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-100, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-100, test(3));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_00.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class StackTrace_NPE_00 {
-
-    public static int test(int a) {
-        int[] array = a > 0 ? new int[3] : null;
-        try {
-            return array.length;
-        } catch (NullPointerException npe) {
-            for (StackTraceElement e : npe.getStackTrace()) {
-                if (e.getClassName().equals(StackTrace_NPE_00.class.getName())) {
-                    return -1;
-                }
-            }
-            return -2;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(-3));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3, test(1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class StackTrace_NPE_01 {
-
-    @SuppressWarnings("all")
-    public static int test(int a) {
-        try {
-            if (a >= 0) {
-                final Object o = null;
-                return o.hashCode();
-            }
-        } catch (NullPointerException npe) {
-            for (StackTraceElement e : npe.getStackTrace()) {
-                if (e.getClassName().equals(StackTrace_NPE_01.class.getName()) && e.getMethodName().equals("test")) {
-                    return a;
-                }
-            }
-        }
-        return -1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class StackTrace_NPE_02 {
-
-    private static String[] trace = {"test1", "test"};
-
-    public static int test(int a) {
-        try {
-            if (a >= 0) {
-                return test1();
-            }
-        } catch (NullPointerException npe) {
-            String thisClass = StackTrace_NPE_02.class.getName();
-            StackTraceElement[] stackTrace = npe.getStackTrace();
-            for (int i = 0; i < stackTrace.length; i++) {
-                StackTraceElement e = stackTrace[i];
-                if (e.getClassName().equals(thisClass)) {
-                    for (int j = 0; j < trace.length; j++) {
-                        StackTraceElement f = stackTrace[i + j];
-                        if (!f.getClassName().equals(thisClass)) {
-                            return -2;
-                        }
-                        if (!f.getMethodName().equals(trace[j])) {
-                            return -3;
-                        }
-                    }
-                    return 0;
-                }
-            }
-        }
-        return -1;
-    }
-
-    @SuppressWarnings("all")
-    private static int test1() {
-        final Object o = null;
-        return o.hashCode();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/StackTrace_NPE_03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-/*
- */
-public class StackTrace_NPE_03 {
-
-    private static String[] trace = {"test2", "test1", "test"};
-
-    public static int test(int a) {
-        try {
-            if (a >= 0) {
-                return test1();
-            }
-        } catch (NullPointerException npe) {
-            String thisClass = StackTrace_NPE_03.class.getName();
-            StackTraceElement[] stackTrace = npe.getStackTrace();
-            for (int i = 0; i < stackTrace.length; i++) {
-                StackTraceElement e = stackTrace[i];
-                if (e.getClassName().equals(thisClass)) {
-                    for (int j = 0; j < trace.length; j++) {
-                        StackTraceElement f = stackTrace[i + j];
-                        if (!f.getClassName().equals(thisClass)) {
-                            return -2;
-                        }
-                        if (!f.getMethodName().equals(trace[j])) {
-                            return -3;
-                        }
-                    }
-                    return 0;
-                }
-            }
-        }
-        return -1;
-    }
-
-    private static int test1() {
-        return test2();
-    }
-
-    private static int test2() {
-        throw new NullPointerException();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(-2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_InCatch01 {
-
-    public static boolean test(int i) throws Exception {
-        if (i == 0) {
-            return true;
-        }
-        try {
-            throw new Exception();
-        } catch (Exception e) {
-            throw e;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_InCatch02 {
-
-    public static boolean test(int i) throws Exception {
-        if (i == 0) {
-            return true;
-        }
-        try {
-            throwE();
-        } catch (Exception e) {
-            throwE(e);
-        }
-        return false;
-    }
-
-    private static void throwE(Exception e) throws Exception {
-        throw e;
-    }
-
-    private static void throwE() throws Exception {
-        throw new Exception();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InCatch03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_InCatch03 {
-
-    public static boolean test(int i) throws Exception {
-        if (i == 0) {
-            return true;
-        }
-        try {
-            throwE();
-        } catch (Exception e) {
-            throw e;
-        }
-        return false;
-    }
-
-    private static void throwE() throws Exception {
-        throw new Exception();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_InNested.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_InNested {
-
-    public static int test(int i) throws Exception {
-        return 42 + test2(i);
-    }
-
-    public static int test2(int i) throws Exception {
-        try {
-            return test3(i);
-        } catch (Exception e) {
-            return 5;
-        }
-    }
-
-    private static int test3(int i) {
-        if (i == 0) {
-            throw new RuntimeException();
-        }
-        return i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(47, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(43, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_NPE_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_NPE_01 {
-
-    public static int test(int i) throws Exception {
-        int a = test2(i);
-        a = a + 1;
-        return a;
-    }
-
-    public static int test2(int i) {
-        if (i < 0) {
-            throw null;
-        }
-        return i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(-1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_Synchronized01 {
-
-    public static synchronized boolean test(int i) throws Exception {
-        return i == 0 || test2(i);
-    }
-
-    @SuppressWarnings("unused")
-    public static boolean test2(int i) throws Exception {
-        throw new Exception();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_Synchronized02 {
-
-    public static synchronized boolean test(int i) throws Exception {
-        if (i == 0) {
-            return true;
-        }
-        throw new Exception();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_Synchronized03 {
-
-    public static synchronized boolean test(int i) throws Exception {
-        if (i == 0) {
-            return true;
-        }
-        return test2(i);
-    }
-
-    @SuppressWarnings("unused")
-    public static synchronized boolean test2(int i) throws Exception {
-        throw new Exception();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_Synchronized04 {
-
-    static final Throw_Synchronized04 object = new Throw_Synchronized04();
-
-    public static boolean test(int i) throws Exception {
-        if (i == 0) {
-            return true;
-        }
-        return object.test2(i);
-    }
-
-    @SuppressWarnings("unused")
-    public synchronized boolean test2(int i) throws Exception {
-        throw new Exception();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/except/Throw_Synchronized05.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.except;
-
-import org.junit.*;
-
-public class Throw_Synchronized05 {
-
-    static final Throw_Synchronized05 object = new Throw_Synchronized05();
-
-    public static boolean test(int i) throws Exception {
-        if (i == 0) {
-            return true;
-        }
-        return object.test2(i);
-    }
-
-    @SuppressWarnings("unused")
-    public synchronized boolean test2(int i) throws Exception {
-        try {
-            throw new Exception();
-        } catch (Exception e) {
-            // do nothing and then rethrow
-            throw e;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_allocate01 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            sum += i;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(3160, test(80));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_allocate02 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            final Integer j = new Integer(i);
-            sum += j;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4950, test(100));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_allocate03 {
-
-    public static int test(int count) {
-        @SuppressWarnings("unused")
-        final int sum = 0;
-        String text = "";
-        for (int i = 0; i < count; i++) {
-            text += '.';
-        }
-        return text.length();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(100, test(100));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_allocate04.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_allocate04 {
-
-    public static int test(int count) {
-        int[] a = new int[count];
-
-        for (int i = 0; i < a.length; i++) {
-            a[i] = i;
-        }
-
-        int i = 0;
-        int iwrap = count - 1;
-        int sum = 0;
-
-        while (i < count) {
-            sum += (a[i] + a[iwrap]) / 2;
-            iwrap = i;
-            i++;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3120, test(80));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_array01 {
-
-    public static int[] array = new int[40];
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            array[i] = i;
-            sum += array[i];
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(780, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_array02 {
-
-    public static byte[] b = new byte[40];
-    public static char[] c = new char[40];
-    public static short[] s = new short[40];
-    public static int[] iArray = new int[40];
-    public static long[] l = new long[40];
-    public static float[] f = new float[40];
-    public static double[] d = new double[40];
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int x = 0; x < count; x++) {
-            b[x] = (byte) x;
-            c[x] = (char) x;
-            s[x] = (short) x;
-            iArray[x] = x;
-            l[x] = x;
-            f[x] = x;
-            d[x] = x;
-            sum += b[x] + c[x] + s[x] + iArray[x] + l[x] + f[x] + d[x];
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5460, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_array03 {
-
-    public static byte[] b = new byte[40];
-    public static char[] c = new char[40];
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            sum += b.length + c.length;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3200, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_array04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_array04 {
-
-    public static byte[] b = new byte[40];
-    public static char[] c = new char[40];
-
-    public static int test(int count) {
-        int sum = 0;
-
-        for (int i = 0; i < b.length; i++) {
-            b[i] = (byte) i;
-            c[i] = (char) i;
-        }
-
-        for (int j = 0; j < 10; j++) {
-            try {
-                for (int i = 0; i < count; i++) {
-                    sum += b[i] + c[i];
-                }
-            } catch (IndexOutOfBoundsException e) {
-                sum += j;
-            }
-        }
-
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(15645, test(80));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_control01 {
-
-    public static int test(int count) {
-        int i1 = 1;
-        int i2 = 2;
-        int i3 = 3;
-        int i4 = 4;
-
-        for (int i = 0; i < count; i++) {
-            i1 = i2;
-            i2 = i3;
-            i3 = i4;
-            i4 = i1;
-
-            i1 = i2;
-            i2 = i3;
-            i3 = i4;
-            i4 = i1;
-
-            i1 = i2;
-            i2 = i3;
-            i3 = i4;
-            i4 = i1;
-
-            i1 = i2;
-            i2 = i3;
-            i3 = i4;
-            i4 = i1;
-        }
-
-        return i1 + i2 * 10 + i3 * 100 + i4 * 1000;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2432, test(40));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(3243, test(80));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_control02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_control02 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            switch (i) {
-                case 30:
-                    sum += 30;
-                    break;
-                case 31:
-                    sum += 31;
-                    break;
-                case 32:
-                    sum += 32;
-                    break;
-                case 33:
-                    sum += 33;
-                    break;
-                case 34:
-                    sum += 34;
-                    break;
-                case 35:
-                    sum += 35;
-                    break;
-                case 36:
-                    sum += 36;
-                    break;
-                case 37:
-                    sum += 37;
-                    break;
-                case 38:
-                    sum += 38;
-                    break;
-                case 39:
-                    sum += 39;
-                    break;
-                case 40:
-                    sum += 40;
-                    break;
-                case 41:
-                    sum += 41;
-                    break;
-                case 42:
-                    sum += 42;
-                    break;
-                default:
-                    sum += 1;
-                    break;
-            }
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(515, test(60));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(555, test(100));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_convert01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_convert01 {
-
-    public static int test(int count) {
-        double sum = 0;
-        for (int i = 0; i < count; i++) {
-            sum = (int) sum + i;
-        }
-        return (int) sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4950, test(100));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_count.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- * Runs: 10 = 55; 20 = 210; 30 = 465; 40 = 820;
- */
-@SuppressWarnings("unused")
-public class HP_count {
-
-    public static int test(int count) {
-        float unusedFloat = 0;
-        double dub = 0;
-        int sum = 0;
-        double unusedDouble = 0;
-        for (int i = 0; i <= count; i++) {
-            if (i > 20) {
-                sum += i;
-            } else {
-                sum += i;
-            }
-            dub += sum;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(820, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_dead01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_dead01 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i <= count; i++) {
-            int a = i + i;
-            int b = i / 2 * i - 10;
-            @SuppressWarnings("unused")
-            int c = a + b;
-            int d = a;
-            sum += d;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(110, test(10));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(420, test(20));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(930, test(30));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1640, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_demo01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_demo01 {
-
-    public static int test(int count) {
-        int sum = 0;
-
-        for (int i = 0; i < count; i++) {
-            int[] ia = new int[count];
-            long[] la = new long[count];
-            float[] fa = new float[count];
-            double[] da = new double[count];
-            sum += ia[i] = (int) (la[i] = (long) (fa[i] = (float) (da[i] = i)));
-        }
-
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3160, test(80));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_field01 {
-
-    public static int a;
-    public static int b;
-    public static int c;
-
-    public static int test(int count) {
-        for (int i = 0; i <= count; i++) {
-            if (i > 5) {
-                a += i;
-            } else if (i > 7) {
-                b += i;
-            } else {
-                c += i;
-            }
-        }
-        return a + b + c;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(820, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- * Runs: 10 = 55; 20 = 210; 30 = 465; 40 = 820;
- */
-public class HP_field02 {
-
-    public int a;
-    public int b;
-    public int c;
-
-    public static int test(int count) {
-        return new HP_field02().run(count);
-    }
-
-    public int run(int count) {
-        for (int i = 0; i <= count; i++) {
-            if (i > 5) {
-                a += i;
-            } else if (i > 7) {
-                b += i;
-            } else {
-                c += i;
-            }
-        }
-        return a + b + c;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(820, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_field03 {
-
-    public static byte b;
-    public static char c;
-    public static short s;
-    public static int i;
-    public static long l;
-    public static float f;
-    public static double d;
-
-    public static int test(int count) {
-        for (int x = 0; x <= count; x++) {
-            b += x;
-            c += x;
-            s += x;
-            i += x;
-            l += x;
-            f += x;
-            d += x;
-        }
-        return (int) (b + c + s + i + l + f + d);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2019980, test(1000));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_field04 {
-
-    public byte b;
-    public char c;
-    public short s;
-    public int i;
-    public long l;
-    public float f;
-    public double d;
-
-    public static int test(int count) {
-        return new HP_field04().run(count);
-    }
-
-    public int run(int count) {
-        for (int x = 0; x <= count; x++) {
-            b += x;
-            c += x;
-            s += x;
-            i += x;
-            l += x;
-            f += x;
-            d += x;
-        }
-        return (int) (b + c + s + i + l + f + d);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4972, test(40));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2019980, test(1000));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_idea.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,456 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-
-package com.oracle.graal.jtt.hotpath;
-
-import java.util.*;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public class HP_idea {
-
-    public boolean test() {
-        buildTestData();
-        Do();
-        return verify();
-    }
-
-    // Declare class data. Byte buffer plain1 holds the original
-    // data for encryption, crypt1 holds the encrypted data, and
-    // plain2 holds the decrypted data, which should match plain1
-    // byte for byte.
-
-    int array_rows;
-
-    byte[] plain1; // Buffer for plaintext data.
-    byte[] crypt1; // Buffer for encrypted data.
-    byte[] plain2; // Buffer for decrypted data.
-
-    short[] userkey; // Key for encryption/decryption.
-    int[] Z; // Encryption subkey (userkey derived).
-    int[] DK; // Decryption subkey (userkey derived).
-
-    void Do() {
-        cipher_idea(plain1, crypt1, Z); // Encrypt plain1.
-        cipher_idea(crypt1, plain2, DK); // Decrypt.
-    }
-
-    /*
-     * buildTestData
-     * 
-     * Builds the data used for the test -- each time the test is run.
-     */
-
-    void buildTestData() {
-        // Create three byte arrays that will be used (and reused) for
-        // encryption/decryption operations.
-
-        plain1 = new byte[array_rows];
-        crypt1 = new byte[array_rows];
-        plain2 = new byte[array_rows];
-
-        Random rndnum = new Random(136506717L); // Create random number generator.
-
-        // Allocate three arrays to hold keys: userkey is the 128-bit key.
-        // Z is the set of 16-bit encryption subkeys derived from userkey,
-        // while DK is the set of 16-bit decryption subkeys also derived
-        // from userkey. NOTE: The 16-bit values are stored here in
-        // 32-bit int arrays so that the values may be used in calculations
-        // as if they are unsigned. Each 64-bit block of plaintext goes
-        // through eight processing rounds involving six of the subkeys
-        // then a final output transform with four of the keys; (8 * 6)
-        // + 4 = 52 subkeys.
-
-        userkey = new short[8]; // User key has 8 16-bit shorts.
-        Z = new int[52]; // Encryption subkey (user key derived).
-        DK = new int[52]; // Decryption subkey (user key derived).
-
-        // Generate user key randomly; eight 16-bit values in an array.
-
-        for (int i = 0; i < 8; i++) {
-            // Again, the random number function returns int. Converting
-            // to a short type preserves the bit pattern in the lower 16
-            // bits of the int and discards the rest.
-
-            userkey[i] = (short) rndnum.nextInt();
-        }
-
-        // Compute encryption and decryption subkeys.
-
-        calcEncryptKey();
-        calcDecryptKey();
-
-        // Fill plain1 with "text."
-        for (int i = 0; i < array_rows; i++) {
-            plain1[i] = (byte) i;
-
-            // Converting to a byte
-            // type preserves the bit pattern in the lower 8 bits of the
-            // int and discards the rest.
-        }
-    }
-
-    /*
-     * calcEncryptKey
-     * 
-     * Builds the 52 16-bit encryption subkeys Z[] from the user key and stores in 32-bit int array. The routing
-     * corrects an error in the source code in the Schnier book. Basically, the sense of the 7- and 9-bit shifts are
-     * reversed. It still works reversed, but would encrypted code would not decrypt with someone else's IDEA code.
-     */
-
-    private void calcEncryptKey() {
-        int j; // Utility variable.
-
-        for (int i = 0; i < 52; i++) {
-            // Zero out the 52-int Z array.
-            Z[i] = 0;
-        }
-
-        for (int i = 0; i < 8; i++) // First 8 subkeys are userkey itself.
-        {
-            Z[i] = userkey[i] & 0xffff; // Convert "unsigned"
-            // short to int.
-        }
-
-        // Each set of 8 subkeys thereafter is derived from left rotating
-        // the whole 128-bit key 25 bits to left (once between each set of
-        // eight keys and then before the last four). Instead of actually
-        // rotating the whole key, this routine just grabs the 16 bits
-        // that are 25 bits to the right of the corresponding subkey
-        // eight positions below the current subkey. That 16-bit extent
-        // straddles two array members, so bits are shifted left in one
-        // member and right (with zero fill) in the other. For the last
-        // two subkeys in any group of eight, those 16 bits start to
-        // wrap around to the first two members of the previous eight.
-
-        for (int i = 8; i < 52; i++) {
-            j = i % 8;
-            if (j < 6) {
-                Z[i] = ((Z[i - 7] >>> 9) | (Z[i - 6] << 7)) // Shift and combine.
-                & 0xFFFF; // Just 16 bits.
-                continue; // Next iteration.
-            }
-
-            if (j == 6) // Wrap to beginning for second chunk.
-            {
-                Z[i] = ((Z[i - 7] >>> 9) | (Z[i - 14] << 7)) & 0xFFFF;
-                continue;
-            }
-
-            // j == 7 so wrap to beginning for both chunks.
-
-            Z[i] = ((Z[i - 15] >>> 9) | (Z[i - 14] << 7)) & 0xFFFF;
-        }
-    }
-
-    /*
-     * calcDecryptKey
-     * 
-     * Builds the 52 16-bit encryption subkeys DK[] from the encryption- subkeys Z[]. DK[] is a 32-bit int array holding
-     * 16-bit values as unsigned.
-     */
-
-    private void calcDecryptKey() {
-        int j, k; // Index counters.
-        int t1, t2, t3; // Temps to hold decrypt subkeys.
-
-        t1 = inv(Z[0]); // Multiplicative inverse (mod x10001).
-        t2 = -Z[1] & 0xffff; // Additive inverse, 2nd encrypt subkey.
-        t3 = -Z[2] & 0xffff; // Additive inverse, 3rd encrypt subkey.
-
-        DK[51] = inv(Z[3]); // Multiplicative inverse (mod x10001).
-        DK[50] = t3;
-        DK[49] = t2;
-        DK[48] = t1;
-
-        j = 47; // Indices into temp and encrypt arrays.
-        k = 4;
-        for (int i = 0; i < 7; i++) {
-            t1 = Z[k++];
-            DK[j--] = Z[k++];
-            DK[j--] = t1;
-            t1 = inv(Z[k++]);
-            t2 = -Z[k++] & 0xffff;
-            t3 = -Z[k++] & 0xffff;
-            DK[j--] = inv(Z[k++]);
-            DK[j--] = t2;
-            DK[j--] = t3;
-            DK[j--] = t1;
-        }
-
-        t1 = Z[k++];
-        DK[j--] = Z[k++];
-        DK[j--] = t1;
-        t1 = inv(Z[k++]);
-        t2 = -Z[k++] & 0xffff;
-        t3 = -Z[k++] & 0xffff;
-        DK[j--] = inv(Z[k++]);
-        DK[j--] = t3;
-        DK[j--] = t2;
-        DK[j--] = t1;
-    }
-
-    /*
-     * cipher_idea
-     * 
-     * IDEA encryption/decryption algorithm. It processes plaintext in 64-bit blocks, one at a time, breaking the block
-     * into four 16-bit unsigned subblocks. It goes through eight rounds of processing using 6 new subkeys each time,
-     * plus four for last step. The source text is in array text1, the destination text goes into array text2 The
-     * routine represents 16-bit subblocks and subkeys as type int so that they can be treated more easily as unsigned.
-     * Multiplication modulo 0x10001 interprets a zero sub-block as 0x10000; it must to fit in 16 bits.
-     */
-
-    private void cipher_idea(byte[] text1, byte[] text2, int[] key) {
-
-        int i1 = 0; // Index into first text array.
-        int i2 = 0; // Index into second text array.
-        int ik; // Index into key array.
-        int x1, x2, x3, x4, t1, t2; // Four "16-bit" blocks, two temps.
-        int r; // Eight rounds of processing.
-
-        for (int i = 0; i < text1.length; i += 8) {
-
-            ik = 0; // Restart key index.
-            r = 8; // Eight rounds of processing.
-
-            // Load eight plain1 bytes as four 16-bit "unsigned" integers.
-            // Masking with 0xff prevents sign extension with cast to int.
-
-            x1 = text1[i1++] & 0xff; // Build 16-bit x1 from 2 bytes,
-            x1 |= (text1[i1++] & 0xff) << 8; // assuming low-order byte first.
-            x2 = text1[i1++] & 0xff;
-            x2 |= (text1[i1++] & 0xff) << 8;
-            x3 = text1[i1++] & 0xff;
-            x3 |= (text1[i1++] & 0xff) << 8;
-            x4 = text1[i1++] & 0xff;
-            x4 |= (text1[i1++] & 0xff) << 8;
-
-            do {
-                // 1) Multiply (modulo 0x10001), 1st text sub-block
-                // with 1st key sub-block.
-
-                x1 = (int) ((long) x1 * key[ik++] % 0x10001L & 0xffff);
-
-                // 2) Add (modulo 0x10000), 2nd text sub-block
-                // with 2nd key sub-block.
-
-                x2 = x2 + key[ik++] & 0xffff;
-
-                // 3) Add (modulo 0x10000), 3rd text sub-block
-                // with 3rd key sub-block.
-
-                x3 = x3 + key[ik++] & 0xffff;
-
-                // 4) Multiply (modulo 0x10001), 4th text sub-block
-                // with 4th key sub-block.
-
-                x4 = (int) ((long) x4 * key[ik++] % 0x10001L & 0xffff);
-
-                // 5) XOR results from steps 1 and 3.
-
-                t2 = x1 ^ x3;
-
-                // 6) XOR results from steps 2 and 4.
-                // Included in step 8.
-
-                // 7) Multiply (modulo 0x10001), result of step 5
-                // with 5th key sub-block.
-
-                t2 = (int) ((long) t2 * key[ik++] % 0x10001L & 0xffff);
-
-                // 8) Add (modulo 0x10000), results of steps 6 and 7.
-
-                t1 = t2 + (x2 ^ x4) & 0xffff;
-
-                // 9) Multiply (modulo 0x10001), result of step 8
-                // with 6th key sub-block.
-
-                t1 = (int) ((long) t1 * key[ik++] % 0x10001L & 0xffff);
-
-                // 10) Add (modulo 0x10000), results of steps 7 and 9.
-
-                t2 = t1 + t2 & 0xffff;
-
-                // 11) XOR results from steps 1 and 9.
-
-                x1 ^= t1;
-
-                // 14) XOR results from steps 4 and 10. (Out of order).
-
-                x4 ^= t2;
-
-                // 13) XOR results from steps 2 and 10. (Out of order).
-
-                t2 ^= x2;
-
-                // 12) XOR results from steps 3 and 9. (Out of order).
-
-                x2 = x3 ^ t1;
-
-                x3 = t2; // Results of x2 and x3 now swapped.
-
-            } while (--r != 0); // Repeats seven more rounds.
-
-            // Final output transform (4 steps).
-
-            // 1) Multiply (modulo 0x10001), 1st text-block
-            // with 1st key sub-block.
-
-            x1 = (int) ((long) x1 * key[ik++] % 0x10001L & 0xffff);
-
-            // 2) Add (modulo 0x10000), 2nd text sub-block
-            // with 2nd key sub-block. It says x3, but that is to undo swap
-            // of subblocks 2 and 3 in 8th processing round.
-
-            x3 = x3 + key[ik++] & 0xffff;
-
-            // 3) Add (modulo 0x10000), 3rd text sub-block
-            // with 3rd key sub-block. It says x2, but that is to undo swap
-            // of subblocks 2 and 3 in 8th processing round.
-
-            x2 = x2 + key[ik++] & 0xffff;
-
-            // 4) Multiply (modulo 0x10001), 4th text-block
-            // with 4th key sub-block.
-
-            x4 = (int) ((long) x4 * key[ik++] % 0x10001L & 0xffff);
-
-            // Repackage from 16-bit sub-blocks to 8-bit byte array text2.
-
-            text2[i2++] = (byte) x1;
-            text2[i2++] = (byte) (x1 >>> 8);
-            text2[i2++] = (byte) x3; // x3 and x2 are switched
-            text2[i2++] = (byte) (x3 >>> 8); // only in name.
-            text2[i2++] = (byte) x2;
-            text2[i2++] = (byte) (x2 >>> 8);
-            text2[i2++] = (byte) x4;
-            text2[i2++] = (byte) (x4 >>> 8);
-
-        } // End for loop.
-
-    } // End routine.
-
-    /*
-     * mul
-     * 
-     * Performs multiplication, modulo (2**16)+1. This code is structured on the assumption that untaken branches are
-     * cheaper than taken branches, and that the compiler doesn't schedule branches. Java: Must work with 32-bit int and
-     * one 64-bit long to keep 16-bit values and their products "unsigned." The routine assumes that both a and b could
-     * fit in 16 bits even though they come in as 32-bit ints. Lots of "& 0xFFFF" masks here to keep things 16-bit.
-     * Also, because the routine stores mod (2**16)+1 results in a 2**16 space, the result is truncated to zero whenever
-     * the result would zero, be 2**16. And if one of the multiplicands is 0, the result is not zero, but (2**16) + 1
-     * minus the other multiplicand (sort of an additive inverse mod 0x10001).
-     * 
-     * NOTE: The java conversion of this routine works correctly, but is half the speed of using Java's modulus division
-     * function (%) on the multiplication with a 16-bit masking of the result--running in the Symantec Caje IDE. So it's
-     * not called for now; the test uses Java % instead.
-     */
-
-    /*
-     * private int mul(int a, int b) throws ArithmeticException { long p; // Large enough to catch 16-bit multiply //
-     * without hitting sign bit. if (a != 0) { if(b != 0) { p = (long) a * b; b = (int) p & 0xFFFF; // Lower 16 bits. a
-     * = (int) p >>> 16; // Upper 16 bits.
-     * 
-     * return (b - a + (b < a ? 1 : 0) & 0xFFFF); } else return ((1 - a) & 0xFFFF); // If b = 0, then same as // 0x10001
-     * - a. } else // If a = 0, then return return((1 - b) & 0xFFFF); // same as 0x10001 - b. }
-     */
-
-    /*
-     * inv
-     * 
-     * Compute multiplicative inverse of x, modulo (2**16)+1 using extended Euclid's GCD (greatest common divisor)
-     * algorithm. It is unrolled twice to avoid swapping the meaning of the registers. And some subtracts are changed to
-     * adds. Java: Though it uses signed 32-bit ints, the interpretation of the bits within is strictly unsigned 16-bit.
-     */
-
-    private int inv(int x) {
-        int x2 = x;
-        int t0, t1;
-        int q, y;
-
-        if (x2 <= 1) {
-            return (x2); // 0 and 1 are self-inverse.
-        }
-
-        t1 = 0x10001 / x2; // (2**16+1)/x; x is >= 2, so fits 16 bits.
-        y = 0x10001 % x2;
-        if (y == 1) {
-            return ((1 - t1) & 0xFFFF);
-        }
-
-        t0 = 1;
-        do {
-            q = x2 / y;
-            x2 = x2 % y;
-            t0 += q * t1;
-            if (x2 == 1) {
-                return (t0);
-            }
-            q = y / x2;
-            y = y % x2;
-            t1 += q * t0;
-        } while (y != 1);
-
-        return ((1 - t1) & 0xFFFF);
-    }
-
-    boolean verify() {
-        boolean error;
-        for (int i = 0; i < array_rows; i++) {
-            error = (plain1[i] != plain2[i]);
-            if (error) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /*
-     * freeTestData
-     * 
-     * Nulls arrays and forces garbage collection to free up memory.
-     */
-
-    void freeTestData() {
-        plain1 = null;
-        crypt1 = null;
-        plain2 = null;
-        userkey = null;
-        Z = null;
-        DK = null;
-    }
-
-    public HP_idea() {
-        array_rows = 3000;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_inline01 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            sum += foo(i);
-        }
-        return sum;
-    }
-
-    public static int foo(int x) {
-        if (x < 15) {
-            return bar(x);
-        }
-        return bar(x + 1);
-    }
-
-    public static int bar(int x) {
-        return x + 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(215, test(20));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_inline02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_inline02 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            sum += foo(i, sum);
-        }
-        return sum;
-    }
-
-    public static int foo(int x, int y) {
-        if (x < 18) {
-            return bar(x, x - y);
-        }
-        return bar(x, x + y);
-    }
-
-    public static int bar(int x, int y) {
-        if (x < 15) {
-            return car(x, x + y);
-        }
-        return x - 1;
-    }
-
-    @SuppressWarnings("unused")
-    public static int car(int x, int y) {
-        if (x < 13) {
-            return x + 1;
-        }
-        return x - 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(196, test(20));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_invoke01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_invoke01 {
-
-    private static int sum;
-
-    public static int test(int count) {
-        sum = 0;
-        final Instruction[] instructions = new Instruction[]{new Instruction.Add(), new Instruction.Sub(), new Instruction.Mul(), new Instruction.Div()};
-        final Visitor v = new Visitor();
-        for (int i = 0; i < count; i++) {
-            instructions[i % 4].accept(v);
-        }
-        return sum;
-    }
-
-    public static abstract class Instruction {
-
-        public abstract void accept(Visitor v);
-
-        public static abstract class Binary extends Instruction {
-
-        }
-
-        public static class Add extends Binary {
-
-            @Override
-            public void accept(Visitor v) {
-                v.visit(this);
-            }
-        }
-
-        public static class Sub extends Binary {
-
-            @Override
-            public void accept(Visitor v) {
-                v.visit(this);
-            }
-        }
-
-        public static class Mul extends Binary {
-
-            @Override
-            public void accept(Visitor v) {
-                v.visit(this);
-            }
-        }
-
-        public static class Div extends Binary {
-
-            @Override
-            public void accept(Visitor v) {
-                v.visit(this);
-            }
-        }
-    }
-
-    @SuppressWarnings("unused")
-    public static class Visitor {
-
-        public void visit(Instruction.Add i) {
-            sum += 7;
-        }
-
-        public void visit(Instruction.Sub i) {
-            sum += 194127;
-        }
-
-        public void visit(Instruction.Mul i) {
-            sum += 18991;
-        }
-
-        public void visit(Instruction.Div i) {
-            sum += 91823;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3049480, test(40));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(6098960, test(80));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_life.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import java.util.*;
-
-import org.junit.*;
-
-/*
- */
-public class HP_life {
-
-    public static int test(int generations) {
-        reset();
-        for (int i = 0; i < generations; ++i) {
-            step();
-        }
-        int sum = 0;
-        for (int row = 0; row < rows; ++row) {
-            for (int col = 0; col < cols; ++col) {
-                boolean value = cell(row, col);
-                // System.out.print(value ? "1" : "0");
-                sum += (row * 15223242 + col * 21623234) ^ ((value ? 1 : 0) * 15323142);
-            }
-        }
-        return sum;
-    }
-
-    private static final int rows = 20;
-    private static final int cols = 20;
-    private static boolean cells[] = new boolean[rows * cols];
-
-    private static boolean cell(int row, int col) {
-        return ((row >= 0) && (row < rows) && (col >= 0) && (col < cols) && cells[row * cols + col]);
-    }
-
-    private static boolean step() {
-        boolean next[] = new boolean[rows * cols];
-        boolean changed = false;
-        for (int row = rows - 1; row >= 0; --row) {
-            int row_offset = row * cols;
-            for (int col = cols - 1; col >= 0; --col) {
-                int count = 0;
-                if (cell(row - 1, col - 1)) {
-                    count++;
-                }
-                if (cell(row - 1, col)) {
-                    count++;
-                }
-                if (cell(row - 1, col + 1)) {
-                    count++;
-                }
-                if (cell(row, col - 1)) {
-                    count++;
-                }
-                if (cell(row, col + 1)) {
-                    count++;
-                }
-                if (cell(row + 1, col - 1)) {
-                    count++;
-                }
-                if (cell(row + 1, col)) {
-                    count++;
-                }
-                if (cell(row + 1, col + 1)) {
-                    count++;
-                }
-                boolean old_state = cells[row_offset + col];
-                boolean new_state = (!old_state && count == 3) || (old_state && (count == 2 || count == 3));
-                if (!changed && new_state != old_state) {
-                    changed = true;
-                }
-                next[row_offset + col] = new_state;
-            }
-        }
-        cells = next;
-        return changed;
-    }
-
-    private static void reset() {
-        Random random = new Random(0);
-        boolean cells2[] = HP_life.cells;
-        for (int offset = 0; offset < cells2.length; ++offset) {
-            cells2[offset] = random.nextDouble() > 0.5;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1756613086, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_nest01 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            sum += i;
-            for (int j = 0; j < count; j++) {
-                sum += j;
-            }
-            for (int j = 0; j < count; j++) {
-                sum += j;
-            }
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3255, test(15));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_nest02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_nest02 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            sum += i;
-            sum = foo(count, sum);
-            sum = foo(count, sum);
-        }
-        return sum;
-    }
-
-    private static int foo(int count, int s) {
-        int sum = s;
-        for (int j = 0; j < count; j++) {
-            sum += j;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3255, test(15));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_scope01 {
-
-    public static int test(int count) {
-        int sum = 0;
-
-        for (int k = 0; k < count; k++) {
-            {
-                int i = 1;
-                sum += i;
-            }
-            {
-                float f = 3;
-                sum += f;
-            }
-            {
-                long l = 7;
-                sum += l;
-            }
-            {
-                double d = 11;
-                sum += d;
-            }
-        }
-
-        for (int k = 0; k < count; k++) {
-            if (k < 20) {
-                int i = 1;
-                sum += i;
-            } else {
-                float f = 3;
-                sum += f;
-            }
-        }
-
-        for (int k = 0; k < count; k++) {
-            int i = 3;
-            for (int j = 0; j < count; j++) {
-                float f = 7;
-                sum += i + f;
-            }
-        }
-
-        for (int k = 0; k < count; k++) {
-            for (int j = 0; j < count; j++) {
-                float f = 7;
-                sum += j + f;
-            }
-            int i = 3;
-            sum += i;
-        }
-
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(59480, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_scope02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_scope02 {
-
-    public static int test(int count) {
-        int sum = 0;
-        // Although sum is not explicitly read in the tree below it is implicitly read
-        // by the guard bail-out.
-        for (int i = 0; i < count; i++) {
-            if (i > 20) {
-                break; // We need to write back either the original value of sum, or the previous iteration's value.
-            }
-            sum = i;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(20, test(40));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(20, test(22));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_series.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_series {
-
-    public static double test(int count) {
-        final int arrayRows = count;
-        final double[][] testArray = new double[2][arrayRows];
-        double omega; // Fundamental frequency.
-        testArray[0][0] = TrapezoidIntegrate(0.0, // Lower bound.
-                        2.0, // Upper bound.
-                        1000, // # of steps.
-                        0.0, // No omega*n needed.
-                        0) / 2.0; // 0 = term A[0].
-        omega = 3.1415926535897932;
-        for (int i = 1; i < arrayRows; i++) {
-            testArray[0][i] = TrapezoidIntegrate(0.0, 2.0, 1000, omega * i, 1); // 1 = cosine
-            // term.
-            testArray[1][i] = TrapezoidIntegrate(0.0, 2.0, 1000, omega * i, 2); // 2 = sine
-            // term.
-        }
-        final double ref[][] = {{2.8729524964837996, 0.0}, {1.1161046676147888, -1.8819691893398025}, {0.34429060398168704, -1.1645642623320958}, {0.15238898702519288, -0.8143461113044298}};
-        double error = 0.0;
-        double sum = 0.0;
-        for (int i = 0; i < 4; i++) {
-            for (int j = 0; j < 2; j++) {
-                error += Math.abs(testArray[j][i] - ref[i][j]);
-                sum += testArray[j][i];
-            }
-        }
-        return sum + error;
-    }
-
-    private static double TrapezoidIntegrate(double x0, // Lower bound.
-                    double x1, // Upper bound.
-                    int ns, // # of steps.
-                    double omegan, // omega * n.
-                    int select) // Term type.
-    {
-        int nsteps = ns;
-        double x; // Independent variable.
-        double dx; // Step size.
-        double rvalue; // Return value.
-
-        x = x0;
-        dx = (x1 - x0) / nsteps;
-        rvalue = thefunction(x0, omegan, select) / 2.0;
-        if (nsteps != 1) {
-            --nsteps; // Already done 1 step.
-            while (--nsteps > 0) {
-                x += dx;
-                rvalue += thefunction(x, omegan, select);
-            }
-        }
-        rvalue = (rvalue + thefunction(x1, omegan, select) / 2.0) * dx;
-        return (rvalue);
-    }
-
-    private static double thefunction(double x, // Independent variable.
-                    double omegan, // Omega * term.
-                    int select) // Choose type.
-    {
-        switch (select) {
-            case 0:
-                return (Math.pow(x + 1.0, x));
-            case 1:
-                return (Math.pow(x + 1.0, x) * Math.cos(omegan * x));
-            case 2:
-                return (Math.pow(x + 1.0, x) * Math.sin(omegan * x));
-        }
-        return (0.0);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.6248571921291398d, test(100), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_trees01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-// Checkstyle: stop
-package com.oracle.graal.jtt.hotpath;
-
-import org.junit.*;
-
-/*
- */
-public class HP_trees01 {
-
-    public static int test(int count) {
-        int sum = 0;
-        for (int i = 0; i < count; i++) {
-            if (i < 100) {
-                sum += 1;
-            } else if (i < 200) {
-                sum += 3;
-            } else if (i < 300) {
-                sum += 5;
-            } else if (i < 400) {
-                sum += 7;
-            } else if (i < 500) {
-                sum += 11;
-            }
-
-            if (i % 5 == 0) {
-                sum += 1;
-            } else if (i % 5 == 1) {
-                sum += 3;
-            } else if (i % 5 == 2) {
-                sum += 5;
-            } else if (i % 5 == 3) {
-                sum += 7;
-            } else if (i % 5 == 4) {
-                sum += 11;
-            }
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(8100, test(1000));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6186134.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotspot;
-
-import java.util.*;
-
-import org.junit.*;
-
-public class Test6186134 {
-
-    public static class TestClass {
-
-        int num = 0;
-
-        public TestClass(int n) {
-            num = n;
-        }
-
-        public boolean more() {
-            return num-- > 0;
-        }
-
-        public ArrayList test1() {
-            ArrayList<Object> res = new ArrayList<>();
-            int maxResults = Integer.MAX_VALUE;
-            int n = 0;
-            boolean more = more();
-            while ((n++ < maxResults) && more) {
-                res.add(new Object());
-                more = more();
-            }
-            return res;
-        }
-
-    }
-
-    public static int test(int n) {
-        for (int i = 0; i < n; i++) {
-            TestClass t = new TestClass(10);
-            int size = t.test1().size();
-            if (size != 10) {
-                return 97;
-            }
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(100));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6196102.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotspot;
-
-import org.junit.*;
-
-/**
- * @test
- * @bug 6196102
- * @summary Integer seems to be greater than Integer.MAX_VALUE
- * 
- * @run main Test6196102
- */
-
-public class Test6196102 {
-
-    public static String test() {
-        int i1 = 0;
-        int i2 = Integer.MAX_VALUE;
-
-        while (i1 >= 0) {
-            i1++;
-            if (i1 > i2) {
-                return "E R R O R: " + i1;
-            }
-        }
-        return "ok";
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("ok", test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6753639.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotspot;
-
-import org.junit.*;
-
-/**
- * @test
- * @bug 6753639
- * @summary Strange optimisation in for loop with cyclic integer condition
- * 
- * @run main/othervm -Xbatch Test6753639
- */
-
-public class Test6753639 {
-
-    public static int test() {
-        int end = Integer.MAX_VALUE;
-        int count = 0;
-        for (int i = Integer.MAX_VALUE - 5; i <= end; i++) {
-            count++;
-            if (count > 100000) {
-                return 95;
-            }
-        }
-        return 97;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(95, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6850611.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotspot;
-
-import org.junit.*;
-
-/**
- * @test
- * @bug 6850611
- * @summary int / long arithmetic seems to be broken in 1.6.0_14 HotSpot Server VM (Win XP)
- * 
- * @run main Test6850611
- */
-
-public class Test6850611 {
-
-    public static int test() {
-        // for (int j = 0; j < 5; ++j) {
-        long x = 0;
-        for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; ++i) {
-            x += i;
-        }
-        if (x != -4294967295L) {
-            return 97;
-        }
-        // }
-        return 95;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(95, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test6959129.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotspot;
-
-import org.junit.*;
-
-/**
- * @test
- * @bug 6959129
- * @summary COMPARISON WITH INTEGER.MAX_INT DOES NOT WORK CORRECTLY IN THE CLIENT VM.
- * 
- *          This test will not run properly without assertions
- * 
- * @run main/othervm -ea Test6959129
- */
-
-public class Test6959129 {
-
-    public static int test() {
-        int min = Integer.MAX_VALUE - 30000;
-        int max = Integer.MAX_VALUE;
-        try {
-            maxMoves(min, max);
-        } catch (AssertionError e) {
-            return 95;
-        }
-        return 97;
-    }
-
-    /**
-     * Imperative implementation that returns the length hailstone moves for a given number.
-     */
-    public static long hailstoneLengthImp(long n2) {
-        long n = n2;
-        long moves = 0;
-        while (n != 1) {
-            assert n > 1;
-            if (isEven(n)) {
-                n = n / 2;
-            } else {
-                n = 3 * n + 1;
-            }
-            ++moves;
-        }
-        return moves;
-    }
-
-    private static boolean isEven(long n) {
-        return n % 2 == 0;
-    }
-
-    /**
-     * Returns the maximum length of the hailstone sequence for numbers between min to max.
-     * 
-     * For rec1 - Assume that min is bigger than max.
-     */
-    public static long maxMoves(int min, int max) {
-        long maxmoves = 0;
-        for (int n = min; n <= max; n++) {
-            long moves = hailstoneLengthImp(n);
-            if (moves > maxmoves) {
-                maxmoves = moves;
-            }
-        }
-        return maxmoves;
-    }
-
-    // @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(95, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/hotspot/Test7005594.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.hotspot;
-
-/**
- * @test
- * @bug 7005594
- * @summary Array overflow not handled correctly with loop optimzations
- * 
- * @run shell Test7005594.sh
- * @##Disabled huge heap##Runs: 0 = 95
- */
-
-public class Test7005594 {
-
-    private static int test0(byte[] a) {
-        int result = 0;
-        for (int i = 0; i < a.length; i += ((0x7fffffff >> 1) + 1)) {
-            result += a[i];
-        }
-        return result;
-    }
-
-    public static int test() {
-        byte[] a = new byte[(0x7fffffff >> 1) + 2];
-        try {
-            test0(a);
-        } catch (ArrayIndexOutOfBoundsException e) {
-            return 95;
-        }
-        return 97;
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/Class_getName.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import org.junit.*;
-
-/*
- */
-public class Class_getName {
-
-    public static String test(int a) {
-        if (a == 0) {
-            return String.class.getName();
-        }
-        return "";
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("java.lang.String", test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import java.util.*;
-
-import org.junit.*;
-
-/*
- */
-public class EnumMap01 {
-
-    private static final EnumMap<Enum, String> map = new EnumMap<>(Enum.class);
-
-    static {
-        map.put(Enum.A, "A");
-        map.put(Enum.B, "B");
-        map.put(Enum.C, "C");
-    }
-
-    public static String test(int i) {
-        return map.get(Enum.values()[i]);
-    }
-
-    private enum Enum {
-        A, B, C
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("A", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("B", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("C", test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/EnumMap02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import java.util.*;
-
-import org.junit.*;
-
-/*
- */
-public class EnumMap02 {
-
-    public static String test(int i) {
-        EnumMap<Enum, String> map = new EnumMap<>(Enum.class);
-        map.put(Enum.A, "A");
-        map.put(Enum.B, "B");
-        map.put(Enum.C, "C");
-        return map.get(Enum.values()[i]);
-    }
-
-    private enum Enum {
-        A, B, C
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("A", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("B", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("C", test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import org.junit.*;
-
-/*
- */
-public class System_currentTimeMillis01 {
-
-    public static int test() {
-        long start = System.currentTimeMillis();
-        for (int i = 0; i < 10000000; i++) {
-            if (System.currentTimeMillis() - start > 0) {
-                return 1;
-            }
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_currentTimeMillis02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import org.junit.*;
-
-/*
- */
-public class System_currentTimeMillis02 {
-
-    public static boolean test() {
-        long start = System.currentTimeMillis();
-        long delta = 0;
-        for (int i = 0; delta == 0 && i < 5000000; i++) {
-            delta = System.currentTimeMillis() - start;
-            // do nothing.
-        }
-        // better get at least 40 millisecond resolution.
-        return delta >= 1 && delta < 40;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import org.junit.*;
-
-/*
- */
-public class System_nanoTime01 {
-
-    public static int test() {
-        long start = System.nanoTime();
-        for (int i = 0; i < 10000000; i++) {
-            if (System.nanoTime() - start > 0) {
-                return 1;
-            }
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_nanoTime02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import org.junit.*;
-
-/*
- */
-public class System_nanoTime02 {
-
-    public static boolean test() {
-        long minDelta = Long.MAX_VALUE;
-
-        // the first call to System.nanoTime might take a long time due to call resolution
-        for (int c = 0; c < 10; c++) {
-            long start = System.nanoTime();
-            long delta = 0;
-            int i;
-            for (i = 0; delta == 0 && i < 50000; i++) {
-                delta = System.nanoTime() - start;
-                // do nothing.
-            }
-            if (delta < minDelta) {
-                minDelta = delta;
-            }
-        }
-
-        // better get at least 30 microsecond resolution.
-        return minDelta > 1 && minDelta < 30000;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/System_setOut.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import java.io.*;
-
-import org.junit.*;
-
-/*
- */
-public class System_setOut {
-
-    public static int test(int n) throws Exception {
-        PrintStream oldOut = System.out;
-        int sum = 0;
-        for (int i = 0; i < 10; i++) {
-            ByteArrayOutputStream ba = new ByteArrayOutputStream(n * 10);
-            PrintStream newOut = new PrintStream(ba);
-            System.setOut(newOut);
-            doPrint(n);
-            sum += ba.size();
-        }
-
-        System.setOut(oldOut);
-        return sum;
-    }
-
-// @NEVER_INLINE
-    private static void doPrint(int n) {
-        for (int i = 0; i < n; i++) {
-            System.out.print('x');
-        }
-    }
-
-    public static void main(String[] args) throws Exception {
-        System.out.println(test(10000));
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(100000, test(10000));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/Thread_setName.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import org.junit.*;
-
-/*
- */
-public class Thread_setName {
-
-    public static String test(String name) {
-        String oldName = Thread.currentThread().getName();
-        Thread.currentThread().setName(name);
-        String name2 = Thread.currentThread().getName();
-        Thread.currentThread().setName(oldName);
-        return name2;
-    }
-
-    public static void main(String[] args) throws Exception {
-        System.out.println(test("abc"));
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("abc", test("abc"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/jdk/UnsafeAccess01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.jdk;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-import sun.misc.*;
-
-/*
- */
-public class UnsafeAccess01 {
-
-    @SuppressWarnings("unused")
-    private int field = 42;
-
-    public static int test() throws SecurityException, NoSuchFieldException, IllegalAccessException {
-        final Unsafe unsafe = getUnsafe();
-
-        final UnsafeAccess01 object = new UnsafeAccess01();
-        final Field field = UnsafeAccess01.class.getDeclaredField("field");
-        final long offset = unsafe.objectFieldOffset(field);
-        final int value = unsafe.getInt(object, offset);
-        return value;
-    }
-
-    private static Unsafe getUnsafe() throws NoSuchFieldException, IllegalAccessException {
-        final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
-        unsafeField.setAccessible(true);
-        return (Unsafe) unsafeField.get(null);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(42, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Boxed_TYPE_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Boxed_TYPE_01 {
-
-    public static String test(int i) {
-        if (i == 0) {
-            return Boolean.TYPE.getName();
-        }
-        if (i == 1) {
-            return Byte.TYPE.getName();
-        }
-        if (i == 2) {
-            return Character.TYPE.getName();
-        }
-        if (i == 3) {
-            return Double.TYPE.getName();
-        }
-        if (i == 4) {
-            return Float.TYPE.getName();
-        }
-        if (i == 5) {
-            return Integer.TYPE.getName();
-        }
-        if (i == 6) {
-            return Long.TYPE.getName();
-        }
-        if (i == 7) {
-            return Short.TYPE.getName();
-        }
-        if (i == 8) {
-            return Void.TYPE.getName();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("boolean", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("byte", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("char", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("double", test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals("float", test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals("int", test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals("long", test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals("short", test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals("void", test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Bridge_method01.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Bridge_method01 {
-
-    private abstract static class Wrap<T> {
-
-        abstract T get();
-    }
-
-    private static class IWrap extends Wrap<Integer> {
-
-        @Override
-        Integer get() {
-            return 1;
-        }
-    }
-
-    private static Wrap<Integer> wrapped = new IWrap();
-
-    public static int test() {
-        return wrapped.get();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/ClassLoader_loadClass01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import java.net.*;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class ClassLoader_loadClass01 {
-
-    public static String test(int i) throws ClassNotFoundException {
-        final URLClassLoader classLoader = new URLClassLoader(new URL[0], String.class.getClassLoader());
-        if (i == 0) {
-            return classLoader.loadClass("java.lang.String").toString();
-        } else if (i == 1) {
-            return classLoader.loadClass("[Ljava.lang.String;").toString();
-        } else if (i == 2) {
-            return classLoader.loadClass("java.lang.String[]").toString();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("class java.lang.String", test(0));
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(null, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_Literal01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_Literal01 {
-
-    public static String test(int i) {
-        if (i == 0) {
-            return Object.class.toString();
-        }
-        if (i == 1) {
-            return String.class.toString();
-        }
-        if (i == 2) {
-            return Class.class.toString();
-        }
-        if (i == 3) {
-            return Class_Literal01.class.toString();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("class java.lang.Object", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("class java.lang.String", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("class java.lang.Class", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("class com.oracle.graal.jtt.lang.Class_Literal01", test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(null, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_asSubclass01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_asSubclass01 {
-
-    public static int test(int i) {
-        if (i == 0) {
-            if (Object.class.asSubclass(String.class) == null) {
-                return -1;
-            }
-        }
-        if (i == 1) {
-            if (String.class.asSubclass(Object.class) == null) {
-                return -1;
-            }
-        }
-        if (i == 2) {
-            if (Object.class.asSubclass(Class_asSubclass01.class) == null) {
-                return -1;
-            }
-        }
-        if (i == 3) {
-            if (Class_asSubclass01.class.asSubclass(Object.class) == null) {
-                return -1;
-            }
-        }
-        return i;
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_cast01 {
-
-    static final String string = "";
-    static final Object object = new Object();
-    static final Class_cast01 thisObject = new Class_cast01();
-
-    public static int test(int i) {
-        if (i == 0) {
-            if (Object.class.cast(string) == null) {
-                return -1;
-            }
-        }
-        if (i == 1) {
-            if (String.class.cast(object) == null) {
-                return -1;
-            }
-        }
-        if (i == 2) {
-            if (Object.class.cast(thisObject) == null) {
-                return -1;
-            }
-        }
-        if (i == 3) {
-            if (Class_cast01.class.cast(object) == null) {
-                return -1;
-            }
-        }
-        return i;
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run0() throws Throwable {
-        test(1);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test(expected = java.lang.ClassCastException.class)
-    public void run2() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_cast02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_cast02 {
-
-    static final String string = "";
-    static final Object object = new Object();
-    static final Class_cast02 thisObject = new Class_cast02();
-
-    public static int test(int i) {
-        if (i == 0) {
-            if (Object.class.cast(null) == null) {
-                return -1;
-            }
-        }
-        if (i == 1) {
-            if (String.class.cast(null) == null) {
-                return -1;
-            }
-        }
-        if (i == 2) {
-            if (Object.class.cast(null) == null) {
-                return -1;
-            }
-        }
-        if (i == 3) {
-            if (Class_cast02.class.cast(null) == null) {
-                return -1;
-            }
-        }
-        return i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-1, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_forName01 {
-
-    public static String test(int i) throws ClassNotFoundException {
-        if (i == 0) {
-            return Class.forName("java.lang.Object").toString();
-        }
-        if (i == 1) {
-            return Class.forName("java.lang.String").toString();
-        }
-        if (i == 2) {
-            return Class.forName("com.oracle.graal.jtt.lang.Class_forName01").toString();
-        }
-        if (i == 3) {
-            return Class.forName("xyxzz.xyzyzyz.XXYYY").toString();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("class java.lang.Object", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("class java.lang.String", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("class com.oracle.graal.jtt.lang.Class_forName01", test(2));
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(null, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_forName02 {
-
-    public static String test(int i) throws ClassNotFoundException {
-        String clname = null;
-        Class cl = null;
-        if (i == 0) {
-            clname = "java.lang.Object";
-            cl = Object.class;
-        } else if (i == 1) {
-            clname = "java.lang.String";
-            cl = String.class;
-        } else if (i == 2) {
-            clname = "com.oracle.graal.jtt.lang.Class_forName02";
-            cl = Class_forName02.class;
-        } else if (i == 3) {
-            clname = "xyzz.zyxy.XYXY";
-            cl = Class_forName02.class;
-        }
-        if (clname != null) {
-            return Class.forName(clname, false, cl.getClassLoader()).toString();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("class java.lang.Object", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("class java.lang.String", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("class com.oracle.graal.jtt.lang.Class_forName02", test(2));
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(null, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import java.net.*;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class Class_forName03 {
-
-    public static String test(int i) throws ClassNotFoundException {
-        String clname = null;
-        Class cl = null;
-        if (i == 0) {
-            clname = "java.lang.Object[]";
-            cl = Object.class;
-        } else if (i == 1) {
-            clname = "[Ljava.lang.String;";
-            cl = String.class;
-        } else if (i == 2) {
-            clname = "[Ljava/lang/String;";
-            cl = String.class;
-        } else if (i == 3) {
-            clname = "[I";
-            cl = Class_forName03.class;
-        } else if (i == 4) {
-            clname = "[java.lang.Object;";
-            cl = Class_forName03.class;
-        }
-        if (clname != null) {
-            return Class.forName(clname, false, new URLClassLoader(new URL[0], cl.getClassLoader())).toString();
-        }
-        return null;
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("class [Ljava.lang.String;", test(1));
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("class [I", test(3));
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(null, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class Class_forName04 {
-
-    public static String test(int i) throws ClassNotFoundException {
-        String clname = null;
-        if (i == 0) {
-            clname = "java.lang.Object[]";
-        } else if (i == 1) {
-            clname = "[Ljava.lang.String;";
-        } else if (i == 2) {
-            clname = "[Ljava/lang/String;";
-        } else if (i == 3) {
-            clname = "[I";
-        } else if (i == 4) {
-            clname = "[java.lang.Object;";
-        }
-        if (clname != null) {
-            return Class.forName(clname).toString();
-        }
-        return null;
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("class [Ljava.lang.String;", test(1));
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("class [I", test(3));
-    }
-
-    @Test(expected = java.lang.ClassNotFoundException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(null, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import java.net.*;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class Class_forName05 {
-
-    public static String test(int i) throws ClassNotFoundException {
-        final URLClassLoader classLoader = new URLClassLoader(new URL[0], String.class.getClassLoader());
-        if (i == 0) {
-            return Class.forName("java.lang.String", false, classLoader).toString();
-        } else if (i == 1) {
-            return Class.forName("[Ljava.lang.String;", false, classLoader).toString();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("class java.lang.String", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("class [Ljava.lang.String;", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(null, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getComponentType01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_getComponentType01 {
-
-    public static String test(int i) {
-        Class cl = Object.class;
-        if (i == 0) {
-            cl = int.class;
-        } else if (i == 1) {
-            cl = int[].class;
-        } else if (i == 2) {
-            cl = Object.class;
-        } else if (i == 3) {
-            cl = Object[].class;
-        } else if (i == 4) {
-            cl = Class_getComponentType01.class;
-        } else if (i == 5) {
-            cl = Cloneable.class;
-        } else if (i == 6) {
-            cl = Object[][].class;
-        } else if (i == 7) {
-            cl = void.class;
-        }
-        cl = cl.getComponentType();
-        if (cl == null) {
-            return null;
-        }
-        return cl.getName();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("int", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(null, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("java.lang.Object", test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(null, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(null, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals("[Ljava.lang.Object;", test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(null, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(null, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getInterfaces01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-
-@SuppressWarnings("static-method")
-public final class Class_getInterfaces01 {
-
-    public static String test(int i) {
-        switch (i) {
-            case 0:
-                return toString(I1.class);
-            case 1:
-                return toString(I2.class);
-            case 2:
-                return toString(C1.class);
-            case 3:
-                return toString(C2.class);
-            case 4:
-                return toString(C12.class);
-            default:
-                return null;
-        }
-    }
-
-    private static String toString(Class< ? > klass) {
-        final Class< ? >[] classes = klass.getInterfaces();
-        final StringBuilder sb = new StringBuilder();
-        boolean first = true;
-        for (Class< ? > c : classes) {
-            if (!first) {
-                sb.append(' ');
-            } else {
-                first = false;
-            }
-            sb.append(c.getName());
-        }
-        return sb.toString();
-    }
-
-    interface I1 {
-
-    }
-
-    interface I2 extends I1 {
-
-    }
-
-    static class C1 implements I1 {
-
-    }
-
-    static class C2 implements I2 {
-
-    }
-
-    static class C12 implements I1, I2 {
-
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I1", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I1", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I2", test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getInterfaces01$I1 com.oracle.graal.jtt.lang.Class_getInterfaces01$I2", test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_getName01 {
-
-    public static String test(int i) {
-        if (i == 0) {
-            return Object.class.getName();
-        } else if (i == 1) {
-            return Class.class.getName();
-        } else if (i == 2) {
-            return Class_getName01.class.getName();
-        } else if (i == 3) {
-            return "a string".getClass() == String.class ? "true" : "false";
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("java.lang.Object", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("java.lang.Class", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.lang.Class_getName01", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("true", test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(null, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getName02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_getName02 {
-
-    public static String test(int i) {
-        if (i == 0) {
-            return int.class.getName();
-        }
-        if (i == 1) {
-            return int[].class.getName();
-        }
-        if (i == 2) {
-            return Object[][].class.getName();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("int", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("[I", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("[[Ljava.lang.Object;", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(null, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_getSimpleName01 {
-
-    public static String test(int i) {
-        if (i == 0) {
-            return Object.class.getSimpleName();
-        }
-        if (i == 1) {
-            return Class.class.getSimpleName();
-        }
-        if (i == 2) {
-            return Class_getSimpleName01.class.getSimpleName();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("Object", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("Class", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("Class_getSimpleName01", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(null, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSimpleName02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_getSimpleName02 {
-
-    public static String test(int i) {
-        if (i == 0) {
-            return int.class.getSimpleName();
-        }
-        if (i == 1) {
-            return int[].class.getSimpleName();
-        }
-        if (i == 2) {
-            return Object[][].class.getSimpleName();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("int", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("int[]", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("Object[][]", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(null, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_getSuperClass01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_getSuperClass01 {
-
-    public static String test(int i) {
-        Class cl = Object.class;
-        if (i == 0) {
-            cl = int.class;
-        } else if (i == 1) {
-            cl = Object.class;
-        } else if (i == 2) {
-            cl = int[].class;
-        } else if (i == 3) {
-            cl = Cloneable.class;
-        } else if (i == 4) {
-            cl = Integer.class;
-        } else if (i == 5) {
-            cl = Class.class;
-        } else if (i == 6) {
-            cl = Class_getSuperClass01.class;
-        }
-        cl = cl.getSuperclass();
-        if (cl == null) {
-            return null;
-        }
-        return cl.getName();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(null, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("java.lang.Object", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(null, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals("java.lang.Number", test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals("java.lang.Object", test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals("java.lang.Object", test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(null, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isArray01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isArray01 {
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return int.class.isArray();
-        }
-        if (i == 1) {
-            return int[].class.isArray();
-        }
-        if (i == 2) {
-            return Object.class.isArray();
-        }
-        if (i == 3) {
-            return Object[].class.isArray();
-        }
-        if (i == 4) {
-            return Class_isArray01.class.isArray();
-        }
-        if (i == 5) {
-            return Cloneable.class.isArray();
-        }
-        if (i == 6) {
-            return Runnable.class.isArray();
-        }
-        if (i == 7) {
-            return void.class.isArray();
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isAssignableFrom01 {
-
-    public static boolean test(int i) {
-        Class source = Object.class;
-        if (i == 0) {
-            source = int.class;
-        }
-        if (i == 1) {
-            source = int[].class;
-        }
-        if (i == 2) {
-            source = float.class;
-        }
-        if (i == 3) {
-            source = byte.class;
-        }
-        if (i == 4) {
-            source = Runnable.class;
-        }
-        if (i == 5) {
-            source = Class_isAssignableFrom01.class;
-        }
-        if (i == 6) {
-            source = Object[].class;
-        }
-        return int.class.isAssignableFrom(source);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isAssignableFrom02 {
-
-    public static boolean test(int i) {
-        Class source = Object.class;
-        if (i == 0) {
-            source = int.class;
-        }
-        if (i == 1) {
-            source = int[].class;
-        }
-        if (i == 2) {
-            source = float.class;
-        }
-        if (i == 3) {
-            source = byte.class;
-        }
-        if (i == 4) {
-            source = Runnable.class;
-        }
-        if (i == 5) {
-            source = Class_isAssignableFrom02.class;
-        }
-        if (i == 6) {
-            source = Object[].class;
-        }
-        return Object.class.isAssignableFrom(source);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isAssignableFrom03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isAssignableFrom03 implements Cloneable {
-
-    public static boolean test(int i) {
-        Class source = Object.class;
-        if (i == 0) {
-            source = int.class;
-        }
-        if (i == 1) {
-            source = int[].class;
-        }
-        if (i == 2) {
-            source = float.class;
-        }
-        if (i == 3) {
-            source = Cloneable.class;
-        }
-        if (i == 4) {
-            source = Runnable.class;
-        }
-        if (i == 5) {
-            source = Class_isAssignableFrom03.class;
-        }
-        if (i == 6) {
-            source = Object[].class;
-        }
-        return Cloneable.class.isAssignableFrom(source);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isInstance01 {
-
-    static final String string = "";
-    static final Object obj = new Object();
-    static final Class_isInstance01 thisObject = new Class_isInstance01();
-
-    public static boolean test(int i) {
-        Object object = null;
-        if (i == 0) {
-            object = obj;
-        }
-        if (i == 1) {
-            object = string;
-        }
-        if (i == 2) {
-            object = thisObject;
-        }
-        return Object.class.isInstance(object);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isInstance02 {
-
-    static final String string = "";
-    static final Object obj = new Object();
-    static final Class_isInstance02 thisObject = new Class_isInstance02();
-
-    public static boolean test(int i) {
-        Object object = null;
-        if (i == 0) {
-            object = obj;
-        }
-        if (i == 1) {
-            object = string;
-        }
-        if (i == 2) {
-            object = thisObject;
-        }
-        return String.class.isInstance(object);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isInstance03 {
-
-    static final String string = "";
-    static final Object obj = new Object();
-    static final Class_isInstance03 thisObject = new Class_isInstance03();
-
-    public static boolean test(int i) {
-        Object object = null;
-        if (i == 0) {
-            object = obj;
-        }
-        if (i == 1) {
-            object = string;
-        }
-        if (i == 2) {
-            object = thisObject;
-        }
-        return Class_isInstance03.class.isInstance(object);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isInstance04 {
-
-    static final String string = "";
-    static final Object[] oarray = {};
-    static final String[] sarray = {};
-
-    public static boolean test(int i) {
-        Object object = null;
-        if (i == 0) {
-            object = oarray;
-        }
-        if (i == 1) {
-            object = string;
-        }
-        if (i == 2) {
-            object = sarray;
-        }
-        return String[].class.isInstance(object);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isInstance05 {
-
-    static final String string = "";
-    static final Object obj = new Object();
-    static final int[] array = {};
-
-    public static boolean test(int i) {
-        Object object = null;
-        if (i == 0) {
-            object = obj;
-        }
-        if (i == 1) {
-            object = string;
-        }
-        if (i == 2) {
-            object = array;
-        }
-        return int[].class.isInstance(object);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInstance06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isInstance06 implements Cloneable {
-
-    static final String string = "";
-    static final Object obj = new Object();
-    static final String[] sarray = {};
-    static final Object thisObject = new Class_isInstance06();
-
-    public static boolean test(int i) {
-        Object object = null;
-        if (i == 0) {
-            object = obj;
-        }
-        if (i == 1) {
-            object = string;
-        }
-        if (i == 2) {
-            object = sarray;
-        }
-        if (i == 3) {
-            object = thisObject;
-        }
-        return Cloneable.class.isInstance(object);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isInterface01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isInterface01 {
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return int.class.isInterface();
-        }
-        if (i == 1) {
-            return int[].class.isInterface();
-        }
-        if (i == 2) {
-            return Object.class.isInterface();
-        }
-        if (i == 3) {
-            return Object[].class.isInterface();
-        }
-        if (i == 4) {
-            return Class_isInterface01.class.isInterface();
-        }
-        if (i == 5) {
-            return Cloneable.class.isInterface();
-        }
-        if (i == 6) {
-            return Runnable.class.isInterface();
-        }
-        if (i == 7) {
-            return void.class.isInterface();
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Class_isPrimitive01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_isPrimitive01 {
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return int.class.isPrimitive();
-        }
-        if (i == 1) {
-            return int[].class.isPrimitive();
-        }
-        if (i == 2) {
-            return Object.class.isPrimitive();
-        }
-        if (i == 3) {
-            return Object[].class.isPrimitive();
-        }
-        if (i == 4) {
-            return Class_isPrimitive01.class.isPrimitive();
-        }
-        if (i == 5) {
-            return Cloneable.class.isPrimitive();
-        }
-        if (i == 6) {
-            return Runnable.class.isPrimitive();
-        }
-        if (i == 7) {
-            return void.class.isPrimitive();
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Double_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Double_01 {
-
-    public static boolean test() {
-        return Double.doubleToLongBits(Double.longBitsToDouble(0x7ff8000000000088L)) == 0x7ff8000000000000L;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Double_toString.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class Double_toString {
-
-    public static String test() {
-        double z1 = 0.4363485526704198;
-        double z2 = -0.43536514763046896;
-        double z3 = z1 + z2;
-        return Double.toString(z3);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("9.834050399508132E-4", test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Float_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-public class Float_01 {
-
-    public static boolean test(float f) {
-        return /* Float.isNaN(f); */f != f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(2.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(0.5f));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(java.lang.Float.NaN));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Float_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Float_02 {
-
-    public static boolean test(float f) {
-        return f != 1.0f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(1.0f));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(2.0f));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(0.5f));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(java.lang.Float.NaN));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Float_03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Float_03 {
-
-    public static boolean test() {
-        return Float.floatToIntBits(Float.intBitsToFloat(0x7fc00088)) == 0x7fc00000;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_greater01 {
-
-    public static boolean test(int i) {
-        if (i > 0) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_greater02 {
-
-    public static boolean test(int i) {
-        if (i > 5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greater03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_greater03 {
-
-    public static boolean test(int i) {
-        if (i > -5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-6));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-5));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(-4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(-1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_greaterEqual01 {
-
-    public static boolean test(int i) {
-        if (i >= 0) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_greaterEqual02 {
-
-    public static boolean test(int i) {
-        if (i >= 5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_greaterEqual03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_greaterEqual03 {
-
-    public static boolean test(int i) {
-        if (i >= -5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-6));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-5));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(-4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(-1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_less01 {
-
-    public static boolean test(int i) {
-        if (i < 0) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_less02 {
-
-    public static boolean test(int i) {
-        if (i < 5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_less03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_less03 {
-
-    public static boolean test(int i) {
-        if (i < -5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-6));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-5));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(-4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(-1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_lessEqual01 {
-
-    public static boolean test(int i) {
-        if (i <= 0) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_lessEqual02 {
-
-    public static boolean test(int i) {
-        if (i <= 5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Int_lessEqual03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Int_lessEqual03 {
-
-    public static boolean test(int i) {
-        if (i <= -5) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-2147483648));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-6));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-5));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(-4));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(-1));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class JDK_ClassLoaders01 {
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return Object.class.getClassLoader() == null;
-        }
-        if (i == 1) {
-            return Class.class.getClassLoader() == null;
-        }
-        if (i == 2) {
-            return String.class.getClassLoader() == null;
-        }
-        if (i == 3) {
-            return Thread.class.getClassLoader() == null;
-        }
-        if (i == 4) {
-            return System.class.getClassLoader() == null;
-        }
-        if (i == 5) {
-            return ClassLoader.class.getClassLoader() == null;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/JDK_ClassLoaders02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- *
- * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
- * that is described in this document. In particular, and without limitation, these intellectual property
- * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
- * more additional patents or pending patent applications in the U.S. and in other countries.
- *
- * U.S. Government Rights - Commercial software. Government users are subject to the Sun
- * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
- * supplements.
- *
- * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
- * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
- * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
- * U.S. and other countries.
- *
- * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
- * Company, Ltd.
- */
-package com.oracle.graal.jtt.lang;
-
-import java.net.*;
-
-import org.junit.*;
-
-/*
- */
-public class JDK_ClassLoaders02 {
-
-    public static boolean test() {
-        ClassLoader classLoader = JDK_ClassLoaders02.class.getClassLoader();
-        return classLoader == null || classLoader instanceof URLClassLoader;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class Long_greater01 {
-
-    public static boolean test(long i) {
-        if (i > 0L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(2L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_greater02 {
-
-    public static boolean test(long i) {
-        if (i > 5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(4L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(5L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(6L));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greater03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_greater03 {
-
-    public static boolean test(long i) {
-        if (i > -5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-6L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-5L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(-4L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(-1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(0L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(1L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(2L));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_greaterEqual01 {
-
-    public static boolean test(long i) {
-        if (i >= 0L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(2L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_greaterEqual02 {
-
-    public static boolean test(long i) {
-        if (i >= 5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(4L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(5L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(6L));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_greaterEqual03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_greaterEqual03 {
-
-    public static boolean test(long i) {
-        if (i >= -5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(-6L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-5L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(-4L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(-1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(0L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(1L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(2L));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(true, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_less01 {
-
-    public static boolean test(long i) {
-        if (i < 0L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(0L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(2L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_less02 {
-
-    public static boolean test(long i) {
-        if (i < 5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_less03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_less03 {
-
-    public static boolean test(long i) {
-        if (i < -5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-6L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(-5L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(-4L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(-1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(0L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(1L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(2L));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_lessEqual01 {
-
-    public static boolean test(long i) {
-        if (i <= 0L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-2L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-2L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(-1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(0L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(1L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(2L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_lessEqual02 {
-
-    public static boolean test(long i) {
-        if (i <= 5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-2L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-1L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(0L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(6L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_lessEqual03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Long_lessEqual03 {
-
-    public static boolean test(long i) {
-        if (i <= -5L) {
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-9223372036854775808L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(-6L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(-5L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(-4L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(-1L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(0L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(false, test(1L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(2L));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(9223372036854775807L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Long_reverseBytes01 {
-
-    public static long test(long val) {
-        return Long.reverseBytes(val);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0x877665544332211L, test(0x1122334455667708L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Long_reverseBytes02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Long_reverseBytes02 {
-
-    public static long test(long val) {
-        return (((val >> 56) & 0xff) << 0) | (((val >> 48) & 0xff) << 8) | (((val >> 40) & 0xff) << 16) | (((val >> 32) & 0xff) << 24) | (((val >> 24) & 0xff) << 32) | (((val >> 16) & 0xff) << 40) |
-                        (((val >> 8) & 0xff) << 48) | (((val >> 0) & 0xff) << 56);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0x877665544332211L, test(0x1122334455667708L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_abs.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_abs {
-
-    @SuppressWarnings("serial")
-    public static class NaN extends Throwable {
-    }
-
-    public static double test(double arg) throws NaN {
-        double v = Math.abs(arg);
-        if (Double.isNaN(v)) {
-            // NaN can't be tested against itself
-            throw new NaN();
-        }
-        return v;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5.0d, test(5.0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(5.0d, test(-5.0d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0.0d, test(-0.0d), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.NEGATIVE_INFINITY), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_abs.NaN.class)
-    public void run6() throws Throwable {
-        test(java.lang.Double.NaN);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_cos.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_cos {
-
-    @SuppressWarnings("serial")
-    public static class NaN extends Throwable {
-    }
-
-    public static double test(double arg) throws NaN {
-        double v = Math.cos(arg);
-        if (Double.isNaN(v)) {
-            // NaN can't be tested against itself
-            throw new NaN();
-        }
-        return v;
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_cos.NaN.class)
-    public void run0() throws Throwable {
-        test(java.lang.Double.NaN);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_cos.NaN.class)
-    public void run1() throws Throwable {
-        test(java.lang.Double.NEGATIVE_INFINITY);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_cos.NaN.class)
-    public void run2() throws Throwable {
-        test(java.lang.Double.POSITIVE_INFINITY);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_log {
-
-    @SuppressWarnings("serial")
-    public static class NaN extends Throwable {
-    }
-
-    public static double test(double arg) throws NaN {
-        double v = Math.log(arg);
-        if (Double.isNaN(v)) {
-            // NaN can't be tested against itself
-            throw new NaN();
-        }
-        return v;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1.0d, test(java.lang.Math.E), 0);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_log.NaN.class)
-    public void run1() throws Throwable {
-        test(java.lang.Double.NaN);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_log.NaN.class)
-    public void run2() throws Throwable {
-        test(-1.0d);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_log.NaN.class)
-    public void run3() throws Throwable {
-        test(java.lang.Double.NEGATIVE_INFINITY);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0.0d), 0);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(-0.0d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_log10.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_log10 {
-
-    @SuppressWarnings("serial")
-    public static class NaN extends Throwable {
-    }
-
-    public static double test(double arg) throws NaN {
-        double v = Math.log10(arg);
-        if (Double.isNaN(v)) {
-            // NaN can't be tested against itself
-            throw new NaN();
-        }
-        return v;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(1.0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0d, test(10.0d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2.0d, test(100.0d), 0);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_log10.NaN.class)
-    public void run3() throws Throwable {
-        test(java.lang.Double.NaN);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_log10.NaN.class)
-    public void run4() throws Throwable {
-        test(-1.0d);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_log10.NaN.class)
-    public void run5() throws Throwable {
-        test(java.lang.Double.NEGATIVE_INFINITY);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0.0d), 0);
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(-0.0d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_pow.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_pow {
-
-    public static double test(double pow) {
-        return Math.pow(2.0d, pow);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4.0d, test(2d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(8.574187700290345d, test(3.1d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sin.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_sin {
-
-    @SuppressWarnings("serial")
-    public static class NaN extends Throwable {
-    }
-
-    public static double test(double arg) throws NaN {
-        double v = Math.sin(arg);
-        if (Double.isNaN(v)) {
-            // NaN can't be tested against itself
-            throw new NaN();
-        }
-        return v;
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_sin.NaN.class)
-    public void run0() throws Throwable {
-        test(java.lang.Double.NaN);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_sin.NaN.class)
-    public void run1() throws Throwable {
-        test(java.lang.Double.NEGATIVE_INFINITY);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_sin.NaN.class)
-    public void run2() throws Throwable {
-        test(java.lang.Double.POSITIVE_INFINITY);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-0.0d, test(-0.0d), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_sqrt.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_sqrt {
-
-    @SuppressWarnings("serial")
-    public static class NaN extends Throwable {
-    }
-
-    public static double test(double arg) throws NaN {
-        double v = Math.sqrt(arg);
-        if (Double.isNaN(v)) {
-            // NaN can't be tested against itself
-            throw new NaN();
-        }
-        return v;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2.0d, test(4.0d), 0);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_sqrt.NaN.class)
-    public void run1() throws Throwable {
-        test(java.lang.Double.NaN);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_sqrt.NaN.class)
-    public void run2() throws Throwable {
-        test(-1.0d);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_sqrt.NaN.class)
-    public void run3() throws Throwable {
-        test(java.lang.Double.NEGATIVE_INFINITY);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(java.lang.Double.POSITIVE_INFINITY), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0d), 0);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-0.0d, test(-0.0d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Math_tan.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class Math_tan {
-
-    @SuppressWarnings("serial")
-    public static class NaN extends Throwable {
-    }
-
-    public static double test(double arg) throws NaN {
-        double v = Math.tan(arg);
-        if (Double.isNaN(v)) {
-            // NaN can't be tested against itself
-            throw new NaN();
-        }
-        return v;
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_tan.NaN.class)
-    public void run0() throws Throwable {
-        test(java.lang.Double.NaN);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_tan.NaN.class)
-    public void run1() throws Throwable {
-        test(java.lang.Double.NEGATIVE_INFINITY);
-    }
-
-    @Test(expected = com.oracle.graal.jtt.lang.Math_tan.NaN.class)
-    public void run2() throws Throwable {
-        test(java.lang.Double.POSITIVE_INFINITY);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-0.0d, test(-0.0d), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0.0d, test(0.0d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-public class Object_clone01 {
-
-    static final Object_clone01 field = new Object_clone01();
-
-    public static boolean test(int i) throws CloneNotSupportedException {
-        return field.tryClone(i);
-    }
-
-    @SuppressWarnings("unused")
-    private boolean tryClone(int i) throws CloneNotSupportedException {
-        return this == this.clone();
-    }
-
-    @Test(expected = java.lang.CloneNotSupportedException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_clone02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-public class Object_clone02 implements Cloneable {
-
-    static final Object_clone02 field = new Object_clone02();
-
-    public static boolean test(int i) throws CloneNotSupportedException {
-        return field.tryClone(i);
-    }
-
-    @SuppressWarnings("unused")
-    private boolean tryClone(int i) throws CloneNotSupportedException {
-        return this == this.clone();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_equals01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_equals01 {
-
-    public static Object_equals01 field = new Object_equals01();
-
-    public static boolean test(int i) {
-        final Object obj1 = new Object();
-        final Object obj2 = new Object();
-        switch (i) {
-            case 0:
-                return obj1.equals(field);
-            case 1:
-                return obj1.equals(obj2);
-            case 2:
-                return obj1.equals(null);
-            case 3:
-                return obj1.equals(obj1);
-            case 4:
-                return field.equals(field);
-            case 5:
-                return obj2.equals(field);
-            case 6:
-                return obj2.equals(obj2);
-            case 7:
-                return obj2.equals(null);
-            case 8:
-                return obj2.equals(obj1);
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(false, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_getClass01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_getClass01 {
-
-    static final Object object = new Object();
-    static final Object string = new String();
-    static final Object_getClass01 thisObject = new Object_getClass01();
-
-    public static String test(int i) {
-        if (i == 0) {
-            return object.getClass().toString();
-        }
-        if (i == 1) {
-            return string.getClass().toString();
-        }
-        if (i == 2) {
-            return thisObject.getClass().toString();
-        }
-        if (i == 3) {
-            return thisObject.getClass().getClass().toString();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("class java.lang.Object", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("class java.lang.String", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("class com.oracle.graal.jtt.lang.Object_getClass01", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("class java.lang.Class", test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(null, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_hashCode01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_hashCode01 {
-
-    public static boolean test() {
-        final Object o1 = new Object();
-        final Object o2 = new Object();
-        return o1.hashCode() != 0 || o2.hashCode() != 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_notify01 {
-
-    static final Object object = new Object();
-
-    public static boolean test() {
-        object.notify();
-        return true;
-    }
-
-    @Test(expected = java.lang.IllegalMonitorStateException.class)
-    public void run0() throws Throwable {
-        test();
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notify02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_notify02 {
-
-    static final Object object = new Object();
-
-    public static boolean test() {
-        synchronized (object) {
-            object.notify();
-        }
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_notifyAll01 {
-
-    static final Object obj = new Object();
-
-    public static boolean test() {
-        obj.notifyAll();
-        return true;
-    }
-
-    @Test(expected = java.lang.IllegalMonitorStateException.class)
-    public void run0() throws Throwable {
-        test();
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_notifyAll02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_notifyAll02 {
-
-    static final Object object = new Object();
-
-    public static boolean test() {
-        synchronized (object) {
-            object.notifyAll();
-        }
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-public class Object_toString01 {
-
-    static final String string = "Object_toString01";
-    static final Object object = new Object();
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return object.toString() != null;
-        }
-        if (i == 1) {
-            return new Object_toString01().toString() == string;
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return string;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_toString02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-public class Object_toString02 {
-
-    static final Object obj = new Object_toString02();
-
-    public static String test(int i) {
-        Object object = null;
-        if (i == 0) {
-            object = obj;
-        } else if (i == 1) {
-            object = "string";
-        } else if (i == 2) {
-            object = "string".getClass();
-        }
-        return object.toString();
-    }
-
-    @Override
-    public String toString() {
-        return "XYZ";
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("XYZ", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("string", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("class java.lang.String", test(2));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_wait01 {
-
-    static final Object object = new Object();
-
-    public static boolean test() throws InterruptedException {
-        object.wait();
-        return true;
-    }
-
-    @Test(expected = java.lang.IllegalMonitorStateException.class)
-    public void run0() throws Throwable {
-        test();
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_wait02 {
-
-    static final Object object = new Object();
-
-    public static boolean test() throws InterruptedException {
-        synchronized (object) {
-            object.wait(1);
-        }
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/Object_wait03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Object_wait03 {
-
-    static final Object object = new Object();
-
-    public static boolean test() throws InterruptedException {
-        synchronized (object) {
-            object.wait(1, 1);
-        }
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/ProcessEnvironment_init.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import java.util.*;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class ProcessEnvironment_init {
-
-    private static HashMap<Object, Object> theEnvironment;
-    public static Map<Object, Object> theUnmodifiableEnvironment;
-
-    public static int test(int v) {
-
-        byte[][] environ = environ();
-        theEnvironment = new HashMap<>(environ.length / 2 + 3);
-
-        for (int i = environ.length - 1; i > 0; i -= 2) {
-            theEnvironment.put(Variable.valueOf(environ[i - 1]), Value.valueOf(environ[i]));
-        }
-
-        theUnmodifiableEnvironment = Collections.unmodifiableMap(new StringEnvironment(theEnvironment));
-
-        return v;
-    }
-
-    @SuppressWarnings("serial")
-    private static final class StringEnvironment extends HashMap<Object, Object> {
-
-        @SuppressWarnings("unused")
-        public StringEnvironment(HashMap<Object, Object> theenvironment) {
-        }
-    }
-
-    private static final class Variable {
-
-        @SuppressWarnings("unused")
-        public static Object valueOf(byte[] bs) {
-            return new Object();
-        }
-    }
-
-    private static final class Value {
-
-        @SuppressWarnings("unused")
-        public static Object valueOf(byte[] bs) {
-            return new Object();
-        }
-    }
-
-    private static byte[][] environ() {
-        return new byte[3][3];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(7, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/StringCoding_Scale.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-public class StringCoding_Scale {
-
-    public static float maxCharPerByte = 1.0f;
-
-    public static int test(int i) {
-        return scale(i, maxCharPerByte);
-    }
-
-    // Copy of java.lang.StringCode.scale
-    private static int scale(int len, float expansionFactor) {
-        // We need to perform double, not float, arithmetic; otherwise
-        // we lose low order bits when len is larger than 2**24.
-        return (int) (len * (double) expansionFactor);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class String_intern01 {
-
-    public static boolean test() {
-        // Checkstyle: stop
-        return "id".intern() == "id";
-        // Checkstyle: resume
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class String_intern02 {
-
-    public static boolean test(int i) {
-        return ("id" + i).intern() == ("id" + i).intern();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_intern03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class String_intern03 {
-
-    public static boolean test(int i) {
-        return ("id" + i).intern().equals("id" + i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/String_valueOf01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class String_valueOf01 {
-
-    public static String test(int i) {
-        Object result = null;
-        if (i == 1) {
-            result = "string";
-        }
-        return String.valueOf(result);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("null", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("string", test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/lang/System_identityHashCode01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.lang;
-
-import org.junit.*;
-
-/*
- */
-public class System_identityHashCode01 {
-
-    private static final Object object0 = new Object();
-    private static final Object object1 = new Object();
-    private static final Object object2 = new Object();
-
-    private static final int hash0 = System.identityHashCode(object0);
-    private static final int hash1 = System.identityHashCode(object1);
-    private static final int hash2 = System.identityHashCode(object2);
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return hash0 == System.identityHashCode(object0);
-        }
-        if (i == 1) {
-            return hash1 == System.identityHashCode(object1);
-        }
-        if (i == 2) {
-            return hash2 == System.identityHashCode(object2);
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/DegeneratedLoop.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class DegeneratedLoop {
-
-    public static String test(int a) {
-        int arg = a;
-        for (;;) {
-            try {
-                arg++;
-                break;
-            } catch (Unresolved iioe) {
-            }
-        }
-        return "ok-" + arg;
-    }
-
-    @SuppressWarnings("serial")
-    public static class Unresolved extends RuntimeException {
-
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("ok-1", test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop01 {
-
-    public static boolean test() {
-        int x = 1;
-
-        for (int i = 0; i < 10; i++) {
-            int y = m();
-            if (x == 1) {
-                return true;
-            }
-            x = y;
-        }
-        return false;
-    }
-
-    private static int m() {
-        return 2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop02 {
-
-    public static boolean test(int arg) {
-        int x = arg;
-
-        for (int i = 0; i < 10; i++) {
-            int y = m();
-            if (x == 1) {
-                return true;
-            }
-            x = y;
-        }
-        return false;
-    }
-
-    private static int m() {
-        return 2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop03 {
-
-    public static int test(int count) {
-        int i1 = 1;
-        int i2 = 2;
-        int i4 = 4;
-
-        for (int i = 0; i < count; i++) {
-            i1 = i2;
-            i2 = 7;
-            i4 = i1;
-        }
-        return i1 + i2 * 10 + i4 * 1000;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(7077, test(10));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop04 {
-
-    public static int test(int count) {
-        int i1 = 1;
-        int i2 = 2;
-        int i3 = 3;
-        int i4 = 4;
-
-        for (int i = 0; i < count; i++) {
-            i1 = i2;
-            i2 = i3;
-            i3 = i4;
-            i4 = i1;
-        }
-        return i1 + i2 * 10 + i3 * 100 + i4 * 1000;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4321, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2432, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2432, test(10));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop05 {
-
-    @SuppressWarnings("unused")
-    public static String test(int a) {
-        int arg = a;
-        int count = 0;
-        while (--arg > 0) {
-            count++;
-            new Object();
-        }
-        return "ok" + count;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("ok0", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("ok9", test(10));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("ok24", test(25));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop06 {
-
-    public static String test(int a) {
-        int arg = a;
-        int count = 0;
-        while (--arg > 0) {
-            count++;
-            foo();
-        }
-        return "ok" + count;
-    }
-
-    static void foo() {
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("ok0", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("ok9", test(10));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("ok24", test(25));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop07.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop07 {
-
-    public static String test(int arg) {
-        int count = arg;
-        for (int i = 0; i < arg; i++) {
-            count++;
-        }
-        return "ok" + count;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("ok0", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("ok20", test(10));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("ok50", test(25));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop08.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop08 {
-
-    public static int test(int arg) {
-        int a = 0;
-        for (int i = 0; i < arg; i++) {
-            a += i;
-        }
-        return a;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(45, test(10));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(300, test(25));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop09.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop09 {
-
-    private static int cnt;
-
-    public static String test(int arg) {
-        cnt = 0;
-        int count = arg;
-        for (int i = 0; i < arg; i++) {
-            count++;
-            foo();
-        }
-        return "ok" + count + "-" + cnt;
-    }
-
-    static void foo() {
-        cnt++;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("ok0-0", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("ok20-10", test(10));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("ok50-25", test(25));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop11.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop11 {
-
-    public static int test(int a) {
-        int arg = a;
-        int v = 0;
-        while (arg-- > 0) {
-            v = 1;
-        }
-        return v;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop12.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop12 {
-
-    private static int[] source = new int[]{10, 15, 20, 25, 30};
-
-    public static int test(int arg) {
-        int i = 0;
-        if (source[i] != arg) {
-            while (++i <= 5 && source[i] != arg) {
-                // nothing
-            }
-        }
-        return i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(10));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(15));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(4, test(30));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop13.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop13 {
-
-    public static class Loop {
-
-        private int index;
-        private Object[] nodes = new Object[]{null, null, new Object(), null, null, new Object(), null};
-        private int size = nodes.length;
-
-        public Loop(int start) {
-            index = start;
-        }
-
-        public void test0() {
-            if (index < size) {
-                do {
-                    index++;
-                } while (index < size && nodes[index] == null);
-            }
-        }
-
-        public int getIndex() {
-            return index;
-        }
-
-    }
-
-    public static int test(int arg) {
-        Loop loop = new Loop(arg);
-        loop.test0();
-        return loop.getIndex();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(5, test(3));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(7, test(6));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(7, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/Loop14.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class Loop14 {
-
-    private static int value;
-
-    public static int test(int arg) {
-        return calc(arg);
-    }
-
-    public static int calc(int arg) {
-        int result = 0;
-        for (int k = 0; k < arg; ++k) {
-            value = 5;
-            for (int i = 0; i < arg; ++i) {
-                for (int j = 0; j < arg; ++j) {
-                }
-                result += value;
-            }
-        }
-        return result;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(5, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopInline.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- * This test is meaningful only if you run it with 'forced' inlinning because running it in the harness with -Xcomp will not trigger any normal inlining
- */
-public class LoopInline {
-
-    public static int test(int arg) {
-        int count = 0;
-        for (int i = 0; i < arg; i++) {
-            count += foo(i);
-            if (count > 15) {
-                count -= foo(3);
-                break;
-            }
-        }
-        return count;
-    }
-
-    public static int foo(int t) {
-        int sum = 0;
-        for (int i = 0; i < t; i++) {
-            sum += i;
-            if (i == 4) {
-                sum += foo2(sum);
-                break;
-            }
-        }
-        return sum;
-    }
-
-    public static int foo2(int i) {
-        int j = i;
-        int sum = 0;
-        while (j > 0) {
-            sum += j * j;
-            j--;
-        }
-        return sum;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(402, test(10));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopNewInstance.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class LoopNewInstance {
-
-    public static Blop initBlop = new Blop();
-
-    @SuppressWarnings("unused")
-    public static int test(int arg) {
-        for (int i = 0; i < arg; i++) {
-            new Blop();
-        }
-        return count;
-    }
-
-    private static int count = 0;
-
-    private static class Blop {
-
-        private boolean exists;
-
-        public Blop() {
-            if (!exists) {
-                count++;
-            }
-            exists = true;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        count = 0;
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        count = 0;
-        Assert.assertEquals(5, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopPhi.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-
-public class LoopPhi {
-
-    public static int test(int arg) {
-        for (int i = 0; i < arg; i++) {
-            test(1, 1, 1, 1, 1, 1);
-        }
-        return test(1, 1, 1, 1, 1, 1);
-    }
-
-    public static int test(int j1, int j2, int j3, int j4, int j5, int j6) {
-        int i1 = j1;
-        int i2 = j2;
-        int i3 = j3;
-        int i4 = j4;
-        int i5 = j5;
-        int i6 = j6;
-
-        if (i1 == 0) {
-            i1 = 2;
-        } else {
-            i2 = 2;
-        }
-        for (int i = 0; i < 10; i++) {
-            if (i == 0) {
-                i3 = 2;
-            } else {
-                i4 = 2;
-            }
-
-            for (int j = 0; j < 10; j++) {
-                if (j == 0) {
-                    i5 = 2;
-                } else {
-                    i6 = 2;
-                }
-            }
-        }
-
-        return i1 + i2 + i3 + i4 + i5 + i6;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(50000));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/loop/LoopSwitch01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.loop;
-
-import org.junit.*;
-
-/*
- */
-public class LoopSwitch01 {
-
-    static int count = 0;
-
-    @SuppressWarnings("unused")
-    public static String test() {
-        String line;
-        while ((line = string()) != null) {
-            switch (line.charAt(0)) {
-                case 'a':
-                    new Object();
-                    break;
-                case 'b':
-                    new Object();
-                    break;
-                default:
-                    new Object();
-                    break;
-            }
-        }
-        return "ok" + count;
-    }
-
-    private static String string() {
-        if (count == 0) {
-            return null;
-        }
-        count--;
-        return "" + ('a' + count);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("ok0", test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class ArrayCompare01 {
-
-    static final long[] a1 = {1, 2, 3, -5};
-    static final long[] a2 = {1, 2, 3, -5};
-    static final long[] a3 = {1, 2, 4, -5};
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return compare(a1, a2);
-        }
-        if (arg == 1) {
-            return compare(a1, a3);
-        }
-        return false;
-    }
-
-    static boolean compare(long[] a, long[] b) {
-        if (a.length == b.length) {
-            for (int i = 0; i < a.length; i++) {
-                if (a[i] != b[i]) {
-                    return false;
-                }
-            }
-            return true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/ArrayCompare02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class ArrayCompare02 {
-
-    static final long[] a1 = {1, 1, 1, 1, 1, 1};
-    static final long[] a2 = {1, 1, 1, 2, 1, 1};
-    static final long[] a3 = {1, 1, 2, 2, 3, 3};
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return compare(a1);
-        }
-        if (arg == 1) {
-            return compare(a2);
-        }
-        if (arg == 2) {
-            return compare(a3);
-        }
-        return false;
-    }
-
-    static boolean compare(long[] a) {
-        return a[0] == a[1] & a[2] == a[3] & a[4] == a[5];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BC_invokevirtual2.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BC_invokevirtual2 {
-
-    static Unresolved object;
-
-    public static class Unresolved {
-
-        public int id(int i) {
-            return i;
-        }
-    }
-
-    private static Unresolved object() {
-        if (object == null) {
-            object = new Unresolved();
-        }
-        return object;
-    }
-
-    public static int test(int a) {
-        return object().id(a);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(3, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-4, test(-4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigByteParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigByteParams01 {
-
-    public static int test(int num) {
-        int sum = 0;
-        if (num == 0) {
-            sum += testA((byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 1, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 2, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 3, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 4, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 5, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 6, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 7, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testA((byte) 8, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-        } else if (num == 1) {
-            sum += testB(0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(1, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(2, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(3, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(4, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(5, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(6, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(7, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            sum += testB(8, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-        } else if (num == 2) {
-            for (int i = 0; i < 9; i++) {
-                sum += testA(i, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            }
-        } else if (num == 3) {
-            for (int i = 0; i < 9; i++) {
-                sum += testB(i, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9);
-            }
-        }
-        return sum;
-    }
-
-    private static int testA(int choice, byte p0, byte p1, byte p2, byte p3, byte p4, byte p5, byte p6, byte p7, byte p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    private static long testB(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(45, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(45, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(45, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(45, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigDoubleParams02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigDoubleParams02 {
-
-    public static double test(int choice, double p0, double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1d, test(0, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2d, test(1, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3d, test(2, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4d, test(3, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5d, test(4, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(6d, test(5, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7d, test(6, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(8d, test(7, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(9d, test(8, 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigFloatParams01 {
-
-    public static double test(int num) {
-        double sum = 0;
-        if (num == 0) {
-            sum += testA(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-        } else if (num == 1) {
-            sum += testB(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-        } else if (num == 2) {
-            for (int i = 0; i < 9; i++) {
-                sum += testA(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            }
-        } else if (num == 3) {
-            for (int i = 0; i < 9; i++) {
-                sum += testB(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            }
-        }
-        return sum;
-    }
-
-    private static float testA(int choice, float p0, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    private static double testB(int choice, double p0, double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(45D, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(45D, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(45D, test(2), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(45D, test(3), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0D, test(4), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigFloatParams02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigFloatParams02 {
-
-    public static float test(int choice, float p0, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1f, test(0, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2f, test(1, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3f, test(2, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4f, test(3, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5f, test(4, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(6f, test(5, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7f, test(6, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(8f, test(7, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(9f, test(8, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigIntParams01 {
-
-    public static int test(int num) {
-        int sum = 0;
-        if (num == 0) {
-            sum += testA(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-        } else if (num == 1) {
-            sum += testB(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testB(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-        } else if (num == 2) {
-            for (int i = 0; i < 9; i++) {
-                sum += testA(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            }
-        } else if (num == 3) {
-            for (int i = 0; i < 9; i++) {
-                sum += testB(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            }
-        }
-        return sum;
-    }
-
-    private static int testA(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    private static long testB(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(45, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(45, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(45, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(45, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigIntParams02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigIntParams02 {
-
-    public static int test(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(0, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3, test(2, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4, test(3, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5, test(4, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(6, test(5, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7, test(6, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(-8, test(7, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(-9, test(8, 1, 2, 3, 4, 5, 6, 7, -8, -9));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigInterfaceParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigInterfaceParams01 {
-
-    public static String test(boolean b, String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-        I i = b ? new A() : new B();
-        return i.test(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
-    }
-
-    interface I {
-
-        String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9);
-    }
-
-    static class A implements I {
-
-        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-            return "A" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
-        }
-    }
-
-    static class B implements I {
-
-        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-            return "B" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("A0123456789", test(true, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("B0123456789", test(false, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigLongParams02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigLongParams02 {
-
-    public static long test(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1L, test(0, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2L, test(1, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3L, test(2, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4L, test(3, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5L, test(4, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(6L, test(5, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7L, test(6, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(-8L, test(7, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(-9L, test(8, 1L, 2L, 3L, 4L, 5L, 6L, 7L, -8L, -9L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigMixedParams01 {
-
-    public static double test(int num) {
-        double sum = 0;
-        if (num == 0) {
-            sum += testA(0, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(1, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(2, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(3, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(4, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(5, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(6, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(7, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            sum += testA(8, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-        } else if (num == 1) {
-            sum += testB(0, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(2, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(3, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(4, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(5, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(6, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(7, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            sum += testB(8, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-        } else if (num == 2) {
-            for (int i = 0; i < 9; i++) {
-                sum += testA(i, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f);
-            }
-        } else if (num == 3) {
-            for (int i = 0; i < 9; i++) {
-                sum += testB(i, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d);
-            }
-        }
-        return sum;
-    }
-
-    @SuppressWarnings("unused")
-    private static float testA(int choice, int i0, int i1, int i2, int i3, float p0, float p1, float p2, float p3, int i4, int i5, float p4, float p5, float p6, float p7, float p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @SuppressWarnings("unused")
-    private static double testB(int choice, int i0, int i1, int i2, double p0, double p1, double p2, double p3, int i3, int i4, double p4, double p5, double p6, double p7, double p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(45D, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(45D, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(45D, test(2), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(45D, test(3), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0D, test(4), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigMixedParams02 {
-
-    @SuppressWarnings("unused")
-    public static float test(int choice, int i0, int i1, int i2, int i3, float p0, float p1, float p2, float p3, int i4, int i5, float p4, float p5, float p6, float p7, float p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1f, test(0, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2f, test(1, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3f, test(2, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4f, test(3, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5f, test(4, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(6f, test(5, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7f, test(6, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(8f, test(7, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(9f, test(8, -1, -1, -1, -1, 1f, 2f, 3f, 4f, -1, -1, 5f, 6f, 7f, 8f, 9f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigMixedParams03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigMixedParams03 {
-
-    @SuppressWarnings("unused")
-    public static double test(int choice, int i0, int i1, int i2, int i3, double p0, double p1, double p2, double p3, int i4, int i5, double p4, double p5, double p6, double p7, double p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1d, test(0, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2d, test(1, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(3d, test(2, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4d, test(3, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5d, test(4, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(6d, test(5, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7d, test(6, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(8d, test(7, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(9d, test(8, -1, -1, -1, -1, 1d, 2d, 3d, 4d, -1, -1, 5d, 6d, 7d, 8d, 9d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigObjectParams01 {
-
-    @SuppressWarnings("unused")
-    public static String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-        return p0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("0", test("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("a", test("a", null, null, null, null, null, null, null, null, null));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigObjectParams02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigObjectParams02 {
-
-    public static String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-        return p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("0123456789", test("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigParamsAlignment.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-public class BigParamsAlignment {
-
-    public static int test(int num) {
-        int sum = 0;
-        if (num == 0) {
-            sum += testA(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(1, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(2, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(3, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(4, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(5, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(6, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(7, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            sum += testA(8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-        } else if (num == 1) {
-            sum += testB(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            sum += testB(9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-        } else if (num == 2) {
-            for (int i = 0; i < 9; i++) {
-                sum += testA(i, 1, 2, 3, 4, 5, 6, 7, 8, 9);
-            }
-        } else if (num == 3) {
-            for (int i = 0; i < 10; i++) {
-                sum += testB(i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-            }
-        } else if (num == 4) {
-            for (int i = 0; i < 11; i++) {
-                sum += testC(i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
-            }
-        } else if (num == 5) {
-            for (int i = 0; i < 12; i++) {
-                sum += testD(i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
-            }
-        }
-        return sum;
-    }
-
-    private static int testA(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    private static int testB(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-            case 9:
-                return p9;
-        }
-        return 42;
-    }
-
-    private static int testC(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-            case 9:
-                return p9;
-            case 10:
-                return p10;
-        }
-        return 42;
-    }
-
-    private static int testD(int choice, int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10, int p11) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-            case 9:
-                return p9;
-            case 10:
-                return p10;
-            case 11:
-                return p11;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(45, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(55, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(45, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(55, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(66, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(78, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(0, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigShortParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigShortParams01 {
-
-    public static int test(int num) {
-        int sum = 0;
-        if (num == 0) {
-            sum += testA((short) 0, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 1, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 2, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 3, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 4, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 5, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 6, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 7, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testA((short) 8, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-        } else if (num == 1) {
-            sum += testB(0, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(1, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(2, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(3, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(4, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(5, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(6, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(7, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            sum += testB(8, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-        } else if (num == 2) {
-            for (int i = 0; i < 9; i++) {
-                sum += testA(i, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            }
-        } else if (num == 3) {
-            for (int i = 0; i < 9; i++) {
-                sum += testB(i, (short) 1, (short) 2, (short) 3, (short) 4, (short) 5, (short) 6, (short) 7, (short) 8, (short) 9);
-            }
-        }
-        return sum;
-    }
-
-    private static int testA(int choice, short p0, short p1, short p2, short p3, short p4, short p5, short p6, short p7, short p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    private static long testB(int choice, long p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) {
-        switch (choice) {
-            case 0:
-                return p0;
-            case 1:
-                return p1;
-            case 2:
-                return p2;
-            case 3:
-                return p3;
-            case 4:
-                return p4;
-            case 5:
-                return p5;
-            case 6:
-                return p6;
-            case 7:
-                return p7;
-            case 8:
-                return p8;
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(45, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(45, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(45, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(45, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/BigVirtualParams01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class BigVirtualParams01 {
-
-    public static String test(boolean b, String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-        I i = b ? new A() : new B();
-        return i.test(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
-    }
-
-    abstract static class I {
-
-        abstract String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9);
-    }
-
-    static class A extends I {
-
-        @Override
-        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-            return "A" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
-        }
-    }
-
-    static class B extends I {
-
-        @Override
-        public String test(String p0, String p1, String p2, String p3, String p4, String p5, String p6, String p7, String p8, String p9) {
-            return "B" + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("A0123456789", test(true, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("B0123456789", test(false, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/Bubblesort.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-public class Bubblesort {
-
-    public static int test(int num) {
-        final int[] array = {23, 8, -9, 5, 882, 0, 0, 1};
-
-        for (int i = 0; i < array.length; i++) {
-            for (int j = i + 1; j < array.length; j++) {
-                if (array[j] < array[i]) {
-                    final int tmp = array[i];
-                    array[i] = array[j];
-                    array[j] = tmp;
-                }
-            }
-        }
-        return array[num];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-9, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(8, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(23, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(882, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/Fibonacci.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class Fibonacci {
-
-    public static int test(int num) {
-        if (num <= 0) {
-            return 0;
-        }
-        int n1 = 0;
-        int n2 = 1;
-        for (int i = 1; i < num; i++) {
-            final int next = n2 + n1;
-            n1 = n2;
-            n2 = next;
-        }
-        return n2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(2, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(3, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(5, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(8, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(13, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-public class InvokeVirtual_01 {
-
-    static class A {
-
-        int plus(int a) {
-            return a;
-        }
-    }
-
-    static class B extends A {
-
-        @Override
-        int plus(int a) {
-            return a + 10;
-        }
-    }
-
-    static class C extends A {
-
-        @Override
-        int plus(int a) {
-            return a + 20;
-        }
-    }
-
-    static A aObject = new A();
-    static A bObject = new B();
-    static A cObject = new C();
-
-    public static int test(int a) {
-        if (a == 0) {
-            return aObject.plus(a);
-        }
-        if (a == 1) {
-            return bObject.plus(a);
-        }
-        if (a == 2) {
-            return cObject.plus(a);
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(22, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(42, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/InvokeVirtual_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-public class InvokeVirtual_02 {
-
-    static class A {
-
-        long plus(long a) {
-            return a;
-        }
-    }
-
-    static class B extends A {
-
-        @Override
-        long plus(long a) {
-            return a + 10;
-        }
-    }
-
-    static class C extends A {
-
-        @Override
-        long plus(long a) {
-            return a + 20;
-        }
-    }
-
-    static A objectA = new A();
-    static A objectB = new B();
-    static A objectC = new C();
-
-    public static long test(long a) {
-        if (a == 0) {
-            return objectA.plus(a);
-        }
-        if (a == 1) {
-            return objectB.plus(a);
-        }
-        if (a == 2) {
-            return objectC.plus(a);
-        }
-        return 42;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11L, test(1L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(22L, test(2L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(42L, test(3L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/Matrix01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class Matrix01 {
-
-    public static class Matrix {
-
-        final int id;
-
-        Matrix(int id) {
-            this.id = id;
-        }
-    }
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return matrix1(3) + matrix1(5);
-        }
-        if (arg == 1) {
-            return matrix2(3) + matrix2(5);
-        }
-        if (arg == 2) {
-            return matrix3(3) + matrix3(5);
-        }
-        if (arg == 3) {
-            return matrix4(3) + matrix4(5);
-        }
-        if (arg == 4) {
-            return matrix5(3) + matrix5(5);
-        }
-        return 42;
-    }
-
-    static int matrix1(int size) {
-        Matrix[] matrix = new Matrix[size];
-        fillMatrix(matrix, size);
-        int count = 0;
-        for (Matrix m : matrix) {
-            if (m != null) {
-                count++;
-            }
-        }
-        return count;
-    }
-
-    static int matrix2(int size) {
-        Matrix[][] matrix = new Matrix[size][size];
-        fillMatrix(matrix, size * size);
-        int count = 0;
-        for (Matrix[] n : matrix) {
-            for (Matrix m : n) {
-                if (m != null) {
-                    count++;
-                }
-            }
-        }
-        return count;
-    }
-
-    static int matrix3(int size) {
-        Matrix[][][] matrix = new Matrix[size][5][size];
-        fillMatrix(matrix, size * size * size);
-        int count = 0;
-        for (Matrix[][] o : matrix) {
-            for (Matrix[] n : o) {
-                for (Matrix m : n) {
-                    if (m != null) {
-                        count++;
-                    }
-                }
-            }
-        }
-        return count;
-    }
-
-    static int matrix4(int size) {
-        Matrix[][][][] matrix = new Matrix[size][2][size][3];
-        fillMatrix(matrix, size * size * size * size);
-        int count = 0;
-        for (Matrix[][][] p : matrix) {
-            for (Matrix[][] o : p) {
-                for (Matrix[] n : o) {
-                    for (Matrix m : n) {
-                        if (m != null) {
-                            count++;
-                        }
-                    }
-                }
-            }
-        }
-        return count;
-    }
-
-    static int matrix5(int size) {
-        Matrix[][][][][] matrix = new Matrix[size][size][3][4][size];
-        fillMatrix(matrix, size * size * size * size * size);
-        int count = 0;
-        for (Matrix[][][][] q : matrix) {
-            for (Matrix[][][] p : q) {
-                for (Matrix[][] o : p) {
-                    for (Matrix[] n : o) {
-                        for (Matrix m : n) {
-                            if (m != null) {
-                                count++;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return count;
-    }
-
-    static void fillMatrix(Object[] matrix, int total) {
-        for (int i = 0; i < 10000; i += 7) {
-            int number = i % total;
-            set(matrix, number);
-        }
-    }
-
-    static void set(Object[] matrix, int number) {
-        int val = number;
-        Object[] array = matrix;
-        while (!(array instanceof Matrix[])) {
-            int index = val % array.length;
-            val = val / array.length;
-            array = (Object[]) array[index];
-        }
-        ((Matrix[]) array)[val % array.length] = new Matrix(number);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(8, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(34, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(152, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(204, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(1547, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(42, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/ReferenceMap01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class ReferenceMap01 {
-
-    public static Integer val1 = new Integer(3);
-    public static Integer val2 = new Integer(4);
-
-    @SuppressWarnings("unused")
-    private static String foo(String[] a) {
-        String[] args = new String[]{"78"};
-        Integer i1 = new Integer(1);
-        Integer i2 = new Integer(2);
-        Integer i3 = val1;
-        Integer i4 = val2;
-        Integer i5 = new Integer(5);
-        Integer i6 = new Integer(6);
-        Integer i7 = new Integer(7);
-        Integer i8 = new Integer(8);
-        Integer i9 = new Integer(9);
-        Integer i10 = new Integer(10);
-        Integer i11 = new Integer(11);
-        Integer i12 = new Integer(12);
-
-        System.gc();
-        int sum = i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12;
-        return args[0] + sum;
-    }
-
-    public static int test() {
-        return Integer.valueOf(foo(new String[]{"asdf"}));
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(7878, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/StrangeFrames.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("unused")
-public class StrangeFrames {
-
-    public static boolean test(int arg) {
-        empty();
-        oneOperandStackSlot();
-        twoOperandStackSlots();
-        oneLocalSlot();
-        return true;
-    }
-
-    static void empty() {
-        // do nothing.
-    }
-
-    static void oneOperandStackSlot() {
-        new StrangeFrames();
-    }
-
-    static void twoOperandStackSlots() {
-        two(new StrangeFrames(), new StrangeFrames());
-    }
-
-    static void oneLocalSlot() {
-        int a;
-    }
-
-    static void two(Object a, Object b) {
-        Object c = b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/String_format01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class String_format01 {
-
-    public static String test(String s) {
-        return String.format("Hello %s", s);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("Hello World", test("World"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("Hello New World Order", test("New World Order"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/String_format02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class String_format02 {
-
-    public static String test(int val) {
-        return String.format("Hello %d", val);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("Hello 0", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("Hello -11", test(-11));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("Hello -2147483648", test(-2147483648));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("Hello 2147483647", test(2147483647));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_String01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_String01 {
-
-    public static String test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, "a", null, "test");
-    }
-
-    private static String get(int index, String... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("a", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(null, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("test", test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_boolean01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_boolean01 {
-
-    public static boolean test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, true, false, true);
-    }
-
-    private static boolean get(int index, boolean... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_byte01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_byte01 {
-
-    public static byte test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, (byte) 1, (byte) 2, (byte) 3);
-    }
-
-    private static byte get(int index, byte... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 1), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 2), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) 3), test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_char01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_char01 {
-
-    public static char test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, 'a', 'b', 'c');
-    }
-
-    private static char get(int index, char... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 97), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 98), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 99), test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_double01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_double01 {
-
-    public static double test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, 0.0d, 1.0d, 2.0d);
-    }
-
-    private static double get(int index, double... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0d, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0d, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2.0d, test(2), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_float01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_float01 {
-
-    public static float test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, 0.0f, 1.0f, 2.0f);
-    }
-
-    private static float get(int index, float... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0.0f, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1.0f, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2.0f, test(2), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_int01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_int01 {
-
-    public static int test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, 0, 1, 2);
-    }
-
-    private static int get(int index, int... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_long01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_long01 {
-
-    public static long test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, 0L, 1L, 2L);
-    }
-
-    private static long get(int index, long... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2L, test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_short01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.micro;
-
-import org.junit.*;
-
-/*
- */
-public class VarArgs_short01 {
-
-    public static short test(int arg) {
-        if (arg == 4) {
-            return get(0);
-        }
-        return get(arg, (short) 0, (short) 1, (short) 2);
-    }
-
-    private static short get(int index, short... args) {
-        return args[index];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 0), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) 1), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) 2), test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class ABCE_01 {
-
-    public static int[] array = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-
-    public static int test(int a) {
-        int arg = a;
-        for (int i = 0; i < array.length; i++) {
-            arg += array[i];
-        }
-        return arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(55, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(65, test(10));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class ABCE_02 {
-
-    public static int[] array = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-
-    public static int test(int arg) {
-        int r = 0;
-        for (int i = 0; i < arg; i++) {
-            r += array[i];
-        }
-        return r;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(55, test(10));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run2() throws Throwable {
-        test(20);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ABCE_03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class ABCE_03 {
-
-    private static final int[] ARRAY1 = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-    private static final int[] ARRAY2 = new int[]{1};
-
-    public static int test(int arg) {
-        int[] array = arg == 0 ? ARRAY2 : ARRAY1;
-        int r = 0;
-        for (int i = 0; i < arg; i++) {
-            r += array[i];
-        }
-        return r;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(55, test(10));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run2() throws Throwable {
-        test(20);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayCopy01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests calls to the array copy method.
- */
-public class ArrayCopy01 {
-
-    public static Object[] src = new Object[]{null, null};
-    public static Object[] dest = new Object[]{null, null};
-
-    public static int test(int srcPos, int destPos, int length) {
-        System.arraycopy(src, srcPos, dest, destPos, length);
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0, 0, 0));
-    }
-
-    @Test(expected = java.lang.IndexOutOfBoundsException.class)
-    public void run1() throws Throwable {
-        test(0, 0, -1);
-    }
-
-    @Test(expected = java.lang.IndexOutOfBoundsException.class)
-    public void run2() throws Throwable {
-        test(-1, 0, 0);
-    }
-
-    @Test(expected = java.lang.IndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(0, -1, 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(0, 0, 2));
-    }
-
-    @Test(expected = java.lang.IndexOutOfBoundsException.class)
-    public void run5() throws Throwable {
-        test(0, 1, 2);
-    }
-
-    @Test(expected = java.lang.IndexOutOfBoundsException.class)
-    public void run6() throws Throwable {
-        test(1, 0, 2);
-    }
-
-    @Test(expected = java.lang.IndexOutOfBoundsException.class)
-    public void run7() throws Throwable {
-        test(1, 1, -1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayLength01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of array length operations.
- */
-public class ArrayLength01 {
-
-    public static final int SIZE = 8;
-    public static final byte[] arr = new byte[5];
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return arr.length;
-        }
-        if (arg == 1) {
-            return new byte[6].length;
-        }
-        if (arg == 2) {
-            return new Object[7].length;
-        }
-        if (arg == 3) {
-            return new Class[SIZE][].length;
-        }
-        if (arg == 4) {
-            return new int[arg].length;
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(6, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(7, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(8, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(4, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_16.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_idiv_16 {
-
-    public static int test(int i, int arg) {
-        if (i == 0) {
-            final int constant = 16;
-            return arg / constant;
-        }
-        return arg / 16;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(0, 16));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(0, 17));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(0, -1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-1, test(0, -16));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-1, test(0, -17));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-64, test(0, -1024));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0, test(1, 0));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(1, test(1, 16));
-    }
-
-    @Test
-    public void run9() throws Throwable {
-        Assert.assertEquals(1, test(1, 17));
-    }
-
-    @Test
-    public void run10() throws Throwable {
-        Assert.assertEquals(0, test(1, -1));
-    }
-
-    @Test
-    public void run11() throws Throwable {
-        Assert.assertEquals(-1, test(1, -16));
-    }
-
-    @Test
-    public void run12() throws Throwable {
-        Assert.assertEquals(-1, test(1, -17));
-    }
-
-    @Test
-    public void run13() throws Throwable {
-        Assert.assertEquals(-64, test(1, -1024));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_idiv_4.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_idiv_4 {
-
-    public static int test(int arg) {
-        return arg / 4;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(4));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(5));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0, test(-1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-1, test(-4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-1, test(-5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-64, test(-256));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_16.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_imul_16 {
-
-    public static int test(int i, int arg) {
-        if (i == 0) {
-            final int mult = 16;
-            return arg * mult;
-        }
-        return arg * 16;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(256, test(0, 16));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(272, test(0, 17));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-16, test(0, -1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-256, test(0, -16));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-272, test(0, -17));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-16, test(0, 2147483647));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0, test(0, -2147483648));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(0, test(1, 0));
-    }
-
-    @Test
-    public void run9() throws Throwable {
-        Assert.assertEquals(256, test(1, 16));
-    }
-
-    @Test
-    public void run10() throws Throwable {
-        Assert.assertEquals(272, test(1, 17));
-    }
-
-    @Test
-    public void run11() throws Throwable {
-        Assert.assertEquals(-16, test(1, -1));
-    }
-
-    @Test
-    public void run12() throws Throwable {
-        Assert.assertEquals(-256, test(1, -16));
-    }
-
-    @Test
-    public void run13() throws Throwable {
-        Assert.assertEquals(-272, test(1, -17));
-    }
-
-    @Test
-    public void run14() throws Throwable {
-        Assert.assertEquals(-16, test(1, 2147483647));
-    }
-
-    @Test
-    public void run15() throws Throwable {
-        Assert.assertEquals(0, test(1, -2147483648));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_imul_4.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_imul_4 {
-
-    public static int test(int arg) {
-        return arg * 4;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(16, test(4));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(20, test(5));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-4, test(-1));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-16, test(-4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-20, test(-5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-1024, test(-256));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_16.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldiv_16 {
-
-    public static long test(long arg) {
-        return arg / 16;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1L, test(16L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1L, test(17L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0L, test(-1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-1L, test(-16L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-1L, test(-17L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-64L, test(-1024L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_ldiv_4.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_ldiv_4 {
-
-    public static long test(long arg) {
-        return arg / 4;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1L, test(4L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1L, test(5L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0L, test(-1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-1L, test(-4L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-1L, test(-5L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-64L, test(-256L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_16.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lmul_16 {
-
-    public static long test(long arg) {
-        return arg * 16;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(256L, test(16L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(272L, test(17L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-16L, test(-1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-256L, test(-16L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-272L, test(-17L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-16384L, test(-1024L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lmul_4.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lmul_4 {
-
-    public static long test(long arg) {
-        return arg * 4;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0L, test(0L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(16L, test(4L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(20L, test(5L));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-4L, test(-1L));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(-16L, test(-4L));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(-20L, test(-5L));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(-1024L, test(-256L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C16.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lshr_C16 {
-
-    public static long test(long a) {
-        return a >> 16;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1330945L, test(87224824140L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C24.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lshr_C24 {
-
-    public static long test(long a) {
-        return a >> 24;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5199L, test(87224824140L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BC_lshr_C32.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BC_lshr_C32 {
-
-    public static long test(long a) {
-        return a >> 32;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(20L, test(87224824140L));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/BlockSkip01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class BlockSkip01 {
-
-    public static boolean test(int arg) {
-        int x = 1;
-
-        if (arg > 2) {
-            x = 2;
-        } else {
-            x = 1;
-        }
-        return m(x) == 2;
-    }
-
-    private static int m(int x) {
-        return x + 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Cmov01 {
-
-    public static boolean test(int a, int b) {
-        boolean result = a < b || a == b;
-        return result;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(-1, -1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1, 10));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(1, 0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Cmov02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Cmov02 {
-
-    public static int test(double a, double b, int v1, int v2) {
-        return a < b ? v1 : v2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(1.0, 1.1, 1, 2));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1.0, -1.1, 1, 2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(1.0, java.lang.Double.NaN, 1, 2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Conditional01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import java.util.*;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("unused")
-public class Conditional01 {
-
-    private static final int RAM_SIZE = 0x100;
-
-    public static int test(int arg) {
-        Conditional01 c = new Conditional01();
-        Random rnd = new Random();
-        for (int i = 0; i < arg; i++) {
-            CPC i2 = new CPC();
-            i2.r1 = new Register();
-            i2.r1.val = i;
-            i2.r1.num = i + RAM_SIZE - 20;
-            i2.r2 = new Register();
-            i2.r2.val = rnd.nextInt();
-            i2.r2.num = rnd.nextInt(RAM_SIZE);
-            try {
-                c.visit(i2);
-            } catch (RuntimeException re) {
-
-            }
-        }
-        return c.cyclesConsumed;
-    }
-
-    private static class Register {
-
-        int val;
-        int num;
-    }
-
-    private static class CPC {
-
-        public Register r1;
-        public Register r2;
-
-    }
-
-    private int nextPC;
-    private int pc;
-    private boolean aC;
-    private boolean aH;
-    private boolean aN;
-    private boolean aZ;
-    private boolean aV;
-    private boolean aS;
-    private int cyclesConsumed;
-    private int[] sram = new int[RAM_SIZE];
-
-    public void visit(CPC i) {
-        nextPC = pc + 2;
-        int tmp0 = getRegisterByte(i.r1);
-        int tmp1 = getRegisterByte(i.r2);
-        int tmp2 = bit(aC);
-        int tmp3 = tmp0 - tmp1 - tmp2;
-        boolean tmp4 = ((tmp0 & 128) != 0);
-        boolean tmp5 = ((tmp1 & 128) != 0);
-        boolean tmp6 = ((tmp3 & 128) != 0);
-        boolean tmp7 = ((tmp0 & 8) != 0);
-        boolean tmp8 = ((tmp1 & 8) != 0);
-        boolean tmp9 = ((tmp3 & 8) != 0);
-        aH = !tmp7 && tmp8 || tmp8 && tmp9 || tmp9 && !tmp7;
-        aC = !tmp4 && tmp5 || tmp5 && tmp6 || tmp6 && !tmp4;
-        aN = tmp6;
-        aZ = low(tmp3) == 0 && aZ;
-        aV = tmp4 && !tmp5 && !tmp6 || !tmp4 && tmp5 && tmp6;
-        aS = (aN != aV);
-        cyclesConsumed++;
-    }
-
-    public int getRegisterByte(Register r1) {
-        if ((r1.val % 10) == 0) {
-            return sram[r1.num];
-        }
-        return r1.val;
-    }
-
-    public int low(int tmp3) {
-        return tmp3 & 0x01;
-    }
-
-    public int bit(boolean c2) {
-        return c2 ? 1 : 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(10, test(10));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(20, test(20));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(38, test(40));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class DeadCode01 {
-
-    public static int test(int a) {
-        int arg = a;
-        int p = arg;
-        if (p > 2) {
-            p += 1;
-            arg += 10;
-        } else {
-            p += 2;
-            arg += 20;
-            if (p > 3) {
-                p += 1;
-                arg += 10;
-                if (p > 4) {
-                    p += 1;
-                    arg += 10;
-                } else {
-                    p += 2;
-                    arg += 20;
-                }
-            } else {
-                p += 2;
-                arg += 20;
-            }
-        }
-        return p;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(5, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(6, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(7, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/DeadCode02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class DeadCode02 {
-
-    public static int test() {
-        int i = 0;
-        while (true) {
-            i++;
-            if (test2()) {
-                break;
-            }
-        }
-        return i;
-    }
-
-    public static boolean test2() {
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Cast01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Fold_Cast01 {
-
-    static final Object object = new Fold_Cast01();
-
-    int field = 9;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return ((Fold_Cast01) object).field;
-        }
-        if (arg == 1) {
-            Object obj = new Fold_Cast01();
-            return ((Fold_Cast01) obj).field;
-        }
-        if (arg == 2) {
-            return ((Fold_Cast01) null).field;
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(9, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(9, test(1));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Fold_Convert01 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return i2b();
-        }
-        if (arg == 1) {
-            return i2s();
-        }
-        if (arg == 2) {
-            return i2c();
-        }
-        return 0;
-    }
-
-    public static int i2b() {
-        int x = 0x00000080;
-        return (byte) x;
-    }
-
-    public static int i2s() {
-        int x = 0x00008000;
-        return (short) x;
-    }
-
-    public static int i2c() {
-        int x = 0xffffffff;
-        return (char) x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-128, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-32768, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(65535, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Fold_Convert02 {
-    public static long test(long arg) {
-        if (arg == 0) {
-            return i2l();
-        }
-        if (arg == 1) {
-            return f2l();
-        }
-        if (arg == 2) {
-            return d2l();
-        }
-        return  0;
-    }
-    public static long i2l() {
-        int x = 0x80000000;
-        return x;
-    }
-    public static long f2l() {
-        float x = -33.1f;
-        return (long) x;
-    }
-    public static long d2l() {
-        double x = -78.1d;
-        return (long) x;
-    }
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(-2147483648L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-33L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-78L, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of float conversions
- */
-public class Fold_Convert03 {
-
-    public static float test(float arg) {
-        if (arg == 0) {
-            return i2f();
-        }
-        if (arg == 1) {
-            return l2f();
-        }
-        if (arg == 2) {
-            return d2f();
-        }
-        return 0;
-    }
-
-    public static float i2f() {
-        int x = 1024;
-        return x;
-    }
-
-    public static float l2f() {
-        long x = -33;
-        return x;
-    }
-
-    public static float d2f() {
-        double x = -78.1d;
-        return (float) x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1024f, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-33f, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(-78.1f, test(2), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Convert04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of float conversions
- */
-public class Fold_Convert04 {
-
-    public static double test(double arg) {
-        if (arg == 0) {
-            return l2d();
-        }
-        if (arg == 1) {
-            return f2d();
-        }
-        return 0;
-    }
-
-    public static double l2d() {
-        long x = 1024;
-        return x;
-    }
-
-    public static double f2d() {
-        float x = -1.25f;
-        return x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1024d, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(-1.25d, test(1), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of float operations.
- */
-public class Fold_Double01 {
-
-    public static double test(double arg) {
-        if (arg == 0) {
-            return add();
-        }
-        if (arg == 1) {
-            return sub();
-        }
-        if (arg == 2) {
-            return mul();
-        }
-        if (arg == 3) {
-            return div();
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        return 0;
-    }
-
-    public static double add() {
-        double x = 3;
-        return x + 7;
-    }
-
-    public static double sub() {
-        double x = 15;
-        return x - 4;
-    }
-
-    public static double mul() {
-        double x = 6;
-        return x * 2;
-    }
-
-    public static double div() {
-        double x = 26;
-        return x / 2;
-    }
-
-    public static double mod() {
-        double x = 29;
-        return x % 15;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10d, test(0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11d, test(1d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12d, test(2d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13d, test(3d), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14d, test(4d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer comparisons.
- */
-public class Fold_Double02 {
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return equ();
-        }
-        if (arg == 1) {
-            return neq();
-        }
-        if (arg == 2) {
-            return geq();
-        }
-        if (arg == 3) {
-            return ge();
-        }
-        if (arg == 4) {
-            return ltq();
-        }
-        if (arg == 5) {
-            return lt();
-        }
-        return false;
-    }
-
-    static boolean equ() {
-        double x = 34;
-        return x == 34;
-    }
-
-    static boolean neq() {
-        double x = 34;
-        return x != 33;
-    }
-
-    static boolean geq() {
-        double x = 34;
-        return x >= 33;
-    }
-
-    static boolean ge() {
-        double x = 34;
-        return x > 35;
-    }
-
-    static boolean ltq() {
-        double x = 34;
-        return x <= 32;
-    }
-
-    static boolean lt() {
-        double x = 34;
-        return x < 31;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Double03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Fold_Double03 {
-
-    private static final double MINUS_ZERO = 1 / Double.NEGATIVE_INFINITY;
-
-    public static double test(int t, double a) {
-        double v;
-        if (t == 0) {
-            v = a * 0.0;
-        } else {
-            v = a * MINUS_ZERO;
-        }
-        return 1 / v;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(0, 5.0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(1, 5.0), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(java.lang.Double.NEGATIVE_INFINITY, test(0, -5.0), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(java.lang.Double.POSITIVE_INFINITY, test(1, -5.0), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of float operations.
- */
-public class Fold_Float01 {
-
-    public static float test(float arg) {
-        if (arg == 0) {
-            return add();
-        }
-        if (arg == 1) {
-            return sub();
-        }
-        if (arg == 2) {
-            return mul();
-        }
-        if (arg == 3) {
-            return div();
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        return 0;
-    }
-
-    public static float add() {
-        float x = 3;
-        return x + 7;
-    }
-
-    public static float sub() {
-        float x = 15;
-        return x - 4;
-    }
-
-    public static float mul() {
-        float x = 6;
-        return x * 2;
-    }
-
-    public static float div() {
-        float x = 26;
-        return x / 2;
-    }
-
-    public static float mod() {
-        float x = 29;
-        return x % 15;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10f, test(0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11f, test(1f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12f, test(2f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13f, test(3f), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14f, test(4f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Float02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer comparisons.
- */
-public class Fold_Float02 {
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return equ();
-        }
-        if (arg == 1) {
-            return neq();
-        }
-        if (arg == 2) {
-            return geq();
-        }
-        if (arg == 3) {
-            return ge();
-        }
-        if (arg == 4) {
-            return ltq();
-        }
-        if (arg == 5) {
-            return lt();
-        }
-        return false;
-    }
-
-    static boolean equ() {
-        float x = 34;
-        return x == 34;
-    }
-
-    static boolean neq() {
-        float x = 34;
-        return x != 33;
-    }
-
-    static boolean geq() {
-        float x = 34;
-        return x >= 33;
-    }
-
-    static boolean ge() {
-        float x = 34;
-        return x > 35;
-    }
-
-    static boolean ltq() {
-        float x = 34;
-        return x <= 32;
-    }
-
-    static boolean lt() {
-        float x = 34;
-        return x < 31;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_InstanceOf01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Fold_InstanceOf01 {
-
-    static final Object object = new Fold_InstanceOf01();
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return object instanceof Fold_InstanceOf01;
-        }
-        if (arg == 1) {
-            Object obj = new Fold_InstanceOf01();
-            return obj instanceof Fold_InstanceOf01;
-        }
-        if (arg == 2) {
-            return null instanceof Fold_InstanceOf01;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Fold_Int01 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return add();
-        }
-        if (arg == 1) {
-            return sub();
-        }
-        if (arg == 2) {
-            return mul();
-        }
-        if (arg == 3) {
-            return div();
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        if (arg == 5) {
-            return and();
-        }
-        if (arg == 6) {
-            return or();
-        }
-        if (arg == 7) {
-            return xor();
-        }
-        return 0;
-    }
-
-    public static int add() {
-        int x = 3;
-        return x + 7;
-    }
-
-    public static int sub() {
-        int x = 15;
-        return x - 4;
-    }
-
-    public static int mul() {
-        int x = 6;
-        return x * 2;
-    }
-
-    public static int div() {
-        int x = 26;
-        return x / 2;
-    }
-
-    public static int mod() {
-        int x = 29;
-        return x % 15;
-    }
-
-    public static int and() {
-        int x = 31;
-        return x & 15;
-    }
-
-    public static int or() {
-        int x = 16;
-        return x | 16;
-    }
-
-    public static int xor() {
-        int x = 0;
-        return x ^ 17;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(17, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Int02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer comparisons.
- */
-public class Fold_Int02 {
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return equ();
-        }
-        if (arg == 1) {
-            return neq();
-        }
-        if (arg == 2) {
-            return geq();
-        }
-        if (arg == 3) {
-            return ge();
-        }
-        if (arg == 4) {
-            return ltq();
-        }
-        if (arg == 5) {
-            return lt();
-        }
-        return false;
-    }
-
-    static boolean equ() {
-        int x = 34;
-        return x == 34;
-    }
-
-    static boolean neq() {
-        int x = 34;
-        return x != 33;
-    }
-
-    static boolean geq() {
-        int x = 34;
-        return x >= 33;
-    }
-
-    static boolean ge() {
-        int x = 34;
-        return x > 35;
-    }
-
-    static boolean ltq() {
-        int x = 34;
-        return x <= 32;
-    }
-
-    static boolean lt() {
-        int x = 34;
-        return x < 31;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Fold_Long01 {
-
-    public static long test(long arg) {
-        if (arg == 0) {
-            return add();
-        }
-        if (arg == 1) {
-            return sub();
-        }
-        if (arg == 2) {
-            return mul();
-        }
-        if (arg == 3) {
-            return div();
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        if (arg == 5) {
-            return and();
-        }
-        if (arg == 6) {
-            return or();
-        }
-        if (arg == 7) {
-            return xor();
-        }
-        return 0;
-    }
-
-    public static long add() {
-        long x = 3;
-        return x + 7;
-    }
-
-    public static long sub() {
-        long x = 15;
-        return x - 4;
-    }
-
-    public static long mul() {
-        long x = 6;
-        return x * 2;
-    }
-
-    public static long div() {
-        long x = 26;
-        return x / 2;
-    }
-
-    public static long mod() {
-        long x = 29;
-        return x % 15;
-    }
-
-    public static long and() {
-        long x = 31;
-        return x & 15;
-    }
-
-    public static long or() {
-        long x = 16;
-        return x | 16;
-    }
-
-    public static long xor() {
-        long x = 0;
-        return x ^ 17;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14L, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15L, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16L, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(17L, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Long02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer comparisons.
- */
-public class Fold_Long02 {
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return equ();
-        }
-        if (arg == 1) {
-            return neq();
-        }
-        if (arg == 2) {
-            return geq();
-        }
-        if (arg == 3) {
-            return ge();
-        }
-        if (arg == 4) {
-            return ltq();
-        }
-        if (arg == 5) {
-            return lt();
-        }
-        return false;
-    }
-
-    static boolean equ() {
-        long x = 34;
-        return x == 34;
-    }
-
-    static boolean neq() {
-        long x = 34;
-        return x != 33;
-    }
-
-    static boolean geq() {
-        long x = 34;
-        return x >= 33;
-    }
-
-    static boolean ge() {
-        long x = 34;
-        return x > 35;
-    }
-
-    static boolean ltq() {
-        long x = 34;
-        return x <= 32;
-    }
-
-    static boolean lt() {
-        long x = 34;
-        return x < 31;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(false, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Fold_Math01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Fold_Math01 {
-
-    public static double test(int arg) {
-        switch (arg) {
-            case 0:
-                return abs();
-            case 1:
-                return sin();
-            case 2:
-                return cos();
-            case 3:
-                return tan();
-            case 4:
-                return atan2();
-            case 5:
-                return sqrt();
-            case 6:
-                return log();
-            case 7:
-                return log10();
-            case 8:
-                return pow();
-            case 9:
-                return exp();
-            case 10:
-                return min();
-            case 11:
-                return max();
-        }
-        return 42;
-    }
-
-    private static double abs() {
-        return Math.abs(-10.0d);
-    }
-
-    private static double sin() {
-        return Math.sin(0.15d);
-    }
-
-    private static double cos() {
-        return Math.cos(0.15d);
-    }
-
-    private static double tan() {
-        return Math.tan(0.15d);
-    }
-
-    private static double atan2() {
-        return Math.atan2(0.15d, 3.1d);
-    }
-
-    private static double sqrt() {
-        return Math.sqrt(144d);
-    }
-
-    private static double log() {
-        return Math.log(3.15d);
-    }
-
-    private static double log10() {
-        return Math.log10(0.15d);
-    }
-
-    private static double pow() {
-        return Math.pow(2.15d, 6.1d);
-    }
-
-    private static double exp() {
-        return Math.log(3.15d);
-    }
-
-    private static int min() {
-        return Math.min(2, -1);
-    }
-
-    private static int max() {
-        return Math.max(2, -1);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10d, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0.14943813247359922d, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(0.9887710779360422d, test(2), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(0.15113521805829508d, test(3), 0);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0.04834938665190287d, test(4), 0);
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(12.0d, test(5), 0);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(1.1474024528375417d, test(6), 0);
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(-0.8239087409443188d, test(7), 0);
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(106.62882057436371d, test(8), 0);
-    }
-
-    @Test
-    public void run9() throws Throwable {
-        Assert.assertEquals(1.1474024528375417d, test(9), 0);
-    }
-
-    @Test
-    public void run10() throws Throwable {
-        Assert.assertEquals(-1.0d, test(10), 0);
-    }
-
-    @Test
-    public void run11() throws Throwable {
-        Assert.assertEquals(2.0d, test(11), 0);
-    }
-
-    @Test
-    public void run12() throws Throwable {
-        Assert.assertEquals(42d, test(12), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Inline01 {
-
-    public static int test(int arg) {
-        return arg + nobranch(true) + nobranch(false) + nobranch(true) + nobranch(false);
-    }
-
-    static int nobranch(boolean f) {
-        if (f) {
-            return 0;
-        }
-        return 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(3, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Inline02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Inline02 {
-
-    public static int test(int arg) {
-        return arg + nobranch(true, arg) + nobranch(false, arg) + nobranch(true, arg) + nobranch(false, arg);
-    }
-
-    static int nobranch(boolean f, int v) {
-        if (f) {
-            return v;
-        }
-        return 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(2, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(5, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(8, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/LLE_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Test case for local load elimination. It makes sure that the second field store is not eliminated, because
- * it is recognized that the first store changes the field "field1", so it is no longer guaranteed that it
- * has its default value 0.
- */
-public class LLE_01 {
-
-    int field1;
-
-    public static int test() {
-        LLE_01 o = new LLE_01();
-        o.field1 = 1;
-        o.field1 = 0;
-        return o.field1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/List_reorder_bug.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("unused")
-public class List_reorder_bug {
-
-    static class List {
-
-        List(int id) {
-            this.id = id;
-        }
-
-        List next;
-        int id;
-        boolean bool = true;
-    }
-
-    private static List list;
-
-    public static boolean test(int i) {
-        list = new List(5);
-        list.next = new List(6);
-        new List_reorder_bug().match(new Object(), 27, 6, 0);
-        return list.next == null;
-    }
-
-    private void match(Object a, int src, int id, int seq) {
-        print("match: " + src + ", " + id);
-        List item = list;
-        List itemPrev = null;
-        while (item != null) {
-            if (item.id == id) {
-                if (item.bool) {
-                    outcall(item.id);
-                }
-                if (itemPrev != null) {
-                    itemPrev.next = item.next;
-                } else {
-                    list = item.next;
-                }
-
-                item.next = null;
-                return;
-            }
-
-            itemPrev = item;
-            item = item.next;
-        }
-    }
-
-    static int globalId;
-
-    private static void outcall(int id) {
-        globalId = id;
-    }
-
-    String s;
-
-    private void print(String s2) {
-        this.s = s2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Test case for null check elimination.
- */
-public class NCE_01 {
-
-    public static NCE_01 object = new NCE_01();
-
-    int field1 = 22;
-    int field2 = 23;
-
-    public static int test() {
-        NCE_01 o = object;
-        int i = o.field1;
-        // expected null check elimination here
-        return o.field2 + i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(45, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Test case for null check elimination.
- */
-public class NCE_02 {
-
-    public static NCE_02 object = new NCE_02();
-
-    int field1;
-    int field2 = 23;
-
-    public static int test() {
-        NCE_02 o = object;
-        o.field1 = 11;
-        // expect non-null
-        o.field1 = 22;
-        // expect non-null
-        return o.field2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(23, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Test case for null check elimination.
- */
-public class NCE_03 {
-
-    private static boolean cond = true;
-    public static NCE_03 object = new NCE_03();
-
-    int field1;
-    int field2 = 23;
-
-    public static int test() {
-        NCE_03 o = object;
-        o.field1 = 11;
-        if (cond) {
-            // expect non-null
-            o.field1 = 22;
-        }
-        // expect non-null
-        return o.field2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(23, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Test case for null check elimination.
- */
-public class NCE_04 {
-
-    private static boolean cond = true;
-    public static NCE_04 object = new NCE_04();
-
-    int field1;
-    int field2 = 23;
-
-    public static int test() {
-        NCE_04 o = object;
-        if (cond) {
-            o.field1 = 22;
-        } else {
-            o.field1 = 11;
-        }
-        // expect non-null
-        return o.field2;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(23, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class NCE_FlowSensitive01 {
-
-    public static String test(String arg) {
-        if (arg != null) {
-            return arg.toString();
-        }
-        return null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("x", test("x"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("yay", test("yay"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class NCE_FlowSensitive02 {
-
-    @SuppressWarnings("all")
-    public static String test(String arg) {
-        if (arg != null) {
-            return arg.toString();
-        }
-        return arg.toString();
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run0() throws Throwable {
-        test(null);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("x", test("x"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("yay", test("yay"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive03.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class NCE_FlowSensitive03 {
-
-    public static String test(String arg) {
-        if ("x".equals(arg)) {
-            if (arg == null) {
-                return "null";
-            }
-        } else {
-            if (arg == null) {
-                return "null";
-            }
-        }
-        // arg cannot be null here
-        return arg.toString();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("null", test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("x", test("x"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("yay", test("yay"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive04.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class NCE_FlowSensitive04 {
-
-    public static String test(String arg2) {
-        String arg = arg2;
-        if (arg == null) {
-            arg = "null";
-        }
-        // arg cannot be null here
-        return arg.toString();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("null", test(null));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("x", test("x"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("yay", test("yay"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/NCE_FlowSensitive05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class NCE_FlowSensitive05 {
-
-    public static String test(Object arg) {
-
-        // An artificial loop to trigger iterative NCE.
-        while (arg != null) {
-            System.out.println(arg);
-        }
-
-        // The upcast must still include the null check.
-        return (String) arg;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(null, test(null));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_byte01 {
-
-    public static byte val;
-
-    public static byte test(byte b) {
-        val = b;
-        return val;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 0), test(((byte) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 1), test(((byte) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) -1), test(((byte) -1)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((byte) 110), test(((byte) 110)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_byte02 {
-
-    static class Byte {
-
-        byte foo;
-    }
-
-    static Byte val = new Byte();
-
-    public static byte test(byte b) {
-        val.foo = b;
-        return val.foo;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 0), test(((byte) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 1), test(((byte) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) -1), test(((byte) -1)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((byte) 110), test(((byte) 110)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_byte03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_byte03 {
-
-    static byte[] val = new byte[4];
-
-    public static byte test(byte b) {
-        val[0] = b;
-        return val[0];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 0), test(((byte) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 1), test(((byte) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) -1), test(((byte) -1)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((byte) 110), test(((byte) 110)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_char01 {
-
-    public static char val;
-
-    public static char test(char b) {
-        val = b;
-        return val;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 0), test(((char) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 1), test(((char) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 255), test(((char) 255)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((char) 65000), test(((char) 65000)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_char02 {
-
-    static class Char {
-
-        char foo;
-    }
-
-    static Char val = new Char();
-
-    public static char test(char b) {
-        val.foo = b;
-        return val.foo;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 0), test(((char) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 1), test(((char) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 255), test(((char) 255)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((char) 65000), test(((char) 65000)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_char03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_char03 {
-
-    static char[] val = new char[4];
-
-    public static char test(char b) {
-        val[0] = b;
-        return val[0];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 0), test(((char) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 1), test(((char) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 255), test(((char) 255)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((char) 65000), test(((char) 65000)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_short01 {
-
-    public static short val;
-
-    public static short test(short b) {
-        val = b;
-        return val;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 0), test(((short) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) 1), test(((short) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) -1), test(((short) -1)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((short) 23110), test(((short) 23110)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_short02 {
-
-    static class Short {
-
-        short foo;
-    }
-
-    static Short val = new Short();
-
-    public static short test(short b) {
-        val.foo = b;
-        return val.foo;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 0), test(((short) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) 1), test(((short) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) -1), test(((short) -1)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((short) 23110), test(((short) 23110)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Narrow_short03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Narrow_short03 {
-
-    static short[] val = new short[4];
-
-    public static short test(short b) {
-        val[0] = b;
-        return val[0];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 0), test(((short) 0)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) 1), test(((short) 1)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) -1), test(((short) -1)));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(((short) 23110), test(((short) 23110)));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Phi01 {
-
-    public static class Phi {
-
-        int f;
-
-        Phi(int f) {
-            this.f = f;
-        }
-    }
-
-    public static int test(int arg) {
-        return test2(new Phi(arg), arg);
-    }
-
-// @NEVER_INLINE
-    private static int test2(Phi p, int a) {
-        int arg = a;
-        if (arg > 2) {
-            p.f += 1;
-            arg += 1;
-        } else {
-            p.f += 2;
-            arg += 2;
-            if (arg > 3) {
-                p.f += 1;
-                arg += 1;
-                if (arg > 4) {
-                    p.f += 1;
-                    arg += 1;
-                } else {
-                    p.f += 2;
-                    arg += 2;
-                }
-            } else {
-                p.f += 2;
-                arg += 2;
-            }
-        }
-        return arg + p.f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(8, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(10, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(8, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(10, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(14, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Phi02 {
-
-    public static class Phi {
-
-        int f;
-
-        Phi(int f) {
-            this.f = f;
-        }
-    }
-
-    public static int test(int arg) {
-        return test2(new Phi(arg), arg);
-    }
-
-// @NEVER_INLINE
-    private static int test2(Phi p, int a) {
-        int arg = a;
-        if (arg > 2) {
-            inc(p, 1);
-            arg += 1;
-        } else {
-            inc(p, 2);
-            arg += 2;
-            if (arg > 3) {
-                inc(p, 1);
-                arg += 1;
-                if (arg > 4) {
-                    inc(p, 1);
-                    arg += 1;
-                } else {
-                    inc(p, 2);
-                    arg += 2;
-                }
-            } else {
-                inc(p, 2);
-                arg += 2;
-            }
-        }
-        return arg + p.f;
-    }
-
-// @NEVER_INLINE
-    private static void inc(Phi p, int inc) {
-        p.f += inc;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(8, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(10, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(8, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(10, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(14, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Phi03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class Phi03 {
-
-    public static class Phi {
-
-        int f;
-
-        Phi(int f) {
-            this.f = f;
-        }
-    }
-
-    public static int test(int arg) {
-        return test2(new Phi(arg), arg);
-    }
-
-// @NEVER_INLINE
-    private static int test2(Phi p, int a) {
-        int arg = a;
-        if (arg > 2) {
-            inc(p, 1);
-            arg += 1;
-        } else {
-            inc(p, 2);
-            arg += 2;
-            if (arg > 3) {
-                inc(p, 1);
-                arg += 1;
-                if (arg > 4) {
-                    inc(p, 1);
-                    arg += 1;
-                } else {
-                    inc(p, 2);
-                    arg += 2;
-                }
-            } else {
-                inc(p, 2);
-                arg += 2;
-            }
-        }
-        return p.f;
-    }
-
-// @NEVER_INLINE
-    private static void inc(Phi p, int inc) {
-        p.f += inc;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(4, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(5, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(6, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(4, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(5, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(7, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Convert01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization integer conversions.
- */
-public class Reduce_Convert01 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return i2b(arg + 10);
-        }
-        if (arg == 1) {
-            return i2s(arg + 10);
-        }
-        if (arg == 2) {
-            return i2c(arg + 10);
-        }
-        return 0;
-    }
-
-    public static int i2b(int arg) {
-        int x = (byte) arg;
-        return (byte) x;
-    }
-
-    public static int i2s(int arg) {
-        int x = (short) arg;
-        return (short) x;
-    }
-
-    public static int i2c(int arg) {
-        int x = (char) arg;
-        return (char) x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Double01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of double operations.
- */
-public class Reduce_Double01 {
-
-    public static double test(double arg) {
-        if (arg == 0) {
-            return add(10);
-        }
-        if (arg == 1) {
-            return sub(11);
-        }
-        if (arg == 2) {
-            return mul(12);
-        }
-        if (arg == 3) {
-            return div(13);
-        }
-        return 0;
-    }
-
-    public static double add(double x) {
-        return x + 0;
-    }
-
-    public static double sub(double x) {
-        return x - 0;
-    }
-
-    public static double mul(double x) {
-        return x * 1;
-    }
-
-    public static double div(double x) {
-        return x / 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10d, test(0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11d, test(1d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12d, test(2d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13d, test(3d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Float01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of float operations.
- */
-public class Reduce_Float01 {
-
-    public static float test(float arg) {
-        if (arg == 0) {
-            return add(10);
-        }
-        if (arg == 1) {
-            return sub(11);
-        }
-        if (arg == 2) {
-            return mul(12);
-        }
-        if (arg == 3) {
-            return div(13);
-        }
-        return 0;
-    }
-
-    public static float add(float x) {
-        return x + 0;
-    }
-
-    public static float sub(float x) {
-        return x - 0;
-    }
-
-    public static float mul(float x) {
-        return x * 1;
-    }
-
-    public static float div(float x) {
-        return x / 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10f, test(0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11f, test(1f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12f, test(2f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13f, test(3f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Int01 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return add(10);
-        }
-        if (arg == 1) {
-            return sub(11);
-        }
-        if (arg == 2) {
-            return mul(12);
-        }
-        if (arg == 3) {
-            return div(13);
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        if (arg == 5) {
-            return and(15);
-        }
-        if (arg == 6) {
-            return or(16);
-        }
-        if (arg == 7) {
-            return xor(17);
-        }
-        return 0;
-    }
-
-    public static int add(int x) {
-        return x + 0;
-    }
-
-    public static int sub(int x) {
-        return x - 0;
-    }
-
-    public static int mul(int x) {
-        return x * 1;
-    }
-
-    public static int div(int x) {
-        return x / 1;
-    }
-
-    public static int mod() {
-        return 14;
-    }
-
-    public static int and(int x) {
-        return x & -1;
-    }
-
-    public static int or(int x) {
-        return x | 0;
-    }
-
-    public static int xor(int x) {
-        return x ^ 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(17, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Int02 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return add(10);
-        }
-        if (arg == 1) {
-            return sub();
-        }
-        if (arg == 2) {
-            return mul(12);
-        }
-        if (arg == 3) {
-            return div();
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        if (arg == 5) {
-            return and(15);
-        }
-        if (arg == 6) {
-            return or(16);
-        }
-        if (arg == 7) {
-            return xor(17);
-        }
-        return 0;
-    }
-
-    public static int add(int x) {
-        return 0 + x;
-    }
-
-    public static int sub() {
-        return 11;
-    }
-
-    public static int mul(int x) {
-        return 1 * x;
-    }
-
-    public static int div() {
-        return 13;
-    }
-
-    public static int mod() {
-        return 14;
-    }
-
-    public static int and(int x) {
-        return -1 & x;
-    }
-
-    public static int or(int x) {
-        return 0 | x;
-    }
-
-    public static int xor(int x) {
-        return 0 ^ x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(17, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Int03 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return add(5);
-        }
-        if (arg == 1) {
-            return sub(10);
-        }
-        if (arg == 2) {
-            return mul(5);
-        }
-        if (arg == 3) {
-            return div(5);
-        }
-        if (arg == 4) {
-            return mod(5);
-        }
-        if (arg == 5) {
-            return and(15);
-        }
-        if (arg == 6) {
-            return or(16);
-        }
-        if (arg == 7) {
-            return xor(17);
-        }
-        return 0;
-    }
-
-    public static int add(int x) {
-        return x + x;
-    }
-
-    public static int sub(int x) {
-        return x - x;
-    }
-
-    public static int mul(int x) {
-        return x * x;
-    }
-
-    public static int div(int x) {
-        return x / x;
-    }
-
-    public static int mod(int x) {
-        return x % x;
-    }
-
-    public static int and(int x) {
-        return x & x;
-    }
-
-    public static int or(int x) {
-        return x | x;
-    }
-
-    public static int xor(int x) {
-        return x ^ x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(25, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Int04.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Int04 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return mul0(arg + 10);
-        }
-        if (arg == 1) {
-            return mul1(arg + 9);
-        }
-        return 0;
-    }
-
-    public static int mul0(int x) {
-        return x * 4;
-    }
-
-    public static int mul1(int x) {
-        return x * 65536;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(40, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(655360, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of integer operations.
- */
-public class Reduce_IntShift01 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return shift0(arg + 10);
-        }
-        if (arg == 1) {
-            return shift1(arg + 10);
-        }
-        if (arg == 2) {
-            return shift2(arg + 10);
-        }
-        if (arg == 3) {
-            return shift3(arg + 10);
-        }
-        if (arg == 4) {
-            return shift4(arg + 10);
-        }
-        if (arg == 5) {
-            return shift5(arg + 10);
-        }
-        return 0;
-    }
-
-    public static int shift0(int x) {
-        return x >> 0;
-    }
-
-    public static int shift1(int x) {
-        return x >>> 0;
-    }
-
-    public static int shift2(int x) {
-        return x << 0;
-    }
-
-    public static int shift3(int x) {
-        return x >> 64;
-    }
-
-    public static int shift4(int x) {
-        return x >>> 64;
-    }
-
-    public static int shift5(int x) {
-        return x << 64;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_IntShift02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of integer operations.
- */
-public class Reduce_IntShift02 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return shift0(arg + 80);
-        }
-        if (arg == 1) {
-            return shift1(arg + 0x8000000a);
-        }
-        if (arg == 2) {
-            return shift2(arg + 192);
-        }
-        if (arg == 3) {
-            return shift3(arg + 208);
-        }
-        if (arg == 4) {
-            return shift4(arg);
-        }
-        if (arg == 5) {
-            return shift5(arg);
-        }
-        return 0;
-    }
-
-    public static int shift0(int x) {
-        return x >>> 3 << 3;
-    }
-
-    public static int shift1(int x) {
-        return x << 3 >>> 3;
-    }
-
-    public static int shift2(int x) {
-        return x >> 3 >> 1;
-    }
-
-    public static int shift3(int x) {
-        return x >>> 3 >>> 1;
-    }
-
-    public static int shift4(int x) {
-        return x << 3 << 1;
-    }
-
-    public static int shift5(int x) {
-        return x << 16 << 17;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(80, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(64, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(0, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Long01 {
-
-    public static long test(long arg) {
-        if (arg == 0) {
-            return add(10);
-        }
-        if (arg == 1) {
-            return sub(11);
-        }
-        if (arg == 2) {
-            return mul(12);
-        }
-        if (arg == 3) {
-            return div(13);
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        if (arg == 5) {
-            return and(15);
-        }
-        if (arg == 6) {
-            return or(16);
-        }
-        if (arg == 7) {
-            return xor(17);
-        }
-        return 0;
-    }
-
-    public static long add(long x) {
-        return x + 0;
-    }
-
-    public static long sub(long x) {
-        return x - 0;
-    }
-
-    public static long mul(long x) {
-        return x * 1;
-    }
-
-    public static long div(long x) {
-        return x / 1;
-    }
-
-    public static long mod() {
-        return 14;
-    }
-
-    public static long and(long x) {
-        return x & -1;
-    }
-
-    public static long or(long x) {
-        return x | 0;
-    }
-
-    public static long xor(long x) {
-        return x ^ 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14L, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15L, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16L, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(17L, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Long02 {
-
-    public static long test(long arg) {
-        if (arg == 0) {
-            return add(10);
-        }
-        if (arg == 1) {
-            return sub();
-        }
-        if (arg == 2) {
-            return mul(12);
-        }
-        if (arg == 3) {
-            return div();
-        }
-        if (arg == 4) {
-            return mod();
-        }
-        if (arg == 5) {
-            return and(15);
-        }
-        if (arg == 6) {
-            return or(16);
-        }
-        if (arg == 7) {
-            return xor(17);
-        }
-        return 0;
-    }
-
-    public static long add(long x) {
-        return 0 + x;
-    }
-
-    public static long sub() {
-        return 11;
-    }
-
-    public static long mul(long x) {
-        return 1 * x;
-    }
-
-    public static long div() {
-        return 13;
-    }
-
-    public static long mod() {
-        return 14;
-    }
-
-    public static long and(long x) {
-        return -1 & x;
-    }
-
-    public static long or(long x) {
-        return 0 | x;
-    }
-
-    public static long xor(long x) {
-        return 0 ^ x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14L, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15L, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16L, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(17L, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Long03 {
-
-    public static long test(long arg) {
-        if (arg == 0) {
-            return add(5);
-        }
-        if (arg == 1) {
-            return sub(10);
-        }
-        if (arg == 2) {
-            return mul(5);
-        }
-        if (arg == 3) {
-            return div(5);
-        }
-        if (arg == 4) {
-            return mod(5);
-        }
-        if (arg == 5) {
-            return and(15);
-        }
-        if (arg == 6) {
-            return or(16);
-        }
-        if (arg == 7) {
-            return xor(17);
-        }
-        return 0;
-    }
-
-    public static long add(long x) {
-        return x + x;
-    }
-
-    public static long sub(long x) {
-        return x - x;
-    }
-
-    public static long mul(long x) {
-        return x * x;
-    }
-
-    public static long div(long x) {
-        return x / x;
-    }
-
-    public static long mod(long x) {
-        return x % x;
-    }
-
-    public static long and(long x) {
-        return x & x;
-    }
-
-    public static long or(long x) {
-        return x | x;
-    }
-
-    public static long xor(long x) {
-        return x ^ x;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(25L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0L, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15L, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(16L, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0L, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_Long04.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class Reduce_Long04 {
-
-    public static long test(long arg) {
-        if (arg == 0) {
-            return mul0(arg + 10);
-        }
-        if (arg == 1) {
-            return mul1(arg + 9);
-        }
-        return 0;
-    }
-
-    public static long mul0(long x) {
-        return x * 4;
-    }
-
-    public static long mul1(long x) {
-        return x * 8589934592L;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(40L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(85899345920L, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of integer operations.
- */
-public class Reduce_LongShift01 {
-
-    public static long test(long arg) {
-        if (arg == 0) {
-            return shift0(arg + 10);
-        }
-        if (arg == 1) {
-            return shift1(arg + 10);
-        }
-        if (arg == 2) {
-            return shift2(arg + 10);
-        }
-        if (arg == 3) {
-            return shift3(arg + 10);
-        }
-        if (arg == 4) {
-            return shift4(arg + 10);
-        }
-        if (arg == 5) {
-            return shift5(arg + 10);
-        }
-        return 0;
-    }
-
-    public static long shift0(long x) {
-        return x >> 0;
-    }
-
-    public static long shift1(long x) {
-        return x >>> 0;
-    }
-
-    public static long shift2(long x) {
-        return x << 0;
-    }
-
-    public static long shift3(long x) {
-        return x >> 64;
-    }
-
-    public static long shift4(long x) {
-        return x >>> 64;
-    }
-
-    public static long shift5(long x) {
-        return x << 64;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(14L, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(15L, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Reduce_LongShift02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of integer operations.
- */
-public class Reduce_LongShift02 {
-
-    public static long test(long arg) {
-        if (arg == 0) {
-            return shift0(arg + 80);
-        }
-        if (arg == 1) {
-            return shift1(arg + 0x800000000000000aL);
-        }
-        if (arg == 2) {
-            return shift2(arg + 192);
-        }
-        if (arg == 3) {
-            return shift3(arg + 208);
-        }
-        if (arg == 4) {
-            return shift4(arg);
-        }
-        return 0;
-    }
-
-    public static long shift0(long x) {
-        return x >>> 3 << 3;
-    }
-
-    public static long shift1(long x) {
-        return x << 3 >>> 3;
-    }
-
-    public static long shift2(long x) {
-        return x >> 3 >> 1;
-    }
-
-    public static long shift3(long x) {
-        return x >>> 3 >>> 1;
-    }
-
-    public static long shift4(long x) {
-        return x << 3 << 1;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(80L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(11L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(12L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(13L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(64L, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of switches.
- */
-public class Switch01 {
-
-    public static int test(int arg) {
-        switch (arg) {
-            default:
-                return 1;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of switches.
- */
-public class Switch02 {
-
-    public static int test(int arg) {
-        switch (arg) {
-            case 1:
-                return 2;
-            default:
-                return 1;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(1, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(2, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/TypeCastElem.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- */
-public class TypeCastElem {
-
-    interface Int1 {
-
-        int do1();
-    }
-
-    interface Int2 {
-
-        int do2();
-    }
-
-    interface Int3 extends Int1 {
-
-        int do3();
-    }
-
-    public static class ClassA implements Int1 {
-
-        private int a;
-
-        public ClassA(int a) {
-            this.a = a;
-        }
-
-        public int do1() {
-            return a;
-        }
-    }
-
-    public static class ClassB extends ClassA implements Int2 {
-
-        int b;
-
-        public ClassB(int a, int b) {
-            super(a);
-            this.b = b;
-        }
-
-        public int do2() {
-            return b;
-        }
-    }
-
-    public static class ClassC implements Int3 {
-
-        private int a;
-        private int b;
-
-        public ClassC(int a, int b) {
-            this.a = a;
-            this.b = b;
-        }
-
-        public int do3() {
-            return b;
-        }
-
-        public int do1() {
-            return a;
-        }
-
-    }
-
-    public static int test1(Object o) {
-        if (o instanceof ClassB) {
-            ClassB b = (ClassB) o;
-            if (o instanceof Int1) {
-                return b.b - b.b + 1;
-            }
-            return 7;
-        }
-        return 3;
-    }
-
-    public static int test2(Object o) {
-        Object b = o;
-        if (o instanceof ClassB) {
-            ClassA a = (ClassA) o;
-            if (b instanceof Int1) {
-                return ((Int1) a).do1();
-            }
-            return 7;
-        }
-        return 3;
-    }
-
-    public static int test3(Object o) {
-        Object b = o;
-        boolean t = o instanceof Int3;
-        if (t) {
-            Int1 a = (Int1) b;
-            return a.do1();
-        }
-        return 3;
-    }
-
-    public static int test(int a, int b, int c) {
-        ClassA ca = new ClassA(a);
-        ClassB cb = new ClassB(a, b);
-        ClassC cc = new ClassC(c, c);
-        int sum1 = test1(ca) + test1(cb) * 10 + test1(cc) * 100;
-        int sum2 = test2(ca) + test2(cb) * 10 + test2(cc) * 100;
-        int sum3 = test3(ca) + test3(cb) * 10 + test3(cc) * 100;
-        int result = sum1 * 5 + sum2 * 7 + sum3 * 9;
-        return result;
-    }
-
-    public static void main(String[] args) {
-        System.out.println(test(10, 13, 25));
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(27183, test(10, 13, 25));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class VN_Cast01 {
-
-    static final Object object = new VN_Cast01();
-
-    int field = 9;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return test1();
-        }
-        if (arg == 1) {
-            return test2();
-        }
-        if (arg == 2) {
-            return test3();
-        }
-        return 0;
-    }
-
-    private static int test1() {
-        Object o = object;
-        VN_Cast01 a = (VN_Cast01) o;
-        VN_Cast01 b = (VN_Cast01) o;
-        return a.field + b.field;
-    }
-
-    private static int test2() {
-        Object obj = new VN_Cast01();
-        VN_Cast01 a = (VN_Cast01) obj;
-        VN_Cast01 b = (VN_Cast01) obj;
-        return a.field + b.field;
-    }
-
-    @SuppressWarnings("all")
-    private static int test3() {
-        Object o = null;
-        VN_Cast01 a = (VN_Cast01) o;
-        VN_Cast01 b = (VN_Cast01) o;
-        return a.field + b.field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(18, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(18, test(1));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Cast02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class VN_Cast02 {
-
-    private static boolean cond = true;
-    static final Object object = new VN_Cast02();
-
-    int field = 9;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return test1();
-        }
-        if (arg == 1) {
-            return test2();
-        }
-        if (arg == 2) {
-            return test3();
-        }
-        return 0;
-    }
-
-    private static int test1() {
-        Object o = object;
-        VN_Cast02 a = (VN_Cast02) o;
-        if (cond) {
-            VN_Cast02 b = (VN_Cast02) o;
-            return a.field + b.field;
-        }
-        return 0;
-    }
-
-    private static int test2() {
-        Object obj = new VN_Cast02();
-        VN_Cast02 a = (VN_Cast02) obj;
-        if (cond) {
-            VN_Cast02 b = (VN_Cast02) obj;
-            return a.field + b.field;
-        }
-        return 0;
-    }
-
-    @SuppressWarnings("all")
-    private static int test3() {
-        Object o = null;
-        VN_Cast02 a = (VN_Cast02) o;
-        if (cond) {
-            VN_Cast02 b = (VN_Cast02) o;
-            return a.field + b.field;
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(18, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(18, test(1));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization integer conversions.
- */
-public class VN_Convert01 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return i2b(arg + 10);
-        }
-        if (arg == 1) {
-            return i2s(arg + 10);
-        }
-        if (arg == 2) {
-            return i2c(arg + 10);
-        }
-        return 0;
-    }
-
-    public static int i2b(int arg) {
-        int x = (byte) arg;
-        int y = (byte) arg;
-        return x + y;
-    }
-
-    public static int i2s(int arg) {
-        int x = (short) arg;
-        int y = (short) arg;
-        return x + y;
-    }
-
-    public static int i2c(int arg) {
-        int x = (char) arg;
-        int y = (char) arg;
-        return x + y;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(20, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(22, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(24, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Convert02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization integer conversions.
- */
-public class VN_Convert02 {
-
-    private static boolean cond = true;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return i2b(arg + 10);
-        }
-        if (arg == 1) {
-            return i2s(arg + 10);
-        }
-        if (arg == 2) {
-            return i2c(arg + 10);
-        }
-        return 0;
-    }
-
-    public static int i2b(int arg) {
-        int x = (byte) arg;
-        if (cond) {
-            int y = (byte) arg;
-            return x + y;
-        }
-        return 0;
-    }
-
-    public static int i2s(int arg) {
-        int x = (short) arg;
-        if (cond) {
-            int y = (short) arg;
-            return x + y;
-        }
-        return 0;
-    }
-
-    public static int i2c(int arg) {
-        int x = (char) arg;
-        if (cond) {
-            int y = (char) arg;
-            return x + y;
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(20, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(22, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(24, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of float operations.
- */
-public class VN_Double01 {
-
-    public static double test(double arg) {
-        if (arg == 0) {
-            return add(arg + 10);
-        }
-        if (arg == 1) {
-            return sub(arg + 10);
-        }
-        if (arg == 2) {
-            return mul(arg + 10);
-        }
-        if (arg == 3) {
-            return div(arg + 10);
-        }
-        return 0;
-    }
-
-    public static double add(double x) {
-        double c = 1;
-        double t = x + c;
-        double u = x + c;
-        return t + u;
-    }
-
-    public static double sub(double x) {
-        double c = 1;
-        double t = x - c;
-        double u = x - c;
-        return t - u;
-    }
-
-    public static double mul(double x) {
-        double c = 1;
-        double t = x * c;
-        double u = x * c;
-        return t * u;
-    }
-
-    public static double div(double x) {
-        double c = 1;
-        double t = x / c;
-        double u = x / c;
-        return t / u;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(22d, test(0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0d, test(1d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(144d, test(2d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1d, test(3d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Double02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of float operations.
- */
-public class VN_Double02 {
-
-    private static boolean cond = true;
-
-    public static double test(double arg) {
-        if (arg == 0) {
-            return add(arg + 10);
-        }
-        if (arg == 1) {
-            return sub(arg + 10);
-        }
-        if (arg == 2) {
-            return mul(arg + 10);
-        }
-        if (arg == 3) {
-            return div(arg + 10);
-        }
-        return 0;
-    }
-
-    public static double add(double x) {
-        double c = 1.0d;
-        double t = x + c;
-        if (cond) {
-            double u = x + c;
-            return t + u;
-        }
-        return 1;
-    }
-
-    public static double sub(double x) {
-        double c = 1.0d;
-        double t = x - c;
-        if (cond) {
-            double u = x - c;
-            return t - u;
-        }
-        return 1;
-    }
-
-    public static double mul(double x) {
-        double c = 1.0d;
-        double t = x * c;
-        if (cond) {
-            double u = x * c;
-            return t * u;
-        }
-        return 1.0d;
-    }
-
-    public static double div(double x) {
-        double c = 1.0d;
-        double t = x / c;
-        if (cond) {
-            double u = x / c;
-            return t / u;
-        }
-        return 1.0d;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(22d, test(0d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0d, test(1d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(144d, test(2d), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1d, test(3d), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class VN_Field01 {
-
-    static final VN_Field01 object = new VN_Field01();
-
-    int field = 9;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return test1();
-        }
-        if (arg == 1) {
-            return test2();
-        }
-        if (arg == 2) {
-            return test3();
-        }
-        return 0;
-    }
-
-    private static int test1() {
-        VN_Field01 a = object;
-        return a.field + a.field;
-    }
-
-    private static int test2() {
-        VN_Field01 a = object;
-        VN_Field01 b = object;
-        return a.field + b.field;
-    }
-
-    @SuppressWarnings("all")
-    private static int test3() {
-        VN_Field01 a = null;
-        VN_Field01 b = null;
-        return a.field + b.field;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(18, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(18, test(1));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Field02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests constant folding of integer operations.
- */
-public class VN_Field02 {
-
-    private static boolean cond = true;
-    static final VN_Field02 object = new VN_Field02();
-
-    int field = 9;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return test1();
-        }
-        if (arg == 1) {
-            return test2();
-        }
-        if (arg == 2) {
-            return test3();
-        }
-        return 0;
-    }
-
-    private static int test1() {
-        VN_Field02 a = object;
-        int c = a.field;
-        if (cond) {
-            return c + a.field;
-        }
-        return 0;
-    }
-
-    private static int test2() {
-        VN_Field02 a = object;
-        if (cond) {
-            VN_Field02 b = object;
-            return a.field + b.field;
-        }
-        return 0;
-    }
-
-    @SuppressWarnings("all")
-    private static int test3() {
-        VN_Field02 a = null;
-        if (cond) {
-            VN_Field02 b = null;
-            return a.field + b.field;
-        }
-        return 0;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(18, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(18, test(1));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of float operations.
- */
-public class VN_Float01 {
-
-    public static float test(float arg) {
-        if (arg == 0) {
-            return add(arg + 10);
-        }
-        if (arg == 1) {
-            return sub(arg + 10);
-        }
-        if (arg == 2) {
-            return mul(arg + 10);
-        }
-        if (arg == 3) {
-            return div(arg + 10);
-        }
-        return 0;
-    }
-
-    public static float add(float x) {
-        float c = 1;
-        float t = x + c;
-        float u = x + c;
-        return t + u;
-    }
-
-    public static float sub(float x) {
-        float c = 1;
-        float t = x - c;
-        float u = x - c;
-        return t - u;
-    }
-
-    public static float mul(float x) {
-        float c = 1;
-        float t = x * c;
-        float u = x * c;
-        return t * u;
-    }
-
-    public static float div(float x) {
-        float c = 1;
-        float t = x / c;
-        float u = x / c;
-        return t / u;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(22f, test(0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0f, test(1f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(144f, test(2f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1f, test(3f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Float02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of float operations.
- */
-public class VN_Float02 {
-
-    private static boolean cond = true;
-
-    public static float test(float arg) {
-        if (arg == 0) {
-            return add(arg + 10);
-        }
-        if (arg == 1) {
-            return sub(arg + 10);
-        }
-        if (arg == 2) {
-            return mul(arg + 10);
-        }
-        if (arg == 3) {
-            return div(arg + 10);
-        }
-        return 0;
-    }
-
-    public static float add(float x) {
-        float c = 1.0f;
-        float t = x + c;
-        if (cond) {
-            float u = x + c;
-            return t + u;
-        }
-        return 1.0f;
-    }
-
-    public static float sub(float x) {
-        float c = 1.0f;
-        float t = x - c;
-        if (cond) {
-            float u = x - c;
-            return t - u;
-        }
-        return 1.0f;
-    }
-
-    public static float mul(float x) {
-        float c = 1.0f;
-        float t = x * c;
-        if (cond) {
-            float u = x * c;
-            return t * u;
-        }
-        return 1.0f;
-    }
-
-    public static float div(float x) {
-        float c = 1.0f;
-        float t = x / c;
-        if (cond) {
-            float u = x / c;
-            return t / u;
-        }
-        return 1.0f;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(22f, test(0f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0f, test(1f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(144f, test(2f), 0);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1f, test(3f), 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of instanceof operations.
- */
-public class VN_InstanceOf01 {
-
-    static final Object object = new VN_InstanceOf01();
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return foo1();
-        }
-        if (arg == 1) {
-            return foo2();
-        }
-        if (arg == 2) {
-            return foo3();
-        }
-        // do nothing
-        return false;
-    }
-
-    private static boolean foo1() {
-        boolean a = object instanceof VN_InstanceOf01;
-        boolean b = object instanceof VN_InstanceOf01;
-        return a | b;
-    }
-
-    private static boolean foo2() {
-        Object obj = new VN_InstanceOf01();
-        boolean a = obj instanceof VN_InstanceOf01;
-        boolean b = obj instanceof VN_InstanceOf01;
-        return a | b;
-    }
-
-    private static boolean foo3() {
-        boolean a = null instanceof VN_InstanceOf01;
-        boolean b = null instanceof VN_InstanceOf01;
-        return a | b;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of instanceof operations.
- */
-public class VN_InstanceOf02 {
-
-    private static boolean cond = true;
-
-    static final Object object = new VN_InstanceOf02();
-
-    public static boolean test(int arg) {
-        if (arg == 0) {
-            return foo1();
-        }
-        if (arg == 1) {
-            return foo2();
-        }
-        if (arg == 2) {
-            return foo3();
-        }
-        // do nothing
-        return false;
-    }
-
-    private static boolean foo1() {
-        boolean a = object instanceof VN_InstanceOf02;
-        if (cond) {
-            boolean b = object instanceof VN_InstanceOf02;
-            return a | b;
-        }
-        return false;
-    }
-
-    private static boolean foo2() {
-        Object obj = new VN_InstanceOf02();
-        boolean a = obj instanceof VN_InstanceOf02;
-        if (cond) {
-            boolean b = obj instanceof VN_InstanceOf02;
-            return a | b;
-        }
-        return false;
-    }
-
-    private static boolean foo3() {
-        boolean a = null instanceof VN_InstanceOf02;
-        if (cond) {
-            boolean b = null instanceof VN_InstanceOf02;
-            return a | b;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(false, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_InstanceOf03.java	Thu Mar 08 19:11:12 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.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of instanceof operations.
- */
-public class VN_InstanceOf03 {
-
-    private static boolean cond = true;
-
-    static final Object object = new VN_InstanceOf03();
-
-    public static boolean test() {
-        return foo();
-    }
-
-    private static boolean foo() {
-        Object obj = new VN_InstanceOf03();
-        boolean a = obj instanceof VN_InstanceOf03;
-        if (cond) {
-            boolean b = obj instanceof VN_InstanceOf03;
-            return a | b;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of integer operations.
- */
-public class VN_Int01 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return add(arg);
-        }
-        if (arg == 1) {
-            return sub(arg);
-        }
-        if (arg == 2) {
-            return mul(arg);
-        }
-        if (arg == 3) {
-            return div(arg);
-        }
-        if (arg == 4) {
-            return mod(arg);
-        }
-        if (arg == 5) {
-            return and(arg);
-        }
-        if (arg == 6) {
-            return or(arg);
-        }
-        if (arg == 7) {
-            return xor(arg);
-        }
-        return 0;
-    }
-
-    public static int add(int x) {
-        int c = 3;
-        int t = x + c;
-        int u = x + c;
-        return t + u;
-    }
-
-    public static int sub(int x) {
-        int c = 3;
-        int t = x - c;
-        int u = x - c;
-        return t - u;
-    }
-
-    public static int mul(int x) {
-        int i = 3;
-        int t = x * i;
-        int u = x * i;
-        return t * u;
-    }
-
-    public static int div(int x) {
-        int i = 9;
-        int t = i / x;
-        int u = i / x;
-        return t / u;
-    }
-
-    public static int mod(int x) {
-        int i = 7;
-        int t = i % x;
-        int u = i % x;
-        return t % u;
-    }
-
-    public static int and(int x) {
-        int i = 7;
-        int t = i & x;
-        int u = i & x;
-        return t & u;
-    }
-
-    public static int or(int x) {
-        int i = 7;
-        int t = i | x;
-        int u = i | x;
-        return t | u;
-    }
-
-    public static int xor(int x) {
-        int i = 7;
-        int t = i ^ x;
-        int u = i ^ x;
-        return t ^ u;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(6, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(36, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(5, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of integer operations.
- */
-public class VN_Int02 {
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return shift0(arg + 10);
-        }
-        if (arg == 1) {
-            return shift1(arg + 10);
-        }
-        if (arg == 2) {
-            return shift2(arg + 10);
-        }
-        return 0;
-    }
-
-    public static int shift0(int x) {
-        int c = 1;
-        int t = x >> c;
-        int u = x >> c;
-        return t + u;
-    }
-
-    public static int shift1(int x) {
-        int c = 1;
-        int t = x >>> c;
-        int u = x >>> c;
-        return t + u;
-    }
-
-    public static int shift2(int x) {
-        int c = 1;
-        int t = x << c;
-        int u = x << c;
-        return t + u;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(10, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(48, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Int03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of integer operations.
- */
-public class VN_Int03 {
-
-    private static boolean cond = true;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return add(arg);
-        }
-        if (arg == 1) {
-            return sub(arg);
-        }
-        if (arg == 2) {
-            return mul(arg);
-        }
-        if (arg == 3) {
-            return div(arg);
-        }
-        if (arg == 4) {
-            return mod(arg);
-        }
-        if (arg == 5) {
-            return and(arg);
-        }
-        if (arg == 6) {
-            return or(arg);
-        }
-        if (arg == 7) {
-            return xor(arg);
-        }
-        return 0;
-    }
-
-    public static int add(int x) {
-        int c = 3;
-        int t = x + c;
-        if (cond) {
-            int u = x + c;
-            return t + u;
-        }
-        return 0;
-    }
-
-    public static int sub(int x) {
-        int c = 3;
-        int t = x - c;
-        if (cond) {
-            int u = x - c;
-            return t - u;
-        }
-        return 3;
-    }
-
-    public static int mul(int x) {
-        int i = 3;
-        int t = x * i;
-        if (cond) {
-            int u = x * i;
-            return t * u;
-        }
-        return 3;
-    }
-
-    public static int div(int x) {
-        int i = 9;
-        int t = i / x;
-        if (cond) {
-            int u = i / x;
-            return t / u;
-        }
-        return 9;
-    }
-
-    public static int mod(int x) {
-        int i = 7;
-        int t = i % x;
-        if (cond) {
-            int u = i % x;
-            return t % u;
-        }
-        return 7;
-    }
-
-    public static int and(int x) {
-        int i = 7;
-        int t = i & x;
-        if (cond) {
-            int u = i & x;
-            return t & u;
-        }
-        return 7;
-    }
-
-    public static int or(int x) {
-        int i = 7;
-        int t = i | x;
-        if (cond) {
-            int u = i | x;
-            return t | u;
-        }
-        return 7;
-    }
-
-    public static int xor(int x) {
-        int i = 7;
-        int t = i ^ x;
-        if (cond) {
-            int u = i ^ x;
-            return t ^ u;
-        }
-        return 7;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(6, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(36, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(5, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of long operations.
- */
-public class VN_Long01 {
-
-    public static long test(int arg) {
-        if (arg == 0) {
-            return add(arg);
-        }
-        if (arg == 1) {
-            return sub(arg);
-        }
-        if (arg == 2) {
-            return mul(arg);
-        }
-        if (arg == 3) {
-            return div(arg);
-        }
-        if (arg == 4) {
-            return mod(arg);
-        }
-        if (arg == 5) {
-            return and(arg);
-        }
-        if (arg == 6) {
-            return or(arg);
-        }
-        if (arg == 7) {
-            return xor(arg);
-        }
-        return 0;
-    }
-
-    public static long add(long x) {
-        long t = x + 3;
-        long u = x + 3;
-        return t + u;
-    }
-
-    public static long sub(long x) {
-        long t = x - 3;
-        long u = x - 3;
-        return t - u;
-    }
-
-    public static long mul(long x) {
-        long t = x * 3;
-        long u = x * 3;
-        return t * u;
-    }
-
-    public static long div(long x) {
-        long t = 9 / x;
-        long u = 9 / x;
-        return t / u;
-    }
-
-    public static long mod(long x) {
-        long t = 7 % x;
-        long u = 7 % x;
-        return t % u;
-    }
-
-    public static long and(long x) {
-        long t = 7 & x;
-        long u = 7 & x;
-        return t & u;
-    }
-
-    public static long or(long x) {
-        long t = 7 | x;
-        long u = 7 | x;
-        return t | u;
-    }
-
-    public static long xor(long x) {
-        long t = 7 ^ x;
-        long u = 7 ^ x;
-        return t ^ u;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(6L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(36L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0L, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(5L, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7L, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0L, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests optimization of integer operations.
- */
-public class VN_Long02 {
-
-    public static long test(int arg) {
-        if (arg == 0) {
-            return shift0(arg + 10);
-        }
-        if (arg == 1) {
-            return shift1(arg + 10);
-        }
-        if (arg == 2) {
-            return shift2(arg + 10);
-        }
-        return 0;
-    }
-
-    public static long shift0(long x) {
-        long c = 1;
-        long t = x >> c;
-        long u = x >> c;
-        return t + u;
-    }
-
-    public static long shift1(long x) {
-        long c = 1;
-        long t = x >>> c;
-        long u = x >>> c;
-        return t + u;
-    }
-
-    public static long shift2(long x) {
-        long c = 1;
-        long t = x << c;
-        long u = x << c;
-        return t + u;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(10L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(10L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(48L, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Long03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of long operations.
- */
-public class VN_Long03 {
-
-    private static boolean cond = true;
-
-    public static long test(int arg) {
-        if (arg == 0) {
-            return add(arg);
-        }
-        if (arg == 1) {
-            return sub(arg);
-        }
-        if (arg == 2) {
-            return mul(arg);
-        }
-        if (arg == 3) {
-            return div(arg);
-        }
-        if (arg == 4) {
-            return mod(arg);
-        }
-        if (arg == 5) {
-            return and(arg);
-        }
-        if (arg == 6) {
-            return or(arg);
-        }
-        if (arg == 7) {
-            return xor(arg);
-        }
-        return 0;
-    }
-
-    public static long add(long x) {
-        long t = x + 3;
-        if (cond) {
-            long u = x + 3;
-            return t + u;
-        }
-        return 3;
-    }
-
-    public static long sub(long x) {
-        long t = x - 3;
-        if (cond) {
-            long u = x - 3;
-            return t - u;
-        }
-        return 3;
-    }
-
-    public static long mul(long x) {
-        long t = x * 3;
-        if (cond) {
-            long u = x * 3;
-            return t * u;
-        }
-        return 3;
-    }
-
-    public static long div(long x) {
-        long t = 9 / x;
-        if (cond) {
-            long u = 9 / x;
-            return t / u;
-        }
-        return 9;
-    }
-
-    public static long mod(long x) {
-        long t = 7 % x;
-        if (cond) {
-            long u = 7 % x;
-            return t % u;
-        }
-        return 7;
-    }
-
-    public static long and(long x) {
-        long t = 7 & x;
-        if (cond) {
-            long u = 7 & x;
-            return t & u;
-        }
-        return 7;
-    }
-
-    public static long or(long x) {
-        long t = 7 | x;
-        if (cond) {
-            long u = 7 | x;
-            return t | u;
-        }
-        return 7;
-    }
-
-    public static long xor(long x) {
-        long t = 7 ^ x;
-        if (cond) {
-            long u = 7 ^ x;
-            return t ^ u;
-        }
-        return 7;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(6L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(0L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(36L, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(1L, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0L, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(5L, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(7L, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(0L, test(7));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/optimize/VN_Loop01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.optimize;
-
-import org.junit.*;
-
-/*
- * Tests value numbering of integer operations.
- */
-public class VN_Loop01 {
-
-    private static boolean cond1 = true;
-    private static boolean cond2 = true;
-
-    public static int test(int arg) {
-        if (arg == 0) {
-            return test1(arg);
-        }
-        if (arg == 1) {
-            return test2(arg);
-        }
-        if (arg == 2) {
-            return test3(arg);
-        }
-        if (arg == 3) {
-            return test4(arg);
-        }
-        return 0;
-    }
-
-    public static int test1(int x) {
-        int c = 3;
-        int t = x + c;
-        while (cond1) {
-            if (cond2) {
-                int u = x + c; // GVN should recognize u == t
-                return t + u;
-            }
-        }
-        return 3; // GVN should recognize 3 == 3
-    }
-
-    public static int test2(int x) {
-        int c = 3;
-        while (cond1) {
-            int t = x + c;
-            if (cond2) {
-                int u = x + c; // GVN should recognize u == t
-                return t + u;
-            }
-        }
-        return 3;
-    }
-
-    public static int test3(int x) {
-        int c = 3;
-        int t = x + c;
-        while (cond1) {
-            if (cond2) {
-                int u = x + c; // GVN should recognize u == t
-                return t + u;
-            }
-            int u = x + c; // GVN should recognize u == t
-            return t + u;
-        }
-        return 3; // GVN should recognize 3 == 3
-    }
-
-    public static int test4(int x) {
-        int c = 3;
-        int t = x + c;
-        while (cond1) {
-            if (!cond2) {
-                int u = x + c;
-                return t + u;
-            }
-            int u = x + c;
-            return t + u;
-        }
-        return 3;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(6, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(8, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(10, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(12, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(0, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_get01 {
-
-    private static final String[] array = {"0", "1", "2"};
-
-    public static String test(int i) {
-        return (String) Array.get(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("0", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("1", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("2", test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_get02 {
-
-    private static final int[] array = {11, 21, 42};
-
-    public static int test(int i) {
-        return (Integer) Array.get(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_get03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_get03 {
-
-    private static final byte[] array = {11, 21, 42};
-
-    public static byte test(int i) {
-        return (Byte) Array.get(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 11), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 21), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) 42), test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getBoolean01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getBoolean01 {
-
-    private static final boolean[] array = {true, false, true};
-
-    public static boolean test(int i) {
-        return Array.getBoolean(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getByte01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getByte01 {
-
-    private static final byte[] array = {11, 21, 42};
-
-    public static byte test(int i) {
-        return Array.getByte(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 11), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 21), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) 42), test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getChar01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getChar01 {
-
-    private static final char[] array = {11, 21, 42};
-
-    public static char test(int i) {
-        return Array.getChar(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 11), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 21), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 42), test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getDouble01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getDouble01 {
-
-    private static final double[] array = {11.1d, 21.1d, 42.1d};
-
-    public static double test(int i) {
-        return Array.getDouble(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11.1d, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21.1d, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42.1d, test(2), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getFloat01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getFloat01 {
-
-    private static final float[] array = {11.1f, 21.1f, 42.1f};
-
-    public static float test(int i) {
-        return Array.getFloat(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11.1f, test(0), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21.1f, test(1), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42.1f, test(2), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getInt01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getInt01 {
-
-    private static final int[] array = {11, 21, 42};
-
-    public static int test(int i) {
-        return Array.getInt(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLength01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getLength01 {
-
-    private static final int[] array0 = {11, 21, 42};
-    private static final boolean[] array1 = {true, true, false, false};
-    private static final String[] array2 = {"String"};
-
-    public static int test(int i) {
-        Object array = null;
-        if (i == 0) {
-            array = array0;
-        } else if (i == 1) {
-            array = array1;
-        } else if (i == 2) {
-            array = array2;
-        }
-        return Array.getLength(array);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(3, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(4, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(1, test(2));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getLong01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getLong01 {
-
-    private static final long[] array = {11, 21, 42};
-
-    public static long test(int i) {
-        return Array.getLong(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11L, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21L, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42L, test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_getShort01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_getShort01 {
-
-    private static final short[] array = {11, 21, 42};
-
-    public static short test(int i) {
-        return Array.getShort(array, i);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 11), test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) 21), test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) 42), test(2));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_newInstance01 {
-
-    public static boolean test(int i) {
-        return Array.newInstance(Array_newInstance01.class, i) != null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test(expected = java.lang.NegativeArraySizeException.class)
-    public void run3() throws Throwable {
-        test(-1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_newInstance02 {
-
-    public static boolean test(int i) {
-        Class< ? > javaClass;
-        if (i == 2) {
-            javaClass = void.class;
-        } else if (i == 3) {
-            javaClass = null;
-        } else {
-            javaClass = int.class;
-        }
-        return Array.newInstance(javaClass, 0) != null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test(expected = java.lang.IllegalArgumentException.class)
-    public void run1() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(3);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_newInstance03 {
-
-    public static boolean test(int i) {
-        Class< ? > javaClass;
-        if (i == 2) {
-            javaClass = int.class;
-        } else if (i == 3) {
-            javaClass = Object.class;
-        } else {
-            javaClass = Array_newInstance03.class;
-        }
-        return Array.newInstance(javaClass, 0).getClass().getComponentType() == javaClass;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_newInstance04 {
-
-    public static boolean test(int i, int j) {
-        final int[] dims = {i, j};
-        return Array.newInstance(Array_newInstance04.class, dims) != null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(1, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(2, 2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(3, 2));
-    }
-
-    @Test(expected = java.lang.NegativeArraySizeException.class)
-    public void run3() throws Throwable {
-        test(0, -1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_newInstance05 {
-
-    public static boolean test(int i, int j) {
-        final int[] dims = {i, j};
-        Class< ? > javaClass;
-        if (i == 2) {
-            javaClass = void.class;
-        } else if (i == 3) {
-            javaClass = null;
-        } else {
-            javaClass = int.class;
-        }
-        return Array.newInstance(javaClass, dims) != null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(1, 3));
-    }
-
-    @Test(expected = java.lang.IllegalArgumentException.class)
-    public void run1() throws Throwable {
-        test(2, 3);
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(3, 4);
-    }
-
-    @Test(expected = java.lang.NegativeArraySizeException.class)
-    public void run3() throws Throwable {
-        test(1, -1);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_newInstance06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_newInstance06 {
-
-    public static boolean test(int i) {
-        final int[] dims = {i, 3};
-        Class< ? > javaClass;
-        if (i == 2) {
-            javaClass = int.class;
-        } else if (i == 3) {
-            javaClass = Object.class;
-        } else {
-            javaClass = Array_newInstance06.class;
-        }
-        return Array.newInstance(javaClass, dims).getClass().getComponentType().getComponentType() == javaClass;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_set01 {
-
-    private static final String[] array = {"x", "x", "x"};
-
-    public static String test(int i, String value) {
-        Array.set(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("1", test(0, "1"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("2", test(1, "2"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("XXd", test(0, "XXd"));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, "--");
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_set02 {
-
-    private static final int[] array = {-1, -1, -1};
-
-    public static int test(int i, int value) {
-        Array.set(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(0, 11));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21, test(1, 21));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(0, 42));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_set03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_set03 {
-
-    private static final byte[] array = {-1, -1, -1};
-
-    public static byte test(int i, byte value) {
-        Array.set(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 11), test(0, ((byte) 11)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 21), test(1, ((byte) 21)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) 42), test(0, ((byte) 42)));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, ((byte) 0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setBoolean01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setBoolean01 {
-
-    private static final boolean[] array = {false, false, false};
-
-    public static boolean test(int i, boolean value) {
-        Array.setBoolean(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0, true));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1, false));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2, true));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, false);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setByte01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setByte01 {
-
-    private static final byte[] array = {-1, -1, -1};
-
-    public static byte test(int i, byte value) {
-        Array.setByte(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((byte) 11), test(0, ((byte) 11)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((byte) 21), test(1, ((byte) 21)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((byte) 42), test(0, ((byte) 42)));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, ((byte) 0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setChar01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setChar01 {
-
-    private static final char[] array = {0, 0, 0};
-
-    public static char test(int i, char value) {
-        Array.setChar(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((char) 11), test(0, ((char) 11)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((char) 21), test(1, ((char) 21)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((char) 42), test(0, ((char) 42)));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, ((char) 0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setDouble01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setDouble01 {
-
-    private static final double[] array = {-1, -1, -1};
-
-    public static double test(int i, double value) {
-        Array.setDouble(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11.1d, test(0, 11.1d), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21.1d, test(1, 21.1d), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42.1d, test(0, 42.1d), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, 0.1d);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setFloat01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setFloat01 {
-
-    private static final float[] array = {-1, -1, -1};
-
-    public static float test(int i, float value) {
-        Array.setFloat(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11.1f, test(0, 11.1f), 0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21.1f, test(1, 21.1f), 0);
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42.1f, test(0, 42.1f), 0);
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, 0.1f);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setInt01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setInt01 {
-
-    private static final int[] array = {-1, -1, -1};
-
-    public static int test(int i, int value) {
-        Array.setInt(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11, test(0, 11));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21, test(1, 21));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42, test(0, 42));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, 0);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setLong01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setLong01 {
-
-    private static final long[] array = {-1, -1, -1};
-
-    public static long test(int i, long value) {
-        Array.setLong(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(11L, test(0, 11L));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(21L, test(1, 21L));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(42L, test(0, 42L));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, 0L);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Array_setShort01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-public class Array_setShort01 {
-
-    private static final short[] array = {-1, -1, -1};
-
-    public static short test(int i, short value) {
-        Array.setShort(array, i, value);
-        return array[i];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(((short) 11), test(0, ((short) 11)));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(((short) 21), test(1, ((short) 21)));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(((short) 42), test(0, ((short) 42)));
-    }
-
-    @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class)
-    public void run3() throws Throwable {
-        test(3, ((short) 0));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredField01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Class_getDeclaredField01 {
-
-    static String field;
-    static int f2;
-
-    public static String test(String input) throws NoSuchFieldException {
-        return Class_getDeclaredField01.class.getDeclaredField(input).getName();
-    }
-
-    public static void main(String[] args) {
-        field = args[0];
-    }
-
-    @Test(expected = java.lang.NoSuchFieldException.class)
-    public void run0() throws Throwable {
-        test("test");
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("field", test("field"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("f2", test("f2"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getDeclaredMethod01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Class_getDeclaredMethod01 {
-
-    static String field;
-
-    public static String test(String input) throws NoSuchMethodException {
-        return Class_getDeclaredMethod01.class.getDeclaredMethod(input, String[].class).getName();
-    }
-
-    public static void main(String[] args) {
-        field = args[0];
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run0() throws Throwable {
-        test("test");
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("main", test("main"));
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run2() throws Throwable {
-        test("xx");
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Class_getField01 {
-
-    public static String field;
-    public String field2;
-    String field3;
-
-    public static String test(String input) throws NoSuchFieldException {
-        return Class_getField01.class.getField(input).getName();
-    }
-
-    @Test(expected = java.lang.NoSuchFieldException.class)
-    public void run0() throws Throwable {
-        test("test");
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("field", test("field"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("field2", test("field2"));
-    }
-
-    @Test(expected = java.lang.NoSuchFieldException.class)
-    public void run3() throws Throwable {
-        test("field3");
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getField02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Class_getField02 {
-
-    public static String field;
-    public String field2;
-    String field3;
-
-    public static String test(String input) throws NoSuchFieldException {
-        return Class_getField02b.class.getField(input).getName();
-    }
-
-    static class Class_getField02b extends Class_getField02 {
-
-        public String field4;
-    }
-
-    @Test(expected = java.lang.NoSuchFieldException.class)
-    public void run0() throws Throwable {
-        test("test");
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("field", test("field"));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("field2", test("field2"));
-    }
-
-    @Test(expected = java.lang.NoSuchFieldException.class)
-    public void run3() throws Throwable {
-        test("field3");
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals("field4", test("field4"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Class_getMethod01 {
-
-    static String field;
-
-    public static String test(String input) throws NoSuchMethodException {
-        return Class_getMethod01.class.getMethod(input, String[].class).getName();
-    }
-
-    public static void main(String[] args) {
-        field = args[0];
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run0() throws Throwable {
-        test("test");
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("main", test("main"));
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run2() throws Throwable {
-        test("xx");
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_getMethod02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Class_getMethod02 {
-
-    static String field;
-
-    public static String test(int arg) throws NoSuchMethodException {
-        if (arg == 0) {
-            return Class_getMethod02.class.getMethod("test").getName();
-        } else if (arg == 1) {
-            return Class_getMethod02.class.getMethod("test", int.class).getName();
-        } else if (arg == 2) {
-            return Class_getMethod02.class.getMethod("main").getName();
-        } else if (arg == 3) {
-            return Class_getMethod02.class.getMethod("main", String[].class).getName();
-        } else if (arg == 4) {
-            return Class_getMethod02.class.getMethod("<init>").getName();
-        } else if (arg == 5) {
-            return Class_getMethod02.class.getMethod("<clinit>").getName();
-        }
-        return null;
-    }
-
-    public static void main(String[] args) {
-        field = args[0];
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("test", test(1));
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals("main", test(3));
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-    @Test(expected = java.lang.NoSuchMethodException.class)
-    public void run5() throws Throwable {
-        test(5);
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(null, test(6));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_newInstance01 {
-
-    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
-        if (i == 0) {
-            return Class_newInstance01.class.newInstance() != null;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_newInstance02 {
-
-    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
-        if (i == 0) {
-            // note: we rely on the other class here.
-            return Class_newInstance07.Class_newInstance.class.newInstance() != null;
-        }
-        return false;
-    }
-
-    @Test(expected = java.lang.IllegalAccessException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-public class Class_newInstance03 {
-
-    public abstract static class AbstractClass {
-    }
-
-    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
-        if (i == 0) {
-            return AbstractClass.class.newInstance() != null;
-        } else if (i == 1) {
-            return Cloneable.class.newInstance() != null;
-        } else if (i == 2) {
-            return int[].class.newInstance() != null;
-        } else if (i == 3) {
-            return int.class.newInstance() != null;
-        }
-        return false;
-    }
-
-    @Test(expected = java.lang.InstantiationException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test(expected = java.lang.InstantiationException.class)
-    public void run1() throws Throwable {
-        test(1);
-    }
-
-    @Test(expected = java.lang.InstantiationException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.InstantiationException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance06.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_newInstance06 {
-
-    public static final class Class_newInstance {
-
-        @SuppressWarnings("unused")
-        private Class_newInstance(int i) {
-            // do nothing. xx
-        }
-    }
-
-    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
-        if (i == 0) {
-            return Class_newInstance.class.newInstance() != null;
-        }
-        return false;
-    }
-
-    @Test(expected = java.lang.InstantiationException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Class_newInstance07.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Class_newInstance07 {
-
-    public static final class Class_newInstance {
-
-        private Class_newInstance() throws Exception {
-            throw new Exception();
-        }
-    }
-
-    public static boolean test(int i) throws IllegalAccessException, InstantiationException {
-        if (i == 0) {
-            return Class_newInstance.class.newInstance() != null;
-        }
-        return false;
-    }
-
-    @Test(expected = java.lang.Exception.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Field_get01 {
-
-    public static final byte byteField = 11;
-    public static final short shortField = 12;
-    public static final char charField = 13;
-    public static final int intField = 14;
-    public static final long longField = 15;
-    public static final float floatField = 16;
-    public static final double doubleField = 17;
-    public static final boolean booleanField = true;
-
-    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
-        if (arg == 0) {
-            return Field_get01.class.getField("byteField").get(null).equals(byteField);
-        } else if (arg == 1) {
-            return Field_get01.class.getField("shortField").get(null).equals(shortField);
-        } else if (arg == 2) {
-            return Field_get01.class.getField("charField").get(null).equals(charField);
-        } else if (arg == 3) {
-            return Field_get01.class.getField("intField").get(null).equals(intField);
-        } else if (arg == 4) {
-            return Field_get01.class.getField("longField").get(null).equals(longField);
-        } else if (arg == 5) {
-            return Field_get01.class.getField("floatField").get(null).equals(floatField);
-        } else if (arg == 6) {
-            return Field_get01.class.getField("doubleField").get(null).equals(doubleField);
-        } else if (arg == 7) {
-            return Field_get01.class.getField("booleanField").get(null).equals(booleanField);
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Field_get02 {
-
-    private static final Field_get02 object = new Field_get02();
-
-    public final byte byteField = 11;
-    public final short shortField = 12;
-    public final char charField = 13;
-    public final int intField = 14;
-    public final long longField = 15;
-    public final float floatField = 16;
-    public final double doubleField = 17;
-    public final boolean booleanField = true;
-
-    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
-        if (arg == 0) {
-            return Field_get02.class.getField("byteField").get(object).equals(object.byteField);
-        } else if (arg == 1) {
-            return Field_get02.class.getField("shortField").get(object).equals(object.shortField);
-        } else if (arg == 2) {
-            return Field_get02.class.getField("charField").get(object).equals(object.charField);
-        } else if (arg == 3) {
-            return Field_get02.class.getField("intField").get(object).equals(object.intField);
-        } else if (arg == 4) {
-            return Field_get02.class.getField("longField").get(object).equals(object.longField);
-        } else if (arg == 5) {
-            return Field_get02.class.getField("floatField").get(object).equals(object.floatField);
-        } else if (arg == 6) {
-            return Field_get02.class.getField("doubleField").get(object).equals(object.doubleField);
-        } else if (arg == 7) {
-            return Field_get02.class.getField("booleanField").get(object).equals(object.booleanField);
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-/*
- */
-public class Field_get03 {
-
-    private static Field ByteField;
-    private static Field ShortField;
-    private static Field CharField;
-    private static Field IntField;
-    private static Field LongField;
-    private static Field FloatField;
-    private static Field DoubleField;
-    private static Field BooleanField;
-
-    static {
-        try {
-            ByteField = Field_get03.class.getField("byteField");
-            ShortField = Field_get03.class.getField("shortField");
-            CharField = Field_get03.class.getField("charField");
-            IntField = Field_get03.class.getField("intField");
-            LongField = Field_get03.class.getField("longField");
-            FloatField = Field_get03.class.getField("floatField");
-            DoubleField = Field_get03.class.getField("doubleField");
-            BooleanField = Field_get03.class.getField("booleanField");
-        } catch (SecurityException e) {
-            e.printStackTrace();
-        } catch (NoSuchFieldException e) {
-            e.printStackTrace();
-        }
-    }
-
-    private static final Field_get03 object = new Field_get03();
-
-    public final byte byteField = 11;
-    public final short shortField = 12;
-    public final char charField = 13;
-    public final int intField = 14;
-    public final long longField = 15;
-    public final float floatField = 16;
-    public final double doubleField = 17;
-    public final boolean booleanField = true;
-
-    public static boolean test(int arg) throws IllegalAccessException {
-        if (arg == 0) {
-            return ByteField.get(object).equals(object.byteField);
-        } else if (arg == 1) {
-            return ShortField.get(object).equals(object.shortField);
-        } else if (arg == 2) {
-            return CharField.get(object).equals(object.charField);
-        } else if (arg == 3) {
-            return IntField.get(object).equals(object.intField);
-        } else if (arg == 4) {
-            return LongField.get(object).equals(object.longField);
-        } else if (arg == 5) {
-            return FloatField.get(object).equals(object.floatField);
-        } else if (arg == 6) {
-            return DoubleField.get(object).equals(object.doubleField);
-        } else if (arg == 7) {
-            return BooleanField.get(object).equals(object.booleanField);
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_get04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Field_get04 {
-
-    private static final Field_get04 object = new Field_get04();
-
-    public final byte byteField = 11;
-    public final short shortField = 12;
-    public final char charField = 13;
-    public final int intField = 14;
-    public final long longField = 15;
-    public final float floatField = 16;
-    public final double doubleField = 17;
-    public final boolean booleanField = true;
-
-    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
-        if (arg == 0) {
-            return Field_get04.class.getField("byteField").getByte(object) == object.byteField;
-        } else if (arg == 1) {
-            return Field_get04.class.getField("shortField").getShort(object) == object.shortField;
-        } else if (arg == 2) {
-            return Field_get04.class.getField("charField").getChar(object) == object.charField;
-        } else if (arg == 3) {
-            return Field_get04.class.getField("intField").getInt(object) == object.intField;
-        } else if (arg == 4) {
-            return Field_get04.class.getField("longField").getLong(object) == object.longField;
-        } else if (arg == 5) {
-            return Field_get04.class.getField("floatField").getFloat(object) == object.floatField;
-        } else if (arg == 6) {
-            return Field_get04.class.getField("doubleField").getDouble(object) == object.doubleField;
-        } else if (arg == 7) {
-            return Field_get04.class.getField("booleanField").getBoolean(object) == object.booleanField;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_getType01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Field_getType01 {
-
-    public static final byte byteField = 11;
-    public static final short shortField = 12;
-    public static final char charField = 13;
-    public static final int intField = 14;
-    public static final long longField = 15;
-    public static final float floatField = 16;
-    public static final double doubleField = 17;
-    public static final boolean booleanField = true;
-
-    public static boolean test(int arg) throws NoSuchFieldException {
-        if (arg == 0) {
-            return Field_getType01.class.getField("byteField").getType() == byte.class;
-        } else if (arg == 1) {
-            return Field_getType01.class.getField("shortField").getType() == short.class;
-        } else if (arg == 2) {
-            return Field_getType01.class.getField("charField").getType() == char.class;
-        } else if (arg == 3) {
-            return Field_getType01.class.getField("intField").getType() == int.class;
-        } else if (arg == 4) {
-            return Field_getType01.class.getField("longField").getType() == long.class;
-        } else if (arg == 5) {
-            return Field_getType01.class.getField("floatField").getType() == float.class;
-        } else if (arg == 6) {
-            return Field_getType01.class.getField("doubleField").getType() == double.class;
-        } else if (arg == 7) {
-            return Field_getType01.class.getField("booleanField").getType() == boolean.class;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Field_set01 {
-
-    public static byte byteField;
-    public static short shortField;
-    public static char charField;
-    public static int intField;
-    public static long longField;
-    public static float floatField;
-    public static double doubleField;
-    public static boolean booleanField;
-
-    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
-        if (arg == 0) {
-            Field_set01.class.getField("byteField").set(null, Byte.valueOf((byte) 11));
-            return byteField == 11;
-        } else if (arg == 1) {
-            Field_set01.class.getField("shortField").set(null, Short.valueOf((short) 12));
-            return shortField == 12;
-        } else if (arg == 2) {
-            Field_set01.class.getField("charField").set(null, Character.valueOf((char) 13));
-            return charField == 13;
-        } else if (arg == 3) {
-            Field_set01.class.getField("intField").set(null, Integer.valueOf(14));
-            return intField == 14;
-        } else if (arg == 4) {
-            Field_set01.class.getField("longField").set(null, Long.valueOf(15L));
-            return longField == 15;
-        } else if (arg == 5) {
-            Field_set01.class.getField("floatField").set(null, Float.valueOf(16));
-            return floatField == 16;
-        } else if (arg == 6) {
-            Field_set01.class.getField("doubleField").set(null, Double.valueOf(17));
-            return doubleField == 17;
-        } else if (arg == 7) {
-            Field_set01.class.getField("booleanField").set(null, true);
-            return booleanField == true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Field_set02 {
-
-    private static final Field_set02 object = new Field_set02();
-
-    public byte byteField;
-    public short shortField;
-    public char charField;
-    public int intField;
-    public long longField;
-    public float floatField;
-    public double doubleField;
-    public boolean booleanField;
-
-    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
-        if (arg == 0) {
-            Field_set02.class.getField("byteField").set(object, Byte.valueOf((byte) 11));
-            return object.byteField == 11;
-        } else if (arg == 1) {
-            Field_set02.class.getField("shortField").set(object, Short.valueOf((short) 12));
-            return object.shortField == 12;
-        } else if (arg == 2) {
-            Field_set02.class.getField("charField").set(object, Character.valueOf((char) 13));
-            return object.charField == 13;
-        } else if (arg == 3) {
-            Field_set02.class.getField("intField").set(object, Integer.valueOf(14));
-            return object.intField == 14;
-        } else if (arg == 4) {
-            Field_set02.class.getField("longField").set(object, Long.valueOf(15L));
-            return object.longField == 15;
-        } else if (arg == 5) {
-            Field_set02.class.getField("floatField").set(object, Float.valueOf(16));
-            return object.floatField == 16;
-        } else if (arg == 6) {
-            Field_set02.class.getField("doubleField").set(object, Double.valueOf(17));
-            return object.doubleField == 17;
-        } else if (arg == 7) {
-            Field_set02.class.getField("booleanField").set(object, true);
-            return object.booleanField == true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Field_set03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Field_set03 {
-
-    private static final Field_set03 object = new Field_set03();
-
-    public byte byteField;
-    public short shortField;
-    public char charField;
-    public int intField;
-    public long longField;
-    public float floatField;
-    public double doubleField;
-    public boolean booleanField;
-
-    public static boolean test(int arg) throws NoSuchFieldException, IllegalAccessException {
-        if (arg == 0) {
-            Field_set03.class.getField("byteField").setByte(object, (byte) 11);
-            return object.byteField == 11;
-        } else if (arg == 1) {
-            Field_set03.class.getField("shortField").setShort(object, (short) 12);
-            return object.shortField == 12;
-        } else if (arg == 2) {
-            Field_set03.class.getField("charField").setChar(object, (char) 13);
-            return object.charField == 13;
-        } else if (arg == 3) {
-            Field_set03.class.getField("intField").setInt(object, 14);
-            return object.intField == 14;
-        } else if (arg == 4) {
-            Field_set03.class.getField("longField").setLong(object, 15L);
-            return object.longField == 15;
-        } else if (arg == 5) {
-            Field_set03.class.getField("floatField").setFloat(object, 16);
-            return object.floatField == 16;
-        } else if (arg == 6) {
-            Field_set03.class.getField("doubleField").setDouble(object, 17);
-            return object.doubleField == 17;
-        } else if (arg == 7) {
-            Field_set03.class.getField("booleanField").setBoolean(object, true);
-            return object.booleanField == true;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run6() throws Throwable {
-        Assert.assertEquals(true, test(6));
-    }
-
-    @Test
-    public void run7() throws Throwable {
-        Assert.assertEquals(true, test(7));
-    }
-
-    @Test
-    public void run8() throws Throwable {
-        Assert.assertEquals(false, test(8));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_except01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-/*
- */
-public class Invoke_except01 {
-
-    public static int test(int arg) throws IllegalAccessException, InvocationTargetException {
-        Object[] args;
-        if (arg == 0) {
-            args = new Object[]{new int[0]};
-        } else if (arg == 1) {
-            args = new Object[]{new int[3]};
-        } else if (arg == 2) {
-            args = new Object[]{null};
-        } else if (arg == 3) {
-            args = new Object[]{new char[3]};
-        } else {
-            args = null;
-        }
-        for (Method m : Invoke_except01.class.getDeclaredMethods()) {
-            if ("method".equals(m.getName())) {
-                return (Integer) m.invoke(null, args);
-            }
-        }
-        return 42;
-    }
-
-    public static int method(int[] arg) {
-        return arg.length;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(3, test(1));
-    }
-
-    @Test(expected = java.lang.reflect.InvocationTargetException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test(expected = java.lang.IllegalArgumentException.class)
-    public void run3() throws Throwable {
-        test(3);
-    }
-
-    @Test(expected = java.lang.IllegalArgumentException.class)
-    public void run4() throws Throwable {
-        test(4);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-/*
- */
-public class Invoke_main01 {
-
-    static String field;
-
-    public static String test(String input) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-        field = null;
-        final String[] args = {input};
-        Invoke_main01.class.getMethod("main", String[].class).invoke(null, new Object[]{args});
-        return field;
-    }
-
-    public static void main(String[] args) {
-        field = args[0];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("test1", test("test1"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("test2", test("test2"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-/*
- */
-public class Invoke_main02 {
-
-    static String field;
-
-    public static String test(String input) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-        field = null;
-        final String[] args = {input};
-        Invoke_main02.class.getDeclaredMethod("main", String[].class).invoke(null, new Object[]{args});
-        return field;
-    }
-
-    public static void main(String[] args) {
-        field = args[0];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("test1", test("test1"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("test2", test("test2"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_main03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-/*
- */
-public class Invoke_main03 {
-
-    static String field;
-
-    public static String test(String input) throws IllegalAccessException, InvocationTargetException {
-        field = null;
-        final String[] args = {input};
-        for (Method m : Invoke_main03.class.getDeclaredMethods()) {
-            if ("main".equals(m.getName())) {
-                m.invoke(null, new Object[]{args});
-            }
-        }
-        return field;
-    }
-
-    public static void main(String[] args) {
-        field = args[0];
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("test1", test("test1"));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("test2", test("test2"));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Invoke_virtual01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-/*
- */
-public class Invoke_virtual01 {
-
-    static final HelperTest helper = new HelperTest(55);
-
-    public static int test(int input) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
-        if (input == 1) {
-            final Method m = HelperTest.class.getDeclaredMethod("getInt");
-            Object o = m.invoke(helper);
-            return ((Integer) o).intValue();
-        }
-        return 0;
-    }
-
-    public static class HelperTest {
-
-        private int intField;
-
-        public int getInt() {
-            return intField;
-        }
-
-        public HelperTest(int i) {
-            intField = i;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(55, test(1));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getParameterTypes01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-@SuppressWarnings("unused")
-public class Method_getParameterTypes01 {
-
-    public static int test(int arg) throws NoSuchMethodException {
-        if (arg == 0) {
-            return Method_getParameterTypes01.class.getMethod("method1").getParameterTypes().length;
-        } else if (arg == 1) {
-            return Method_getParameterTypes01.class.getMethod("method2", int.class).getParameterTypes().length;
-        } else if (arg == 2) {
-            return Method_getParameterTypes01.class.getMethod("method3", int.class, Object.class).getParameterTypes().length;
-        }
-        return -1;
-    }
-
-    public int method1() {
-        return 0;
-    }
-
-    public void method2(int arg1) {
-    }
-
-    public void method3(int arg1, Object arg2) {
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(1, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(2, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(-1, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Method_getReturnType01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-/*
- */
-public class Method_getReturnType01 {
-
-    public static String test(int arg) throws NoSuchMethodException {
-        if (arg == 0) {
-            return Method_getReturnType01.class.getMethod("method1").getReturnType().getName();
-        } else if (arg == 1) {
-            return Method_getReturnType01.class.getMethod("method2").getReturnType().getName();
-        } else if (arg == 2) {
-            return Method_getReturnType01.class.getMethod("method3").getReturnType().getName();
-        }
-        return null;
-    }
-
-    public int method1() {
-        return 0;
-    }
-
-    public String method2() {
-        return null;
-    }
-
-    public void method3() {
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("int", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("java.lang.String", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("void", test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(null, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/reflect/Reflection_getCallerClass01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.reflect;
-
-import org.junit.*;
-
-import sun.reflect.*;
-
-/*
- */
-@SuppressWarnings("static-method")
-public final class Reflection_getCallerClass01 {
-
-    public static final class Caller1 {
-
-        private Caller1() {
-        }
-
-        static String caller1(int depth) {
-            return Reflection.getCallerClass(depth).getName();
-        }
-    }
-
-    public static final class Caller2 {
-
-        private Caller2() {
-        }
-
-        static String caller2(int depth) {
-            return Caller1.caller1(depth);
-        }
-    }
-
-    public static String test(int depth) {
-        return Caller2.caller2(depth);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals("sun.reflect.Reflection", test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.reflect.Reflection_getCallerClass01$Caller1", test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals("com.oracle.graal.jtt.reflect.Reflection_getCallerClass01$Caller2", test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_contended01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Monitor_contended01 implements Runnable {
-
-    static final Object cond = new Object();
-    static final Object obj = new Object();
-
-    boolean started = false;
-    boolean acquired = false;
-
-    public static boolean test() throws InterruptedException {
-        // test contention for monitor
-        final Monitor_contended01 object = new Monitor_contended01();
-        synchronized (obj) {
-            new Thread(object).start();
-            // wait for other thread to startup and contend
-            synchronized (cond) {
-                cond.wait(1000);
-                if (!object.started) {
-                    return false;
-                }
-            }
-        }
-        // wait for other thread to acquire monitor and then exit
-        synchronized (cond) {
-            cond.wait(1000);
-        }
-        return object.acquired;
-    }
-
-    public void run() {
-        // signal that we have started up so first thread will release lock
-        synchronized (cond) {
-            started = true;
-            cond.notifyAll();
-        }
-        synchronized (obj) {
-
-        }
-        // signal that we have successfully acquired and released the monitor
-        synchronized (cond) {
-            acquired = true;
-            cond.notifyAll();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitor_notowner01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Monitor_notowner01 {
-
-    static Object monitor = new Object();
-    static Object finished = new Object();
-
-    public static boolean test() throws InterruptedException {
-        final BadRunnable badRunnable = new BadRunnable();
-        synchronized (monitor) {
-            new Thread(badRunnable).start();
-            synchronized (finished) {
-                finished.wait(1000);
-            }
-        }
-        return badRunnable.caught;
-    }
-
-    static class BadRunnable implements Runnable {
-
-        protected boolean caught = false;
-
-        public void run() {
-            try {
-                // we don't own this!
-                monitor.wait();
-            } catch (InterruptedException ex) {
-
-            } catch (IllegalMonitorStateException ex) {
-                caught = true;
-                synchronized (finished) {
-                    finished.notifyAll();
-                }
-            }
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Monitorenter01 {
-
-    static final Object object = new Object();
-
-    public static boolean test() {
-        // test nested locking.
-        synchronized (object) {
-            synchronized (object) {
-                return true;
-            }
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Monitorenter02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Monitorenter02 {
-
-    static final Object object = new Object();
-
-    public static boolean test() {
-        // test nested locking.
-        synchronized (object) {
-            return test2();
-        }
-    }
-
-    private static boolean test2() {
-        synchronized (object) {
-            return true;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Object_wait01 implements Runnable {
-
-    static volatile int count = 0;
-    static volatile boolean done;
-    static final Object object = new Object();
-
-    public static boolean test(int i) throws InterruptedException {
-        count = 0;
-        done = false;
-        new Thread(new Object_wait01()).start();
-        synchronized (object) {
-            while (count < i) {
-                object.wait();
-            }
-            done = true;
-            return count >= i;
-        }
-
-    }
-
-    public void run() {
-        int i = 0;
-        while (i++ < 1000000 && !done) {
-            synchronized (object) {
-                count++;
-                object.notifyAll();
-            }
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(15));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Object_wait02 implements Runnable {
-
-    static volatile boolean done;
-    static final Object object = new Object();
-    static int sleep;
-
-    public static boolean test(int i) throws InterruptedException {
-        done = false;
-        sleep = i * 200;
-        new Thread(new Object_wait02()).start();
-        synchronized (object) {
-            while (!done) {
-                object.wait(200);
-            }
-        }
-        return done;
-    }
-
-    public void run() {
-        try {
-            Thread.sleep(sleep);
-        } catch (InterruptedException ex) {
-
-        }
-        synchronized (object) {
-            done = true;
-            object.notifyAll();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Object_wait03 implements Runnable {
-
-    static volatile boolean done;
-    static final Object object = new Object();
-    static int sleep;
-
-    public static boolean test(int i) throws InterruptedException {
-        done = false;
-        sleep = i * 200;
-        synchronized (object) {
-            new Thread(new Object_wait03()).start();
-            dowait();
-        }
-        return done;
-    }
-
-    private static void dowait() throws InterruptedException {
-        synchronized (object) {
-            while (!done) {
-                object.wait(200);
-            }
-        }
-    }
-
-    public void run() {
-        try {
-            Thread.sleep(sleep);
-        } catch (InterruptedException ex) {
-
-        }
-        synchronized (object) {
-            done = true;
-            object.notifyAll();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Object_wait04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Object_wait04 implements Runnable {
-
-    static volatile boolean done;
-    static final Object object = new Object();
-    static int sleep;
-
-    public static boolean test(int i) throws InterruptedException {
-        done = false;
-        sleep = i * 50;
-        synchronized (object) {
-            new Thread(new Object_wait04()).start();
-            dowait(i);
-        }
-        return done;
-    }
-
-    private static void dowait(int i) throws InterruptedException {
-        if (i == 0) {
-            while (!done) {
-                object.wait(100);
-            }
-        } else {
-            synchronized (object) {
-                dowait(i - 1);
-            }
-        }
-    }
-
-    public void run() {
-        try {
-            Thread.sleep(sleep);
-        } catch (InterruptedException ex) {
-
-        }
-        synchronized (object) {
-            done = true;
-            object.notifyAll();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(true, test(4));
-    }
-
-    @Test
-    public void run5() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-/*
- */
-public class ThreadLocal01 {
-
-    private static final ThreadLocal<Integer> local = new ThreadLocal<>();
-
-    public static int test(int i) {
-        local.set(i + 5);
-        return local.get();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(6, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(7, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-/*
- */
-public class ThreadLocal02 {
-
-    public static int test(int i) {
-        ThreadLocal<Integer> local = new ThreadLocal<>();
-        local.set(i + 5);
-        return local.get();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(5, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(6, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(7, test(2));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/ThreadLocal03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-/*
- */
-public class ThreadLocal03 {
-
-    static final ThreadLocal<Integer> local = new ThreadLocal<>();
-
-    public static int test(int i) {
-        int sum = 0;
-        for (int j = 0; j < i; j++) {
-            TThread t = new TThread();
-            t.input = 10 + j;
-            t.run();
-            try {
-                t.join();
-            } catch (InterruptedException e) {
-                return -1;
-            }
-            sum += t.output;
-        }
-        return sum;
-    }
-
-    private static class TThread extends Thread {
-
-        int input;
-        int output;
-
-        @Override
-        public void run() {
-            local.set(input + 5);
-            output = local.get();
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(0, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(15, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(31, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(48, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_currentThread01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_currentThread01 {
-
-    public static boolean test() {
-        return Thread.currentThread() != null;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_getState01 {
-
-    public static boolean test() {
-        return Thread.currentThread().getState() == Thread.State.RUNNABLE;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_getState02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_getState02 {
-
-    public static boolean test() {
-        return new Thread().getState() == Thread.State.NEW;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_holdsLock01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_holdsLock01 {
-
-    static final Object monitor = new Object();
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            synchronized (monitor) {
-                return Thread.holdsLock(monitor);
-            }
-        } else if (i == 1) {
-            synchronized (monitor) {
-                // do nothing.
-            }
-            return Thread.holdsLock(monitor);
-        } else if (i == 2) {
-            return Thread.holdsLock(null);
-        }
-        return Thread.holdsLock(monitor);
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(false, test(1));
-    }
-
-    @Test(expected = java.lang.NullPointerException.class)
-    public void run2() throws Throwable {
-        test(2);
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(false, test(3));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isAlive01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_isAlive01 {
-
-    public static boolean test() {
-        return Thread.currentThread().isAlive();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_isInterrupted01 {
-
-    public static boolean test() {
-        return Thread.currentThread().isInterrupted();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- */
-
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-//Test all, mainly monitors
-public class Thread_isInterrupted02 {
-
-    private static final Object start = new Object();
-    private static final Object end = new Object();
-    private static int waitTime;
-
-    @SuppressWarnings("unused")
-    public static boolean test(int i, int time) throws InterruptedException {
-        waitTime = time;
-        final Thread thread = new Thread();
-        synchronized (thread) {
-            // start the thread and wait for it
-            thread.setDaemon(true); // in case the thread gets stuck
-            thread.start();
-            thread.wait();
-        }
-        synchronized (start) {
-            thread.interrupt();
-        }
-        synchronized (end) {
-            end.wait(200);
-        }
-        return thread.interrupted;
-    }
-
-    private static class Thread extends java.lang.Thread {
-
-        private boolean interrupted;
-
-        @Override
-        public void run() {
-            try {
-                synchronized (start) {
-                    synchronized (this) {
-                        // signal test thread that we are running
-                        notify();
-                    }
-                    // wait for the condition, which should be interrupted
-                    if (waitTime == 0) {
-                        start.wait();
-                    } else {
-                        start.wait(waitTime);
-                    }
-                }
-            } catch (InterruptedException e) {
-                // interrupted successfully.
-                interrupted = true;
-                synchronized (end) {
-                    // notify the other thread we are done
-                    end.notify();
-                }
-            }
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0, 0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1, 500));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-/*
- */
-
-// Interrupted while sleeping, throws an interrupted exception
-public class Thread_isInterrupted03 {
-
-    public static boolean test() throws InterruptedException {
-        final Thread1 thread = new Thread1();
-        thread.start();
-        Thread.sleep(1000);
-        thread.interrupt();
-        Thread.sleep(1000);
-        // Did thread get interrupted?
-        final boolean result = thread.getInterrupted();
-        // This stops the thread even if the interrupt didn't!
-        thread.setInterrupted(true);
-        return result;
-    }
-
-    private static class Thread1 extends java.lang.Thread {
-
-        private boolean interrupted = false;
-
-        @Override
-        public void run() {
-            while (!interrupted) {
-                try {
-                    sleep(10000);
-                } catch (InterruptedException e) {
-                    interrupted = true;
-                }
-            }
-        }
-
-        public void setInterrupted(boolean val) {
-            interrupted = val;
-        }
-
-        public boolean getInterrupted() {
-            return interrupted;
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted04.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-/*
- */
-
-// Interrupted while running, do nothing, just set the flag and continue
-// (thomaswue) This test will exercise deoptimization on HotSpot, because a volatile unloaded field is accessed.
-// (thomaswue) The temporary result variable is needed, because in order to query the isInterrupted flag, the thread must be alive.
-public class Thread_isInterrupted04 {
-
-    public static boolean test() throws InterruptedException {
-        final Thread1 thread = new Thread1();
-        thread.start();
-        while (!thread.running) {
-            Thread.sleep(10);
-        }
-        Thread.sleep(100);
-        thread.interrupt();
-        boolean result = thread.isInterrupted();
-        thread.setStop(true);
-        return result;
-    }
-
-    public static class Thread1 extends java.lang.Thread {
-
-        private volatile boolean stop = false;
-        public volatile boolean running = false;
-        public long i = 0;
-
-        @Override
-        public void run() {
-            running = true;
-            while (!stop) {
-                i++;
-            }
-        }
-
-        public void setStop(boolean value) {
-            stop = value;
-        }
-
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_isInterrupted05.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-/*
- */
-
-// Interrupted during wait, with interrupter joining
-public class Thread_isInterrupted05 {
-
-    public static boolean test() throws InterruptedException {
-        final WaitInterruptee waitInterruptee = new WaitInterruptee();
-        waitInterruptee.start();
-        waitInterruptee.interrupt();
-        waitInterruptee.join();
-
-        if (waitInterruptee.throwable != null) {
-            throw new RuntimeException(waitInterruptee.throwable);
-        }
-        return true;
-    }
-
-    static class WaitInterruptee extends Thread {
-
-        Throwable throwable;
-
-        public WaitInterruptee() {
-            super("WaitInterruptee");
-        }
-
-        @Override
-        public void run() {
-            try {
-                synchronized (this) {
-                    try {
-                        wait();
-                    } catch (InterruptedException ex) {
-                    }
-                }
-            } catch (Throwable t) {
-                throwable = t;
-            }
-        }
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Thread_join01 implements Runnable {
-
-    static volatile boolean cont;
-
-    public static boolean test() throws InterruptedException {
-        cont = true;
-        final Thread thread = new Thread(new Thread_join01());
-        thread.start();
-        thread.join();
-        return cont;
-    }
-
-    public void run() {
-        cont = false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- *
- * This test sleeps the thread that is joined to, which should ensure that the joining thread
- * actually does wait for completeion.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Thread_join02 implements Runnable {
-
-    static volatile boolean cont;
-
-    public static boolean test() throws InterruptedException {
-        cont = true;
-        final Thread thread = new Thread(new Thread_join02());
-        thread.start();
-        thread.join();
-        return cont;
-    }
-
-    public void run() {
-        try {
-            Thread.sleep(200);
-        } catch (InterruptedException ex) {
-        }
-        cont = false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_join03.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- */
-/*
- *
- * This test sleeps the joining thread, which should enure that the joinee is
- * terminated by the time the join occurs.
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Thread_join03 implements Runnable {
-
-    static volatile boolean cont;
-
-    public static boolean test() throws InterruptedException {
-        cont = true;
-        final Thread thread = new Thread(new Thread_join03());
-        thread.start();
-        Thread.sleep(200);
-        thread.join();
-        return cont;
-    }
-
-    public void run() {
-        cont = false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(false, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_new01 {
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return new Thread() != null;
-        }
-        if (i == 1) {
-            return new Thread("Thread_new01") != null;
-        }
-        if (i == 2) {
-            return new Thread(new Thread()) != null;
-        }
-        if (i == 3) {
-            return new Thread(new Thread(), "Thread_new01") != null;
-        }
-        return false;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_new02.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-public class Thread_new02 implements Runnable {
-
-    static final Thread_new02 thisObject = new Thread_new02();
-
-    public static boolean test(int i) {
-        if (i == 0) {
-            return new Thread() != null;
-        }
-        if (i == 1) {
-            return new Thread("Thread_new01") != null;
-        }
-        if (i == 2) {
-            return new Thread(thisObject) != null;
-        }
-        if (i == 3) {
-            return new Thread(thisObject, "Thread_new01") != null;
-        }
-        return false;
-    }
-
-    public void run() {
-        // do nothing.
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(0));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(2));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(3));
-    }
-
-    @Test
-    public void run4() throws Throwable {
-        Assert.assertEquals(false, test(4));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_setPriority01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_setPriority01 {
-
-    public static boolean test(int i) {
-        final Thread currentThread = Thread.currentThread();
-        final int prev = currentThread.getPriority();
-        currentThread.setPriority(i);
-        currentThread.setPriority(prev);
-        return true;
-    }
-
-    @Test(expected = java.lang.IllegalArgumentException.class)
-    public void run0() throws Throwable {
-        test(0);
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(1));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(5));
-    }
-
-    @Test
-    public void run3() throws Throwable {
-        Assert.assertEquals(true, test(10));
-    }
-
-    @Test(expected = java.lang.IllegalArgumentException.class)
-    public void run4() throws Throwable {
-        test(11);
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_sleep01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_sleep01 {
-
-    public static boolean test(int i) throws InterruptedException {
-        final long before = System.currentTimeMillis();
-        Thread.sleep(i);
-        return System.currentTimeMillis() - before >= i;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test(10));
-    }
-
-    @Test
-    public void run1() throws Throwable {
-        Assert.assertEquals(true, test(20));
-    }
-
-    @Test
-    public void run2() throws Throwable {
-        Assert.assertEquals(true, test(100));
-    }
-
-}
--- a/graal/com.oracle.max.graal.jtt/src/com/oracle/graal/jtt/threads/Thread_yield01.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- */
-package com.oracle.graal.jtt.threads;
-
-import org.junit.*;
-
-@SuppressWarnings("static-method")
-public final class Thread_yield01 {
-
-    public static boolean test() {
-        Thread.yield();
-        return true;
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        Assert.assertEquals(true, test());
-    }
-
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,559 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.amd64;
-
-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.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.asm.*;
-
-public enum AMD64Arithmetic {
-    IADD, ISUB, IMUL, IDIV, IREM, IUDIV, IUREM, IAND, IOR, IXOR, ISHL, ISHR, IUSHR,
-    LADD, LSUB, LMUL, LDIV, LREM, LUDIV, LUREM, LAND, LOR, LXOR, LSHL, LSHR, LUSHR,
-    FADD, FSUB, FMUL, FDIV, FAND, FOR, FXOR,
-    DADD, DSUB, DMUL, DDIV, DAND, DOR, DXOR,
-    INEG, LNEG,
-    I2L, L2I, I2B, I2C, I2S,
-    F2D, D2F,
-    I2F, I2D, F2I, D2I,
-    L2F, L2D, F2L, D2L,
-    MOV_I2F, MOV_L2D, MOV_F2I, MOV_D2L;
-
-
-    public static class Op1Reg extends AMD64LIRInstruction {
-        public Op1Reg(AMD64Arithmetic opcode, CiValue result, CiValue x) {
-            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue result = output(0);
-            CiValue x = input(0);
-
-            emit(tasm, masm, (AMD64Arithmetic) code, result, x, null);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    public static class Op1Stack extends AMD64LIRInstruction {
-        public Op1Stack(AMD64Arithmetic opcode, CiValue result, CiValue x) {
-            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue result = output(0);
-            CiValue x = input(0);
-
-            AMD64Move.move(tasm, masm, result, x);
-            emit(tasm, masm, (AMD64Arithmetic) code, result);
-        }
-
-        @Override
-        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    public static class Op2Stack extends AMD64LIRInstruction {
-        public Op2Stack(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
-            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, new CiValue[] {y}, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = alive(0);
-
-            AMD64Move.move(tasm, masm, result, x);
-            emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Alive && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        @Override
-        public void verify() {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = alive(0);
-
-            super.verify();
-            assert differentRegisters(result, y) || sameRegister(x, y);
-            verifyKind((AMD64Arithmetic) code, result, x, y);
-        }
-    }
-
-    public static class Op2Reg extends AMD64LIRInstruction {
-        public Op2Reg(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
-            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, new CiValue[] {y}, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = alive(0);
-
-            AMD64Move.move(tasm, masm, result, x);
-            emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Alive && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        @Override
-        public void verify() {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = alive(0);
-
-            super.verify();
-            assert differentRegisters(result, y) || sameRegister(x, y);
-            verifyKind((AMD64Arithmetic) code, result, x, y);
-        }
-    }
-
-    public static class Op2RegCommutative extends AMD64LIRInstruction {
-        public Op2RegCommutative(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
-            super(opcode, new CiValue[] {result}, null, new CiValue[] {x, y}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = input(1);
-
-            if (sameRegister(result, y)) {
-                emit(tasm, masm, (AMD64Arithmetic) code, result, x, null);
-            } else {
-                AMD64Move.move(tasm, masm, result, x);
-                emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
-            }
-        }
-
-        @Override
-        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Input && index == 1) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        @Override
-        protected void verify() {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = input(1);
-
-            super.verify();
-            verifyKind((AMD64Arithmetic) code, result, x, y);
-        }
-    }
-
-    public static class ShiftOp extends AMD64LIRInstruction {
-        public ShiftOp(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
-            super(opcode, new CiValue[] {result}, null, new CiValue[] {x}, new CiValue[] {y}, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = alive(0);
-
-            AMD64Move.move(tasm, masm, result, x);
-            emit(tasm, masm, (AMD64Arithmetic) code, result, y, null);
-        }
-
-        @Override
-        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Alive && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        @Override
-        public void verify() {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = alive(0);
-
-            super.verify();
-            assert isConstant(y) || asRegister(y) == AMD64.rcx;
-            assert differentRegisters(result, y) || sameRegister(x, y);
-            verifyKind((AMD64Arithmetic) code, result, x, x);
-            assert y.kind.stackKind() == CiKind.Int;
-        }
-    }
-
-    public static class DivOp extends AMD64LIRInstruction {
-        public DivOp(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y, LIRDebugInfo info) {
-            super(opcode, new CiValue[] {result}, info, new CiValue[] {x}, new CiValue[] {y}, new CiValue[] {asRegister(result) == AMD64.rax ? AMD64.rdx.asValue(result.kind) : AMD64.rax.asValue(result.kind)});
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue result = output(0);
-            CiValue y = alive(0);
-
-            emit(tasm, masm, (AMD64Arithmetic) code, result, y, info);
-        }
-
-        @Override
-        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Alive && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Temp && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        @Override
-        protected void verify() {
-            CiValue result = output(0);
-            CiValue x = input(0);
-            CiValue y = alive(0);
-
-            super.verify();
-            // left input in rax, right input in any register but rax and rdx, result quotient in rax, result remainder in rdx
-            assert asRegister(x) == AMD64.rax;
-            assert differentRegisters(y, AMD64.rax.asValue(), AMD64.rdx.asValue());
-            assert (name().endsWith("DIV") && asRegister(result) == AMD64.rax) || (name().endsWith("REM") && asRegister(result) == AMD64.rdx);
-            verifyKind((AMD64Arithmetic) code, result, x, y);
-        }
-    }
-
-
-    @SuppressWarnings("unused")
-    protected static void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Arithmetic opcode, CiValue result) {
-        switch (opcode) {
-            case INEG: masm.negl(asIntReg(result)); break;
-            case LNEG: masm.negq(asLongReg(result)); break;
-            case L2I:  masm.andl(asIntReg(result), 0xFFFFFFFF); break;
-            case I2B:  masm.signExtendByte(asIntReg(result)); break;
-            case I2C:  masm.andl(asIntReg(result), 0xFFFF); break;
-            case I2S:  masm.signExtendShort(asIntReg(result)); break;
-            default:   throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    public static void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Arithmetic opcode, CiValue dst, CiValue src, LIRDebugInfo info) {
-        int exceptionOffset = -1;
-        if (isRegister(src)) {
-            switch (opcode) {
-                case IADD: masm.addl(asIntReg(dst),  asIntReg(src)); break;
-                case ISUB: masm.subl(asIntReg(dst),  asIntReg(src)); break;
-                case IAND: masm.andl(asIntReg(dst),  asIntReg(src)); break;
-                case IMUL: masm.imull(asIntReg(dst), asIntReg(src)); break;
-                case IOR:  masm.orl(asIntReg(dst),   asIntReg(src)); break;
-                case IXOR: masm.xorl(asIntReg(dst),  asIntReg(src)); break;
-                case ISHL: masm.shll(asIntReg(dst)); break;
-                case ISHR: masm.sarl(asIntReg(dst)); break;
-                case IUSHR:masm.shrl(asIntReg(dst)); break;
-
-                case LADD: masm.addq(asLongReg(dst),  asLongReg(src)); break;
-                case LSUB: masm.subq(asLongReg(dst),  asLongReg(src)); break;
-                case LMUL: masm.imulq(asLongReg(dst), asLongReg(src)); break;
-                case LAND: masm.andq(asLongReg(dst),  asLongReg(src)); break;
-                case LOR:  masm.orq(asLongReg(dst),   asLongReg(src)); break;
-                case LXOR: masm.xorq(asLongReg(dst),  asLongReg(src)); break;
-                case LSHL: masm.shlq(asLongReg(dst)); break;
-                case LSHR: masm.sarq(asLongReg(dst)); break;
-                case LUSHR:masm.shrq(asLongReg(dst)); break;
-
-                case FADD: masm.addss(asFloatReg(dst), asFloatReg(src)); break;
-                case FSUB: masm.subss(asFloatReg(dst), asFloatReg(src)); break;
-                case FMUL: masm.mulss(asFloatReg(dst), asFloatReg(src)); break;
-                case FDIV: masm.divss(asFloatReg(dst), asFloatReg(src)); break;
-                case FAND: masm.andps(asFloatReg(dst), asFloatReg(src)); break;
-                case FOR:  masm.orps(asFloatReg(dst),  asFloatReg(src)); break;
-                case FXOR: masm.xorps(asFloatReg(dst), asFloatReg(src)); break;
-
-                case DADD: masm.addsd(asDoubleReg(dst), asDoubleReg(src)); break;
-                case DSUB: masm.subsd(asDoubleReg(dst), asDoubleReg(src)); break;
-                case DMUL: masm.mulsd(asDoubleReg(dst), asDoubleReg(src)); break;
-                case DDIV: masm.divsd(asDoubleReg(dst), asDoubleReg(src)); break;
-                case DAND: masm.andpd(asDoubleReg(dst), asDoubleReg(src)); break;
-                case DOR:  masm.orpd(asDoubleReg(dst),  asDoubleReg(src)); break;
-                case DXOR: masm.xorpd(asDoubleReg(dst), asDoubleReg(src)); break;
-
-                case I2L: masm.movslq(asLongReg(dst), asIntReg(src)); break;
-                case F2D: masm.cvtss2sd(asDoubleReg(dst), asFloatReg(src)); break;
-                case D2F: masm.cvtsd2ss(asFloatReg(dst), asDoubleReg(src)); break;
-                case I2F: masm.cvtsi2ssl(asFloatReg(dst), asIntReg(src)); break;
-                case I2D: masm.cvtsi2sdl(asDoubleReg(dst), asIntReg(src)); break;
-                case L2F: masm.cvtsi2ssq(asFloatReg(dst), asLongReg(src)); break;
-                case L2D: masm.cvtsi2sdq(asDoubleReg(dst), asLongReg(src)); break;
-                case F2I:
-                    masm.cvttss2sil(asIntReg(dst), asFloatReg(src));
-                    emitConvertFixup(tasm, masm, dst, src);
-                    break;
-                case D2I:
-                    masm.cvttsd2sil(asIntReg(dst), asDoubleReg(src));
-                    emitConvertFixup(tasm, masm, dst, src);
-                    break;
-                case F2L:
-                    masm.cvttss2siq(asLongReg(dst), asFloatReg(src));
-                    emitConvertFixup(tasm, masm, dst, src);
-                    break;
-                case D2L:
-                    masm.cvttsd2siq(asLongReg(dst), asDoubleReg(src));
-                    emitConvertFixup(tasm, masm, dst, src);
-                    break;
-                case MOV_I2F: masm.movdl(asFloatReg(dst), asIntReg(src)); break;
-                case MOV_L2D: masm.movdq(asDoubleReg(dst), asLongReg(src)); break;
-                case MOV_F2I: masm.movdl(asIntReg(dst), asFloatReg(src)); break;
-                case MOV_D2L: masm.movdq(asLongReg(dst), asDoubleReg(src)); break;
-
-                case IDIV:
-                case IREM:
-                    masm.cdql();
-                    exceptionOffset = masm.codeBuffer.position();
-                    masm.idivl(asRegister(src));
-                    break;
-
-                case LDIV:
-                case LREM:
-                    Label continuation = new Label();
-                    if (opcode == LDIV) {
-                        // check for special case of Long.MIN_VALUE / -1
-                        Label normalCase = new Label();
-                        masm.movq(AMD64.rdx, java.lang.Long.MIN_VALUE);
-                        masm.cmpq(AMD64.rax, AMD64.rdx);
-                        masm.jcc(ConditionFlag.notEqual, normalCase);
-                        masm.cmpl(asRegister(src), -1);
-                        masm.jcc(ConditionFlag.equal, continuation);
-                        masm.bind(normalCase);
-                    }
-
-                    masm.cdqq();
-                    exceptionOffset = masm.codeBuffer.position();
-                    masm.idivq(asRegister(src));
-                    masm.bind(continuation);
-                    break;
-
-                case IUDIV:
-                case IUREM:
-                    // Must zero the high 64-bit word (in RDX) of the dividend
-                    masm.xorq(AMD64.rdx, AMD64.rdx);
-                    exceptionOffset = masm.codeBuffer.position();
-                    masm.divl(asRegister(src));
-                    break;
-
-                case LUDIV:
-                case LUREM:
-                    // Must zero the high 64-bit word (in RDX) of the dividend
-                    masm.xorq(AMD64.rdx, AMD64.rdx);
-                    exceptionOffset = masm.codeBuffer.position();
-                    masm.divq(asRegister(src));
-                    break;
-                default:
-                    throw GraalInternalError.shouldNotReachHere();
-            }
-        } else if (isConstant(src)) {
-            switch (opcode) {
-                case IADD: masm.incrementl(asIntReg(dst), tasm.asIntConst(src)); break;
-                case ISUB: masm.decrementl(asIntReg(dst), tasm.asIntConst(src)); break;
-                case IMUL: masm.imull(asIntReg(dst), asIntReg(dst), tasm.asIntConst(src)); break;
-                case IAND: masm.andl(asIntReg(dst), tasm.asIntConst(src)); break;
-                case IOR:  masm.orl(asIntReg(dst),  tasm.asIntConst(src)); break;
-                case IXOR: masm.xorl(asIntReg(dst), tasm.asIntConst(src)); break;
-                case ISHL: masm.shll(asIntReg(dst), tasm.asIntConst(src) & 31); break;
-                case ISHR: masm.sarl(asIntReg(dst), tasm.asIntConst(src) & 31); break;
-                case IUSHR:masm.shrl(asIntReg(dst), tasm.asIntConst(src) & 31); break;
-
-                case LADD: masm.addq(asLongReg(dst), tasm.asIntConst(src)); break;
-                case LSUB: masm.subq(asLongReg(dst), tasm.asIntConst(src)); break;
-                case LMUL: masm.imulq(asLongReg(dst), asLongReg(dst), tasm.asIntConst(src)); break;
-                case LAND: masm.andq(asLongReg(dst), tasm.asIntConst(src)); break;
-                case LOR:  masm.orq(asLongReg(dst),  tasm.asIntConst(src)); break;
-                case LXOR: masm.xorq(asLongReg(dst), tasm.asIntConst(src)); break;
-                case LSHL: masm.shlq(asLongReg(dst), tasm.asIntConst(src) & 63); break;
-                case LSHR: masm.sarq(asLongReg(dst), tasm.asIntConst(src) & 63); break;
-                case LUSHR:masm.shrq(asLongReg(dst), tasm.asIntConst(src) & 63); break;
-
-                case FADD: masm.addss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
-                case FSUB: masm.subss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
-                case FMUL: masm.mulss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
-                case FAND: masm.andps(asFloatReg(dst), tasm.asFloatConstRef(src, 16)); break;
-                case FOR:  masm.orps(asFloatReg(dst),  tasm.asFloatConstRef(src, 16)); break;
-                case FXOR: masm.xorps(asFloatReg(dst), tasm.asFloatConstRef(src, 16)); break;
-                case FDIV: masm.divss(asFloatReg(dst), tasm.asFloatConstRef(src)); break;
-
-                case DADD: masm.addsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
-                case DSUB: masm.subsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
-                case DMUL: masm.mulsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
-                case DDIV: masm.divsd(asDoubleReg(dst), tasm.asDoubleConstRef(src)); break;
-                case DAND: masm.andpd(asDoubleReg(dst), tasm.asDoubleConstRef(src, 16)); break;
-                case DOR:  masm.orpd(asDoubleReg(dst),  tasm.asDoubleConstRef(src, 16)); break;
-                case DXOR: masm.xorpd(asDoubleReg(dst), tasm.asDoubleConstRef(src, 16)); break;
-                default:   throw GraalInternalError.shouldNotReachHere();
-            }
-        } else {
-            switch (opcode) {
-                case IADD: masm.addl(asIntReg(dst), tasm.asIntAddr(src)); break;
-                case ISUB: masm.subl(asIntReg(dst), tasm.asIntAddr(src)); break;
-                case IAND: masm.andl(asIntReg(dst), tasm.asIntAddr(src)); break;
-                case IOR:  masm.orl(asIntReg(dst),  tasm.asIntAddr(src)); break;
-                case IXOR: masm.xorl(asIntReg(dst), tasm.asIntAddr(src)); break;
-
-                case LADD: masm.addq(asLongReg(dst), tasm.asLongAddr(src)); break;
-                case LSUB: masm.subq(asLongReg(dst), tasm.asLongAddr(src)); break;
-                case LAND: masm.andq(asLongReg(dst), tasm.asLongAddr(src)); break;
-                case LOR:  masm.orq(asLongReg(dst),  tasm.asLongAddr(src)); break;
-                case LXOR: masm.xorq(asLongReg(dst), tasm.asLongAddr(src)); break;
-
-                case FADD: masm.addss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
-                case FSUB: masm.subss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
-                case FMUL: masm.mulss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
-                case FDIV: masm.divss(asFloatReg(dst), tasm.asFloatAddr(src)); break;
-
-                case DADD: masm.addsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
-                case DSUB: masm.subsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
-                case DMUL: masm.mulsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
-                case DDIV: masm.divsd(asDoubleReg(dst), tasm.asDoubleAddr(src)); break;
-                default:   throw GraalInternalError.shouldNotReachHere();
-            }
-        }
-
-        if (info != null) {
-            assert exceptionOffset != -1;
-            tasm.recordImplicitException(exceptionOffset, info);
-        }
-    }
-
-    private static void emitConvertFixup(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue x) {
-        ConvertSlowPath slowPath = new ConvertSlowPath(result, x);
-        tasm.slowPaths.add(slowPath);
-        switch (result.kind) {
-            case Int:  masm.cmpl(asIntReg(result),  Integer.MIN_VALUE); break;
-            case Long: masm.cmpq(asLongReg(result), tasm.asLongConstRef(CiConstant.forLong(java.lang.Long.MIN_VALUE))); break;
-            default:   throw GraalInternalError.shouldNotReachHere();
-        }
-        masm.jcc(ConditionFlag.equal, slowPath.start);
-        masm.bind(slowPath.continuation);
-    }
-
-    private static class ConvertSlowPath extends AMD64SlowPath {
-        public final Label start = new Label();
-        public final Label continuation = new Label();
-        private final CiValue result;
-        private final CiValue x;
-
-        public ConvertSlowPath(CiValue result, CiValue x) {
-            this.result = result;
-            this.x = x;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            masm.bind(start);
-            switch (x.kind) {
-                case Float:  masm.ucomiss(asFloatReg(x),  tasm.asFloatConstRef(CiConstant.FLOAT_0)); break;
-                case Double: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(CiConstant.DOUBLE_0)); break;
-                default:     throw GraalInternalError.shouldNotReachHere();
-            }
-            Label nan = new Label();
-            masm.jcc(ConditionFlag.parity, nan);
-            masm.jcc(ConditionFlag.below, continuation);
-
-            // input is > 0 -> return maxInt
-            // result register already contains 0x80000000, so subtracting 1 gives 0x7fffffff
-            switch (result.kind) {
-                case Int:  masm.decrementl(asIntReg(result),  1); break;
-                case Long: masm.decrementq(asLongReg(result), 1); break;
-                default:   throw GraalInternalError.shouldNotReachHere();
-            }
-            masm.jmp(continuation);
-
-            // input is NaN -> return 0
-            masm.bind(nan);
-            masm.xorptr(asRegister(result), asRegister(result));
-            masm.jmp(continuation);
-        }
-    }
-
-
-    private static void verifyKind(AMD64Arithmetic opcode, CiValue result, CiValue x, CiValue y) {
-        assert (opcode.name().startsWith("I") && result.kind == CiKind.Int && x.kind.stackKind() == CiKind.Int && y.kind.stackKind() == CiKind.Int)
-            || (opcode.name().startsWith("L") && result.kind == CiKind.Long && x.kind == CiKind.Long && y.kind == CiKind.Long)
-            || (opcode.name().startsWith("F") && result.kind == CiKind.Float && x.kind == CiKind.Float && y.kind == CiKind.Float)
-            || (opcode.name().startsWith("D") && result.kind == CiKind.Double && x.kind == CiKind.Double && y.kind == CiKind.Double);
-    }
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.amd64;
-
-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.Mark;
-import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.asm.*;
-
-public class AMD64Call {
-
-    public static class DirectCallOp extends AMD64LIRInstruction implements StandardOp.CallOp {
-        private final Object targetMethod;
-        private final Map<XirMark, Mark> marks;
-
-        public DirectCallOp(Object targetMethod, CiValue result, CiValue[] parameters, LIRDebugInfo info, Map<XirMark, Mark> marks) {
-            super("CALL_DIRECT", new CiValue[] {result}, info, parameters, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-            this.targetMethod = targetMethod;
-            this.marks = marks;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            callAlignment(tasm, masm);
-            if (marks != null) {
-                marks.put(XirMark.CALLSITE, tasm.recordMark(null, new Mark[0]));
-            }
-            directCall(tasm, masm, targetMethod, info);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-            } else if (mode == OperandMode.Output) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    public static class IndirectCallOp extends AMD64LIRInstruction implements StandardOp.CallOp {
-        private final Object targetMethod;
-        private final Map<XirMark, Mark> marks;
-
-        private static CiValue[] concat(CiValue[] parameters, CiValue targetAddress) {
-            CiValue[] result = Arrays.copyOf(parameters, parameters.length + 1);
-            result[result.length - 1] = targetAddress;
-            return result;
-        }
-
-        public IndirectCallOp(Object targetMethod, CiValue result, CiValue[] parameters, CiValue targetAddress, LIRDebugInfo info, Map<XirMark, Mark> marks) {
-            super("CALL_INDIRECT", new CiValue[] {result}, info, concat(parameters, targetAddress), LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-            this.targetMethod = targetMethod;
-            this.marks = marks;
-        }
-
-        private CiValue targetAddress() {
-            return input(inputs.length - 1);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            callAlignment(tasm, masm);
-            if (marks != null) {
-                marks.put(XirMark.CALLSITE, tasm.recordMark(null, new Mark[0]));
-            }
-            indirectCall(tasm, masm, asRegister(targetAddress()), targetMethod, info);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-            } else if (mode == OperandMode.Output) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static void callAlignment(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        // make sure that the displacement word of the call ends up word aligned
-        int offset = masm.codeBuffer.position();
-        offset += tasm.target.arch.machineCodeCallDisplacementOffset;
-        while (offset++ % tasm.target.wordSize != 0) {
-            masm.nop();
-        }
-    }
-
-    public static void directCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Object target, LIRDebugInfo info) {
-        int before = masm.codeBuffer.position();
-        if (target instanceof CiRuntimeCall) {
-            long maxOffset = tasm.runtime.getMaxCallTargetOffset((CiRuntimeCall) target);
-            if (maxOffset != (int) maxOffset) {
-                // offset might not fit a 32-bit immediate, generate an
-                // indirect call with a 64-bit immediate
-                CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
-                // TODO (cwimmer): we want to get rid of a generally reserved scratch register.
-                masm.movq(scratch, 0L);
-                masm.call(scratch);
-            } else {
-                masm.call();
-            }
-        } else {
-            masm.call();
-        }
-        int after = masm.codeBuffer.position();
-        tasm.recordDirectCall(before, after, tasm.runtime.asCallTarget(target), info);
-        tasm.recordExceptionHandlers(after, info);
-        masm.ensureUniquePC();
-    }
-
-    public static void directJmp(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Object target) {
-        int before = masm.codeBuffer.position();
-        masm.jmp(0, true);
-        int after = masm.codeBuffer.position();
-        tasm.recordDirectCall(before, after, tasm.runtime.asCallTarget(target), null);
-        masm.ensureUniquePC();
-    }
-
-    public static void indirectCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiRegister dst, Object target, LIRDebugInfo info) {
-        int before = masm.codeBuffer.position();
-        masm.call(dst);
-        int after = masm.codeBuffer.position();
-        tasm.recordIndirectCall(before, after, tasm.runtime.asCallTarget(target), info);
-        tasm.recordExceptionHandlers(after, info);
-        masm.ensureUniquePC();
-    }
-
-    public static void shouldNotReachHere(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        boolean assertions = false;
-        assert (assertions = true) == true;
-
-        if (assertions) {
-            directCall(tasm, masm, CiRuntimeCall.Debug, null);
-            masm.hlt();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.amd64;
-
-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.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.asm.*;
-
-public enum AMD64Compare {
-    ICMP, LCMP, ACMP, FCMP, DCMP;
-
-    public static class CompareOp extends AMD64LIRInstruction {
-        public CompareOp(AMD64Compare opcode, CiValue x, CiValue y) {
-            super(opcode, LIRInstruction.NO_OPERANDS, null, new CiValue[] {x, y}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            CiValue x = input(0);
-            CiValue y = input(1);
-            emit(tasm, masm, (AMD64Compare) code, x, y);
-        }
-
-        @Override
-        public EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Input && index == 1) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        @Override
-        protected void verify() {
-            CiValue x = input(0);
-            CiValue y = input(1);
-
-            super.verify();
-            assert (name().startsWith("I") && x.kind == CiKind.Int && y.kind.stackKind() == CiKind.Int)
-                || (name().startsWith("I") && x.kind == CiKind.Jsr && y.kind == CiKind.Jsr)
-                || (name().startsWith("L") && x.kind == CiKind.Long && y.kind == CiKind.Long)
-                || (name().startsWith("A") && x.kind == CiKind.Object && y.kind == CiKind.Object)
-                || (name().startsWith("F") && x.kind == CiKind.Float && y.kind == CiKind.Float)
-                || (name().startsWith("D") && x.kind == CiKind.Double && y.kind == CiKind.Double);
-        }
-    }
-
-    public static void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Compare opcode, CiValue x, CiValue y) {
-        if (isRegister(y)) {
-            switch (opcode) {
-                case ICMP: masm.cmpl(asIntReg(x), asIntReg(y)); break;
-                case LCMP: masm.cmpq(asLongReg(x), asLongReg(y)); break;
-                case ACMP: masm.cmpptr(asObjectReg(x), asObjectReg(y)); break;
-                case FCMP: masm.ucomiss(asFloatReg(x), asFloatReg(y)); break;
-                case DCMP: masm.ucomisd(asDoubleReg(x), asDoubleReg(y)); break;
-                default:   throw GraalInternalError.shouldNotReachHere();
-            }
-        } else if (isConstant(y)) {
-            switch (opcode) {
-                case ICMP: masm.cmpl(asIntReg(x), tasm.asIntConst(y)); break;
-                case LCMP: masm.cmpq(asLongReg(x), tasm.asIntConst(y)); break;
-                case ACMP:
-                    if (((CiConstant) y).isNull()) {
-                        masm.cmpq(asObjectReg(x), 0); break;
-                    } else {
-                        throw GraalInternalError.shouldNotReachHere("Only null object constants are allowed in comparisons");
-                    }
-                case FCMP: masm.ucomiss(asFloatReg(x), tasm.asFloatConstRef(y)); break;
-                case DCMP: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(y)); break;
-                default:   throw GraalInternalError.shouldNotReachHere();
-            }
-        } else {
-            switch (opcode) {
-                case ICMP: masm.cmpl(asIntReg(x), tasm.asIntAddr(y)); break;
-                case LCMP: masm.cmpq(asLongReg(x), tasm.asLongAddr(y)); break;
-                case ACMP: masm.cmpptr(asObjectReg(x), tasm.asObjectAddr(y)); break;
-                case FCMP: masm.ucomiss(asFloatReg(x), tasm.asFloatAddr(y)); break;
-                case DCMP: masm.ucomisd(asDoubleReg(x), tasm.asDoubleAddr(y)); break;
-                default:  throw GraalInternalError.shouldNotReachHere();
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,383 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.amd64;
-
-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.CiAddress.Scale;
-import com.oracle.max.cri.ci.CiTargetMethod.JumpTable;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.asm.*;
-import com.oracle.graal.nodes.calc.*;
-
-public class AMD64ControlFlow {
-
-    public static class ReturnOp extends AMD64LIRInstruction {
-        public ReturnOp(CiValue input) {
-            super("RETURN", LIRInstruction.NO_OPERANDS, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            masm.ret(0);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class BranchOp extends AMD64LIRInstruction implements StandardOp.BranchOp {
-        protected Condition condition;
-        protected LabelRef destination;
-
-        public BranchOp(Condition condition, LabelRef destination, LIRDebugInfo info) {
-            super("BRANCH", LIRInstruction.NO_OPERANDS, info, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-            this.condition = condition;
-            this.destination = destination;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            masm.jcc(intCond(condition), destination.label());
-        }
-
-        @Override
-        public LabelRef destination() {
-            return destination;
-        }
-
-        @Override
-        public void negate(LabelRef newDestination) {
-            destination = newDestination;
-            condition = condition.negate();
-        }
-
-        @Override
-        public String operationString() {
-            return condition.operator + " [" + destination + "]";
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class FloatBranchOp extends BranchOp {
-        protected boolean unorderedIsTrue;
-
-        public FloatBranchOp(Condition condition, boolean unorderedIsTrue, LabelRef destination, LIRDebugInfo info) {
-            super(condition, destination, info);
-            this.unorderedIsTrue = unorderedIsTrue;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            floatJcc(masm, condition, unorderedIsTrue, destination.label());
-        }
-
-        @Override
-        public void negate(LabelRef newDestination) {
-            super.negate(newDestination);
-            unorderedIsTrue = !unorderedIsTrue;
-        }
-
-        @Override
-        public String operationString() {
-            return condition.operator + " [" + destination + "]" + (unorderedIsTrue ? " unorderedIsTrue" : " unorderedIsFalse");
-        }
-    }
-
-
-    public static class TableSwitchOp extends AMD64LIRInstruction {
-        private final int lowKey;
-        private final LabelRef defaultTarget;
-        private final LabelRef[] targets;
-
-        public TableSwitchOp(final int lowKey, final LabelRef defaultTarget, final LabelRef[] targets, Variable index, Variable scratch) {
-            super("TABLE_SWITCH", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, new CiValue[] {index}, new CiValue[] {scratch});
-            this.lowKey = lowKey;
-            this.defaultTarget = defaultTarget;
-            this.targets = targets;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            tableswitch(tasm, masm, lowKey, defaultTarget, targets, asIntReg(alive(0)), asLongReg(temp(0)));
-        }
-
-        @Override
-        public String operationString() {
-            StringBuilder buf = new StringBuilder(super.operationString());
-            buf.append("\ndefault: [").append(defaultTarget).append(']');
-            int key = lowKey;
-            for (LabelRef l : targets) {
-                buf.append("\ncase ").append(key).append(": [").append(l).append(']');
-                key++;
-            }
-            return buf.toString();
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Alive && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Temp && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class CondMoveOp extends AMD64LIRInstruction {
-        private final Condition condition;
-
-        public CondMoveOp(Variable result, Condition condition, Variable trueValue, CiValue falseValue) {
-            super("CMOVE", new CiValue[] {result}, null, new CiValue[] {falseValue}, new CiValue[] {trueValue}, LIRInstruction.NO_OPERANDS);
-            this.condition = condition;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            cmove(tasm, masm, output(0), false, condition, false, alive(0), input(0));
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Alive && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        @Override
-        public String operationString() {
-            return condition.toString() + " " + super.operationString();
-        }
-    }
-
-
-    public static class FloatCondMoveOp extends AMD64LIRInstruction {
-        private final Condition condition;
-        private final boolean unorderedIsTrue;
-
-        public FloatCondMoveOp(Variable result, Condition condition, boolean unorderedIsTrue, Variable trueValue, Variable falseValue) {
-            super("FLOAT_CMOVE", new CiValue[] {result}, null, LIRInstruction.NO_OPERANDS, new CiValue[] {trueValue, falseValue}, LIRInstruction.NO_OPERANDS);
-            this.condition = condition;
-            this.unorderedIsTrue = unorderedIsTrue;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            cmove(tasm, masm, output(0), true, condition, unorderedIsTrue, alive(0), alive(1));
-        }
-
-        @Override
-        public String operationString() {
-            return condition.toString() + " unordered=" + unorderedIsTrue + " " + super.operationString();
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Alive && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Alive && index == 1) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    private static void tableswitch(TargetMethodAssembler tasm, AMD64MacroAssembler masm, int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiRegister value, CiRegister scratch) {
-        Buffer buf = masm.codeBuffer;
-        // Compare index against jump table bounds
-        int highKey = lowKey + targets.length - 1;
-        if (lowKey != 0) {
-            // subtract the low value from the switch value
-            masm.subl(value, lowKey);
-            masm.cmpl(value, highKey - lowKey);
-        } else {
-            masm.cmpl(value, highKey);
-        }
-
-        // Jump to default target if index is not within the jump table
-        masm.jcc(ConditionFlag.above, defaultTarget.label());
-
-        // Set scratch to address of jump table
-        int leaPos = buf.position();
-        masm.leaq(scratch, new CiAddress(tasm.target.wordKind, AMD64.rip.asValue(), 0));
-        int afterLea = buf.position();
-
-        // Load jump table entry into scratch and jump to it
-        masm.movslq(value, new CiAddress(CiKind.Int, scratch.asValue(), value.asValue(), Scale.Times4, 0));
-        masm.addq(scratch, value);
-        masm.jmp(scratch);
-
-        // Inserting padding so that jump table address is 4-byte aligned
-        if ((buf.position() & 0x3) != 0) {
-            masm.nop(4 - (buf.position() & 0x3));
-        }
-
-        // Patch LEA instruction above now that we know the position of the jump table
-        int jumpTablePos = buf.position();
-        buf.setPosition(leaPos);
-        masm.leaq(scratch, new CiAddress(tasm.target.wordKind, AMD64.rip.asValue(), jumpTablePos - afterLea));
-        buf.setPosition(jumpTablePos);
-
-        // Emit jump table entries
-        for (LabelRef target : targets) {
-            Label label = target.label();
-            int offsetToJumpTableBase = buf.position() - jumpTablePos;
-            if (label.isBound()) {
-                int imm32 = label.position() - jumpTablePos;
-                buf.emitInt(imm32);
-            } else {
-                label.addPatchAt(buf.position());
-
-                buf.emitByte(0); // psuedo-opcode for jump table entry
-                buf.emitShort(offsetToJumpTableBase);
-                buf.emitByte(0); // padding to make jump table entry 4 bytes wide
-            }
-        }
-
-        JumpTable jt = new JumpTable(jumpTablePos, lowKey, highKey, 4);
-        tasm.targetMethod.addAnnotation(jt);
-    }
-
-    private static void floatJcc(AMD64MacroAssembler masm, Condition condition, boolean unorderedIsTrue, Label label) {
-        ConditionFlag cond = floatCond(condition);
-        Label endLabel = new Label();
-        if (unorderedIsTrue && !trueOnUnordered(cond)) {
-            masm.jcc(ConditionFlag.parity, label);
-        } else if (!unorderedIsTrue && trueOnUnordered(cond)) {
-            masm.jcc(ConditionFlag.parity, endLabel);
-        }
-        masm.jcc(cond, label);
-        masm.bind(endLabel);
-    }
-
-    private static void cmove(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, boolean isFloat, Condition condition, boolean unorderedIsTrue, CiValue trueValue, CiValue falseValue) {
-        ConditionFlag cond = isFloat ? floatCond(condition) : intCond(condition);
-        // check that we don't overwrite an input operand before it is used.
-        assert !result.equals(trueValue);
-
-        AMD64Move.move(tasm, masm, result, falseValue);
-        cmove(tasm, masm, result, cond, trueValue);
-
-        if (isFloat) {
-            if (unorderedIsTrue && !trueOnUnordered(cond)) {
-                cmove(tasm, masm, result, ConditionFlag.parity, trueValue);
-            } else if (!unorderedIsTrue && trueOnUnordered(cond)) {
-                cmove(tasm, masm, result, ConditionFlag.parity, falseValue);
-            }
-        }
-    }
-
-    private static void cmove(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, ConditionFlag cond, CiValue other) {
-        if (isRegister(other)) {
-            assert asRegister(other) != asRegister(result) : "other already overwritten by previous move";
-            switch (other.kind) {
-                case Int:  masm.cmovl(cond, asRegister(result), asRegister(other)); break;
-                case Long: masm.cmovq(cond, asRegister(result), asRegister(other)); break;
-                default:   throw GraalInternalError.shouldNotReachHere();
-            }
-        } else {
-            switch (other.kind) {
-                case Int:  masm.cmovl(cond, asRegister(result), tasm.asAddress(other)); break;
-                case Long: masm.cmovq(cond, asRegister(result), tasm.asAddress(other)); break;
-                default:   throw GraalInternalError.shouldNotReachHere();
-            }
-        }
-    }
-
-    private static ConditionFlag intCond(Condition cond) {
-        switch (cond) {
-            case EQ: return ConditionFlag.equal;
-            case NE: return ConditionFlag.notEqual;
-            case LT: return ConditionFlag.less;
-            case LE: return ConditionFlag.lessEqual;
-            case GE: return ConditionFlag.greaterEqual;
-            case GT: return ConditionFlag.greater;
-            case BE: return ConditionFlag.belowEqual;
-            case AE: return ConditionFlag.aboveEqual;
-            case AT: return ConditionFlag.above;
-            case BT: return ConditionFlag.below;
-            case OF: return ConditionFlag.overflow;
-            case NOF: return ConditionFlag.noOverflow;
-            default: throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private static ConditionFlag floatCond(Condition cond) {
-        switch (cond) {
-            case EQ: return ConditionFlag.equal;
-            case NE: return ConditionFlag.notEqual;
-            case LT: return ConditionFlag.below;
-            case LE: return ConditionFlag.belowEqual;
-            case GE: return ConditionFlag.aboveEqual;
-            case GT: return ConditionFlag.above;
-            default: throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private static boolean trueOnUnordered(ConditionFlag condition) {
-        switch(condition) {
-            case aboveEqual:
-            case notEqual:
-            case above:
-            case less:
-            case overflow:
-                return false;
-            case equal:
-            case belowEqual:
-            case below:
-            case greaterEqual:
-            case noOverflow:
-                return true;
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64LIRInstruction.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.amd64;
-
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.asm.*;
-
-/**
- * Convenience class to provide AMD64MacroAssembler for the {@link #emitCode} method.
- */
-public abstract class AMD64LIRInstruction extends LIRInstruction {
-
-    public AMD64LIRInstruction(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps) {
-        super(opcode, outputs, info, inputs, alives, temps);
-    }
-
-    @Override
-    public final void emitCode(TargetMethodAssembler tasm) {
-        emitCode(tasm, (AMD64MacroAssembler) tasm.asm);
-    }
-
-    public abstract void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm);
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,489 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.amd64;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static java.lang.Double.*;
-import static java.lang.Float.*;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.StandardOp.*;
-import com.oracle.graal.lir.asm.*;
-
-public class AMD64Move {
-
-    public static class SpillMoveOp extends AMD64LIRInstruction implements MoveOp {
-        public SpillMoveOp(CiValue result, CiValue input) {
-            super("MOVE", new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            move(tasm, masm, getResult(), getInput());
-        }
-
-        @Override
-        public CiValue getInput() {
-            return input(0);
-        }
-        @Override
-        public CiValue getResult() {
-            return output(0);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class MoveToRegOp extends AMD64LIRInstruction implements MoveOp {
-        public MoveToRegOp(CiValue result, CiValue input) {
-            super("MOVE", new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            move(tasm, masm, getResult(), getInput());
-        }
-
-        @Override
-        public CiValue getInput() {
-            return input(0);
-        }
-        @Override
-        public CiValue getResult() {
-            return output(0);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.RegisterHint);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class MoveFromRegOp extends AMD64LIRInstruction implements MoveOp {
-        public MoveFromRegOp(CiValue result, CiValue input) {
-            super("MOVE", new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            move(tasm, masm, getResult(), getInput());
-        }
-
-        @Override
-        public CiValue getInput() {
-            return input(0);
-        }
-        @Override
-        public CiValue getResult() {
-            return output(0);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant, OperandFlag.RegisterHint);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class LoadOp extends AMD64LIRInstruction {
-        public LoadOp(CiValue result, CiValue address, LIRDebugInfo info) {
-            super("LOAD", new CiValue[] {result}, info, new CiValue[] {address}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            load(tasm, masm, output(0), (CiAddress) input(0), info);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Address);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class StoreOp extends AMD64LIRInstruction {
-        public StoreOp(CiValue address, CiValue input, LIRDebugInfo info) {
-            super("STORE", LIRInstruction.NO_OPERANDS, info, new CiValue[] {address, input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            store(tasm, masm, (CiAddress) input(0), input(1), info);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Address);
-            } else if (mode == OperandMode.Input && index == 1) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Constant);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class LeaOp extends AMD64LIRInstruction {
-        public LeaOp(CiValue result, CiValue address) {
-            super("LEA", new CiValue[] {result}, null, new CiValue[] {address}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            masm.leaq(asLongReg(output(0)), tasm.asAddress(input(0)));
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Address, OperandFlag.Stack, OperandFlag.Uninitialized);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class MembarOp extends AMD64LIRInstruction {
-        private final int barriers;
-
-        public MembarOp(final int barriers) {
-            super("MEMBAR", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-            this.barriers = barriers;
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            masm.membar(barriers);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class NullCheckOp extends AMD64LIRInstruction {
-        public NullCheckOp(Variable input, LIRDebugInfo info) {
-            super("NULL_CHECK", LIRInstruction.NO_OPERANDS, info, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            tasm.recordImplicitException(masm.codeBuffer.position(), info);
-            masm.nullCheck(asRegister(input(0)));
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static class CompareAndSwapOp extends AMD64LIRInstruction {
-        public CompareAndSwapOp(CiValue result, CiAddress address, CiValue cmpValue, CiValue newValue) {
-            super("CAS", new CiValue[] {result}, null, new CiValue[] {address, cmpValue, newValue}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            compareAndSwap(tasm, masm, output(0), asAddress(input(0)), input(1), input(2));
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Input && index == 0) {
-                return EnumSet.of(OperandFlag.Address);
-            } else if (mode == OperandMode.Input && index == 1) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Input && index == 2) {
-                return EnumSet.of(OperandFlag.Register);
-            } else if (mode == OperandMode.Output && index == 0) {
-                return EnumSet.of(OperandFlag.Register);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static void move(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
-        if (isRegister(input)) {
-            if (isRegister(result)) {
-                reg2reg(masm, result, input);
-            } else if (isStackSlot(result)) {
-                reg2stack(tasm, masm, result, input);
-            } else {
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        } else if (isStackSlot(input)) {
-            if (isRegister(result)) {
-                stack2reg(tasm, masm, result, input);
-            } else {
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        } else if (isConstant(input)) {
-            if (isRegister(result)) {
-                const2reg(tasm, masm, result, (CiConstant) input);
-            } else if (isStackSlot(result)) {
-                const2stack(tasm, masm, result, (CiConstant) input);
-            } else {
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        } else {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private static void reg2reg(AMD64MacroAssembler masm, CiValue result, CiValue input) {
-        if (input.equals(result)) {
-            return;
-        }
-        switch (input.kind) {
-            case Jsr:
-            case Int:    masm.movl(asRegister(result),    asRegister(input)); break;
-            case Long:   masm.movq(asRegister(result),    asRegister(input)); break;
-            case Float:  masm.movflt(asFloatReg(result),  asFloatReg(input)); break;
-            case Double: masm.movdbl(asDoubleReg(result), asDoubleReg(input)); break;
-            case Object: masm.movq(asRegister(result),    asRegister(input)); break;
-            default:     throw GraalInternalError.shouldNotReachHere("kind=" + result.kind);
-        }
-    }
-
-    private static void reg2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
-        switch (input.kind) {
-            case Jsr:
-            case Int:    masm.movl(tasm.asAddress(result),   asRegister(input)); break;
-            case Long:   masm.movq(tasm.asAddress(result),   asRegister(input)); break;
-            case Float:  masm.movflt(tasm.asAddress(result), asFloatReg(input)); break;
-            case Double: masm.movsd(tasm.asAddress(result),  asDoubleReg(input)); break;
-            case Object: masm.movq(tasm.asAddress(result),   asRegister(input)); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private static void stack2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
-        switch (input.kind) {
-            case Jsr:
-            case Int:    masm.movl(asRegister(result),    tasm.asAddress(input)); break;
-            case Long:   masm.movq(asRegister(result),    tasm.asAddress(input)); break;
-            case Float:  masm.movflt(asFloatReg(result),  tasm.asAddress(input)); break;
-            case Double: masm.movdbl(asDoubleReg(result), tasm.asAddress(input)); break;
-            case Object: masm.movq(asRegister(result),    tasm.asAddress(input)); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private static void const2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiConstant input) {
-        // Note: we use the kind of the input operand (and not the kind of the result operand) because they don't match
-        // in all cases. For example, an object constant can be loaded to a long register when unsafe casts occurred (e.g.,
-        // for a write barrier where arithmetic operations are then performed on the pointer).
-        switch (input.kind.stackKind()) {
-            case Jsr:
-            case Int:
-                // Do not optimize with an XOR as this instruction may be between
-                // a CMP and a Jcc in which case the XOR will modify the condition
-                // flags and interfere with the Jcc.
-                masm.movl(asRegister(result), tasm.asIntConst(input));
-                break;
-            case Long:
-                // Do not optimize with an XOR as this instruction may be between
-                // a CMP and a Jcc in which case the XOR will modify the condition
-                // flags and interfere with the Jcc.
-                masm.movq(asRegister(result), input.asLong());
-                break;
-            case Float:
-                // This is *not* the same as 'constant == 0.0f' in the case where constant is -0.0f
-                if (Float.floatToRawIntBits(input.asFloat()) == Float.floatToRawIntBits(0.0f)) {
-                    masm.xorps(asFloatReg(result), asFloatReg(result));
-                } else {
-                    masm.movflt(asFloatReg(result), tasm.asFloatConstRef(input));
-                }
-                break;
-            case Double:
-                // This is *not* the same as 'constant == 0.0d' in the case where constant is -0.0d
-                if (Double.doubleToRawLongBits(input.asDouble()) == Double.doubleToRawLongBits(0.0d)) {
-                    masm.xorpd(asDoubleReg(result), asDoubleReg(result));
-                } else {
-                    masm.movdbl(asDoubleReg(result), tasm.asDoubleConstRef(input));
-                }
-                break;
-            case Object:
-                // Do not optimize with an XOR as this instruction may be between
-                // a CMP and a Jcc in which case the XOR will modify the condition
-                // flags and interfere with the Jcc.
-                if (input.isNull()) {
-                    masm.movq(asRegister(result), 0x0L);
-                } else if (tasm.target.inlineObjects) {
-                    tasm.recordDataReferenceInCode(input, 0);
-                    masm.movq(asRegister(result), 0xDEADDEADDEADDEADL);
-                } else {
-                    masm.movq(asRegister(result), tasm.recordDataReferenceInCode(input, 0));
-                }
-                break;
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    private static void const2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiConstant input) {
-        switch (input.kind.stackKind()) {
-            case Jsr:
-            case Int:    masm.movl(tasm.asAddress(result), input.asInt()); break;
-            case Long:   masm.movlong(tasm.asAddress(result), input.asLong()); break;
-            case Float:  masm.movl(tasm.asAddress(result), floatToRawIntBits(input.asFloat())); break;
-            case Double: masm.movlong(tasm.asAddress(result), doubleToRawLongBits(input.asDouble())); break;
-            case Object:
-                if (input.isNull()) {
-                    masm.movlong(tasm.asAddress(result), 0L);
-                } else {
-                    throw GraalInternalError.shouldNotReachHere("Non-null object constants must be in register");
-                }
-                break;
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-
-    public static void load(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiAddress loadAddr, LIRDebugInfo info) {
-        if (info != null) {
-            tasm.recordImplicitException(masm.codeBuffer.position(), info);
-        }
-        switch (loadAddr.kind) {
-            case Boolean:
-            case Byte:   masm.movsxb(asRegister(result),  loadAddr); break;
-            case Char:   masm.movzxl(asRegister(result),  loadAddr); break;
-            case Short:  masm.movswl(asRegister(result),  loadAddr); break;
-            case Int:    masm.movslq(asRegister(result),  loadAddr); break;
-            case Long:   masm.movq(asRegister(result),    loadAddr); break;
-            case Float:  masm.movflt(asFloatReg(result),  loadAddr); break;
-            case Double: masm.movdbl(asDoubleReg(result), loadAddr); break;
-            case Object: masm.movq(asRegister(result),    loadAddr); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    public static void store(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiAddress storeAddr, CiValue input, LIRDebugInfo info) {
-        if (info != null) {
-            tasm.recordImplicitException(masm.codeBuffer.position(), info);
-        }
-
-        if (isRegister(input)) {
-            switch (storeAddr.kind) {
-                case Boolean:
-                case Byte:   masm.movb(storeAddr,   asRegister(input)); break;
-                case Char:
-                case Short:  masm.movw(storeAddr,   asRegister(input)); break;
-                case Int:    masm.movl(storeAddr,   asRegister(input)); break;
-                case Long:   masm.movq(storeAddr,   asRegister(input)); break;
-                case Float:  masm.movflt(storeAddr, asFloatReg(input)); break;
-                case Double: masm.movsd(storeAddr,  asDoubleReg(input)); break;
-                case Object: masm.movq(storeAddr,   asRegister(input)); break;
-                default:     throw GraalInternalError.shouldNotReachHere();
-            }
-        } else if (isConstant(input)) {
-            CiConstant c = (CiConstant) input;
-            switch (storeAddr.kind) {
-                case Boolean:
-                case Byte:   masm.movb(storeAddr, c.asInt() & 0xFF); break;
-                case Char:
-                case Short:  masm.movw(storeAddr, c.asInt() & 0xFFFF); break;
-                case Jsr:
-                case Int:    masm.movl(storeAddr, c.asInt()); break;
-                case Long:
-                    if (NumUtil.isInt(c.asLong())) {
-                        masm.movslq(storeAddr, (int) c.asLong());
-                    } else {
-                        throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory");
-                    }
-                    break;
-                case Float:  masm.movl(storeAddr, floatToRawIntBits(c.asFloat())); break;
-                case Double: throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory");
-                case Object:
-                    if (c.isNull()) {
-                        masm.movptr(storeAddr, 0);
-                    } else {
-                        throw GraalInternalError.shouldNotReachHere("Cannot store 64-bit constants to memory");
-                    }
-                    break;
-                default:
-                    throw GraalInternalError.shouldNotReachHere();
-            }
-
-        } else {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    protected static void compareAndSwap(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiAddress address, CiValue cmpValue, CiValue newValue) {
-        assert asRegister(cmpValue) == AMD64.rax && asRegister(result) == AMD64.rax;
-
-        if (tasm.target.isMP) {
-            masm.lock();
-        }
-        switch (cmpValue.kind) {
-            case Int:    masm.cmpxchgl(asRegister(newValue), address); break;
-            case Long:
-            case Object: masm.cmpxchgq(asRegister(newValue), address); break;
-            default:     throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SlowPath.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.amd64;
-
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.asm.*;
-
-/**
- * Convenience class to provide AMD64MacroAssembler for the {@link #emitCode} method.
- */
-public abstract class AMD64SlowPath implements LIR.SlowPath {
-    @Override
-    public final void emitCode(TargetMethodAssembler tasm) {
-        emitCode(tasm, (AMD64MacroAssembler) tasm.asm);
-    }
-
-    public abstract void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm);
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,344 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-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.CiCallingConvention.Type;
-import com.oracle.max.cri.ri.*;
-
-/**
- * This class is used to build the stack frame layout for a compiled method.
- * A {@link CiStackSlot} is used to index slots of the frame relative to the stack pointer.
- * The frame size is only fixed after register allocation when all spill slots have
- * been allocated. Both the outgoing argument area and the spill are can grow until then.
- * Therefore, outgoing arguments are indexed from the stack pointer, while spill slots
- * are indexed from the beginning of the frame (and the total frame size has to be added
- * to get the actual offset from the stack pointer).
- * <br>
- * This is the format of a stack frame:
- * <pre>
- *   Base       Contents
- *
- *            :                                :  -----
- *   caller   | incoming overflow argument n   |    ^
- *   frame    :     ...                        :    | positive
- *            | incoming overflow argument 0   |    | offsets
- *   ---------+--------------------------------+---------------------
- *            | return address                 |    |            ^
- *   current  +--------------------------------+    |            |    -----
- *   frame    |                                |    |            |      ^
- *            : callee save area               :    |            |      |
- *            |                                |    |            |      |
- *            +--------------------------------+    |            |      |
- *            | spill slot 0                   |    | negative   |      |
- *            :     ...                        :    v offsets    |      |
- *            | spill slot n                   |  -----        total  frame
- *            +--------------------------------+               frame  size
- *            | alignment padding              |               size     |
- *            +--------------------------------+  -----          |      |
- *            | outgoing overflow argument n   |    ^            |      |
- *            :     ...                        :    | positive   |      |
- *            | outgoing overflow argument 0   |    | offsets    v      v
- *    %sp-->  +--------------------------------+---------------------------
- *
- * </pre>
- * The spill slot area also includes stack allocated memory blocks (ALLOCA blocks). The size
- * of such a block may be greater than the size of a normal spill slot or the word size.
- * <br>
- * A runtime has two ways to reserve space in the stack frame for its own use: <ul>
- * <li>A memory block somewhere in the frame of size {@link RiRuntime#getCustomStackAreaSize()}. The offset
- *     to this block is returned in {@link CiTargetMethod#customStackAreaOffset()}.
- * <li>At the beginning of the overflow argument area: The calling convention can specify that the first
- *     overflow stack argument is not at offset 0, but at a specified offset o. Use
- *     {@link RiRuntime#getMinimumOutgoingSize()} to make sure that call-free methods also have this space
- *     reserved. Then the VM can use memory the memory at offset 0 relative to the stack pointer.
- * </ul>
- */
-public final class FrameMap {
-    public final RiRuntime runtime;
-    public final CiTarget target;
-    public final RiRegisterConfig registerConfig;
-
-    /**
-     * The final frame size, not including the size of the return address.
-     * The value is only set after register allocation is complete, i.e., after all spill slots have been allocated.
-     */
-    private int frameSize;
-
-    /**
-     * Size of the area occupied by spill slots and other stack-allocated memory blocks.
-     */
-    private int spillSize;
-
-    /**
-     * Size of the area occupied by outgoing overflow arguments.
-     * This value is adjusted as calling conventions for outgoing calls are retrieved.
-     */
-    private int outgoingSize;
-
-    /**
-     * The list of stack areas allocated in this frame that are present in every reference map.
-     */
-    private final List<CiStackSlot> objectStackBlocks;
-
-    /**
-     * The stack area reserved for use by the VM, or {@code null} if the VM does not request stack space.
-     */
-    private final CiStackSlot customArea;
-
-    /**
-     * Creates a new frame map for the specified method.
-     */
-    public FrameMap(RiRuntime runtime, CiTarget target, RiRegisterConfig registerConfig) {
-        this.runtime = runtime;
-        this.target = target;
-        this.registerConfig = registerConfig;
-        this.frameSize = -1;
-        this.spillSize = returnAddressSize() + calleeSaveAreaSize();
-        this.outgoingSize = runtime.getMinimumOutgoingSize();
-        this.objectStackBlocks = new ArrayList<>();
-        this.customArea = allocateStackBlock(runtime.getCustomStackAreaSize(), false);
-    }
-
-
-    private int returnAddressSize() {
-        return target.arch.returnAddressSize;
-    }
-
-    private int calleeSaveAreaSize() {
-        CiCalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
-        return csl != null ? csl.size : 0;
-    }
-
-    /**
-     * Gets the frame size of the compiled frame, not including the size of the return address.
-     * @return The size of the frame (in bytes).
-     */
-    public int frameSize() {
-        assert frameSize != -1 : "frame size not computed yet";
-        return frameSize;
-    }
-
-    /**
-     * Gets the total frame size of the compiled frame, including the size of the return address.
-     * @return The total size of the frame (in bytes).
-     */
-    public int totalFrameSize() {
-        return frameSize() + returnAddressSize();
-    }
-
-    /**
-     * Sets the frame size for this frame.
-     * @param frameSize The frame size (in bytes).
-     */
-    public void setFrameSize(int frameSize) {
-        assert this.frameSize == -1 : "must only be set once";
-        this.frameSize = frameSize;
-    }
-
-    /**
-     * Computes the frame size for this frame. After this method has been called, methods that change the
-     * frame size cannot be called anymore, e.g., no more spill slots or outgoing arguments can be requested.
-     */
-    public void finish() {
-        setFrameSize(target.alignFrameSize(outgoingSize + spillSize - returnAddressSize()));
-    }
-
-    /**
-     * Computes the offset of a stack slot relative to the frame register.
-     * This is also the bit index of stack slots in the reference map.
-     *
-     * @param slot a stack slot
-     * @return the offset of the stack slot
-     */
-    public int offsetForStackSlot(CiStackSlot slot) {
-        assert (!slot.rawAddFrameSize() && slot.rawOffset() < outgoingSize) ||
-            (slot.rawAddFrameSize() && slot.rawOffset() < 0 && -slot.rawOffset() <= spillSize) ||
-            (slot.rawAddFrameSize() && slot.rawOffset() >= 0);
-        return slot.offset(totalFrameSize());
-    }
-
-    /**
-     * Gets the offset to the stack area where callee-saved registers are stored.
-     * @return The offset to the callee save area (in bytes).
-     */
-    public int offsetToCalleeSaveArea() {
-        return frameSize() - calleeSaveAreaSize();
-    }
-
-    /**
-     * Gets the offset of the stack area stack block reserved for use by the VM, or -1 if the VM does not request stack space.
-     * @return The offset to the custom area (in bytes).
-     */
-    public int offsetToCustomArea() {
-        return customArea == null ? -1 : offsetForStackSlot(customArea);
-    }
-
-    /**
-     * Informs the frame map that the compiled code calls a particular method, which
-     * may need stack space for outgoing arguments.
-     * @param cc The calling convention for the called method.
-     * @param type The type of calling convention.
-     */
-    public void callsMethod(CiCallingConvention cc, Type type) {
-        // TODO look at the actual stack offsets?
-        assert type.out;
-        reserveOutgoing(cc.stackSize);
-    }
-
-    /**
-     * Reserves space for stack-based outgoing arguments.
-     * @param argsSize The amount of space (in bytes) to reserve for stack-based outgoing arguments.
-     */
-    public void reserveOutgoing(int argsSize) {
-        assert frameSize == -1 : "frame size must not yet be fixed";
-        outgoingSize = Math.max(outgoingSize, argsSize);
-    }
-
-    private CiStackSlot getSlot(CiKind kind, int additionalOffset) {
-        return CiStackSlot.get(kind, -spillSize + additionalOffset, true);
-    }
-
-    /**
-     * Reserves a spill slot in the frame of the method being compiled. The returned slot is aligned on its natural alignment,
-     * i.e., an 8-byte spill slot is aligned at an 8-byte boundary.
-     * @param kind The kind of the spill slot to be reserved.
-     * @return A spill slot denoting the reserved memory area.
-     */
-    public CiStackSlot allocateSpillSlot(CiKind kind) {
-        assert frameSize == -1 : "frame size must not yet be fixed";
-        int size = target.sizeInBytes(kind);
-        spillSize = NumUtil.roundUp(spillSize + size, size);
-        return getSlot(kind, 0);
-    }
-
-    /**
-     * Reserves a block of memory in the frame of the method being compiled. The returned block is aligned on a word boundary.
-     * If the requested size is 0, the method returns {@code null}.
-     *
-     * @param size The size to reserve (in bytes).
-     * @param refs Specifies if the block is all references. If true, the block will be in all reference maps for this method.
-     *             The caller is responsible to initialize the memory block before the first instruction that uses a reference map.
-     * @return A stack slot describing the begin of the memory block.
-     */
-    public CiStackSlot allocateStackBlock(int size, boolean refs) {
-        assert frameSize == -1 : "frame size must not yet be fixed";
-        if (size == 0) {
-            return null;
-        }
-        spillSize = NumUtil.roundUp(spillSize + size, target.wordSize);
-
-        if (refs) {
-            assert size % target.wordSize == 0;
-            CiStackSlot result = getSlot(CiKind.Object, 0);
-            objectStackBlocks.add(result);
-            for (int i = target.wordSize; i < size; i += target.wordSize) {
-                objectStackBlocks.add(getSlot(CiKind.Object, i));
-            }
-            return result;
-
-        } else {
-            return getSlot(target.wordKind, 0);
-        }
-    }
-
-
-    private int frameRefMapIndex(CiStackSlot slot) {
-        assert offsetForStackSlot(slot) % target.wordSize == 0;
-        return offsetForStackSlot(slot) / target.wordSize;
-    }
-
-    /**
-     * Initializes a reference map that covers all registers of the target architecture.
-     */
-    public CiBitMap initRegisterRefMap() {
-        return new CiBitMap(target.arch.registerReferenceMapBitCount);
-    }
-
-    /**
-     * Initializes a reference map. Initially, the size is large enough to cover all the
-     * slots in the frame. If the method has incoming reference arguments on the stack,
-     * the reference map might grow later when such a reference is set.
-     */
-    public CiBitMap initFrameRefMap() {
-        CiBitMap frameRefMap = new CiBitMap(frameSize() / target.wordSize);
-        for (CiStackSlot slot : objectStackBlocks) {
-            setReference(slot, null, frameRefMap);
-        }
-        return frameRefMap;
-    }
-
-    /**
-     * Marks the specified location as a reference in the reference map of the debug information.
-     * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
-     * {@link CiConstant} is automatically tracked.
-     *
-     * @param location The location to be added to the reference map.
-     * @param registerRefMap A register reference map, as created by {@link #initRegisterRefMap()}.
-     * @param frameRefMap A frame reference map, as created by {@link #initFrameRefMap()}.
-     */
-    public void setReference(CiValue location, CiBitMap registerRefMap, CiBitMap frameRefMap) {
-        if (location.kind == CiKind.Object) {
-            if (isRegister(location)) {
-                assert registerRefMap.size() == target.arch.registerReferenceMapBitCount;
-                registerRefMap.set(asRegister(location).number);
-            } else if (isStackSlot(location)) {
-                int index = frameRefMapIndex(asStackSlot(location));
-                frameRefMap.grow(index + 1);
-                frameRefMap.set(index);
-            } else {
-                assert isConstant(location);
-            }
-        }
-    }
-
-    /**
-     * Clears the specified location as a reference in the reference map of the debug information.
-     * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
-     * {@link CiConstant} is automatically tracked.
-     *
-     * @param location The location to be removed from the reference map.
-     * @param registerRefMap A register reference map, as created by {@link #initRegisterRefMap()}.
-     * @param frameRefMap A frame reference map, as created by {@link #initFrameRefMap()}.
-     */
-    public void clearReference(CiValue location, CiBitMap registerRefMap, CiBitMap frameRefMap) {
-        if (location.kind == CiKind.Object) {
-            if (location instanceof CiRegisterValue) {
-                assert registerRefMap.size() == target.arch.registerReferenceMapBitCount;
-                registerRefMap.clear(asRegister(location).number);
-            } else if (isStackSlot(location)) {
-                int index = frameRefMapIndex(asStackSlot(location));
-                if (index < frameRefMap.size()) {
-                    frameRefMap.clear(index);
-                }
-            } else {
-                assert isConstant(location);
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIR.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.asm.*;
-import com.oracle.graal.lir.cfg.*;
-
-/**
- * This class implements the overall container for the LIR graph
- * and directs its construction, optimization, and finalization.
- */
-public class LIR {
-
-    public final ControlFlowGraph cfg;
-
-    /**
-     * The nodes for the blocks.
-     * TODO: This should go away, we want all nodes connected with a next-pointer.
-     */
-    private final BlockMap<List<Node>> nodesFor;
-
-    /**
-     * The linear-scan ordered list of blocks.
-     */
-    private final List<Block> linearScanOrder;
-
-    /**
-     * The order in which the code is emitted.
-     */
-    private final List<Block> codeEmittingOrder;
-
-
-    public final List<SlowPath> slowPaths;
-
-    public final List<SlowPath> deoptimizationStubs;
-
-    /**
-     * The last slow path emitted, which can be used emit marker bytes.
-     */
-    public SlowPath methodEndMarker;
-
-    private int numVariables;
-
-    public SpillMoveFactory spillMoveFactory;
-
-    public interface SpillMoveFactory {
-        LIRInstruction createMove(CiValue result, CiValue input);
-        LIRInstruction createExchange(CiValue input1, CiValue input2);
-    }
-
-    public interface SlowPath {
-        void emitCode(TargetMethodAssembler tasm);
-    }
-
-    /**
-     * Creates a new LIR instance for the specified compilation.
-     * @param numLoops number of loops
-     * @param compilation the compilation
-     */
-    public LIR(ControlFlowGraph cfg, BlockMap<List<Node>> nodesFor, List<Block> linearScanOrder, List<Block> codeEmittingOrder) {
-        this.cfg = cfg;
-        this.nodesFor = nodesFor;
-        this.codeEmittingOrder = codeEmittingOrder;
-        this.linearScanOrder = linearScanOrder;
-
-        slowPaths = new ArrayList<>();
-        deoptimizationStubs = new ArrayList<>();
-    }
-
-    public List<Node> nodesFor(Block block) {
-        return nodesFor.get(block);
-    }
-
-    /**
-     * Gets the linear scan ordering of blocks as a list.
-     * @return the blocks in linear scan order
-     */
-    public List<Block> linearScanOrder() {
-        return linearScanOrder;
-    }
-
-    public List<Block> codeEmittingOrder() {
-        return codeEmittingOrder;
-    }
-
-    public int numVariables() {
-        return numVariables;
-    }
-
-    public int nextVariable() {
-        return numVariables++;
-    }
-
-    public void emitCode(TargetMethodAssembler tasm) {
-        for (Block b : codeEmittingOrder()) {
-            emitBlock(tasm, b);
-        }
-
-        // generate code for slow cases
-        for (SlowPath sp : slowPaths) {
-            emitSlowPath(tasm, sp);
-        }
-        // generate deoptimization stubs
-        for (SlowPath sp : deoptimizationStubs) {
-            emitSlowPath(tasm, sp);
-        }
-        // generate traps at the end of the method
-        emitSlowPath(tasm, methodEndMarker);
-    }
-
-    private static void emitBlock(TargetMethodAssembler tasm, Block block) {
-        if (Debug.isDumpEnabled()) {
-            tasm.blockComment(String.format("block B%d %s", block.getId(), block.getLoop()));
-        }
-
-        for (LIRInstruction op : block.lir) {
-            if (Debug.isDumpEnabled()) {
-                tasm.blockComment(String.format("%d %s", op.id(), op));
-            }
-
-            emitOp(tasm, op);
-        }
-    }
-
-    private static void emitOp(TargetMethodAssembler tasm, LIRInstruction op) {
-        try {
-            try {
-                op.emitCode(tasm);
-            } catch (AssertionError t) {
-                throw new GraalInternalError(t);
-            } catch (RuntimeException t) {
-                throw new GraalInternalError(t);
-            }
-        } catch (GraalInternalError e) {
-            throw e.addContext("lir instruction", op);
-        }
-    }
-
-    private static void emitSlowPath(TargetMethodAssembler tasm, SlowPath sp) {
-        if (Debug.isDumpEnabled()) {
-            tasm.blockComment(String.format("slow case %s", sp.getClass().getName()));
-        }
-        sp.emitCode(tasm);
-    }
-
-/*
-    private int lastDecodeStart;
-
-    private void printAssembly(TargetMethodAssembler tasm) {
-        byte[] currentBytes = tasm.asm.codeBuffer.copyData(lastDecodeStart, tasm.asm.codeBuffer.position());
-        if (currentBytes.length > 0) {
-            String disasm = tasm.runtime.disassemble(currentBytes, lastDecodeStart);
-            if (disasm.length() != 0) {
-                TTY.println(disasm);
-            } else {
-                TTY.println("Code [+%d]: %d bytes", lastDecodeStart, currentBytes.length);
-                Util.printBytes(lastDecodeStart, currentBytes, GraalOptions.PrintAssemblyBytesPerLine);
-            }
-        }
-        lastDecodeStart = tasm.asm.codeBuffer.position();
-    }
-
-
-    public static void printBlock(Block x) {
-        // print block id
-        TTY.print("B%d ", x.getId());
-
-        // print flags
-        if (x.isLoopHeader()) {
-            TTY.print("lh ");
-        }
-        if (x.isLoopEnd()) {
-            TTY.print("le ");
-        }
-
-        // print block bci range
-        TTY.print("[%d, %d] ", -1, -1);
-
-        // print predecessors and successors
-        if (x.numberOfPreds() > 0) {
-            TTY.print("preds: ");
-            for (int i = 0; i < x.numberOfPreds(); i++) {
-                TTY.print("B%d ", x.predAt(i).getId());
-            }
-        }
-
-        if (x.numberOfSux() > 0) {
-            TTY.print("sux: ");
-            for (int i = 0; i < x.numberOfSux(); i++) {
-                TTY.print("B%d ", x.suxAt(i).getId());
-            }
-        }
-
-        TTY.println();
-    }
-
-    public static void printLIR(List<Block> blocks) {
-        if (TTY.isSuppressed()) {
-            return;
-        }
-        TTY.println("LIR:");
-        int i;
-        for (i = 0; i < blocks.size(); i++) {
-            Block bb = blocks.get(i);
-            printBlock(bb);
-            TTY.println("__id_Instruction___________________________________________");
-            for (LIRInstruction op : bb.lir) {
-                TTY.println(op.toStringWithIdPrefix());
-                TTY.println();
-            }
-            TTY.println();
-        }
-    }
-*/
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.lir.LIRInstruction.OperandFlag;
-import com.oracle.graal.lir.LIRInstruction.OperandMode;
-import com.oracle.graal.lir.LIRInstruction.ValueProcedure;
-
-/**
- * This class represents garbage collection and deoptimization information attached to a LIR instruction.
- */
-public class LIRDebugInfo {
-    public final CiFrame topFrame;
-    private final CiVirtualObject[] virtualObjects;
-    private final List<CiStackSlot> pointerSlots;
-    public final LabelRef exceptionEdge;
-    private CiDebugInfo debugInfo;
-
-    public LIRDebugInfo(CiFrame topFrame, CiVirtualObject[] virtualObjects, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
-        this.topFrame = topFrame;
-        this.virtualObjects = virtualObjects;
-        this.pointerSlots = pointerSlots;
-        this.exceptionEdge = exceptionEdge;
-    }
-
-    public boolean hasDebugInfo() {
-        return debugInfo != null;
-    }
-
-    public CiDebugInfo debugInfo() {
-        assert debugInfo != null : "debug info not allocated yet";
-        return debugInfo;
-    }
-
-    /**
-     * Iterates the frame state and calls the {@link ValueProcedure} for every variable.
-     *
-     * @param proc The procedure called for variables.
-     */
-    public void forEachState(ValueProcedure proc) {
-        for (CiFrame cur = topFrame; cur != null; cur = cur.caller()) {
-            processValues(cur.values, proc);
-        }
-        if (virtualObjects != null) {
-            for (CiVirtualObject obj : virtualObjects) {
-                processValues(obj.values(), proc);
-            }
-        }
-    }
-
-    /**
-     * We filter out constant and illegal values ourself before calling the procedure, so {@link OperandFlag#Constant} and {@link OperandFlag#Illegal} need not be set.
-     */
-    private static final EnumSet<OperandFlag> STATE_FLAGS = EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-
-    private void processValues(CiValue[] values, ValueProcedure proc) {
-        for (int i = 0; i < values.length; i++) {
-            CiValue value = values[i];
-            if (value instanceof CiMonitorValue) {
-                CiMonitorValue monitor = (CiMonitorValue) value;
-                if (processed(monitor.owner)) {
-                    monitor.owner = proc.doValue(monitor.owner, OperandMode.Alive, STATE_FLAGS);
-                }
-
-            } else if (processed(value)) {
-                values[i] = proc.doValue(value, OperandMode.Alive, STATE_FLAGS);
-            }
-        }
-    }
-
-    private boolean processed(CiValue value) {
-        if (isIllegal(value)) {
-            // Ignore dead local variables.
-            return false;
-        } else if (isConstant(value)) {
-            // Ignore constants, the register allocator does not need to see them.
-            return false;
-        } else if (isVirtualObject(value)) {
-            assert Arrays.asList(virtualObjects).contains(value);
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-
-    public void finish(CiBitMap registerRefMap, CiBitMap frameRefMap, FrameMap frameMap) {
-        debugInfo = new CiDebugInfo(topFrame, registerRefMap, frameRefMap);
-
-        // Add additional stack slots for outgoing method parameters.
-        if (pointerSlots != null) {
-            for (CiStackSlot v : pointerSlots) {
-                frameMap.setReference(v, registerRefMap, frameRefMap);
-            }
-        }
-    }
-
-
-    @Override
-    public String toString() {
-        return debugInfo != null ? debugInfo.toString() : topFrame.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRInsertionBuffer.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import java.util.*;
-
-/**
- * A buffer to enqueue updates to a list. This avoids frequent re-sizing of the list and copying of list elements
- * when insertions are done at multiple positions of the list. Additionally, it ensures that the list is not modified
- * while it is, e.g., iterated, and instead only modified once after the iteration is done.
- * <br>
- * The buffer uses internal data structures to store the enqueued updates. To avoid allocations, a buffer can be re-used.
- * Call the methods in the following order:
- * {@link #init()}, {@link #append()}, {@link #append()}, ..., {@link #finish()}, {@link #init()}, ...
- * <br>
- * Note: This class does not depend on LIRInstruction, so we could make it a generic utility class.
- */
-public final class LIRInsertionBuffer {
-
-    /**
-     * The lir list where ops of this buffer should be inserted later (null when uninitialized).
-     */
-    private List<LIRInstruction> lir;
-
-    /**
-     * List of insertion points. index and count are stored alternately:
-     * indexAndCount[i * 2]: the index into lir list where "count" ops should be inserted
-     * indexAndCount[i * 2 + 1]: the number of ops to be inserted at index
-     */
-    private final List<Integer> indexAndCount;
-
-    /**
-     * The LIROps to be inserted.
-     */
-    private final List<LIRInstruction> ops;
-
-
-    public LIRInsertionBuffer() {
-        indexAndCount = new ArrayList<>(8);
-        ops = new ArrayList<>(8);
-    }
-
-    /**
-     * Initialize this buffer. This method must be called before using {@link #append()}.
-     */
-    public void init(List<LIRInstruction> newLir) {
-        assert !initialized() : "already initialized";
-        assert indexAndCount.size() == 0 && ops.size() == 0;
-        this.lir = newLir;
-    }
-
-    public boolean initialized() {
-        return lir != null;
-    }
-
-    public List<LIRInstruction> lirList() {
-        return lir;
-    }
-
-    /**
-     * Enqueue a new instruction that will be appended to the instruction list when {@link #finish()} is called.
-     * The new instruction is added <b>before</b> the existing instruction with the given index. This method can only be called
-     * with increasing values of index, e.g., once an instruction was appended with index 4, subsequent instructions can
-     * only be appended with index 4 or higher.
-     */
-    public void append(int index, LIRInstruction op) {
-        int i = numberOfInsertionPoints() - 1;
-        if (i < 0 || indexAt(i) < index) {
-            appendNew(index, 1);
-        } else {
-            assert indexAt(i) == index : "can append LIROps in ascending order only";
-            assert countAt(i) > 0 : "check";
-            setCountAt(i, countAt(i) + 1);
-        }
-        ops.add(op);
-
-        assert verify();
-    }
-
-    /**
-     * Append all enqueued instructions to the instruction list. After that, {@link init()} can be called again to re-use this buffer.
-     */
-    public void finish() {
-        if (ops.size() > 0) {
-            int n = lir.size();
-            // increase size of instructions list
-            for (int i = 0; i < ops.size(); i++) {
-                lir.add(null);
-            }
-            // insert ops from buffer into instructions list
-            int opIndex = ops.size() - 1;
-            int ipIndex = numberOfInsertionPoints() - 1;
-            int fromIndex = n - 1;
-            int toIndex = lir.size() - 1;
-            while (ipIndex >= 0) {
-                int index = indexAt(ipIndex);
-                // make room after insertion point
-                while (fromIndex >= index) {
-                    lir.set(toIndex--, lir.get(fromIndex--));
-                }
-                // insert ops from buffer
-                for (int i = countAt(ipIndex); i > 0; i--) {
-                    lir.set(toIndex--, ops.get(opIndex--));
-                }
-                ipIndex--;
-            }
-            indexAndCount.clear();
-            ops.clear();
-        }
-        lir = null;
-    }
-
-    private void appendNew(int index, int count) {
-        indexAndCount.add(index);
-        indexAndCount.add(count);
-    }
-
-    private void setCountAt(int i, int value) {
-        indexAndCount.set((i << 1) + 1, value);
-    }
-
-    private int numberOfInsertionPoints() {
-        assert indexAndCount.size() % 2 == 0 : "must have a count for each index";
-        return indexAndCount.size() >> 1;
-    }
-
-    private int indexAt(int i) {
-        return indexAndCount.get((i << 1));
-    }
-
-    private int countAt(int i) {
-        return indexAndCount.get((i << 1) + 1);
-    }
-
-    private boolean verify() {
-        int sum = 0;
-        int prevIdx = -1;
-
-        for (int i = 0; i < numberOfInsertionPoints(); i++) {
-            assert prevIdx < indexAt(i) : "index must be ordered ascending";
-            sum += countAt(i);
-        }
-        assert sum == ops.size() : "wrong total sum";
-        return true;
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,447 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.asm.*;
-
-/**
- * The {@code LIRInstruction} class definition.
- */
-public abstract class LIRInstruction {
-
-    public static final CiValue[] NO_OPERANDS = {};
-
-    /**
-     * Iterator for iterating over a list of values. Subclasses must overwrite one of the doValue methods.
-     * Clients of the class must only call the doValue method that takes additional parameters.
-     */
-    public abstract static class ValueProcedure {
-        /**
-         * Iterator method to be overwritten. This version of the iterator does not take additional parameters
-         * to keep the signature short.
-         *
-         * @param value The value that is iterated.
-         * @return The new value to replace the value that was passed in.
-         */
-        protected CiValue doValue(CiValue value) {
-            throw GraalInternalError.shouldNotReachHere("One of the doValue() methods must be overwritten");
-        }
-
-        /**
-         * Iterator method to be overwritten. This version of the iterator gets additional parameters about the
-         * processed value.
-         *
-         * @param value The value that is iterated.
-         * @param mode The operand mode for the value.
-         * @param flags A set of flags for the value.
-         * @return The new value to replace the value that was passed in.
-         */
-        public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-            return doValue(value);
-        }
-    }
-
-
-    /**
-     * Constants denoting how a LIR instruction uses an operand.
-     */
-    public enum OperandMode {
-        /**
-         * The value must have been defined before. It is alive before the instruction until the beginning of the
-         * instruction, but not necessarily throughout the instruction. A register assigned to it can also be assigend
-         * to a Temp or Output operand. The value can be used again after the instruction, so the instruction must not
-         * modify the register.
-         */
-        Input,
-
-        /**
-         * The value must have been defined before. It is alive before the instruction and throughout the instruction. A
-         * register assigned to it cannot be assigned to a Temp or Output operand. The value can be used again after the
-         * instruction, so the instruction must not modify the register.
-         */
-        Alive,
-
-        /**
-         * The value must not have been defined before, and must not be used after the instruction. The instruction can
-         * do whatever it wants with the register assigned to it (or not use it at all).
-         */
-        Temp,
-
-        /**
-         * The value must not have been defined before. The instruction has to assign a value to the register. The
-         * value can (and most likely will) be used after the instruction.
-         */
-        Output,
-    }
-
-    /**
-     * Flags for an operand.
-     */
-    public enum OperandFlag {
-        /**
-         * The value can be a {@link CiRegisterValue}.
-         */
-        Register,
-
-        /**
-         * The value can be a {@link CiStackSlot}.
-         */
-        Stack,
-
-        /**
-         * The value can be a {@link CiAddress}.
-         */
-        Address,
-
-        /**
-         * The value can be a {@link CiConstant}.
-         */
-        Constant,
-
-        /**
-         * The value can be {@link CiValue#IllegalValue}.
-         */
-        Illegal,
-
-        /**
-         * The register allocator should try to assign a certain register to improve code quality.
-         * Use {@link LIRInstruction#forEachRegisterHint} to access the register hints.
-         */
-        RegisterHint,
-
-        /**
-         * The value can be uninitialized, e.g., a stack slot that has not written to before. This is only
-         * used to avoid false positives in verification code.
-         */
-        Uninitialized,
-    }
-
-    /**
-     * For validity checking of the operand flags defined by instruction subclasses.
-     */
-    private static final EnumMap<OperandMode, EnumSet<OperandFlag>> ALLOWED_FLAGS;
-
-    static {
-        ALLOWED_FLAGS = new EnumMap<>(OperandMode.class);
-        ALLOWED_FLAGS.put(OperandMode.Input,  EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Address, OperandFlag.Constant, OperandFlag.Illegal, OperandFlag.RegisterHint, OperandFlag.Uninitialized));
-        ALLOWED_FLAGS.put(OperandMode.Alive,  EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Address, OperandFlag.Constant, OperandFlag.Illegal, OperandFlag.RegisterHint, OperandFlag.Uninitialized));
-        ALLOWED_FLAGS.put(OperandMode.Temp,   EnumSet.of(OperandFlag.Register, OperandFlag.Constant, OperandFlag.Illegal, OperandFlag.RegisterHint));
-        ALLOWED_FLAGS.put(OperandMode.Output, EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Illegal, OperandFlag.RegisterHint));
-    }
-
-    /**
-     * The opcode of this instruction.
-     */
-    protected final Object code;
-
-    /**
-     * The output operands for this instruction (modified by the register allocator).
-     */
-    protected CiValue[] outputs;
-
-    /**
-     * The input operands for this instruction (modified by the register allocator).
-     */
-    protected CiValue[] inputs;
-
-    /**
-     * The alive operands for this instruction (modified by the register allocator).
-     */
-    protected CiValue[] alives;
-
-    /**
-     * The temp operands for this instruction (modified by the register allocator).
-     */
-    protected CiValue[] temps;
-
-    /**
-     * Used to emit debug information.
-     */
-    public final LIRDebugInfo info;
-
-    /**
-     * Instruction id for register allocation.
-     */
-    private int id;
-
-    /**
-     * Constructs a new LIR instruction that has input and temp operands.
-     *
-     * @param opcode the opcode of the new instruction
-     * @param outputs the operands that holds the operation results of this instruction.
-     * @param info the {@link LIRDebugInfo} info that is to be preserved for the instruction. This will be {@code null} when no debug info is required for the instruction.
-     * @param inputs the input operands for the instruction.
-     * @param temps the temp operands for the instruction.
-     */
-    public LIRInstruction(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps) {
-        this.code = opcode;
-        this.outputs = outputs;
-        this.inputs = inputs;
-        this.alives = alives;
-        this.temps = temps;
-        this.info = info;
-        this.id = -1;
-    }
-
-    public abstract void emitCode(TargetMethodAssembler tasm);
-
-
-    public final int id() {
-        return id;
-    }
-
-    public final void setId(int id) {
-        this.id = id;
-    }
-
-    /**
-     * Gets an input operand of this instruction.
-     *
-     * @param index the index of the operand requested.
-     * @return the {@code index}'th input operand.
-     */
-    protected final CiValue input(int index) {
-        return inputs[index];
-    }
-
-    /**
-     * Gets an alive operand of this instruction.
-     *
-     * @param index the index of the operand requested.
-     * @return the {@code index}'th alive operand.
-     */
-    protected final CiValue alive(int index) {
-        return alives[index];
-    }
-
-    /**
-     * Gets a temp operand of this instruction.
-     *
-     * @param index the index of the operand requested.
-     * @return the {@code index}'th temp operand.
-     */
-    protected final CiValue temp(int index) {
-        return temps[index];
-    }
-
-    /**
-     * Gets the result operand for this instruction.
-     *
-     * @return return the result operand
-     */
-    protected final CiValue output(int index) {
-        return outputs[index];
-    }
-
-    /**
-     * Gets the instruction name.
-     */
-    public String name() {
-        return code.toString();
-    }
-
-    public boolean hasOperands() {
-        return inputs.length > 0 || alives.length > 0 || temps.length > 0 || outputs.length > 0 || info != null || hasCall();
-    }
-
-    private static final EnumSet<OperandFlag> ADDRESS_FLAGS = EnumSet.of(OperandFlag.Register, OperandFlag.Illegal);
-
-    private void forEach(CiValue[] values, OperandMode mode, ValueProcedure proc) {
-        for (int i = 0; i < values.length; i++) {
-            assert ALLOWED_FLAGS.get(mode).containsAll(flagsFor(mode, i));
-
-            CiValue value = values[i];
-            if (isAddress(value)) {
-                assert flagsFor(mode, i).contains(OperandFlag.Address);
-                CiAddress address = asAddress(value);
-                address.base = proc.doValue(address.base, mode, ADDRESS_FLAGS);
-                address.index = proc.doValue(address.index, mode, ADDRESS_FLAGS);
-            } else {
-                values[i] = proc.doValue(values[i], mode, flagsFor(mode, i));
-            }
-        }
-    }
-
-    public final void forEachInput(ValueProcedure proc) {
-        forEach(inputs, OperandMode.Input, proc);
-    }
-
-    public final void forEachAlive(ValueProcedure proc) {
-        forEach(alives, OperandMode.Alive, proc);
-    }
-
-    public final void forEachTemp(ValueProcedure proc) {
-        forEach(temps, OperandMode.Temp, proc);
-    }
-
-    public final void forEachOutput(ValueProcedure proc) {
-        forEach(outputs, OperandMode.Output, proc);
-    }
-
-    public final void forEachState(ValueProcedure proc) {
-        if (info != null) {
-            info.forEachState(proc);
-
-            if (this instanceof LIRXirInstruction) {
-                LIRXirInstruction xir = (LIRXirInstruction) this;
-                if (xir.infoAfter != null) {
-                    xir.infoAfter.forEachState(proc);
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns true when this instruction is a call instruction that destroys all caller-saved registers.
-     */
-    public final boolean hasCall() {
-        return this instanceof StandardOp.CallOp;
-    }
-
-    /**
-     * Iterates all register hints for the specified value, i.e., all preferred candidates for the register to be
-     * assigned to the value.
-     * <br>
-     * Subclasses can override this method. The default implementation processes all Input operands as the hints for
-     * an Output operand, and all Output operands as the hints for an Input operand.
-     *
-     * @param value The value the hints are needed for.
-     * @param mode The operand mode of the value.
-     * @param proc The procedure invoked for all the hints. If the procedure returns a non-null value, the iteration is stopped
-     *             and the value is returned by this method, i.e., clients can stop the iteration once a suitable hint has been found.
-     * @return The non-null value returned by the procedure, or null.
-     */
-    public CiValue forEachRegisterHint(CiValue value, OperandMode mode, ValueProcedure proc) {
-        CiValue[] hints;
-        if (mode == OperandMode.Input) {
-            hints = outputs;
-        } else if (mode == OperandMode.Output) {
-            hints = inputs;
-        } else {
-            return null;
-        }
-
-        for (int i = 0; i < hints.length; i++) {
-            CiValue result = proc.doValue(hints[i], null, null);
-            if (result != null) {
-                return result;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Used by the register allocator to decide which kind of location can be assigned to the operand.
-     * @param mode The kind of operand.
-     * @param index The index of the operand.
-     * @return The flags for the operand.
-     */
-    // TODO (cwimmer) this method will go away when we have named operands, the flags will be specified as annotations instead.
-    protected abstract EnumSet<OperandFlag> flagsFor(OperandMode mode, int index);
-
-    protected void verify() {
-    }
-
-
-    public final String toStringWithIdPrefix() {
-        if (id != -1) {
-            return String.format("%4d %s", id, toString());
-        }
-        return "     " + toString();
-    }
-
-    /**
-     * Gets the operation performed by this instruction in terms of its operands as a string.
-     */
-    public String operationString() {
-        StringBuilder buf = new StringBuilder();
-        String sep = "";
-        if (outputs.length > 1) {
-            buf.append("(");
-        }
-        for (CiValue output : outputs) {
-            buf.append(sep).append(output);
-            sep = ", ";
-        }
-        if (outputs.length > 1) {
-            buf.append(")");
-        }
-        if (outputs.length > 0) {
-            buf.append(" = ");
-        }
-
-        if (inputs.length + alives.length != 1) {
-            buf.append("(");
-        }
-        sep = "";
-        for (CiValue input : inputs) {
-            buf.append(sep).append(input);
-            sep = ", ";
-        }
-        for (CiValue input : alives) {
-            buf.append(sep).append(input).append(" ~");
-            sep = ", ";
-        }
-        if (inputs.length + alives.length != 1) {
-            buf.append(")");
-        }
-
-        if (temps.length > 0) {
-            buf.append(" [");
-        }
-        sep = "";
-        for (CiValue temp : temps) {
-            buf.append(sep).append(temp);
-            sep = ", ";
-        }
-        if (temps.length > 0) {
-            buf.append("]");
-        }
-        return buf.toString();
-    }
-
-    protected void appendDebugInfo(StringBuilder buf) {
-        if (info != null) {
-            buf.append(" [bci:");
-            String sep = "";
-            for (CiFrame cur = info.topFrame; cur != null; cur = cur.caller()) {
-                buf.append(sep).append(cur.bci);
-                sep = ",";
-            }
-            buf.append("]");
-        }
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder buf = new StringBuilder(name()).append(' ').append(operationString());
-        appendDebugInfo(buf);
-        return buf.toString();
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-import static com.oracle.graal.lir.ValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.LIRInstruction.*;
-import com.oracle.graal.lir.cfg.*;
-
-public final class LIRVerifier {
-    private final LIR lir;
-    private final FrameMap frameMap;
-
-    private final boolean beforeRegisterAllocation;
-
-    private final BitSet[] blockLiveOut;
-    private final Object[] variableDefinitions;
-
-    private BitSet liveOutFor(Block block) {
-        return blockLiveOut[block.getId()];
-    }
-    private void setLiveOutFor(Block block, BitSet liveOut) {
-        blockLiveOut[block.getId()] = liveOut;
-    }
-
-    private int maxRegisterNum() {
-        return frameMap.target.arch.registers.length;
-    }
-
-    private boolean isAllocatableRegister(CiValue value) {
-        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
-    }
-
-    public static boolean verify(final LIRInstruction op) {
-        ValueProcedure allowedProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return allowed(op, value, mode, flags); } };
-
-        op.forEachInput(allowedProc);
-        op.forEachAlive(allowedProc);
-        op.forEachState(allowedProc);
-        op.forEachTemp(allowedProc);
-        op.forEachOutput(allowedProc);
-
-        op.verify();
-        return true;
-    }
-
-    public static boolean verify(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap) {
-        LIRVerifier verifier = new LIRVerifier(beforeRegisterAllocation, lir, frameMap);
-        verifier.verify();
-        return true;
-    }
-
-
-    private LIRVerifier(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap) {
-        this.beforeRegisterAllocation = beforeRegisterAllocation;
-        this.lir = lir;
-        this.frameMap = frameMap;
-        this.blockLiveOut = new BitSet[lir.linearScanOrder().size()];
-        this.variableDefinitions = new Object[lir.numVariables()];
-    }
-
-    private BitSet curVariablesLive;
-    private CiValue[] curRegistersLive;
-
-    private Block curBlock;
-    private Object curInstruction;
-    private BitSet curRegistersDefined;
-
-    private void verify() {
-        ValueProcedure useProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return use(value, mode, flags); } };
-        ValueProcedure defProc = new ValueProcedure() { @Override public CiValue doValue(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) { return def(value, mode, flags); } };
-
-        curRegistersDefined = new BitSet();
-        for (Block block : lir.linearScanOrder()) {
-            curBlock = block;
-            curVariablesLive = new BitSet();
-            curRegistersLive = new CiValue[maxRegisterNum()];
-
-            if (block.getDominator() != null) {
-                curVariablesLive.or(liveOutFor(block.getDominator()));
-            }
-
-            assert block.lir.get(0) instanceof StandardOp.LabelOp : "block must start with label";
-            if (block.numberOfPreds() > 1) {
-                assert block.lir.get(0) instanceof StandardOp.PhiLabelOp : "phi mapping required for multiple predecessors";
-                CiValue[] phiDefinitions = ((StandardOp.PhiLabelOp) block.lir.get(0)).getPhiDefinitions();
-                if (!beforeRegisterAllocation) {
-                    assert phiDefinitions.length == 0;
-                }
-                for (Block pred : block.getPredecessors()) {
-                    assert pred.numberOfSux() == 1;
-                    LIRInstruction last = pred.lir.get(pred.lir.size() - 1);
-                    assert last instanceof StandardOp.PhiJumpOp : "phi mapping required for multiple successors";
-                    CiValue[] phiUses = ((StandardOp.PhiJumpOp) last).getPhiInputs();
-                    if (!beforeRegisterAllocation) {
-                        assert phiUses.length == 0;
-                    }
-                }
-            }
-
-            if (block.numberOfSux() > 0) {
-                LIRInstruction last = block.lir.get(block.lir.size() - 1);
-                assert last instanceof StandardOp.JumpOp || last instanceof LIRXirInstruction : "block with successor must end with unconditional jump";
-            }
-
-            for (LIRInstruction op : block.lir) {
-                curInstruction = op;
-
-                op.forEachInput(useProc);
-                if (op.hasCall()) {
-                    for (CiRegister register : frameMap.registerConfig.getCallerSaveRegisters()) {
-                        curRegistersLive[register.number] = null;
-                    }
-                }
-                curRegistersDefined.clear();
-                op.forEachAlive(useProc);
-                op.forEachState(useProc);
-                op.forEachTemp(defProc);
-                op.forEachOutput(defProc);
-
-                curInstruction = null;
-            }
-
-            setLiveOutFor(block, curVariablesLive);
-        }
-    }
-
-    private CiValue use(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        allowed(curInstruction, value, mode, flags);
-
-        if (isVariable(value)) {
-            assert beforeRegisterAllocation;
-
-            int variableIdx = asVariable(value).index;
-            if (!curVariablesLive.get(variableIdx)) {
-                TTY.println("block %s  instruction %s", curBlock, curInstruction);
-                TTY.println("live variables: %s", curVariablesLive);
-                if (variableDefinitions[variableIdx] != null) {
-                    TTY.println("definition of %s: %s", value, variableDefinitions[variableIdx]);
-                }
-                TTY.println("ERROR: Use of variable %s that is not defined in dominator", value);
-                throw GraalInternalError.shouldNotReachHere();
-            }
-
-        } else if (isAllocatableRegister(value)) {
-            int regNum = asRegister(value).number;
-            if (mode == OperandMode.Alive) {
-                curRegistersDefined.set(regNum);
-            }
-
-            if (beforeRegisterAllocation && curRegistersLive[regNum] != value) {
-                TTY.println("block %s  instruction %s", curBlock, curInstruction);
-                TTY.println("live registers: %s", Arrays.toString(curRegistersLive));
-                TTY.println("ERROR: Use of fixed register %s that is not defined in this block", value);
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        }
-        return value;
-    }
-
-    private CiValue def(CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        allowed(curInstruction, value, mode, flags);
-
-        if (isVariable(value)) {
-            assert beforeRegisterAllocation;
-
-            int variableIdx = asVariable(value).index;
-            if (variableDefinitions[variableIdx] != null) {
-                TTY.println("block %s  instruction %s", curBlock, curInstruction);
-                TTY.println("live variables: %s", curVariablesLive);
-                TTY.println("definition of %s: %s", value, variableDefinitions[variableIdx]);
-                TTY.println("ERROR: Variable %s defined multiple times", value);
-                throw GraalInternalError.shouldNotReachHere();
-            }
-            assert curInstruction != null;
-            variableDefinitions[variableIdx] = curInstruction;
-            assert !curVariablesLive.get(variableIdx);
-            if (mode == OperandMode.Output) {
-                curVariablesLive.set(variableIdx);
-            }
-
-        } else if (isAllocatableRegister(value)) {
-            int regNum = asRegister(value).number;
-            if (curRegistersDefined.get(regNum)) {
-                TTY.println("block %s  instruction %s", curBlock, curInstruction);
-                TTY.println("ERROR: Same register defined twice in the same instruction: %s", value);
-                throw GraalInternalError.shouldNotReachHere();
-            }
-            curRegistersDefined.set(regNum);
-
-            if (beforeRegisterAllocation) {
-                if (mode == OperandMode.Output) {
-                    curRegistersLive[regNum] = value;
-                } else {
-                    curRegistersLive[regNum] = null;
-                }
-            }
-        }
-        return value;
-    }
-
-    private static CiValue allowed(Object op, CiValue value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        if ((isVariable(value)  && flags.contains(OperandFlag.Register)) ||
-            (isRegister(value)  && flags.contains(OperandFlag.Register)) ||
-            (isStackSlot(value) && flags.contains(OperandFlag.Stack)) ||
-            (isConstant(value)  && flags.contains(OperandFlag.Constant) && mode != OperandMode.Output) ||
-            (isIllegal(value)   && flags.contains(OperandFlag.Illegal))) {
-            return value;
-        }
-        TTY.println("instruction %s", op);
-        TTY.println("mode: %s  flags: %s", mode, flags);
-        TTY.println("Unexpected value: %s %s", value.getClass().getSimpleName(), value);
-        throw GraalInternalError.shouldNotReachHere();
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LIRXirInstruction.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.xir.*;
-import com.oracle.graal.graph.*;
-
-public abstract class LIRXirInstruction extends LIRInstruction {
-
-    public final CiValue[] originalOperands;
-    public final int outputOperandIndex;
-    public final int[] inputOperandIndices;
-    public final int[] tempOperandIndices;
-    public final XirSnippet snippet;
-    public final LIRDebugInfo infoAfter;
-    public final LabelRef trueSuccessor;
-    public final LabelRef falseSuccessor;
-
-    public LIRXirInstruction(Object opcode,
-                             XirSnippet snippet,
-                             CiValue[] originalOperands,
-                             CiValue outputOperand,
-                             CiValue[] inputs, CiValue[] temps,
-                             int[] inputOperandIndices, int[] tempOperandIndices,
-                             int outputOperandIndex,
-                             LIRDebugInfo info,
-                             LIRDebugInfo infoAfter,
-                             LabelRef trueSuccessor,
-                             LabelRef falseSuccessor) {
-        // Note that we register the XIR input operands as Alive, because the XIR specification allows that input operands
-        // are used at any time, even when the temp operands and the actual output operands have already be assigned.
-        super(opcode, isLegal(outputOperand) ? new CiValue[] {outputOperand} : LIRInstruction.NO_OPERANDS, info, LIRInstruction.NO_OPERANDS, inputs, temps);
-        this.infoAfter = infoAfter;
-        this.snippet = snippet;
-        this.inputOperandIndices = inputOperandIndices;
-        this.tempOperandIndices = tempOperandIndices;
-        this.outputOperandIndex = outputOperandIndex;
-        this.originalOperands = originalOperands;
-        this.falseSuccessor = falseSuccessor;
-        this.trueSuccessor = trueSuccessor;
-        assert isLegal(outputOperand) || outputOperandIndex == -1;
-    }
-
-    @Override
-    protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-        if (mode == OperandMode.Alive || mode == OperandMode.Temp) {
-            return EnumSet.of(OperandFlag.Register, OperandFlag.Constant, OperandFlag.Illegal);
-        } else if (mode == OperandMode.Output && index == 0) {
-            return EnumSet.of(OperandFlag.Register);
-        }
-        throw GraalInternalError.shouldNotReachHere();
-    }
-
-    public CiValue[] getOperands() {
-        for (int i = 0; i < inputOperandIndices.length; i++) {
-            originalOperands[inputOperandIndices[i]] = alive(i);
-        }
-        for (int i = 0; i < tempOperandIndices.length; i++) {
-            originalOperands[tempOperandIndices[i]] = temp(i);
-        }
-        if (outputOperandIndex != -1) {
-            originalOperands[outputOperandIndex] = output(0);
-        }
-        return originalOperands;
-    }
-
-    @Override
-    public String name() {
-        return "XIR: " + snippet.template;
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/LabelRef.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import com.oracle.max.asm.*;
-import com.oracle.graal.lir.cfg.*;
-
-/**
- * LIR instructions such as JUMP and BRANCH need to reference their target {@link Block}. However,
- * direct references are not possible since the control flow graph (and therefore successors lists) can
- * be changed by optimizations - and fixing the instructions is error prone.
- * Therefore, we only reference of block B from block A only via the tuple (A, successor-index-of-B), i.e.,
- * indirectly by storing the index into the successor list of A.
- * Note that therefore it is not allowed to reorder the successor list!
- *
- * Labels of out-of-line stubs can be referenced directly, therefore it is also possible to construct a
- * LabelRef for a Label directly via {@link #forLabel}.
- */
-public abstract class LabelRef {
-
-    public abstract Label label();
-
-    /**
-     * Returns a new reference to a statically defined label.
-     * @param label The label that is always returned.
-     * @return The newly created label reference.
-     */
-    public static LabelRef forLabel(final Label label) {
-       return new LabelRef() {
-           @Override
-           public Label label() {
-               return label;
-           }
-
-           @Override
-           public String toString() {
-               return label.toString();
-           }
-       };
-    }
-
-    /**
-     * Returns a new reference to a successor of the given block.
-     * This allows to reference the given successor even when the successor list
-     * is modified between the creation of the reference and the call to {@link #getLabel}.
-     * @param block The base block that contains the successor list.
-     * @param suxIndex The index of the successor.
-     * @return The newly created label reference.
-     */
-    public static LabelRef forSuccessor(final Block block, final int suxIndex) {
-        return new LabelRef() {
-            @Override
-            public Label label() {
-                return ((StandardOp.LabelOp) block.suxAt(suxIndex).lir.get(0)).getLabel();
-            }
-
-            @Override
-            public String toString() {
-                return suxIndex < block.numberOfSux() ? block.suxAt(suxIndex).toString() : "?" + block + ":" + suxIndex + "?";
-            }
-        };
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/StandardOp.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.asm.*;
-
-/**
- * A collection of machine-independent LIR operations, as well as interfaces to be implemented for specific kinds or LIR
- * operations.
- */
-public class StandardOp {
-
-    private static CiValue[] EMPTY = new CiValue[0];
-
-    /**
-     * LIR operation that defines the position of a label.
-     * The first operation of every block must implement this interface.
-     */
-    public static class LabelOp extends LIRInstruction {
-        private final Label label;
-        private final boolean align;
-
-        protected LabelOp(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps, Label label, boolean align) {
-            super(opcode, outputs, info, inputs, alives, temps);
-            this.label = label;
-            this.align = align;
-        }
-
-        public LabelOp(Label label, boolean align) {
-            this("LABEL", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, label, align);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm) {
-            if (align) {
-                tasm.asm.align(tasm.target.wordSize);
-            }
-            tasm.asm.bind(label);
-        }
-
-        @Override
-        public String operationString() {
-            return label.toString() + " " + super.operationString();
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        public Label getLabel() {
-            return label;
-        }
-    }
-
-    public static class PhiLabelOp extends LabelOp {
-        public PhiLabelOp(Label label, boolean align, CiValue[] phiDefinitions) {
-            super("PHI_LABEL", phiDefinitions, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, label, align);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Output) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        public void markResolved() {
-            outputs = EMPTY;
-        }
-
-        public CiValue[] getPhiDefinitions() {
-            return outputs;
-        }
-    }
-
-    /**
-     * LIR operation that is an unconditional jump to {@link #destination()}.
-     * When the LIR is constructed, the last operation of every block must implement this interface. After
-     * register allocation, unnecessary jumps can be deleted.
-     *
-     * TODO (cwimmer) Currently, a block can also end with an XIR operation.
-     */
-    public static class JumpOp extends LIRInstruction {
-        private final LabelRef destination;
-
-        protected JumpOp(Object opcode, CiValue[] outputs, LIRDebugInfo info, CiValue[] inputs, CiValue[] alives, CiValue[] temps, LabelRef destination) {
-            super(opcode, outputs, info, inputs, alives, temps);
-            this.destination = destination;
-        }
-
-        public JumpOp(LabelRef destination, LIRDebugInfo info) {
-            this("JUMP", LIRInstruction.NO_OPERANDS, info, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, destination);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm) {
-            tasm.asm.jmp(destination.label());
-        }
-
-        @Override
-        public String operationString() {
-            return  destination + " " + super.operationString();
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        public LabelRef destination() {
-            return destination;
-        }
-    }
-
-    public static class PhiJumpOp extends JumpOp {
-        public PhiJumpOp(LabelRef destination, CiValue[] phiInputs) {
-            super("PHI_JUMP", LIRInstruction.NO_OPERANDS, null, LIRInstruction.NO_OPERANDS, phiInputs, LIRInstruction.NO_OPERANDS, destination);
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Alive) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack, OperandFlag.Constant);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-
-        public void markResolved() {
-            alives = EMPTY;
-        }
-
-        public CiValue[] getPhiInputs() {
-            return alives;
-        }
-    }
-
-    /**
-     * Marker interface for a LIR operation that is a conditional jump to {@link #destination()}.
-     * Conditional jumps may be negated or optimized away after register allocation.
-     */
-    public interface BranchOp {
-        LabelRef destination();
-        void negate(LabelRef newDestination);
-    }
-
-    /**
-     * Marker interface for a LIR operation that moves a value from {@link #getInput()} to {@link #getResult()}.
-     */
-    public interface MoveOp {
-        CiValue getInput();
-        CiValue getResult();
-    }
-
-    /**
-     * Marker interface for a LIR operation that calls a method, i.e., destroys all caller-saved registers.
-     */
-    public interface CallOp {
-    }
-
-
-    /**
-     * Meta-operation that defines the incoming method parameters. In the LIR, every register and variable must be
-     * defined before it is used. This operation is the definition point of method parameters, but is otherwise a no-op.
-     * In particular, it is not the actual method prologue.
-     */
-    public static final class ParametersOp extends LIRInstruction {
-        public ParametersOp(CiValue[] params) {
-            super("PARAMS", params, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-        }
-
-        @Override
-        public void emitCode(TargetMethodAssembler tasm) {
-            // No code to emit.
-        }
-
-        @Override
-        protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-            if (mode == OperandMode.Output) {
-                return EnumSet.of(OperandFlag.Register, OperandFlag.Stack);
-            }
-            throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/ValueUtil.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import com.oracle.max.cri.ci.*;
-
-public class ValueUtil extends CiValueUtil {
-
-    public static boolean isVariable(CiValue value) {
-        assert value != null;
-        return value instanceof Variable;
-    }
-
-    public static Variable asVariable(CiValue value) {
-        assert value != null;
-        return (Variable) value;
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/Variable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir;
-
-import com.oracle.max.cri.ci.*;
-
-/**
- * Represents a value that is yet to be bound to a machine location (such as
- * a {@link CiRegisterValue} or {@link CiStackSlot}) by a register allocator.
- */
-public final class Variable 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;
-
-    /**
-     * The type of register that this variable needs to get assigned.
-     */
-    public final CiRegister.RegisterFlag flag;
-
-    /**
-     * Creates a new variable.
-     * @param kind
-     * @param index
-     */
-    public Variable(CiKind kind, int index, CiRegister.RegisterFlag flag) {
-        super(kind);
-        assert kind == kind.stackKind() : "Variables can be only created for stack kinds";
-        assert index >= 0;
-        this.index = index;
-        this.flag = flag;
-    }
-
-    @Override
-    public int hashCode() {
-        return (index << 4) | kind.ordinal();
-    }
-
-    @Override
-    public String toString() {
-        return "v" + index + kindSuffix();
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.asm;
-
-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.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.LIR.*;
-
-public class TargetMethodAssembler {
-
-    private static class ExceptionInfo {
-        public final int codeOffset;
-        public final LabelRef exceptionEdge;
-
-        public ExceptionInfo(int pcOffset, LabelRef exceptionEdge) {
-            this.codeOffset = pcOffset;
-            this.exceptionEdge = exceptionEdge;
-        }
-    }
-
-    public final AbstractAssembler asm;
-    public final CiTargetMethod targetMethod;
-    public final CiTarget target;
-    public final RiRuntime runtime;
-    public final FrameMap frameMap;
-    public final List<SlowPath> slowPaths;
-
-    private List<ExceptionInfo> exceptionInfoList;
-    private int lastSafepointPos;
-
-    public TargetMethodAssembler(CiTarget target, RiRuntime runtime, FrameMap frameMap, List<SlowPath> slowPaths, AbstractAssembler asm) {
-        this.target = target;
-        this.runtime = runtime;
-        this.frameMap = frameMap;
-        this.slowPaths = slowPaths;
-        this.asm = asm;
-        this.targetMethod = new CiTargetMethod();
-        // 0 is a valid pc for safepoints in template methods
-        this.lastSafepointPos = -1;
-    }
-
-    public void setFrameSize(int frameSize) {
-        targetMethod.setFrameSize(frameSize);
-    }
-
-    public CiTargetMethod.Mark recordMark(Object id, CiTargetMethod.Mark[] references) {
-        return targetMethod.recordMark(asm.codeBuffer.position(), id, references);
-    }
-
-    public void blockComment(String s) {
-        targetMethod.addAnnotation(new CiTargetMethod.CodeComment(asm.codeBuffer.position(), s));
-    }
-
-    public CiTargetMethod finishTargetMethod(Object name, boolean isStub) {
-        // Install code, data and frame size
-        targetMethod.setTargetCode(asm.codeBuffer.close(false), asm.codeBuffer.position());
-
-        // Record exception handlers if they exist
-        if (exceptionInfoList != null) {
-            for (ExceptionInfo ei : exceptionInfoList) {
-                int codeOffset = ei.codeOffset;
-                targetMethod.recordExceptionHandler(codeOffset, ei.exceptionEdge.label().position());
-            }
-        }
-
-        Debug.metric("TargetMethods").increment();
-        Debug.metric("CodeBytesEmitted").add(targetMethod.targetCodeSize());
-        Debug.metric("SafepointsEmitted").add(targetMethod.safepoints.size());
-        Debug.metric("DataPatches").add(targetMethod.dataReferences.size());
-        Debug.metric("ExceptionHandlersEmitted").add(targetMethod.exceptionHandlers.size());
-
-        Debug.log("Finished target method %s, isStub %b", name, isStub);
-/*
-        if (GraalOptions.PrintAssembly && !TTY.isSuppressed() && !isStub) {
-            Util.printSection("Target Method", Util.SECTION_CHARACTER);
-            TTY.println("Name: " + name);
-            TTY.println("Frame size: " + targetMethod.frameSize());
-            TTY.println("Register size: " + asm.target.arch.registerReferenceMapBitCount);
-
-            if (GraalOptions.PrintCodeBytes) {
-                Util.printSection("Code", Util.SUB_SECTION_CHARACTER);
-                TTY.println("Code: %d bytes", targetMethod.targetCodeSize());
-                Util.printBytes(0L, targetMethod.targetCode(), 0, targetMethod.targetCodeSize(), GraalOptions.PrintAssemblyBytesPerLine);
-            }
-
-            Util.printSection("Disassembly", Util.SUB_SECTION_CHARACTER);
-            String disassembly = runtime.disassemble(targetMethod);
-            TTY.println(disassembly);
-            boolean noDis = disassembly == null || disassembly.length() == 0;
-
-            Util.printSection("Safepoints", Util.SUB_SECTION_CHARACTER);
-            for (CiTargetMethod.Safepoint x : targetMethod.safepoints) {
-                TTY.println(x.toString());
-                if (noDis && x.debugInfo != null) {
-                    TTY.println(CiUtil.indent(x.debugInfo.toString(), "  "));
-                }
-            }
-
-            Util.printSection("Data Patches", Util.SUB_SECTION_CHARACTER);
-            for (CiTargetMethod.DataPatch x : targetMethod.dataReferences) {
-                TTY.println(x.toString());
-            }
-
-            Util.printSection("Marks", Util.SUB_SECTION_CHARACTER);
-            for (CiTargetMethod.Mark x : targetMethod.marks) {
-                TTY.println(x.toString());
-            }
-
-            Util.printSection("Exception Handlers", Util.SUB_SECTION_CHARACTER);
-            for (CiTargetMethod.ExceptionHandler x : targetMethod.exceptionHandlers) {
-                TTY.println(x.toString());
-            }
-        }
-*/
-
-        return targetMethod;
-    }
-
-    public void recordExceptionHandlers(int pcOffset, LIRDebugInfo info) {
-        if (info != null) {
-            if (info.exceptionEdge != null) {
-                if (exceptionInfoList == null) {
-                    exceptionInfoList = new ArrayList<>(4);
-                }
-                exceptionInfoList.add(new ExceptionInfo(pcOffset, info.exceptionEdge));
-            }
-        }
-    }
-
-    public void recordImplicitException(int pcOffset, LIRDebugInfo info) {
-        // record an implicit exception point
-        if (info != null) {
-            assert lastSafepointPos < pcOffset : lastSafepointPos + "<" + pcOffset;
-            lastSafepointPos = pcOffset;
-            targetMethod.recordSafepoint(pcOffset, info.debugInfo());
-            assert info.exceptionEdge == null;
-        }
-    }
-
-    public void recordDirectCall(int posBefore, int posAfter, Object callTarget, LIRDebugInfo info) {
-        CiDebugInfo debugInfo = info != null ? info.debugInfo() : null;
-        assert lastSafepointPos < posAfter;
-        lastSafepointPos = posAfter;
-        targetMethod.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, true);
-    }
-
-    public void recordIndirectCall(int posBefore, int posAfter, Object callTarget, LIRDebugInfo info) {
-        CiDebugInfo debugInfo = info != null ? info.debugInfo() : null;
-        assert lastSafepointPos < posAfter;
-        lastSafepointPos = posAfter;
-        targetMethod.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, false);
-    }
-
-    public void recordSafepoint(int pos, LIRDebugInfo info) {
-        // safepoints always need debug info
-        CiDebugInfo debugInfo = info.debugInfo();
-        assert lastSafepointPos < pos;
-        lastSafepointPos = pos;
-        targetMethod.recordSafepoint(pos, debugInfo);
-    }
-
-    public CiAddress recordDataReferenceInCode(CiConstant data, int alignment) {
-        assert data != null;
-        int pos = asm.codeBuffer.position();
-        Debug.log("Data reference in code: pos = %d, data = %s", pos, data.toString());
-        targetMethod.recordDataReference(pos, data, alignment);
-        return CiAddress.Placeholder;
-    }
-
-    public int lastSafepointPos() {
-        return lastSafepointPos;
-    }
-
-
-    /**
-     * Returns the integer value of any constants that can be represented by a 32-bit integer value,
-     * including long constants that fit into the 32-bit range.
-     */
-    public int asIntConst(CiValue value) {
-        assert (value.kind.stackKind() == CiKind.Int || value.kind == CiKind.Jsr || value.kind == CiKind.Long) && isConstant(value);
-        long c = ((CiConstant) value).asLong();
-        if (!(NumUtil.isInt(c))) {
-            throw GraalInternalError.shouldNotReachHere();
-        }
-        return (int) c;
-    }
-
-    /**
-     * Returns the address of a float constant that is embedded as a data references into the code.
-     */
-    public CiAddress asFloatConstRef(CiValue value) {
-        return asFloatConstRef(value, 4);
-    }
-
-    public CiAddress asFloatConstRef(CiValue value, int alignment) {
-        assert value.kind == CiKind.Float && isConstant(value);
-        return recordDataReferenceInCode((CiConstant) value, alignment);
-    }
-
-    /**
-     * Returns the address of a double constant that is embedded as a data references into the code.
-     */
-    public CiAddress asDoubleConstRef(CiValue value) {
-        return asDoubleConstRef(value, 8);
-    }
-
-    public CiAddress asDoubleConstRef(CiValue value, int alignment) {
-        assert value.kind == CiKind.Double && isConstant(value);
-        return recordDataReferenceInCode((CiConstant) value, alignment);
-    }
-
-    /**
-     * Returns the address of a long constant that is embedded as a data references into the code.
-     */
-    public CiAddress asLongConstRef(CiValue value) {
-        assert value.kind == CiKind.Long && isConstant(value);
-        return recordDataReferenceInCode((CiConstant) value, 8);
-    }
-
-    public CiAddress asIntAddr(CiValue value) {
-        assert value.kind == CiKind.Int;
-        return asAddress(value);
-    }
-
-    public CiAddress asLongAddr(CiValue value) {
-        assert value.kind == CiKind.Long;
-        return asAddress(value);
-    }
-
-    public CiAddress asObjectAddr(CiValue value) {
-        assert value.kind == CiKind.Object;
-        return asAddress(value);
-    }
-
-    public CiAddress asFloatAddr(CiValue value) {
-        assert value.kind == CiKind.Float;
-        return asAddress(value);
-    }
-
-    public CiAddress asDoubleAddr(CiValue value) {
-        assert value.kind == CiKind.Double;
-        return asAddress(value);
-    }
-
-    public CiAddress asAddress(CiValue value) {
-        if (isStackSlot(value)) {
-            CiStackSlot slot = (CiStackSlot) value;
-            return new CiAddress(slot.kind, frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot));
-        }
-        return (CiAddress) value;
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/Block.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.cfg;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.java.*;
-
-public class Block {
-    protected int id;
-
-    protected BeginNode beginNode;
-    protected Node endNode;
-    protected Loop loop;
-    protected double probability;
-
-    protected List<Block> predecessors;
-    protected List<Block> successors;
-
-    protected Block dominator;
-    protected List<Block> dominated;
-    protected Block postdominator;
-
-    // Fields that still need to be worked on, try to remove them later.
-    public List<LIRInstruction> lir;
-    public boolean align;
-    public int linearScanNumber;
-
-    public Block() {
-        id = ControlFlowGraph.BLOCK_ID_INITIAL;
-    }
-
-    public int getId() {
-        assert id >= 0;
-        return id;
-    }
-
-    public BeginNode getBeginNode() {
-        return beginNode;
-    }
-
-    public Node getEndNode() {
-        return endNode;
-    }
-
-    public Loop getLoop() {
-        return loop;
-    }
-
-    public int getLoopDepth() {
-        return loop == null ? 0 : loop.depth;
-    }
-
-    public boolean isLoopHeader() {
-        return getBeginNode() instanceof LoopBeginNode;
-    }
-
-    public boolean isLoopEnd() {
-        return getEndNode() instanceof LoopEndNode;
-    }
-
-    public boolean isExceptionEntry() {
-        return getBeginNode().next() instanceof ExceptionObjectNode;
-    }
-
-    public List<Block> getPredecessors() {
-        return predecessors;
-    }
-
-    public List<Block> getSuccessors() {
-        return successors;
-    }
-
-    public Block getDominator() {
-        return dominator;
-    }
-
-    public Block getEarliestPostDominated() {
-        Block b = this;
-        while (true) {
-            Block dom = b.getDominator();
-            if (dom != null && dom.getPostdominator() == b) {
-                b = dom;
-            } else {
-                break;
-            }
-        }
-        return b;
-    }
-
-    public List<Block> getDominated() {
-        if (dominated == null) {
-            return Collections.emptyList();
-        }
-        return dominated;
-    }
-
-    public Block getPostdominator() {
-        return postdominator;
-    }
-
-    private class NodeIterator implements Iterator<Node> {
-        private Node cur;
-
-        public NodeIterator() {
-            cur = getBeginNode();
-        }
-
-        @Override
-        public boolean hasNext() {
-            return cur != null;
-        }
-
-        @Override
-        public Node next() {
-            Node result = cur;
-            if (cur == getEndNode()) {
-                cur = null;
-            } else {
-                cur = ((FixedWithNextNode) cur).next();
-            }
-            assert !(cur instanceof BeginNode);
-            return result;
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    public Iterable<Node> getNodes() {
-        return new Iterable<Node>() {
-            @Override
-            public Iterator<Node> iterator() {
-                return new NodeIterator();
-            }
-        };
-    }
-
-    public int getFirstLirInstructionId() {
-        int result = lir.get(0).id();
-        assert result >= 0;
-        return result;
-    }
-
-    public int getLastLirInstructionId() {
-        int result = lir.get(lir.size() - 1).id();
-        assert result >= 0;
-        return result;
-    }
-
-    @Override
-    public String toString() {
-        return "B" + id;
-    }
-
-
-// to be inlined later on
-    public int numberOfPreds() {
-        return getPredecessors().size();
-    }
-
-    public int numberOfSux() {
-        return getSuccessors().size();
-    }
-
-    public Block predAt(int i) {
-        return getPredecessors().get(i);
-    }
-
-    public Block suxAt(int i) {
-        return getSuccessors().get(i);
-    }
-// end to be inlined later on
-
-    public boolean dominates(Block block) {
-        return block.isDominatedBy(this);
-    }
-
-    public boolean isDominatedBy(Block block) {
-        if (block == this) {
-            return true;
-        }
-        if (dominator == null) {
-            return false;
-        }
-        return dominator.isDominatedBy(block);
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/BlockMap.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.cfg;
-
-public class BlockMap<T> {
-    private final T[] data;
-
-    @SuppressWarnings("unchecked")
-    public BlockMap(ControlFlowGraph cfg) {
-        data = (T[]) new Object[cfg.getBlocks().length];
-    }
-
-    public T get(Block block) {
-        return data[block.getId()];
-    }
-
-    public void put(Block block, T value) {
-        data[block.getId()] = value;
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/CFGVerifier.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.cfg;
-
-public class CFGVerifier {
-    public static boolean verify(ControlFlowGraph cfg) {
-        for (Block block : cfg.getBlocks()) {
-            assert cfg.getBlocks()[block.getId()] == block;
-
-            for (Block pred : block.getPredecessors()) {
-                assert pred.getSuccessors().contains(block);
-                assert pred.getId() < block.getId() || pred.isLoopEnd();
-            }
-
-            for (Block sux : block.getSuccessors()) {
-                assert sux.getPredecessors().contains(block);
-                assert sux.getId() > block.getId() || sux.isLoopHeader();
-            }
-
-            if (block.getDominator() != null) {
-                assert block.getDominator().getId() < block.getId();
-                assert block.getDominator().getDominated().contains(block);
-            }
-            for (Block dominated : block.getDominated()) {
-                assert dominated.getId() > block.getId();
-                assert dominated.getDominator() == block;
-            }
-
-            assert cfg.getLoops() == null || !block.isLoopHeader() || block.getLoop().header == block;
-        }
-
-        if (cfg.getLoops() != null) {
-            for (Loop loop : cfg.getLoops()) {
-                assert loop.header.isLoopHeader();
-
-                for (Block block : loop.blocks) {
-                    assert block.getId() >= loop.header.getId();
-
-                    Loop blockLoop = block.getLoop();
-                    while (blockLoop != loop) {
-                        blockLoop = blockLoop.parent;
-                        assert blockLoop != null;
-                    }
-                }
-
-                for (Block block : loop.exits) {
-                    assert block.getId() >= loop.header.getId();
-
-                    Loop blockLoop = block.getLoop();
-                    while (blockLoop != null) {
-                        blockLoop = blockLoop.parent;
-                        assert blockLoop != loop;
-                    }
-                }
-            }
-        }
-
-        return true;
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/ControlFlowGraph.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,319 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.cfg;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-public class ControlFlowGraph {
-
-    public final StructuredGraph graph;
-
-    private final NodeMap<Block> nodeToBlock;
-    private Block[] reversePostOrder;
-    private Loop[] loops;
-
-    public static ControlFlowGraph compute(StructuredGraph graph, boolean connectBlocks, boolean computeLoops, boolean computeDominators, boolean computePostdominators) {
-        ControlFlowGraph cfg = new ControlFlowGraph(graph);
-        cfg.identifyBlocks();
-        if (connectBlocks || computeLoops || computeDominators || computePostdominators) {
-            cfg.connectBlocks();
-        }
-        if (computeLoops) {
-            cfg.computeLoopInformation();
-        }
-        if (computeDominators) {
-            cfg.computeDominators();
-        }
-        if (computePostdominators) {
-            cfg.computePostdominators();
-        }
-        assert CFGVerifier.verify(cfg);
-        return cfg;
-    }
-
-    protected ControlFlowGraph(StructuredGraph graph) {
-        this.graph = graph;
-        this.nodeToBlock = graph.createNodeMap();
-    }
-
-    public Block[] getBlocks() {
-        return reversePostOrder;
-    }
-
-    public Block getStartBlock() {
-        return reversePostOrder[0];
-    }
-
-    public NodeMap<Block> getNodeToBlock() {
-        return nodeToBlock;
-    }
-
-    public Block blockFor(Node node) {
-        return nodeToBlock.get(node);
-    }
-
-    public Loop[] getLoops() {
-        return loops;
-    }
-
-    protected static final int BLOCK_ID_INITIAL = -1;
-    protected static final int BLOCK_ID_VISITED = -2;
-
-    private void identifyBlocks() {
-        // Find all block headers
-        int numBlocks = 0;
-        for (Node node : graph.getNodes()) {
-            if (node instanceof BeginNode) {
-                Block block = new Block();
-                numBlocks++;
-
-                block.beginNode = (BeginNode) node;
-                Node cur = node;
-                do {
-                    assert !cur.isDeleted();
-                    block.endNode = cur;
-
-                    assert nodeToBlock.get(cur) == null;
-                    nodeToBlock.set(cur, block);
-                    if (cur instanceof MergeNode) {
-                        for (PhiNode phi : ((MergeNode) cur).phis()) {
-                            nodeToBlock.set(phi, block);
-                        }
-                    }
-
-                    if (cur instanceof FixedNode) {
-                        double probability = ((FixedNode) cur).probability();
-                        if (probability > block.probability) {
-                            block.probability = probability;
-                        }
-                    }
-
-                    Node next = null;
-                    for (Node sux : cur.successors()) {
-                        if (sux != null && !(sux instanceof BeginNode)) {
-                            assert next == null;
-                            next = sux;
-                        }
-                    }
-                    cur = next;
-                } while (cur != null);
-            }
-        }
-
-        // Compute postorder.
-        ArrayList<Block> postOrder = new ArrayList<>(numBlocks);
-        ArrayList<Block> stack = new ArrayList<>();
-        stack.add(blockFor(graph.start()));
-
-        do {
-            Block block = stack.get(stack.size() - 1);
-            if (block.id == BLOCK_ID_INITIAL) {
-                // First time we see this block: push all successors.
-                for (Node suxNode : block.getEndNode().cfgSuccessors()) {
-                    Block suxBlock = blockFor(suxNode);
-                    if (suxBlock.id == BLOCK_ID_INITIAL) {
-                        stack.add(suxBlock);
-                    }
-                }
-                block.id = BLOCK_ID_VISITED;
-            } else if (block.id == BLOCK_ID_VISITED) {
-                // Second time we see this block: All successors have been processed, so add block to postorder list.
-                stack.remove(stack.size() - 1);
-                postOrder.add(block);
-            } else {
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        } while (!stack.isEmpty());
-
-        // Compute reverse postorder and number blocks.
-        assert postOrder.size() <= numBlocks : "some blocks originally created can be unreachable, so actual block list can be shorter";
-        numBlocks = postOrder.size();
-        reversePostOrder = new Block[numBlocks];
-        for (int i = 0; i < numBlocks; i++) {
-            reversePostOrder[i] = postOrder.get(numBlocks - i - 1);
-            reversePostOrder[i].id = i;
-        }
-    }
-
-    // Connect blocks (including loop backward edges), but ignoring dead code (blocks with id < 0).
-    private void connectBlocks() {
-        for (Block block : reversePostOrder) {
-            List<Block> predecessors = new ArrayList<>();
-            for (Node predNode : block.getBeginNode().cfgPredecessors()) {
-                Block predBlock = nodeToBlock.get(predNode);
-                if (predBlock.id >= 0) {
-                    predecessors.add(predBlock);
-                }
-            }
-            if (block.getBeginNode() instanceof LoopBeginNode) {
-                for (LoopEndNode predNode : ((LoopBeginNode) block.getBeginNode()).orderedLoopEnds()) {
-                    Block predBlock = nodeToBlock.get(predNode);
-                    if (predBlock.id >= 0) {
-                        predecessors.add(predBlock);
-                    }
-                }
-            }
-            block.predecessors = predecessors;
-
-            List<Block> successors = new ArrayList<>();
-            for (Node suxNode : block.getEndNode().cfgSuccessors()) {
-                Block suxBlock = nodeToBlock.get(suxNode);
-                assert suxBlock.id >= 0;
-                successors.add(suxBlock);
-            }
-            if (block.getEndNode() instanceof LoopEndNode) {
-                Block suxBlock = nodeToBlock.get(((LoopEndNode) block.getEndNode()).loopBegin());
-                assert suxBlock.id >= 0;
-                successors.add(suxBlock);
-            }
-            block.successors = successors;
-        }
-    }
-
-    private void computeLoopInformation() {
-        List<Loop> loopsList = new ArrayList<>();
-        for (Block block : reversePostOrder) {
-            Node beginNode = block.getBeginNode();
-            if (beginNode instanceof LoopBeginNode) {
-                Loop loop = new Loop(block.getLoop(), loopsList.size(), block);
-                loopsList.add(loop);
-
-                for (LoopEndNode end : ((LoopBeginNode) beginNode).loopEnds()) {
-                    Block endBlock = nodeToBlock.get(end);
-                    computeLoopBlocks(endBlock, loop);
-                }
-            }
-        }
-        loops = loopsList.toArray(new Loop[loopsList.size()]);
-
-        for (Loop loop : loops) {
-            for (Block block : loop.blocks) {
-                for (Block sux : block.getSuccessors()) {
-                    if (sux.getLoopDepth() < loop.depth) {
-                        loop.exits.add(sux);
-                    }
-                }
-            }
-        }
-    }
-
-    private void computeLoopBlocks(Block block, Loop loop) {
-        if (block.getLoop() == loop) {
-            return;
-        }
-        assert block.loop == loop.parent;
-        block.loop = loop;
-
-        assert !loop.blocks.contains(block);
-        loop.blocks.add(block);
-
-        if (block != loop.header) {
-            for (Block pred : block.getPredecessors()) {
-                computeLoopBlocks(pred, loop);
-            }
-        }
-    }
-
-    private void computeDominators() {
-        assert reversePostOrder[0].getPredecessors().size() == 0 : "start block has no predecessor and therefore no dominator";
-        for (int i = 1; i < reversePostOrder.length; i++) {
-            Block block = reversePostOrder[i];
-            List<Block> predecessors = block.getPredecessors();
-            assert predecessors.size() > 0;
-
-            Block dominator = predecessors.get(0);
-            for (int j = 1; j < predecessors.size(); j++) {
-                Block pred = predecessors.get(j);
-                if (!pred.isLoopEnd()) {
-                    dominator = commonDominator(dominator, pred);
-                }
-            }
-            setDominator(block, dominator);
-        }
-    }
-
-    private static void setDominator(Block block, Block dominator) {
-        block.dominator = dominator;
-        if (dominator.dominated == null) {
-            dominator.dominated = new ArrayList<>();
-        }
-        dominator.dominated.add(block);
-    }
-
-    public static Block commonDominator(Block a, Block b) {
-        Block iterA = a;
-        Block iterB = b;
-        while (iterA != iterB) {
-            if (iterA.getId() > iterB.getId()) {
-                iterA = iterA.getDominator();
-            } else {
-                assert iterB.getId() > iterA.getId();
-                iterB = iterB.getDominator();
-            }
-        }
-        return iterA;
-    }
-
-    private void computePostdominators() {
-        for (Block block : reversePostOrder) {
-            if (block.isLoopEnd()) {
-                // We do not want the loop header registered as the postdominator of the loop end.
-                continue;
-            }
-            Block postdominator = null;
-            for (Block sux : block.getSuccessors()) {
-                if (sux.isExceptionEntry()) {
-                    // We ignore exception handlers.
-                } else if (postdominator == null) {
-                    postdominator = sux;
-                } else {
-                    postdominator = commonPostdominator(postdominator, sux);
-                }
-            }
-            block.postdominator = postdominator;
-        }
-    }
-
-    private static Block commonPostdominator(Block a, Block b) {
-        Block iterA = a;
-        Block iterB = b;
-        while (iterA != iterB) {
-            if (iterA.getId() < iterB.getId()) {
-                iterA = iterA.getPostdominator();
-                if (iterA == null) {
-                    return null;
-                }
-            } else {
-                assert iterB.getId() < iterA.getId();
-                iterB = iterB.getPostdominator();
-                if (iterB == null) {
-                    return null;
-                }
-            }
-        }
-        return iterA;
-    }
-}
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/graal/lir/cfg/Loop.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.lir.cfg;
-
-import java.util.*;
-
-public class Loop {
-    public final Loop parent;
-    public final List<Loop> children;
-
-    public final int depth;
-    public final int index;
-    public final Block header;
-    public final List<Block> blocks;
-    public final List<Block> exits;
-
-    protected Loop(Loop parent, int index, Block header) {
-        this.parent = parent;
-        if (parent != null) {
-            this.depth = parent.depth + 1;
-            parent.children.add(this);
-        } else {
-            this.depth = 1;
-        }
-        this.index = index;
-        this.header = header;
-        this.blocks = new ArrayList<>();
-        this.children = new ArrayList<>();
-        this.exits = new ArrayList<>();
-    }
-
-    @Override
-    public String toString() {
-        return "loop " + index + " depth " + depth + (parent != null ? " outer " + parent.index : "");
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.cri;
-
-import com.oracle.graal.graph.*;
-
-public interface CiLoweringTool {
-    GraalRuntime getRuntime();
-    Node getGuardAnchor();
-    Node createGuard(Node condition);
-}
-
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/cri/GraalRuntime.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.cri;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * Graal-specific extensions for the runtime interface that must be implemented by the VM.
- */
-public interface GraalRuntime extends RiRuntime {
-
-    void lower(Node n, CiLoweringTool tool);
-
-    StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List<? extends Node> parameters);
-
-    CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/AbstractStateSplit.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code AbstractStateSplit} class is the abstract base class of all instructions
- * that store an immutable copy of the frame state.
- */
-public abstract class AbstractStateSplit extends FixedWithNextNode implements StateSplit {
-
-    @Input(notDataflow = true) private FrameState stateAfter;
-
-    @Override
-    public FrameState stateAfter() {
-        return stateAfter;
-    }
-
-    @Override
-    public void setStateAfter(FrameState x) {
-        assert x == null || x.isAlive() : "frame state must be in a graph";
-        updateUsages(stateAfter, x);
-        stateAfter = x;
-    }
-
-    /**
-     * Creates a new state split with the specified value type.
-     * @param kind the type of the value that this instruction produces
-     */
-    public AbstractStateSplit(Stamp stamp) {
-        super(stamp);
-    }
-
-    @Override
-    public boolean needsStateAfter() {
-        return true;
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> debugProperties = super.getDebugProperties();
-        if (stateAfter() != null) {
-            debugProperties.put("stateAfter", stateAfter().toString(Verbosity.Debugger));
-        }
-        return debugProperties;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/AnchorNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code AnchorNode} can be used a lower bound for a Guard. It can also be used as an upper bound if no other FixedNode can be used for that purpose.
- */
-public final class AnchorNode extends FixedWithNextNode implements LIRLowerable, Canonicalizable {
-
-    @Input(notDataflow = true) private final NodeInputList<GuardNode> guards = new NodeInputList<>(this);
-
-    public AnchorNode() {
-        super(StampFactory.illegal());
-    }
-
-    public void addGuard(GuardNode x) {
-        guards.add(x);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (this.usages().size() == 0 && guards.size() == 0) {
-            return null;
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // Currently, there is nothing to emit since anchors are only a structural element with no execution semantics.
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class BeginNode extends AbstractStateSplit implements LIRLowerable, Simplifiable, Node.IterableNodeType {
-    public BeginNode() {
-        super(StampFactory.illegal());
-    }
-
-    public static BeginNode begin(FixedNode with) {
-        if (with instanceof BeginNode) {
-            return (BeginNode) with;
-        }
-        BeginNode begin =  with.graph().add(new BeginNode());
-        begin.setNext(with);
-        return begin;
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> debugProperties = super.getDebugProperties();
-        debugProperties.put("shortName", "B");
-        return debugProperties;
-    }
-
-    @Override
-    public void simplify(SimplifierTool tool) {
-        FixedNode prev = (FixedNode) this.predecessor();
-        if (prev == null) {
-            // This is the start node.
-        } else if (prev instanceof ControlSplitNode) {
-            // This begin node is necessary.
-        } else {
-            // This begin node can be removed and all guards moved up to the preceding begin node.
-            if (!usages().isEmpty()) {
-                Node prevBegin = prev;
-                while (!(prevBegin instanceof BeginNode)) {
-                    prevBegin = prevBegin.predecessor();
-                }
-                for (Node usage : usages()) {
-                    tool.addToWorkList(usage);
-                }
-                replaceAtUsages(prevBegin);
-            }
-            ((StructuredGraph) graph()).removeFixed(this);
-        }
-    }
-
-    public void evacuateGuards() {
-        if (!usages().isEmpty()) {
-            Node prevBegin = predecessor();
-            assert prevBegin != null;
-            while (!(prevBegin instanceof BeginNode)) {
-                prevBegin = prevBegin.predecessor();
-            }
-            replaceAtUsages(prevBegin);
-        }
-    }
-
-    @Override
-    public boolean verify() {
-        assertTrue(predecessor() != null || this == ((StructuredGraph) graph()).start() || this instanceof MergeNode, "begin nodes must be connected");
-        return super.verify();
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // nop
-    }
-
-    public NodeIterable<GuardNode> guards() {
-        return usages().filter(GuardNode.class);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/BooleanNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.type.*;
-
-
-public abstract class BooleanNode extends FloatingNode {
-
-    public BooleanNode(Stamp stamp) {
-        super(stamp);
-    }
-
-    public abstract BooleanNode negate();
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public abstract class CallTargetNode extends ValueNode implements LIRLowerable {
-    @Input protected final NodeInputList<ValueNode> arguments;
-
-    public CallTargetNode(ValueNode[] arguments) {
-        super(StampFactory.illegal());
-        this.arguments = new NodeInputList<>(this, arguments);
-    }
-
-    public NodeInputList<ValueNode> arguments() {
-        return arguments;
-    }
-
-    public abstract RiType returnType();
-
-    public abstract CiKind returnKind();
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        //nop
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,230 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code ConstantNode} represents a constant such as an integer value,
- * long, float, object reference, address, etc.
- */
-@NodeInfo(shortName = "Const")
-public class ConstantNode extends BooleanNode implements LIRLowerable {
-
-    @Data public final CiConstant value;
-
-    protected ConstantNode(CiConstant value) {
-        this(value, null);
-    }
-
-    /**
-     * Constructs a new ConstantNode representing the specified constant.
-     * @param value the constant
-     */
-    protected ConstantNode(CiConstant value, RiRuntime runtime) {
-        super(StampFactory.forConstant(value, runtime));
-        this.value = value;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        if (gen.canInlineConstant(value) || onlyUsedInFrameState()) {
-            gen.setResult(this, value);
-        } else {
-            gen.setResult(this, gen.emitMove(value));
-        }
-    }
-
-    private boolean onlyUsedInFrameState() {
-        return usages().filter(NodePredicates.isNotA(FrameState.class)).isEmpty();
-    }
-
-    public static ConstantNode forCiConstant(CiConstant constant, RiRuntime runtime, Graph graph) {
-        return graph.unique(new ConstantNode(constant, runtime));
-    }
-
-    /**
-     * Returns a node for a double constant.
-     * @param d the double value for which to create the instruction
-     * @param graph
-     * @return a node for a double constant
-     */
-    public static ConstantNode forDouble(double d, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forDouble(d)));
-    }
-
-    /**
-     * Returns a node for a float constant.
-     * @param f the float value for which to create the instruction
-     * @param graph
-     * @return a node for a float constant
-     */
-    public static ConstantNode forFloat(float f, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forFloat(f)));
-    }
-
-    /**
-     * Returns a node for an long constant.
-     * @param i the long value for which to create the instruction
-     * @param graph
-     * @return a node for an long constant
-     */
-    public static ConstantNode forLong(long i, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forLong(i)));
-    }
-
-    /**
-     * Returns a node for an integer constant.
-     * @param i the integer value for which to create the instruction
-     * @param graph
-     * @return a node for an integer constant
-     */
-    public static ConstantNode forInt(int i, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forInt(i)));
-    }
-
-    /**
-     * Returns a node for a boolean constant.
-     * @param i the boolean value for which to create the instruction
-     * @param graph
-     * @return a node representing the boolean
-     */
-    public static ConstantNode forBoolean(boolean i, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forBoolean(i)));
-    }
-
-    /**
-     * Returns a node for a byte constant.
-     * @param i the byte value for which to create the instruction
-     * @param graph
-     * @return a node representing the byte
-     */
-    public static ConstantNode forByte(byte i, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forByte(i)));
-    }
-
-    /**
-     * Returns a node for a char constant.
-     * @param i the char value for which to create the instruction
-     * @param graph
-     * @return a node representing the char
-     */
-    public static ConstantNode forChar(char i, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forChar(i)));
-    }
-
-    /**
-     * Returns a node for a short constant.
-     * @param i the short value for which to create the instruction
-     * @param graph
-     * @return a node representing the short
-     */
-    public static ConstantNode forShort(short i, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forShort(i)));
-    }
-
-    /**
-     * Returns a node for an address (jsr/ret address) constant.
-     * @param i the address value for which to create the instruction
-     * @param graph
-     * @return a node representing the address
-     */
-    public static ConstantNode forJsr(int i, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forJsr(i)));
-    }
-
-    /**
-     * Returns a node for an object constant.
-     * @param o the object value for which to create the instruction
-     * @param graph
-     * @return a node representing the object
-     */
-    public static ConstantNode forObject(Object o, RiRuntime runtime, Graph graph) {
-        return graph.unique(new ConstantNode(CiConstant.forObject(o), runtime));
-    }
-
-    public static ConstantNode forIntegerKind(CiKind kind, long value, Graph graph) {
-        switch (kind) {
-            case Byte:
-            case Short:
-            case Int:
-                return ConstantNode.forInt((int) value, graph);
-            case Long:
-                return ConstantNode.forLong(value, graph);
-            default:
-                throw new InternalError("Should not reach here");
-        }
-    }
-
-    public static ConstantNode forFloatingKind(CiKind kind, double value, Graph graph) {
-        switch (kind) {
-            case Float:
-                return ConstantNode.forFloat((float) value, graph);
-            case Double:
-                return ConstantNode.forDouble(value, graph);
-            default:
-                throw new InternalError("Should not reach here");
-        }
-    }
-
-    public static ConstantNode defaultForKind(CiKind kind, Graph graph) {
-        switch(kind) {
-            case Boolean:
-                return ConstantNode.forBoolean(false, graph);
-            case Byte:
-            case Char:
-            case Short:
-            case Int:
-                return ConstantNode.forInt(0, graph);
-            case Double:
-                return ConstantNode.forDouble(0.0, graph);
-            case Float:
-                return ConstantNode.forFloat(0.0f, graph);
-            case Long:
-                return ConstantNode.forLong(0L, graph);
-            case Object:
-                return ConstantNode.forObject(null, null, graph);
-            default:
-                return null;
-        }
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Name) {
-            return super.toString(Verbosity.Name) + "(" + value.kind.format(value.boxedValue()) + ")";
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    @Override
-    public BooleanNode negate() {
-        return ConstantNode.forBoolean(!value.asBoolean(), graph());
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ControlSplitNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code ControlSplitNode} is a base class for all instructions that split the control flow (ie. have more than one successor).
- */
-public abstract class ControlSplitNode extends FixedNode {
-
-    @Successor private final NodeSuccessorList<BeginNode> blockSuccessors;
-
-    public BeginNode blockSuccessor(int index) {
-        return blockSuccessors.get(index);
-    }
-
-    public void setBlockSuccessor(int index, BeginNode x) {
-        blockSuccessors.set(index, x);
-    }
-
-    public int blockSuccessorCount() {
-        return blockSuccessors.size();
-    }
-
-    protected final double[] branchProbability;
-
-    public ControlSplitNode(Stamp stamp, BeginNode[] blockSuccessors, double[] branchProbability) {
-        super(stamp);
-        assert branchProbability.length == blockSuccessors.length;
-        this.blockSuccessors = new NodeSuccessorList<>(this, blockSuccessors);
-        this.branchProbability = branchProbability;
-    }
-
-    public double probability(int successorIndex) {
-        return branchProbability[successorIndex];
-    }
-
-    public void setProbability(int successorIndex, double x) {
-        branchProbability[successorIndex] = x;
-    }
-
-    /**
-     * Gets the successor corresponding to the default (fall through) case.
-     * @return the default successor
-     */
-    public FixedNode defaultSuccessor() {
-        return blockSuccessor(blockSuccessorCount() - 1);
-    }
-
-    public Iterable<BeginNode> blockSuccessors() {
-        return new Iterable<BeginNode>() {
-            @Override
-            public Iterator<BeginNode> iterator() {
-                return new Iterator<BeginNode>() {
-                    int i = 0;
-                    @Override
-                    public void remove() {
-                        throw new UnsupportedOperationException();
-                    }
-                    @Override
-                    public BeginNode next() {
-                        return ControlSplitNode.this.blockSuccessor(i++);
-                    }
-
-                    @Override
-                    public boolean hasNext() {
-                        return i < ControlSplitNode.this.blockSuccessorCount();
-                    }
-                };
-            }
-        };
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        StringBuilder str = new StringBuilder();
-        for (int i = 0; i < branchProbability.length; i++) {
-            str.append(i == 0 ? "" : ", ").append(String.format(Locale.ENGLISH, "%7.5f", branchProbability[i]));
-        }
-        properties.put("branchProbability", str.toString());
-        return properties;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-@NodeInfo(shortName = "Deopt")
-public class DeoptimizeNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
-
-    public static enum DeoptAction {
-        None,                           // just interpret, do not invalidate nmethod
-        Recompile,                      // recompile the nmethod; need not invalidate
-        InvalidateReprofile,            // invalidate the nmethod, reset IC, maybe recompile
-        InvalidateRecompile,            // invalidate the nmethod, recompile (probably)
-        InvalidateStopCompiling,        // invalidate the nmethod and do not compile
-    }
-
-    @Data private String message;
-    @Data private final DeoptAction action;
-
-    public DeoptimizeNode() {
-        this(DeoptAction.InvalidateReprofile);
-    }
-
-    public DeoptimizeNode(DeoptAction action) {
-        super(StampFactory.illegal());
-        this.action = action;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public String message() {
-        return message;
-    }
-
-    public DeoptAction action() {
-        return action;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitDeoptimizeOn(null, action, message);
-    }
-
-    @NodeIntrinsic
-    public static void deopt() {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/EndNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class EndNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
-
-    public EndNode() {
-        super(StampFactory.illegal());
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitEndNode(this);
-    }
-
-    public MergeNode merge() {
-        return (MergeNode) usages().first();
-    }
-
-    @Override
-    public boolean verify() {
-        assertTrue(usages().size() <= 1, "at most one usage");
-        return super.verify();
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> debugProperties = super.getDebugProperties();
-        debugProperties.put("shortName", "E");
-        return debugProperties;
-    }
-
-    @Override
-    public Iterable< ? extends Node> cfgSuccessors() {
-        return Arrays.asList(merge());
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.cri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public final class FixedGuardNode extends FixedWithNextNode implements Simplifiable, Lowerable, LIRLowerable {
-
-    @Input private final NodeInputList<BooleanNode> conditions;
-
-    public FixedGuardNode(BooleanNode condition) {
-        super(StampFactory.illegal());
-        this.conditions = new NodeInputList<>(this, new BooleanNode[] {condition});
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        for (BooleanNode condition : conditions()) {
-            gen.emitGuardCheck(condition);
-        }
-    }
-
-    public void addCondition(BooleanNode x) {
-        conditions.add(x);
-    }
-
-    public NodeInputList<BooleanNode> conditions() {
-        return conditions;
-    }
-
-    @Override
-    public void simplify(SimplifierTool tool) {
-        for (BooleanNode n : conditions.snapshot()) {
-            if (n instanceof ConstantNode) {
-                ConstantNode c = (ConstantNode) n;
-                if (c.asConstant().asBoolean()) {
-                    conditions.remove(n);
-                } else {
-                    FixedNode next = this.next();
-                    if (next != null) {
-                        tool.deleteBranch(next);
-                    }
-                    setNext(graph().add(new DeoptimizeNode(DeoptAction.InvalidateRecompile)));
-                    return;
-                }
-            }
-        }
-        if (conditions.isEmpty()) {
-            ((StructuredGraph) graph()).removeFixed(this);
-        }
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        AnchorNode newAnchor = graph().add(new AnchorNode());
-        for (BooleanNode b : conditions) {
-            newAnchor.addGuard((GuardNode) tool.createGuard(b));
-        }
-        ((StructuredGraph) graph()).replaceFixedWithFixed(this, newAnchor);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FixedNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.nodes.type.*;
-
-public abstract class FixedNode extends ValueNode {
-
-    private double probability;
-
-    public FixedNode(Stamp stamp) {
-        super(stamp);
-    }
-
-    public double probability() {
-        return probability;
-    }
-
-    public void setProbability(double probability) {
-        this.probability = probability;
-    }
-
-    protected void copyInto(FixedNode newNode) {
-        newNode.setProbability(probability);
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("probability", String.format(Locale.ENGLISH, "%7.5f", probability));
-        return properties;
-    }
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FixedWithNextNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.nodes.type.*;
-
-/**
- * Base class of all nodes that are fixed within the control flow graph and have an immediate successor.
- */
-public abstract class FixedWithNextNode extends FixedNode {
-
-    public FixedNode next() {
-        assert scheduledNext() == null || scheduledNext() instanceof FixedNode : "next() cannot be used while the graph is scheduled";
-        return (FixedNode) scheduledNext();
-    }
-
-    public void setNext(FixedNode x) {
-        setScheduledNext(x);
-    }
-
-    public FixedWithNextNode(Stamp stamp) {
-        super(stamp);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,344 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.virtual.*;
-
-/**
- * The {@code FrameState} class encapsulates the frame state (i.e. local variables and
- * operand stack) at a particular point in the abstract interpretation.
- */
-public final class FrameState extends Node implements Node.IterableNodeType, LIRLowerable {
-
-    protected final int localsSize;
-
-    protected final int stackSize;
-
-    private boolean rethrowException;
-
-    private boolean duringCall;
-
-    /**
-     * This BCI should be used for frame states that are built for code with no meaningful BCI.
-     */
-    public static final int UNKNOWN_BCI = -4;
-
-    /**
-     * When a node whose frame state has this BCI value is inlined, its frame state
-     * will be replaced with the frame state before the inlined invoke node.
-     */
-    public static final int BEFORE_BCI = -1;
-
-    /**
-     * When a node whose frame state has this BCI value is inlined, its frame state
-     * will be replaced with the frame state {@linkplain Invoke#stateAfter() after}
-     * the inlined invoke node.
-     */
-    public static final int AFTER_BCI = -2;
-
-    /**
-     * When a node whose frame state has this BCI value is inlined, its frame state
-     * will be replaced with the frame state at the exception edge of the inlined
-     * invoke node.
-     */
-    public static final int AFTER_EXCEPTION_BCI = -3;
-
-    @Input private FrameState outerFrameState;
-
-    @Input private final NodeInputList<ValueNode> values;
-
-    @Input private final NodeInputList<Node> virtualObjectMappings;
-
-    /**
-     * The bytecode index to which this frame state applies. This will be {@code -1}
-     * iff this state is mutable.
-     */
-    public final int bci;
-
-    private final RiResolvedMethod method;
-
-    /**
-     * Creates a {@code FrameState} for the given scope and maximum number of stack and local variables.
-     *
-     * @param method the method for this frame state
-     * @param bci the bytecode index of the frame state
-     * @param localsSize number of locals
-     * @param stackSize size of the stack
-     * @param rethrowException if true the VM should re-throw the exception on top of the stack when deopt'ing using this framestate
-     */
-    public FrameState(RiResolvedMethod method, int bci, int localsSize, int stackSize, boolean rethrowException, boolean duringCall) {
-        assert stackSize >= 0;
-        this.method = method;
-        this.bci = bci;
-        this.localsSize = localsSize;
-        this.stackSize = stackSize;
-        this.values = new NodeInputList<>(this, localsSize + stackSize);
-        this.virtualObjectMappings = new NodeInputList<>(this);
-        this.rethrowException = rethrowException;
-        this.duringCall = duringCall;
-        assert !rethrowException || stackSize == 1 : "must have exception on top of the stack";
-    }
-
-    public FrameState(RiResolvedMethod method, int bci, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException, boolean duringCall) {
-        this.method = method;
-        this.bci = bci;
-        this.localsSize = locals.length;
-        this.stackSize = stackSize;
-        final ValueNode[] newValues = new ValueNode[locals.length + stackSize];
-        for (int i = 0; i < locals.length; i++) {
-            assert locals[i] == null || !locals[i].isDeleted();
-            newValues[i] = locals[i];
-        }
-        for (int i = 0; i < stackSize; i++) {
-            assert stack[i] == null || !stack[i].isDeleted();
-            newValues[localsSize + i] = stack[i];
-        }
-        this.values = new NodeInputList<>(this, newValues);
-        this.virtualObjectMappings = new NodeInputList<>(this);
-        this.rethrowException = rethrowException;
-        this.duringCall = duringCall;
-        assert !rethrowException || stackSize == 1 : "must have exception on top of the stack";
-    }
-
-    public NodeIterable<ValueNode> values() {
-        return values;
-    }
-
-    public FrameState outerFrameState() {
-        return outerFrameState;
-    }
-
-    public void setOuterFrameState(FrameState x) {
-        updateUsages(this.outerFrameState, x);
-        this.outerFrameState = x;
-    }
-
-    private void setValueAt(int i, ValueNode x) {
-        values.set(i, x);
-    }
-
-    public boolean rethrowException() {
-        return rethrowException;
-    }
-
-    public boolean duringCall() {
-        return duringCall;
-    }
-
-    public void setDuringCall(boolean b) {
-        this.duringCall = b;
-    }
-
-    public RiResolvedMethod method() {
-        return method;
-    }
-
-    public void addVirtualObjectMapping(Node virtualObject) {
-        assert virtualObject instanceof VirtualObjectFieldNode || virtualObject instanceof PhiNode : virtualObject;
-        virtualObjectMappings.add(virtualObject);
-    }
-
-    public int virtualObjectMappingCount() {
-        return virtualObjectMappings.size();
-    }
-
-    public Node virtualObjectMappingAt(int i) {
-        return virtualObjectMappings.get(i);
-    }
-
-    public Iterable<Node> virtualObjectMappings() {
-        return virtualObjectMappings;
-    }
-
-    /**
-     * Gets a copy of this frame state.
-     */
-    public FrameState duplicate(int newBci) {
-        return duplicate(newBci, false);
-    }
-
-    public FrameState duplicate(int newBci, boolean duplicateOuter) {
-        FrameState other = graph().add(new FrameState(method, newBci, localsSize, stackSize, rethrowException, duringCall));
-        other.values.setAll(values);
-        other.virtualObjectMappings.setAll(virtualObjectMappings);
-        FrameState newOuterFrameState = outerFrameState();
-        if (duplicateOuter && newOuterFrameState != null) {
-            newOuterFrameState = newOuterFrameState.duplicate(newOuterFrameState.bci, duplicateOuter);
-        }
-        other.setOuterFrameState(newOuterFrameState);
-        return other;
-    }
-
-    /**
-     * Creates a copy of this frame state with one stack element of type popKind popped from the stack and the
-     * values in pushedValues pushed on the stack. The pushedValues are expected to be in slot encoding: a long
-     * or double is followed by a null slot.
-     */
-    public FrameState duplicateModified(int newBci, boolean newRethrowException, CiKind popKind, ValueNode... pushedValues) {
-        int popSlots = 0;
-        if (popKind != CiKind.Void) {
-            if (stackAt(stackSize() - 1) == null) {
-                popSlots = 2;
-            } else {
-                popSlots = 1;
-            }
-            assert stackAt(stackSize() - popSlots).kind().stackKind() == popKind.stackKind();
-        }
-
-        int pushSlots = pushedValues.length;
-        FrameState other = graph().add(new FrameState(method, newBci, localsSize, stackSize - popSlots + pushSlots, newRethrowException, false));
-        for (int i = 0; i < localsSize; i++) {
-            other.setValueAt(i, localAt(i));
-        }
-        for (int i = 0; i < stackSize - popSlots; i++) {
-            other.setValueAt(localsSize + i, stackAt(i));
-        }
-        int slot = localsSize + stackSize - popSlots;
-        for (int i = 0; i < pushSlots; i++) {
-            other.setValueAt(slot++, pushedValues[i]);
-        }
-        other.virtualObjectMappings.setAll(virtualObjectMappings);
-        other.setOuterFrameState(outerFrameState());
-        return other;
-    }
-
-    /**
-     * Gets the size of the local variables.
-     */
-    public int localsSize() {
-        return localsSize;
-    }
-
-    /**
-     * Gets the current size (height) of the stack.
-     */
-    public int stackSize() {
-        return stackSize;
-    }
-
-    /**
-     * Gets the value in the local variables at the specified index.
-     *
-     * @param i the index into the locals
-     * @return the instruction that produced the value for the specified local
-     */
-    public ValueNode localAt(int i) {
-        assert i >= 0 && i < localsSize : "local variable index out of range: " + i;
-        return values.get(i);
-    }
-
-    /**
-     * Get the value on the stack at the specified stack index.
-     *
-     * @param i the index into the stack, with {@code 0} being the bottom of the stack
-     * @return the instruction at the specified position in the stack
-     */
-    public ValueNode stackAt(int i) {
-        assert i >= 0 && i < stackSize;
-        return values.get(localsSize + i);
-    }
-
-    public MergeNode block() {
-        return usages().filter(MergeNode.class).first();
-    }
-
-    public NodeIterable<FrameState> innerFrameStates() {
-        return usages().filter(FrameState.class);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // Nothing to do, frame states are processed as part of the handling of AbstractStateSplit nodes.
-    }
-
-    private static String toString(FrameState frameState) {
-        StringBuilder sb = new StringBuilder();
-        String nl = CiUtil.NEW_LINE;
-        FrameState fs = frameState;
-        while (fs != null) {
-            CiUtil.appendLocation(sb, fs.method, fs.bci).append(nl);
-            sb.append("locals: [");
-            for (int i = 0; i < fs.localsSize(); i++) {
-                sb.append(i == 0 ? "" : ", ").append(fs.localAt(i) == null ? "_" : fs.localAt(i).toString(Verbosity.Id));
-            }
-            sb.append("]").append(nl).append("stack: ");
-            for (int i = 0; i < fs.stackSize(); i++) {
-                sb.append(i == 0 ? "" : ", ").append(fs.stackAt(i) == null ? "_" : fs.stackAt(i).toString(Verbosity.Id));
-            }
-            sb.append(nl);
-            fs = fs.outerFrameState();
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Debugger) {
-            return toString(this);
-        } else if (verbosity == Verbosity.Name) {
-            return super.toString(Verbosity.Name) + "@" + bci;
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("bci", bci);
-        if (method != null) {
-            properties.put("method", CiUtil.format("%H.%n(%p):%r", method));
-        } else {
-            properties.put("method", "None");
-        }
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < localsSize(); i++) {
-            sb.append(i == 0 ? "" : ", ").append(localAt(i) == null ? "_" : localAt(i).toString(Verbosity.Id));
-        }
-        properties.put("locals", sb.toString());
-        sb = new StringBuilder();
-        for (int i = 0; i < stackSize(); i++) {
-            sb.append(i == 0 ? "" : ", ").append(stackAt(i) == null ? "_" : stackAt(i).toString(Verbosity.Id));
-        }
-        properties.put("stack", sb.toString());
-        properties.put("rethrowException", rethrowException);
-        properties.put("duringCall", duringCall);
-        return properties;
-    }
-
-    @Override
-    public boolean verify() {
-        for (ValueNode value : values) {
-            assert assertTrue(value == null || !value.isDeleted(), "frame state must not contain deleted nodes");
-            assert assertTrue(value == null || value instanceof VirtualObjectNode || (value.kind() != CiKind.Void && value.kind() != CiKind.Illegal), "unexpected value: %s", value);
-        }
-        return super.verify();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public final class GuardNode extends FloatingNode implements Canonicalizable, LIRLowerable {
-
-    @Input private BooleanNode condition;
-    @Input(notDataflow = true) private FixedNode anchor;
-
-    public FixedNode anchor() {
-        return anchor;
-    }
-
-    public void setAnchor(FixedNode x) {
-        updateUsages(anchor, x);
-        anchor = x;
-    }
-
-    /**
-     * The instruction that produces the tested boolean value.
-     */
-    public BooleanNode condition() {
-        return condition;
-    }
-
-    public GuardNode(BooleanNode condition, FixedNode anchor) {
-        super(StampFactory.illegal());
-        this.condition = condition;
-        this.anchor = anchor;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitGuardCheck(condition());
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (condition() instanceof ConstantNode) {
-            ConstantNode c = (ConstantNode) condition();
-            if (c.asConstant().asBoolean()) {
-                this.replaceAtUsages(null);
-                return null;
-            }
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/IfNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code IfNode} represents a branch that can go one of two directions depending on the outcome of a
- * comparison.
- */
-public final class IfNode extends ControlSplitNode implements Simplifiable, LIRLowerable {
-    public static final int TRUE_EDGE = 0;
-    public static final int FALSE_EDGE = 1;
-
-    private static final BeginNode[] EMPTY_IF_SUCCESSORS = new BeginNode[] {null, null};
-
-    @Input private BooleanNode compare;
-
-    public BooleanNode compare() {
-        return compare;
-    }
-
-    public IfNode(BooleanNode condition, FixedNode trueSuccessor, FixedNode falseSuccessor, double takenProbability) {
-        super(StampFactory.illegal(), new BeginNode[] {BeginNode.begin(trueSuccessor), BeginNode.begin(falseSuccessor)}, new double[] {takenProbability, 1 - takenProbability});
-        this.compare = condition;
-    }
-
-    public IfNode(BooleanNode condition, double probability) {
-        super(StampFactory.illegal(), EMPTY_IF_SUCCESSORS, new double[] {probability, 1 - probability});
-        this.compare = condition;
-    }
-
-    /**
-     * Gets the true successor.
-     *
-     * @return the true successor
-     */
-    public BeginNode trueSuccessor() {
-        return blockSuccessor(0);
-    }
-
-    /**
-     * Gets the false successor.
-     *
-     * @return the false successor
-     */
-    public BeginNode falseSuccessor() {
-        return blockSuccessor(1);
-    }
-
-    public void setTrueSuccessor(BeginNode node) {
-        setBlockSuccessor(0, node);
-    }
-
-    public void setFalseSuccessor(BeginNode node) {
-        setBlockSuccessor(1, node);
-    }
-
-    /**
-     * Gets the node corresponding to the specified outcome of the branch.
-     *
-     * @param istrue {@code true} if the true successor is requested, {@code false} otherwise
-     * @return the corresponding successor
-     */
-    public BeginNode successor(boolean istrue) {
-        return blockSuccessor(istrue ? 0 : 1);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitIf(this);
-    }
-
-    @Override
-    public boolean verify() {
-        assertTrue(compare() != null, "missing compare");
-        assertTrue(trueSuccessor() != null, "missing trueSuccessor");
-        assertTrue(falseSuccessor() != null, "missing falseSuccessor");
-        return super.verify();
-    }
-
-    @Override
-    public void simplify(SimplifierTool tool) {
-        if (compare() instanceof ConstantNode) {
-            ConstantNode c = (ConstantNode) compare();
-            if (c.asConstant().asBoolean()) {
-                tool.deleteBranch(falseSuccessor());
-                tool.addToWorkList(trueSuccessor());
-                ((StructuredGraph) graph()).removeSplit(this, TRUE_EDGE);
-            } else {
-                tool.deleteBranch(trueSuccessor());
-                tool.addToWorkList(falseSuccessor());
-                ((StructuredGraph) graph()).removeSplit(this, FALSE_EDGE);
-            }
-        } else {
-            if (trueSuccessor().next() instanceof EndNode && falseSuccessor().next() instanceof EndNode) {
-                EndNode trueEnd = (EndNode) trueSuccessor().next();
-                EndNode falseEnd = (EndNode) falseSuccessor().next();
-                MergeNode merge = trueEnd.merge();
-                if (merge == falseEnd.merge() && merge.forwardEndCount() == 2) {
-                    Iterator<PhiNode> phis = merge.phis().iterator();
-                    if (!phis.hasNext()) {
-                        // empty if construct with no phis: remove it
-                        removeEmptyIf(tool);
-                    } else {
-                        PhiNode singlePhi = phis.next();
-                        if (!phis.hasNext()) {
-                            // one phi at the merge of an otherwise empty if construct: try to convert into a MaterializeNode
-                            boolean inverted = trueEnd == merge.forwardEndAt(FALSE_EDGE);
-                            ValueNode trueValue = singlePhi.valueAt(inverted ? 1 : 0);
-                            ValueNode falseValue = singlePhi.valueAt(inverted ? 0 : 1);
-                            if (trueValue.kind() != falseValue.kind()) {
-                                return;
-                            }
-                            if (trueValue.kind() != CiKind.Int && trueValue.kind() != CiKind.Long) {
-                                return;
-                            }
-                            if (trueValue.isConstant() && falseValue.isConstant()) {
-                                MaterializeNode materialize = MaterializeNode.create(compare(), graph(), trueValue, falseValue);
-                                ((StructuredGraph) graph()).replaceFloating(singlePhi, materialize);
-                                removeEmptyIf(tool);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    private void removeEmptyIf(SimplifierTool tool) {
-        BeginNode trueSuccessor = trueSuccessor();
-        BeginNode falseSuccessor = falseSuccessor();
-        assert trueSuccessor.next() instanceof EndNode && falseSuccessor.next() instanceof EndNode;
-
-        EndNode trueEnd = (EndNode) trueSuccessor.next();
-        EndNode falseEnd = (EndNode) falseSuccessor.next();
-        assert trueEnd.merge() == falseEnd.merge();
-
-        MergeNode merge = trueEnd.merge();
-        assert merge.usages().isEmpty();
-
-        FixedNode next = merge.next();
-        merge.setNext(null);
-        setTrueSuccessor(null);
-        setFalseSuccessor(null);
-        ((FixedWithNextNode) predecessor()).setNext(next);
-        safeDelete();
-        trueSuccessor.safeDelete();
-        falseSuccessor.safeDelete();
-        merge.safeDelete();
-        trueEnd.safeDelete();
-        falseEnd.safeDelete();
-        tool.addToWorkList(next);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/Invoke.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.java.*;
-
-public interface Invoke extends StateSplit {
-
-    FixedNode next();
-
-    void setNext(FixedNode x);
-
-    MethodCallTargetNode callTarget();
-
-    int bci();
-
-    FixedNode node();
-
-    FrameState stateDuring();
-
-    FrameState stateAfter();
-
-    Node predecessor();
-
-    void intrinsify(Node node);
-
-    Graph graph();
-
-    double probability();
-
-    void setProbability(double value);
-
-    boolean useForInlining();
-
-    void setUseForInlining(boolean value);
-
-    boolean megamorph();
-
-    void setMegamorph(boolean megamorph);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.util.*;
-
-/**
- * The {@code InvokeNode} represents all kinds of method calls.
- */
-public final class InvokeNode extends AbstractStateSplit implements Node.IterableNodeType, Invoke, LIRLowerable, MemoryCheckpoint  {
-
-    @Input private final MethodCallTargetNode callTarget;
-    @Data private final int bci;
-    // megamorph should only be true when the compiler is sure that the call site is megamorph, and false when in doubt
-    @Data private boolean megamorph;
-    private boolean useForInlining;
-
-    /**
-     * Constructs a new Invoke instruction.
-     *
-     * @param bci the bytecode index of the original invoke (used for debug infos)
-     * @param opcode the opcode of the invoke
-     * @param target the target method being called
-     * @param args the list of instructions producing arguments to the invocation, including the receiver object
-     */
-    public InvokeNode(MethodCallTargetNode callTarget, int bci) {
-        super(callTarget.returnStamp());
-        this.callTarget = callTarget;
-        this.bci = bci;
-        this.megamorph = false;
-        this.useForInlining = true;
-    }
-
-    public MethodCallTargetNode callTarget() {
-        return callTarget;
-    }
-
-    @Override
-    public boolean megamorph() {
-        return megamorph;
-    }
-
-    @Override
-    public void setMegamorph(boolean megamorph) {
-        this.megamorph = megamorph;
-    }
-
-    public boolean useForInlining() {
-        return useForInlining;
-    }
-
-    @Override
-    public void setUseForInlining(boolean value) {
-        this.useForInlining = value;
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> debugProperties = super.getDebugProperties();
-        if (callTarget != null && callTarget.targetMethod() != null) {
-            debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
-        }
-        return debugProperties;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitInvoke(this);
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Long) {
-            return super.toString(Verbosity.Short) + "(bci=" + bci() + ")";
-        } else if (verbosity == Verbosity.Name) {
-            if (callTarget == null || callTarget.targetMethod() == null) {
-                return "Invoke#??Invalid!";
-            }
-            return "Invoke#" + callTarget.targetMethod().name();
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    public int bci() {
-        return bci;
-    }
-
-    @Override
-    public FixedNode node() {
-        return this;
-    }
-
-    @Override
-    public FrameState stateDuring() {
-        FrameState stateAfter = stateAfter();
-        FrameState stateDuring = stateAfter.duplicateModified(bci(), stateAfter.rethrowException(), this.callTarget.targetMethod().signature().returnKind(false));
-        stateDuring.setDuringCall(true);
-        return stateDuring;
-    }
-
-    @Override
-    public void intrinsify(Node node) {
-        MethodCallTargetNode call = callTarget;
-        FrameState stateAfter = stateAfter();
-        if (node instanceof StateSplit) {
-            StateSplit stateSplit = (StateSplit) node;
-            stateSplit.setStateAfter(stateAfter);
-        }
-        if (node == null) {
-            assert kind() == CiKind.Void && usages().isEmpty();
-            ((StructuredGraph) graph()).removeFixed(this);
-        } else {
-            if (node instanceof FixedWithNextNode) {
-                ((StructuredGraph) graph()).replaceFixedWithFixed(this, (FixedWithNextNode) node);
-            } else if (node instanceof DeoptimizeNode) {
-                this.replaceAtPredecessors(node);
-                this.replaceAtUsages(null);
-                GraphUtil.killCFG(this);
-                return;
-            } else {
-                ((StructuredGraph) graph()).replaceFixed(this, node);
-            }
-        }
-        call.safeDelete();
-        if (stateAfter.usages().isEmpty()) {
-            stateAfter.safeDelete();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.util.*;
-
-public class InvokeWithExceptionNode extends ControlSplitNode implements Node.IterableNodeType, Invoke, MemoryCheckpoint, LIRLowerable {
-    public static final int NORMAL_EDGE = 0;
-    public static final int EXCEPTION_EDGE = 1;
-
-    @Input private final MethodCallTargetNode callTarget;
-    @Input private FrameState stateAfter;
-    @Data private final int bci;
-    // megamorph should only be true when the compiler is sure that the call site is megamorph, and false when in doubt
-    @Data private boolean megamorph;
-    private boolean useForInlining;
-
-    /**
-     * @param kind
-     * @param blockSuccessors
-     * @param branchProbability
-     */
-    public InvokeWithExceptionNode(MethodCallTargetNode callTarget, BeginNode exceptionEdge, int bci) {
-        super(callTarget.returnStamp(), new BeginNode[]{null, exceptionEdge}, new double[]{1.0, 0.0});
-        this.bci = bci;
-        this.callTarget = callTarget;
-        this.megamorph = true;
-        this.useForInlining = true;
-    }
-
-    public BeginNode exceptionEdge() {
-        return blockSuccessor(EXCEPTION_EDGE);
-    }
-
-    public void setExceptionEdge(BeginNode x) {
-        setBlockSuccessor(EXCEPTION_EDGE, x);
-    }
-
-    public BeginNode next() {
-        return blockSuccessor(NORMAL_EDGE);
-    }
-
-    public void setNext(BeginNode x) {
-        setBlockSuccessor(NORMAL_EDGE, x);
-    }
-
-    public MethodCallTargetNode callTarget() {
-        return callTarget;
-    }
-
-    @Override
-    public boolean megamorph() {
-        return megamorph;
-    }
-
-    @Override
-    public void setMegamorph(boolean megamorph) {
-        this.megamorph = megamorph;
-    }
-
-    @Override
-    public boolean useForInlining() {
-        return useForInlining;
-    }
-
-    @Override
-    public void setUseForInlining(boolean value) {
-        this.useForInlining = value;
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Long) {
-            return super.toString(Verbosity.Short) + "(bci=" + bci() + ")";
-        } else if (verbosity == Verbosity.Name) {
-            return "Invoke!#" + callTarget.targetMethod().name();
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    public int bci() {
-        return bci;
-    }
-
-    @Override
-    public FixedNode node() {
-        return this;
-    }
-
-    @Override
-    public void setNext(FixedNode x) {
-        if (x != null) {
-            this.setNext(BeginNode.begin(x));
-        } else {
-            this.setNext(null);
-        }
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitInvoke(this);
-    }
-
-    public FrameState stateAfter() {
-        return stateAfter;
-    }
-
-    public void setStateAfter(FrameState stateAfter) {
-        updateUsages(this.stateAfter, stateAfter);
-        this.stateAfter = stateAfter;
-    }
-
-    public FrameState stateDuring() {
-        FrameState tempStateAfter = stateAfter();
-        FrameState stateDuring = tempStateAfter.duplicateModified(bci(), tempStateAfter.rethrowException(), this.callTarget.targetMethod().signature().returnKind(false));
-        stateDuring.setDuringCall(true);
-        return stateDuring;
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> debugProperties = super.getDebugProperties();
-        debugProperties.put("memoryCheckpoint", "true");
-        if (callTarget != null && callTarget.targetMethod() != null) {
-            debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
-        }
-        return debugProperties;
-    }
-
-    public void killExceptionEdge() {
-        BeginNode exceptionEdge = exceptionEdge();
-        setExceptionEdge(null);
-        GraphUtil.killCFG(exceptionEdge);
-    }
-
-    @Override
-    public boolean needsStateAfter() {
-        return true;
-    }
-
-    @Override
-    public void intrinsify(Node node) {
-        MethodCallTargetNode call = callTarget;
-        FrameState state = stateAfter();
-        killExceptionEdge();
-        if (node instanceof StateSplit) {
-            StateSplit stateSplit = (StateSplit) node;
-            stateSplit.setStateAfter(state);
-        }
-        if (node == null) {
-            assert kind() == CiKind.Void && usages().isEmpty();
-            ((StructuredGraph) graph()).removeSplit(this, NORMAL_EDGE);
-        } else {
-            ((StructuredGraph) graph()).replaceSplit(this, node, NORMAL_EDGE);
-        }
-        call.safeDelete();
-        if (state.usages().isEmpty()) {
-            state.safeDelete();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/LocalNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code Local} instruction is a placeholder for an incoming argument
- * to a function call.
- */
-
-public final class LocalNode extends FloatingNode implements Node.IterableNodeType {
-
-    @Data private final int index;
-
-    public LocalNode(CiKind kind, int index) {
-        this(index, StampFactory.forKind(kind));
-    }
-
-    public LocalNode(int index, Stamp stamp) {
-        super(stamp);
-        this.index = index;
-    }
-
-    /**
-     * Gets the index of this local in the array of parameters. This is NOT the JVM local index.
-     * @return the index
-     */
-    public int index() {
-        return index;
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Name) {
-            return super.toString(Verbosity.Name) + "(" + index + ")";
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public class LoopBeginNode extends MergeNode implements Node.IterableNodeType, LIRLowerable {
-    private double loopFrequency;
-    private int nextEndIndex;
-
-    public LoopBeginNode() {
-        loopFrequency = 1;
-    }
-
-    public double loopFrequency() {
-        return loopFrequency;
-    }
-
-    public void setLoopFrequency(double loopFrequency) {
-        this.loopFrequency = loopFrequency;
-    }
-
-    public NodeIterable<LoopEndNode> loopEnds() {
-        return usages().filter(LoopEndNode.class);
-    }
-
-    public List<LoopEndNode> orderedLoopEnds() {
-        List<LoopEndNode> snapshot = usages().filter(LoopEndNode.class).snapshot();
-        Collections.sort(snapshot, new Comparator<LoopEndNode>() {
-            @Override
-            public int compare(LoopEndNode o1, LoopEndNode o2) {
-                return o1.endIndex() - o2.endIndex();
-            }
-        });
-        return snapshot;
-    }
-
-    public EndNode forwardEnd() {
-        assert forwardEndCount() == 1;
-        return forwardEndAt(0);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // Nothing to emit, since this is node is used for structural purposes only.
-    }
-
-    @Override
-    protected void deleteEnd(EndNode end) {
-        if (end instanceof LoopEndNode) {
-            LoopEndNode loopEnd = (LoopEndNode) end;
-            loopEnd.setLoopBegin(null);
-            int idx = loopEnd.endIndex();
-            for (LoopEndNode le : loopEnds()) {
-                int leIdx = le.endIndex();
-                assert leIdx != idx;
-                if (leIdx > idx) {
-                    le.setEndIndex(leIdx - 1);
-                }
-            }
-            nextEndIndex--;
-        } else {
-            super.deleteEnd(end);
-        }
-    }
-
-    @Override
-    public int phiPredecessorCount() {
-        return forwardEndCount() + loopEnds().count();
-    }
-
-    @Override
-    public int phiPredecessorIndex(EndNode pred) {
-        if (pred instanceof LoopEndNode) {
-            LoopEndNode loopEnd = (LoopEndNode) pred;
-            if (loopEnd.loopBegin() == this) {
-                assert loopEnd.endIndex() < loopEnds().count() : "Invalid endIndex : " + loopEnd;
-                return loopEnd.endIndex() + forwardEndCount();
-            }
-        } else {
-            return super.forwardEndIndex(pred);
-        }
-        throw ValueUtil.shouldNotReachHere("unknown pred : " + pred);
-    }
-
-    @Override
-    public EndNode phiPredecessorAt(int index) {
-        if (index < forwardEndCount()) {
-            return forwardEndAt(index);
-        }
-        for (LoopEndNode end : loopEnds()) {
-            int idx = index - forwardEndCount();
-            assert idx >= 0;
-            if (end.endIndex() == idx) {
-                return end;
-            }
-        }
-        throw ValueUtil.shouldNotReachHere();
-    }
-
-    @Override
-    public boolean verify() {
-        assertTrue(loopEnds().isNotEmpty(), "missing loopEnd");
-        return super.verify();
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("loopFrequency", String.format("%7.1f", loopFrequency));
-        return properties;
-    }
-
-    public int nextEndIndex() {
-        return nextEndIndex++;
-    }
-
-    @Override
-    public void simplify(SimplifierTool tool) {
-        // nothing yet
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/LoopEndNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public final class LoopEndNode extends EndNode {
-
-    @Input(notDataflow = true) private LoopBeginNode loopBegin;
-    @Data private boolean safepointPolling;
-    @Data private int endIndex;
-
-    public LoopEndNode(LoopBeginNode begin) {
-        int idx = begin.nextEndIndex();
-        assert idx >= 0;
-        this.safepointPolling = true;
-        this.endIndex = idx;
-        this.loopBegin = begin;
-    }
-
-    @Override
-    public MergeNode merge() {
-        return loopBegin();
-    }
-
-    public LoopBeginNode loopBegin() {
-        return loopBegin;
-    }
-
-    public void setLoopBegin(LoopBeginNode x) {
-        updateUsages(this.loopBegin, x);
-        this.loopBegin = x;
-    }
-
-
-    public void setSafepointPolling(boolean safePointPolling) {
-        this.safepointPolling = safePointPolling;
-    }
-
-    public boolean hasSafepointPolling() {
-        return safepointPolling;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitLoopEnd(this);
-        super.generate(gen);
-    }
-
-    @Override
-    public boolean verify() {
-        assertTrue(loopBegin != null, "must have a loop begin");
-        assertTrue(usages().count() == 0, "LoopEnds can not be used");
-        return super.verify();
-    }
-
-    public int endIndex() {
-        return endIndex;
-    }
-
-    public void setEndIndex(int idx) {
-        this.endIndex = idx;
-    }
-
-    @Override
-    public Iterable< ? extends Node> cfgSuccessors() {
-        return Collections.emptyList();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.calc.*;
-
-public final class MaterializeNode extends ConditionalNode {
-
-    private MaterializeNode(BooleanNode condition, ValueNode trueValue, ValueNode falseValue) {
-        super(condition, trueValue, falseValue);
-    }
-
-    public static MaterializeNode create(BooleanNode condition, Graph graph, ValueNode trueValue, ValueNode falseValue) {
-        MaterializeNode result = new MaterializeNode(condition, trueValue, falseValue);
-        return graph.unique(result);
-
-    }
-
-    public static MaterializeNode create(BooleanNode condition, Graph graph) {
-        return create(condition, graph, ConstantNode.forInt(1, graph), ConstantNode.forInt(0, graph));
-    }
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.spi.*;
-
-/**
- * Denotes the merging of multiple control-flow paths.
- */
-public class MergeNode extends BeginNode implements Node.IterableNodeType, LIRLowerable {
-
-    @Input(notDataflow = true) private final NodeInputList<EndNode> ends = new NodeInputList<>(this);
-
-    @Override
-    public boolean needsStateAfter() {
-        return false;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitMerge(this);
-    }
-
-    public int forwardEndIndex(EndNode end) {
-        return ends.indexOf(end);
-    }
-
-    public void addForwardEnd(EndNode end) {
-        ends.add(end);
-    }
-
-    public int forwardEndCount() {
-        return ends.size();
-    }
-
-    public EndNode forwardEndAt(int index) {
-        return ends.get(index);
-    }
-
-    @Override
-    public NodeIterable<EndNode> cfgPredecessors() {
-        return ends;
-    }
-
-    /**
-     * Determines if a given node is a phi whose {@linkplain PhiNode#merge() merge} is this node.
-     *
-     * @param value the instruction to test
-     * @return {@code true} if {@code value} is a phi and its merge is {@code this}
-     */
-    public boolean isPhiAtMerge(Node value) {
-        return value instanceof PhiNode && ((PhiNode) value).merge() == this;
-    }
-
-    /**
-     * Removes the given end from the merge, along with the entries corresponding to this end in the phis connected to the merge.
-     * @param pred the end to remove
-     */
-    public void removeEnd(EndNode pred) {
-        int predIndex = phiPredecessorIndex(pred);
-        assert predIndex != -1;
-        deleteEnd(pred);
-        for (PhiNode phi : phis()) {
-            phi.removeInput(predIndex);
-        }
-    }
-
-    protected void deleteEnd(EndNode end) {
-        ends.remove(end);
-    }
-
-    public void clearEnds() {
-        ends.clear();
-    }
-
-    public NodeIterable<EndNode> forwardEnds() {
-        return ends;
-    }
-
-    public int phiPredecessorCount() {
-        return forwardEndCount();
-    }
-
-    public int phiPredecessorIndex(EndNode pred) {
-        return forwardEndIndex(pred);
-    }
-
-    public EndNode phiPredecessorAt(int index) {
-        return forwardEndAt(index);
-    }
-
-    public NodeIterable<PhiNode> phis() {
-        return this.usages().filter(PhiNode.class);
-    }
-
-    @Override
-    public void simplify(SimplifierTool tool) {
-        FixedNode next = next();
-        if (next instanceof LoopEndNode) {
-            LoopEndNode origLoopEnd = (LoopEndNode) next;
-            LoopBeginNode begin = origLoopEnd.loopBegin();
-            for (PhiNode phi : phis()) {
-                for (Node usage : phi.usages().filter(isNotA(FrameState.class))) {
-                    if (!begin.isPhiAtMerge(usage)) {
-                        return;
-                    }
-                }
-            }
-            Debug.log("Split %s into loop ends for %s", this, begin);
-            int numEnds = this.forwardEndCount();
-            StructuredGraph graph = (StructuredGraph) graph();
-            for (int i = 0; i < numEnds - 1; i++) {
-                EndNode end = forwardEndAt(numEnds - 1 - i);
-                LoopEndNode loopEnd = graph.add(new LoopEndNode(begin));
-                for (PhiNode phi : begin.phis()) {
-                    ValueNode v = phi.valueAt(origLoopEnd);
-                    ValueNode newInput;
-                    if (isPhiAtMerge(v)) {
-                        PhiNode endPhi = (PhiNode) v;
-                        newInput = endPhi.valueAt(end);
-                    } else {
-                        newInput = v;
-                    }
-                    phi.addInput(newInput);
-                }
-                this.removeEnd(end);
-                end.replaceAtPredecessors(loopEnd);
-                end.safeDelete();
-                tool.addToWorkList(loopEnd.predecessor());
-            }
-            graph.reduceTrivialMerge(this);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code PhiNode} represents the merging of dataflow in the graph. It refers to a merge
- * and a variable.
- */
-public final class PhiNode extends FloatingNode implements Canonicalizable, Node.IterableNodeType {
-
-    @Input(notDataflow = true) private MergeNode merge;
-
-    @Input private final NodeInputList<ValueNode> values = new NodeInputList<>(this);
-
-    public MergeNode merge() {
-        return merge;
-    }
-
-    public static enum PhiType {
-        Value, // normal value phis
-        Memory, // memory phis
-        Virtual // phis used for VirtualObjectField merges
-    }
-
-    private final PhiType type;
-
-    public PhiNode(CiKind kind, MergeNode merge, PhiType type) {
-        super(StampFactory.forKind(kind));
-        this.type = type;
-        this.merge = merge;
-    }
-
-    public PhiType type() {
-        return type;
-    }
-
-    public NodeInputList<ValueNode> values() {
-        return values;
-    }
-
-    public boolean inferStamp() {
-        Stamp newStamp = StampFactory.or(values());
-        if (stamp().equals(newStamp)) {
-            return false;
-        } else {
-            setStamp(newStamp);
-            return true;
-        }
-    }
-
-    @Override
-    public boolean verify() {
-        assertTrue(merge() != null, "missing merge");
-        assertTrue(merge().phiPredecessorCount() == valueCount(), "mismatch between merge predecessor count and phi value count: %d != %d", merge().phiPredecessorCount(), valueCount());
-        if (type == PhiType.Value) {
-            for (ValueNode v : values()) {
-                assertTrue(v.kind() == kind(), "all phi values must have same kind");
-            }
-        }
-        return super.verify();
-    }
-
-    /**
-     * Get the instruction that produces the value associated with the i'th predecessor of the merge.
-     *
-     * @param i the index of the predecessor
-     * @return the instruction that produced the value in the i'th predecessor
-     */
-    public ValueNode valueAt(int i) {
-        return values.get(i);
-    }
-
-    public void setValueAt(int i, ValueNode x) {
-        values.set(i, x);
-    }
-
-    public ValueNode valueAt(EndNode pred) {
-        return valueAt(merge().phiPredecessorIndex(pred));
-    }
-
-    /**
-     * Get the number of inputs to this phi (i.e. the number of predecessors to the merge).
-     *
-     * @return the number of inputs in this phi
-     */
-    public int valueCount() {
-        return values.size();
-    }
-
-    public void clearValues() {
-        values.clear();
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Name) {
-            StringBuilder str = new StringBuilder();
-            for (int i = 0; i < valueCount(); ++i) {
-                if (i != 0) {
-                    str.append(' ');
-                }
-                str.append(valueAt(i) == null ? "-" : valueAt(i).toString(Verbosity.Id));
-            }
-            if (type == PhiType.Value) {
-                return super.toString(Verbosity.Name) + "(" + str + ")";
-            } else {
-                return type + super.toString(Verbosity.Name) + "(" + str + ")";
-            }
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    public void addInput(ValueNode x) {
-        values.add(x);
-    }
-
-    public void removeInput(int index) {
-        values.remove(index);
-    }
-
-    public ValueNode singleValue() {
-        ValueNode differentValue = null;
-        for (ValueNode n : values()) {
-            if (n != this) {
-                if (differentValue == null) {
-                    differentValue = n;
-                } else if (differentValue != n) {
-                    return null;
-                }
-            }
-        }
-        return differentValue;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        ValueNode singleValue = singleValue();
-
-        if (singleValue != null) {
-            return singleValue;
-        }
-
-        return this;
-    }
-
-    public ValueNode firstValue() {
-        return valueAt(0);
-    }
-
-    public boolean isLoopPhi() {
-        return merge() instanceof LoopBeginNode;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/PiNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-
-public class PiNode extends FloatingNode implements LIRLowerable {
-
-    @Input private ValueNode value;
-    @Input private BeginNode anchor;
-
-    public ValueNode value() {
-        return value;
-    }
-
-    public BeginNode anchor() {
-        return anchor;
-    }
-
-    public PiNode(ValueNode value, BeginNode anchor, Stamp stamp) {
-        super(stamp);
-        this.value = value;
-        this.anchor = anchor;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        generator.setResult(this, generator.operand(value));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ReturnNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public final class ReturnNode extends FixedNode implements LIRLowerable, Node.IterableNodeType {
-
-    @Input private ValueNode result;
-
-    public ValueNode result() {
-        return result;
-    }
-
-    /**
-     * Constructs a new Return instruction.
-     * @param result the instruction producing the result for this return; {@code null} if this is a void return
-     */
-    public ReturnNode(ValueNode result) {
-        super(StampFactory.forKind(result == null ? CiKind.Void : result.kind()));
-        this.result = result;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitReturn(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ScheduledNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.graal.graph.*;
-
-public class ScheduledNode extends Node {
-
-    @Successor private ScheduledNode scheduledNext; // the immediate successor of the current node
-
-    public ScheduledNode scheduledNext() {
-        return scheduledNext;
-    }
-
-    public void setScheduledNext(ScheduledNode x) {
-        updatePredecessors(scheduledNext, x);
-        scheduledNext = x;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/StateSplit.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-public interface StateSplit {
-
-    /**
-     * Gets the state of the JVM frame after execution of this node.
-     */
-    FrameState stateAfter();
-
-    /**
-     * Sets the state of the JVM frame after execution of this node.
-     */
-    void setStateAfter(FrameState x);
-
-    /**
-     * Determines if the caller should create an {@link #stateAfter() after}
-     * frame state for this node if it doesn't already have one.
-     */
-    boolean needsStateAfter();
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,333 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.util.*;
-
-
-/**
- * A graph that contains at least one distinguished node : the {@link #start() start} node.
- * This node is the start of the control flow of the graph.
- */
-public class StructuredGraph extends Graph {
-    private final BeginNode start;
-    private final RiResolvedMethod method;
-
-    /**
-     * Creates a new Graph containing a single {@link BeginNode} as the {@link #start() start} node.
-     */
-    public StructuredGraph(String name) {
-        this(name, null);
-    }
-
-    public StructuredGraph(String name, RiResolvedMethod method) {
-        super(name);
-        this.start = add(new BeginNode());
-        this.method = method;
-    }
-
-    /**
-     * Creates a new Graph containing a single {@link BeginNode} as the {@link #start() start} node.
-     */
-    public StructuredGraph() {
-        this((String) null);
-    }
-
-    public StructuredGraph(RiResolvedMethod method) {
-        this(null, method);
-    }
-
-    public BeginNode start() {
-        return start;
-    }
-
-    public RiResolvedMethod method() {
-        return method;
-    }
-
-    @Override
-    public StructuredGraph copy() {
-        return copy(name);
-    }
-
-    @Override
-    public StructuredGraph copy(String newName) {
-        StructuredGraph copy = new StructuredGraph(newName);
-        HashMap<Node, Node> replacements = new HashMap<>();
-        replacements.put(start, copy.start);
-        copy.addDuplicates(getNodes(), replacements);
-        return copy;
-    }
-
-    public LocalNode getLocal(int index) {
-        for (LocalNode local : getNodes(LocalNode.class)) {
-            if (local.index() == index) {
-                return local;
-            }
-        }
-        return null;
-    }
-
-    public Iterable<Invoke> getInvokes() {
-        final Iterator<MethodCallTargetNode> callTargets = getNodes(MethodCallTargetNode.class).iterator();
-        return new Iterable<Invoke>() {
-            private Invoke next;
-
-            @Override
-            public Iterator<Invoke> iterator() {
-                return new Iterator<Invoke>() {
-
-                    @Override
-                    public boolean hasNext() {
-                        if (next == null) {
-                            while (callTargets.hasNext()) {
-                                Invoke i = callTargets.next().invoke();
-                                if (i != null) {
-                                    next = i;
-                                    return true;
-                                }
-                            }
-                            return false;
-                        } else {
-                            return true;
-                        }
-                    }
-
-                    @Override
-                    public Invoke next() {
-                        try {
-                            return next;
-                        } finally {
-                            next = null;
-                        }
-                    }
-
-                    @Override
-                    public void remove() {
-                        throw new UnsupportedOperationException();
-                    }
-                };
-            }
-        };
-    }
-
-    public boolean hasLoops() {
-        return getNodes(LoopBeginNode.class).iterator().hasNext();
-    }
-
-    public void removeFloating(FloatingNode node) {
-        assert node != null && node.isAlive() : "cannot remove " + node;
-        node.safeDelete();
-    }
-
-    public void replaceFloating(FloatingNode node, ValueNode replacement) {
-        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
-        node.replaceAtUsages(replacement);
-        node.safeDelete();
-    }
-
-    public void removeFixed(FixedWithNextNode node) {
-        assert node != null;
-        assert node.usages().isEmpty() : node + " " + node.usages();
-        FixedNode next = node.next();
-        node.setNext(null);
-        node.replaceAtPredecessors(next);
-        node.safeDelete();
-    }
-
-    public void replaceFixed(FixedWithNextNode node, Node replacement) {
-        if (replacement instanceof FixedWithNextNode) {
-            replaceFixedWithFixed(node, (FixedWithNextNode) replacement);
-        } else {
-            assert replacement != null : "cannot replace " + node + " with null";
-            assert replacement instanceof FloatingNode : "cannot replace " + node + " with " + replacement;
-            replaceFixedWithFloating(node, (FloatingNode) replacement);
-        }
-    }
-
-    public void replaceFixedWithFixed(FixedWithNextNode node, FixedWithNextNode replacement) {
-        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
-        replacement.setProbability(node.probability());
-        FixedNode next = node.next();
-        node.setNext(null);
-        replacement.setNext(next);
-        node.replaceAndDelete(replacement);
-    }
-
-    public void replaceFixedWithFloating(FixedWithNextNode node, FloatingNode replacement) {
-        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
-        FixedNode next = node.next();
-        node.setNext(null);
-        node.replaceAtPredecessors(next);
-        node.replaceAtUsages(replacement);
-        node.safeDelete();
-    }
-
-    public void removeSplit(ControlSplitNode node, int survivingSuccessor) {
-        assert node != null;
-        assert node.usages().isEmpty();
-        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
-        BeginNode begin = node.blockSuccessor(survivingSuccessor);
-        begin.evacuateGuards();
-        FixedNode next = begin.next();
-        begin.setNext(null);
-        for (int i = 0; i < node.blockSuccessorCount(); i++) {
-            node.setBlockSuccessor(i, null);
-        }
-        node.replaceAtPredecessors(next);
-        node.safeDelete();
-        begin.safeDelete();
-    }
-
-    public void removeSplitPropagate(ControlSplitNode node, int survivingSuccessor) {
-        assert node != null;
-        assert node.usages().isEmpty();
-        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
-        BeginNode begin = node.blockSuccessor(survivingSuccessor);
-        begin.evacuateGuards();
-        FixedNode next = begin.next();
-        begin.setNext(null);
-        for (int i = 0; i < node.blockSuccessorCount(); i++) {
-            BeginNode successor = node.blockSuccessor(i);
-            node.setBlockSuccessor(i, null);
-            if (successor != begin && successor.isAlive()) {
-                GraphUtil.killCFG(successor);
-            }
-        }
-        if (next.isAlive()) {
-            node.replaceAtPredecessors(next);
-            node.safeDelete();
-            begin.safeDelete();
-        } else {
-            assert node.isDeleted();
-        }
-    }
-
-    public void replaceSplit(ControlSplitNode node, Node replacement, int survivingSuccessor) {
-        if (replacement instanceof FixedWithNextNode) {
-            replaceSplitWithFixed(node, (FixedWithNextNode) replacement, survivingSuccessor);
-        } else {
-            assert replacement != null : "cannot replace " + node + " with null";
-            assert replacement instanceof FloatingNode : "cannot replace " + node + " with " + replacement;
-            replaceSplitWithFloating(node, (FloatingNode) replacement, survivingSuccessor);
-        }
-    }
-
-    public void replaceSplitWithFixed(ControlSplitNode node, FixedWithNextNode replacement, int survivingSuccessor) {
-        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
-        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
-        BeginNode begin = node.blockSuccessor(survivingSuccessor);
-        begin.evacuateGuards();
-        FixedNode next = begin.next();
-        begin.setNext(null);
-        for (int i = 0; i < node.blockSuccessorCount(); i++) {
-            node.setBlockSuccessor(i, null);
-        }
-        replacement.setNext(next);
-        node.replaceAndDelete(replacement);
-        begin.safeDelete();
-    }
-
-    public void replaceSplitWithFloating(ControlSplitNode node, FloatingNode replacement, int survivingSuccessor) {
-        assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
-        assert survivingSuccessor >= 0 && survivingSuccessor < node.blockSuccessorCount() : "invalid surviving successor " + survivingSuccessor + " for " + node;
-        BeginNode begin = node.blockSuccessor(survivingSuccessor);
-        begin.evacuateGuards();
-        FixedNode next = begin.next();
-        begin.setNext(null);
-        for (int i = 0; i < node.blockSuccessorCount(); i++) {
-            node.setBlockSuccessor(i, null);
-        }
-        node.replaceAtPredecessors(next);
-        node.replaceAtUsages(replacement);
-        node.safeDelete();
-        begin.safeDelete();
-    }
-
-    public void addAfterFixed(FixedWithNextNode node, FixedWithNextNode newNode) {
-        assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " after " + node;
-        assert newNode.next() == null;
-        newNode.setProbability(node.probability());
-        FixedNode next = node.next();
-        node.setNext(newNode);
-        newNode.setNext(next);
-    }
-
-    public void addBeforeFixed(FixedNode node, FixedWithNextNode newNode) {
-        assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " before " + node;
-        assert node.predecessor() != null && node.predecessor() instanceof FixedWithNextNode : "cannot add " + newNode + " before " + node;
-        assert newNode.next() == null;
-        newNode.setProbability(node.probability());
-        FixedWithNextNode pred = (FixedWithNextNode) node.predecessor();
-        pred.setNext(newNode);
-        newNode.setNext(node);
-    }
-
-    public void reduceDegenerateLoopBegin(LoopBeginNode begin) {
-        assert begin.loopEnds().isEmpty() : "Loop begin still has backedges";
-        if (begin.forwardEndCount() == 1) { // bypass merge and remove
-            reduceTrivialMerge(begin);
-        } else { // convert to merge
-            MergeNode merge = this.add(new MergeNode());
-            this.replaceFixedWithFixed(begin, merge);
-        }
-    }
-
-    public void reduceTrivialMerge(MergeNode merge) {
-        assert merge.forwardEndCount() == 1;
-        assert !(merge instanceof LoopBeginNode) || ((LoopBeginNode) merge).loopEnds().isEmpty();
-        for (PhiNode phi : merge.phis().snapshot()) {
-            assert phi.valueCount() == 1;
-            ValueNode singleValue = phi.valueAt(0);
-            phi.replaceAtUsages(singleValue);
-            phi.safeDelete();
-        }
-        EndNode singleEnd = merge.forwardEndAt(0);
-        FixedNode sux = merge.next();
-        FrameState stateAfter = merge.stateAfter();
-        // evacuateGuards
-        Node prevBegin = singleEnd.predecessor();
-        assert prevBegin != null;
-        while (!(prevBegin instanceof BeginNode)) {
-            prevBegin = prevBegin.predecessor();
-        }
-        merge.replaceAtUsages(prevBegin);
-
-        merge.safeDelete();
-        if (stateAfter != null && stateAfter.usages().isEmpty()) {
-            stateAfter.safeDelete();
-        }
-        if (sux == null) {
-            singleEnd.replaceAtPredecessors(null);
-            singleEnd.safeDelete();
-        } else {
-            singleEnd.replaceAndDelete(sux);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * Unwind takes an exception object, destroys the current stack frame and passes the exception object to the system's exception dispatch code.
- */
-public final class UnwindNode extends FixedNode implements LIRLowerable, Node.IterableNodeType {
-
-    @Input private ValueNode exception;
-
-    public ValueNode exception() {
-        return exception;
-    }
-
-    public UnwindNode(ValueNode exception) {
-        super(StampFactory.forKind(CiKind.Object));
-        assert exception == null || exception.kind() == CiKind.Object;
-        this.exception = exception;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitCallToRuntime(CiRuntimeCall.UnwindException, false, gen.operand(exception()));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * This class represents a value within the graph, including local variables, phis, and
- * all other instructions.
- */
-public abstract class ValueNode extends ScheduledNode implements StampProvider {
-
-    /**
-     * The kind of this value. This is {@link CiKind#Void} for instructions that produce no value.
-     * This kind is guaranteed to be a {@linkplain CiKind#stackKind() stack kind}.
-     */
-    @Data private Stamp stamp;
-
-    /**
-     * Creates a new value with the specified kind.
-     * @param kind the type of this value
-     * @param inputCount
-     * @param successorCount
-     * @param graph
-     */
-    public ValueNode(Stamp stamp) {
-        this.stamp = stamp;
-        assert kind() != null && kind() == kind().stackKind() : kind() + " != " + kind().stackKind();
-    }
-
-    public Stamp stamp() {
-        return stamp;
-    }
-
-    public void setStamp(Stamp stamp) {
-        this.stamp = stamp;
-    }
-
-    public CiKind kind() {
-        return stamp.kind();
-    }
-
-    /**
-     * Checks whether this value is a constant (i.e. it is of type {@link ConstantNode}.
-     * @return {@code true} if this value is a constant
-     */
-    public final boolean isConstant() {
-        return this instanceof ConstantNode;
-    }
-
-    /**
-     * Checks whether this value represents the null constant.
-     * @return {@code true} if this value represents the null constant
-     */
-    public final boolean isNullConstant() {
-        return this instanceof ConstantNode && ((ConstantNode) this).value.isNull();
-    }
-
-    /**
-     * Convert this value to a constant if it is a constant, otherwise return null.
-     * @return the {@link CiConstant} represented by this value if it is a constant; {@code null}
-     * otherwise
-     */
-    public final CiConstant asConstant() {
-        if (this instanceof ConstantNode) {
-            return ((ConstantNode) this).value;
-        }
-        return null;
-    }
-
-    /**
-     * Computes the exact type of the result of this node, if possible.
-     * @return the exact type of the result of this node, if it is known; {@code null} otherwise
-     */
-    public final RiResolvedType exactType() {
-        return stamp.exactType();
-    }
-
-    /**
-     * Computes the declared type of the result of this node, if possible.
-     * @return the declared type of the result of this node, if it is known; {@code null} otherwise
-     */
-    public final RiResolvedType declaredType() {
-        return stamp.declaredType();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/ValueUtil.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.Verbosity;
-
-
-public class ValueUtil {
-
-    public static ValueNode assertKind(CiKind kind, ValueNode x) {
-        assert x != null && ((x.kind() == kind) || (x.kind() == CiKind.Jsr && kind == CiKind.Object)) : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.kind());
-        return x;
-    }
-
-    public static RuntimeException shouldNotReachHere(String msg) {
-        throw new InternalError("should not reach here: " + msg);
-    }
-
-    public static RuntimeException shouldNotReachHere() {
-        throw new InternalError("should not reach here");
-    }
-
-    public static ValueNode assertLong(ValueNode x) {
-        assert x != null && (x.kind() == CiKind.Long);
-        return x;
-    }
-
-    public static ValueNode assertJsr(ValueNode x) {
-        assert x != null && (x.kind() == CiKind.Jsr);
-        return x;
-    }
-
-    public static ValueNode assertInt(ValueNode x) {
-        assert x != null && (x.kind() == CiKind.Int);
-        return x;
-    }
-
-    public static ValueNode assertFloat(ValueNode x) {
-        assert x != null && (x.kind() == CiKind.Float);
-        return x;
-    }
-
-    public static ValueNode assertObject(ValueNode x) {
-        assert x != null && (x.kind() == CiKind.Object);
-        return x;
-    }
-
-    public static ValueNode assertDouble(ValueNode x) {
-        assert x != null && (x.kind() == CiKind.Double);
-        return x;
-    }
-
-    public static void assertHigh(ValueNode x) {
-        assert x == null;
-    }
-
-    public static boolean typeMismatch(ValueNode x, ValueNode y) {
-        return y == null || x == null || x.kind() != y.kind();
-    }
-
-
-    @SuppressWarnings("unchecked")
-    public static <T extends Node> Collection<T> filter(Iterable<Node> nodes, Class<T> clazz) {
-        ArrayList<T> phis = new ArrayList<>();
-        for (Node node : nodes) {
-            if (clazz.isInstance(node)) {
-                phis.add((T) node);
-            }
-        }
-        return phis;
-    }
-
-    /**
-     * Converts a given instruction to a value string. The representation of an node as
-     * a value is formed by concatenating the {@linkplain com.oracle.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.
-     * @return the instruction representation as a string
-     */
-    public static String valueString(ValueNode value) {
-        return (value == null) ? "-" : ("" + value.kind().typeChar + value.toString(Verbosity.Id));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "&")
-public final class AndNode extends LogicNode implements Canonicalizable, LIRLowerable {
-
-    public AndNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x() == y()) {
-            return x();
-        }
-        if (x().isConstant() && !y().isConstant()) {
-            return graph().unique(new AndNode(kind(), y(), x()));
-        }
-        if (x().isConstant()) {
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() & y().asConstant().asInt(), graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() & y().asConstant().asLong(), graph());
-            }
-        } else if (y().isConstant()) {
-            if (kind() == CiKind.Int) {
-                int c = y().asConstant().asInt();
-                if (c == -1) {
-                    return x();
-                }
-                if (c == 0) {
-                    return ConstantNode.forInt(0, graph());
-                }
-            } else {
-                assert kind() == CiKind.Long;
-                long c = y().asConstant().asLong();
-                if (c == -1) {
-                    return x();
-                }
-                if (c == 0) {
-                    return ConstantNode.forLong(0, graph());
-                }
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitAnd(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ArithmeticNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * The {@code ArithmeticOp} class represents arithmetic operations such as addition, subtraction, etc.
- */
-public abstract class ArithmeticNode extends BinaryNode {
-
-    private final boolean isStrictFP;
-
-    /**
-     * Creates a new arithmetic operation.
-     * @param kind the result kind of the operation
-     * @param x the first input instruction
-     * @param y the second input instruction
-     * @param isStrictFP indicates this operation has strict rounding semantics
-     */
-    public ArithmeticNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
-        super(kind, x, y);
-        this.isStrictFP = isStrictFP;
-    }
-
-    /**
-     * Checks whether this instruction has strict fp semantics.
-     * @return {@code true} if this instruction has strict fp semantics
-     */
-    public boolean isStrictFP() {
-        return isStrictFP;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code BinaryNode} class is the base of arithmetic and logic operations with two inputs.
- */
-public abstract class BinaryNode extends FloatingNode {
-
-    @Input private ValueNode x;
-    @Input private ValueNode y;
-
-    public ValueNode x() {
-        return x;
-    }
-
-    public ValueNode y() {
-        return y;
-    }
-
-    /**
-     * Creates a new BinaryNode instance.
-     * @param kind the result type of this instruction
-     * @param x the first input instruction
-     * @param y the second input instruction
-     */
-    public BinaryNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(StampFactory.forKind(kind));
-        this.x = x;
-        this.y = y;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/* TODO (thomaswue/gdub) 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)
- *
- * Compare should probably be made a value (so that it can be canonicalized for example) and in later stages some Compare usage should be transformed
- * into variants that do not materialize the value (CompareIf, CompareGuard...)
- */
-public final class CompareNode extends BooleanNode implements Canonicalizable, LIRLowerable {
-
-    @Input private ValueNode x;
-    @Input private ValueNode y;
-
-    @Data private final Condition condition;
-    @Data private final boolean unorderedIsTrue;
-
-    public ValueNode x() {
-        return x;
-    }
-
-    public ValueNode y() {
-        return y;
-    }
-
-    /**
-     * Constructs a new Compare instruction.
-     *
-     * @param x the instruction producing the first input to the instruction
-     * @param condition the condition (comparison operation)
-     * @param y the instruction that produces the second input to this instruction
-     * @param graph
-     */
-    public CompareNode(ValueNode x, Condition condition, ValueNode y) {
-        this(x, condition, false, y);
-    }
-
-    /**
-     * Constructs a new Compare instruction.
-     *
-     * @param x the instruction producing the first input to the instruction
-     * @param condition the condition (comparison operation)
-     * @param y the instruction that produces the second input to this instruction
-     * @param graph
-     */
-    public CompareNode(ValueNode x, Condition condition, boolean unorderedIsTrue, ValueNode y) {
-        super(StampFactory.illegal());
-        assert (x == null && y == null) || x.kind() == y.kind();
-        this.condition = condition;
-        this.unorderedIsTrue = unorderedIsTrue;
-        this.x = x;
-        this.y = y;
-    }
-
-    /**
-     * Gets the condition (comparison operation) for this instruction.
-     *
-     * @return the condition
-     */
-    public Condition condition() {
-        return condition;
-    }
-
-    /**
-     * Checks whether unordered inputs mean true or false.
-     *
-     * @return {@code true} if unordered inputs produce true
-     */
-    public boolean unorderedIsTrue() {
-        return unorderedIsTrue;
-    }
-
-    @Override
-    public BooleanNode negate() {
-        return graph().unique(new CompareNode(x(), condition.negate(), !unorderedIsTrue, y()));
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Name) {
-            return super.toString(Verbosity.Name) + " " + condition.operator;
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    private ValueNode optimizeMaterialize(CiConstant constant, MaterializeNode materializeNode, RiRuntime runtime) {
-        CiConstant trueConstant = materializeNode.trueValue().asConstant();
-        CiConstant falseConstant = materializeNode.falseValue().asConstant();
-
-        if (falseConstant != null && trueConstant != null) {
-            Boolean trueResult = condition().foldCondition(trueConstant, constant, runtime, unorderedIsTrue());
-            Boolean falseResult = condition().foldCondition(falseConstant, constant, runtime, unorderedIsTrue());
-
-            if (trueResult != null && falseResult != null) {
-                boolean trueUnboxedResult = trueResult;
-                boolean falseUnboxedResult = falseResult;
-                if (trueUnboxedResult == falseUnboxedResult) {
-                    return ConstantNode.forBoolean(trueUnboxedResult, graph());
-                } else {
-                    if (trueUnboxedResult) {
-                        assert falseUnboxedResult == false;
-                        return materializeNode.condition();
-                    } else {
-                        assert falseUnboxedResult == true;
-                        return materializeNode.condition().negate();
-
-                    }
-                }
-            }
-        }
-        return this;
-    }
-
-    private ValueNode optimizeNormalizeCmp(CiConstant constant, NormalizeCompareNode normalizeNode) {
-        if (constant.kind == CiKind.Int && constant.asInt() == 0) {
-            Condition cond = condition();
-            boolean isLess = cond == Condition.LE || cond == Condition.LT || cond == Condition.BE || cond == Condition.BT;
-            boolean canonUnorderedIsTrue = cond != Condition.EQ && (cond == Condition.NE || !(isLess ^ normalizeNode.isUnorderedLess));
-            CompareNode result = graph().unique(new CompareNode(normalizeNode.x(), cond, canonUnorderedIsTrue, normalizeNode.y()));
-            return result;
-        }
-        return this;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && !y().isConstant()) { // move constants to the left (y)
-            return graph().unique(new CompareNode(y(), condition.mirror(), unorderedIsTrue(), x()));
-        } else if (x().isConstant() && y().isConstant()) {
-            CiConstant constX = x().asConstant();
-            CiConstant constY = y().asConstant();
-            Boolean result = condition().foldCondition(constX, constY, tool.runtime(), unorderedIsTrue());
-            if (result != null) {
-                return ConstantNode.forBoolean(result, graph());
-            }
-        }
-
-        if (y().isConstant()) {
-            if (x() instanceof MaterializeNode) {
-                return optimizeMaterialize(y().asConstant(), (MaterializeNode) x(), tool.runtime());
-            } else if (x() instanceof NormalizeCompareNode) {
-                return optimizeNormalizeCmp(y().asConstant(), (NormalizeCompareNode) x());
-            }
-        }
-
-        if (x() == y() && x().kind() != CiKind.Float && x().kind() != CiKind.Double) {
-            return ConstantNode.forBoolean(condition().check(1, 1), graph());
-        }
-        if ((condition == Condition.NE || condition == Condition.EQ) && x().kind() == CiKind.Object) {
-            ValueNode object = null;
-            if (x().isNullConstant()) {
-                object = y();
-            } else if (y().isNullConstant()) {
-                object = x();
-            }
-            if (object != null) {
-                return graph().unique(new NullCheckNode(object, condition == Condition.EQ));
-            } else {
-                Stamp xStamp = x.stamp();
-                Stamp yStamp = y.stamp();
-                if (xStamp.alwaysDistinct(yStamp)) {
-                    return ConstantNode.forBoolean(condition == Condition.NE, graph());
-                }
-            }
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,452 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.util.*;
-
-/**
- * Condition codes used in conditionals.
- */
-public enum Condition {
-    /**
-     * Equal.
-     */
-    EQ("=="),
-
-    /**
-     * Not equal.
-     */
-    NE("!="),
-
-    /**
-     * Signed less than.
-     */
-    LT("<"),
-
-    /**
-     * Signed less than or equal.
-     */
-    LE("<="),
-
-    /**
-     * Signed greater than.
-     */
-    GT(">"),
-
-    /**
-     * Signed greater than or equal.
-     */
-    GE(">="),
-
-    /**
-     * Unsigned greater than or equal ("above than or equal").
-     */
-    AE("|>=|"),
-
-    /**
-     * Unsigned less than or equal ("below than or equal").
-     */
-    BE("|<=|"),
-
-    /**
-     * Unsigned greater than ("above than").
-     */
-    AT("|>|"),
-
-    /**
-     * Unsigned less than ("below than").
-     */
-    BT("|<|"),
-
-    /**
-     * Operation produced an overflow.
-     */
-    OF("overflow"),
-
-    /**
-     * Operation did not produce an overflow.
-     */
-    NOF("noOverflow");
-
-    public final String operator;
-
-    private Condition(String operator) {
-        this.operator = operator;
-    }
-
-    public boolean check(int left, int right) {
-        switch (this) {
-            case EQ: return left == right;
-            case NE: return left != right;
-            case LT: return left < right;
-            case LE: return left <= right;
-            case GT: return left > right;
-            case GE: return left >= right;
-            case AE: return UnsignedMath.aboveOrEqual(left, right);
-            case BE: return UnsignedMath.belowOrEqual(left, right);
-            case AT: return UnsignedMath.aboveThan(left, right);
-            case BT: return UnsignedMath.belowThan(left, right);
-        }
-        throw new IllegalArgumentException();
-    }
-
-    /**
-     * Negate this conditional.
-     * @return the condition that represents the negation
-     */
-    public final Condition negate() {
-        switch (this) {
-            case EQ: return NE;
-            case NE: return EQ;
-            case LT: return GE;
-            case LE: return GT;
-            case GT: return LE;
-            case GE: return LT;
-            case BT: return AE;
-            case BE: return AT;
-            case AT: return BE;
-            case AE: return BT;
-            case OF: return NOF;
-            case NOF: return OF;
-        }
-        throw new IllegalArgumentException(this.toString());
-    }
-
-    public boolean implies(Condition other) {
-        if (other == this) {
-            return true;
-        }
-        switch (this) {
-            case EQ: return other == LE || other == GE || other == BE || other == AE;
-            case NE: return false;
-            case LT: return other == LE;
-            case LE: return false;
-            case GT: return other == GE;
-            case GE: return false;
-            case BT: return other == BE;
-            case BE: return false;
-            case AT: return other == AE;
-            case AE: return false;
-            case OF: return false;
-            case NOF: return false;
-        }
-        throw new IllegalArgumentException(this.toString());
-    }
-
-    /**
-     * Mirror this conditional (i.e. commute "a op b" to "b op' a")
-     * @return the condition representing the equivalent commuted operation
-     */
-    public final Condition mirror() {
-        switch (this) {
-            case EQ: return EQ;
-            case NE: return NE;
-            case LT: return GT;
-            case LE: return GE;
-            case GT: return LT;
-            case GE: return LE;
-            case BT: return AT;
-            case BE: return AE;
-            case AT: return BT;
-            case AE: return BE;
-        }
-        throw new IllegalArgumentException();
-    }
-
-    /**
-     * Checks if this conditional operation is commutative.
-     * @return {@code true} if this operation is commutative
-     */
-    public final boolean isCommutative() {
-        return this == EQ || this == NE;
-    }
-
-    /**
-     * Attempts to fold a comparison between two constants and return the result.
-     * @param lt the constant on the left side of the comparison
-     * @param rt the constant on the right side of the comparison
-     * @param runtime the RiRuntime (might be needed to compare runtime-specific types)
-     * @return {@link Boolean#TRUE} if the comparison is known to be true,
-     * {@link Boolean#FALSE} if the comparison is known to be false, {@code null} otherwise.
-     */
-    public Boolean foldCondition(CiConstant lt, CiConstant rt, RiRuntime runtime, boolean unorderedIsTrue) {
-        switch (lt.kind) {
-            case Boolean:
-            case Byte:
-            case Char:
-            case Short:
-            case Jsr:
-            case Int: {
-                int x = lt.asInt();
-                int y = rt.asInt();
-                switch (this) {
-                    case EQ: return x == y;
-                    case NE: return x != y;
-                    case LT: return x < y;
-                    case LE: return x <= y;
-                    case GT: return x > y;
-                    case GE: return x >= y;
-                    case AE: return UnsignedMath.aboveOrEqual(x, y);
-                    case BE: return UnsignedMath.belowOrEqual(x, y);
-                    case AT: return UnsignedMath.aboveThan(x, y);
-                    case BT: return UnsignedMath.belowThan(x, y);
-                }
-                break;
-            }
-            case Long: {
-                long x = lt.asLong();
-                long y = rt.asLong();
-                switch (this) {
-                    case EQ: return x == y;
-                    case NE: return x != y;
-                    case LT: return x < y;
-                    case LE: return x <= y;
-                    case GT: return x > y;
-                    case GE: return x >= y;
-                    case AE: return UnsignedMath.aboveOrEqual(x, y);
-                    case BE: return UnsignedMath.belowOrEqual(x, y);
-                    case AT: return UnsignedMath.aboveThan(x, y);
-                    case BT: return UnsignedMath.belowThan(x, y);
-                }
-                break;
-            }
-            case Object: {
-                switch (this) {
-                    case EQ: return runtime.areConstantObjectsEqual(lt, rt);
-                    case NE: return !runtime.areConstantObjectsEqual(lt, rt);
-                }
-                break;
-            }
-            case Float: {
-                float x = lt.asFloat();
-                float y = rt.asFloat();
-                if (Float.isNaN(x) || Float.isNaN(y)) {
-                    return unorderedIsTrue;
-                }
-                switch (this) {
-                    case EQ: return x == y;
-                    case NE: return x != y;
-                    case LT: return x < y;
-                    case LE: return x <= y;
-                    case GT: return x > y;
-                    case GE: return x >= y;
-                }
-            }
-            case Double: {
-                double x = lt.asDouble();
-                double y = rt.asDouble();
-                if (Double.isNaN(x) || Double.isNaN(y)) {
-                    return unorderedIsTrue;
-                }
-                switch (this) {
-                    case EQ: return x == y;
-                    case NE: return x != y;
-                    case LT: return x < y;
-                    case LE: return x <= y;
-                    case GT: return x > y;
-                    case GE: return x >= y;
-                }
-            }
-        }
-        assert false : "missed folding of constant operands: " + lt + " " + this + " " + rt;
-        return null;
-    }
-
-    public Condition join(Condition other) {
-        if (other == this) {
-            return this;
-        }
-        if (this == OF || this == NOF || other == OF || other == NOF) {
-            return null;
-        }
-        switch (this) {
-            case EQ:
-                if (other == LE || other == GE || other == BE || other == AE) {
-                    return EQ;
-                } else {
-                    return null;
-                }
-            case NE:
-                if (other == LT || other == GT || other == BT || other == AT) {
-                    return other;
-                } else if (other == LE) {
-                    return LT;
-                } else if (other == GE) {
-                    return GT;
-                } else if (other == BE) {
-                    return BT;
-                } else if (other == AE) {
-                    return AT;
-                } else {
-                    return null;
-                }
-            case LE:
-                if (other == GE || other == EQ) {
-                    return EQ;
-                } else if (other == NE || other == LT) {
-                    return LT;
-                } else {
-                    return null;
-                }
-            case LT:
-                if (other == NE || other == LE) {
-                    return LT;
-                } else {
-                    return null;
-                }
-            case GE:
-                if (other == LE || other == EQ) {
-                    return EQ;
-                } else if (other == NE || other == GT) {
-                    return GT;
-                } else {
-                    return null;
-                }
-            case GT:
-                if (other == NE || other == GE) {
-                    return GT;
-                } else {
-                    return null;
-                }
-            case BE:
-                if (other == AE || other == EQ) {
-                    return EQ;
-                } else if (other == NE || other == BT) {
-                    return BT;
-                } else {
-                    return null;
-                }
-            case BT:
-                if (other == NE || other == BE) {
-                    return BT;
-                } else {
-                    return null;
-                }
-            case AE:
-                if (other == BE || other == EQ) {
-                    return EQ;
-                } else if (other == NE || other == AT) {
-                    return AT;
-                } else {
-                    return null;
-                }
-            case AT:
-                if (other == NE || other == AE) {
-                    return AT;
-                } else {
-                    return null;
-                }
-        }
-        throw new IllegalArgumentException(this.toString());
-    }
-
-    public Condition meet(Condition other) {
-        if (other == this) {
-            return this;
-        }
-        if (this == OF || this == NOF || other == OF || other == NOF) {
-            return null;
-        }
-        switch (this) {
-            case EQ:
-                if (other == LE || other == GE || other == BE || other == AE) {
-                    return other;
-                } else if (other == LT) {
-                    return LE;
-                } else if (other == GT) {
-                    return GE;
-                } else if (other == BT) {
-                    return BE;
-                } else if (other == AT) {
-                    return AE;
-                } else {
-                    return null;
-                }
-            case NE:
-                if (other == LT || other == GT || other == BT || other == AT) {
-                    return NE;
-                } else {
-                    return null;
-                }
-            case LE:
-                if (other == EQ || other == LT) {
-                    return LE;
-                } else {
-                    return null;
-                }
-            case LT:
-                if (other == EQ || other == LE) {
-                    return LE;
-                } else if (other == NE || other == GT) {
-                    return NE;
-                } else {
-                    return null;
-                }
-            case GE:
-                if (other == EQ || other == GT) {
-                    return GE;
-                } else {
-                    return null;
-                }
-            case GT:
-                if (other == EQ || other == GE) {
-                    return GE;
-                } else if (other == NE || other == LT) {
-                    return NE;
-                } else {
-                    return null;
-                }
-            case BE:
-                if (other == EQ || other == BT) {
-                    return BE;
-                } else {
-                    return null;
-                }
-            case BT:
-                if (other == EQ || other == BE) {
-                    return BE;
-                } else if (other == NE || other == AT) {
-                    return NE;
-                } else {
-                    return null;
-                }
-            case AE:
-                if (other == EQ || other == AT) {
-                    return AE;
-                } else {
-                    return null;
-                }
-            case AT:
-                if (other == EQ || other == AE) {
-                    return AE;
-                } else if (other == NE || other == BT) {
-                    return NE;
-                } else {
-                    return null;
-                }
-        }
-        throw new IllegalArgumentException(this.toString());
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.calc;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-/**
- * The {@code ConditionalNode} class represents a comparison that yields one of two values. Note that these nodes are not
- * built directly from the bytecode but are introduced by canonicalization.
- */
-public class ConditionalNode extends BinaryNode implements Canonicalizable, LIRLowerable {
-
-    @Input private BooleanNode condition;
-
-    public BooleanNode condition() {
-        return condition;
-    }
-
-    public ConditionalNode(BooleanNode condition, ValueNode trueValue, ValueNode falseValue) {
-        super(trueValue.kind(), trueValue, falseValue);
-        assert trueValue.kind() == falseValue.kind();
-        this.condition = condition;
-    }
-
-    public ValueNode trueValue() {
-        return x();
-    }
-
-    public ValueNode falseValue() {
-        return y();
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (condition instanceof ConstantNode) {
-            ConstantNode c = (ConstantNode) condition;
-            if (c.asConstant().asBoolean()) {
-                return trueValue();
-            } else {
-                return falseValue();
-            }
-        }
-        if (trueValue() == falseValue()) {
-            return trueValue();
-        }
-
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        generator.emitConditional(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import static com.oracle.max.cri.ci.CiKind.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code ConvertNode} class represents a conversion between primitive types.
- */
-public final class ConvertNode extends FloatingNode implements Canonicalizable, LIRLowerable {
-
-    public enum Op {
-        I2L(Int, Long),
-        L2I(Long, Int),
-        I2B(Int, Byte),
-        I2C(Int, Char),
-        I2S(Int, Short),
-        F2D(Float, Double),
-        D2F(Double, Float),
-        I2F(Int, Float),
-        I2D(Int, Double),
-        F2I(Float, Int),
-        D2I(Double, Int),
-        L2F(Long, Float),
-        L2D(Long, Double),
-        F2L(Float, Long),
-        D2L(Double, Long),
-        MOV_I2F(Int, Float),
-        MOV_L2D(Long, Double),
-        MOV_F2I(Float, Int),
-        MOV_D2L(Double, Long);
-
-        public final CiKind from;
-        public final CiKind to;
-
-        private Op(CiKind from, CiKind to) {
-            this.from = from;
-            this.to = to;
-        }
-    }
-
-    @Input private ValueNode value;
-
-    @Data public final Op opcode;
-
-    public ValueNode value() {
-        return value;
-    }
-
-    /**
-     * Constructs a new Convert instance.
-     * @param kind the result type of this instruction
-     * @param opcode the operation
-     * @param value the instruction producing the input value
-     * @param graph
-     */
-    public ConvertNode(Op opcode, ValueNode value) {
-        super(StampFactory.forKind(opcode.to.stackKind()));
-        assert value.kind() == opcode.from : opcode + " : " + value.kind() + " != " + opcode.from;
-        this.opcode = opcode;
-        this.value = value;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (value instanceof ConstantNode) {
-            CiConstant c = ((ConstantNode) value).asConstant();
-            switch (opcode) {
-                case I2L: return ConstantNode.forLong(c.asInt(), graph());
-                case L2I: return ConstantNode.forInt((int) c.asLong(), graph());
-                case I2B: return ConstantNode.forByte((byte) c.asInt(), graph());
-                case I2C: return ConstantNode.forChar((char) c.asInt(), graph());
-                case I2S: return ConstantNode.forShort((short) c.asInt(), graph());
-                case F2D: return ConstantNode.forDouble(c.asFloat(), graph());
-                case D2F: return ConstantNode.forFloat((float) c.asDouble(), graph());
-                case I2F: return ConstantNode.forFloat(c.asInt(), graph());
-                case I2D: return ConstantNode.forDouble(c.asInt(), graph());
-                case F2I: return ConstantNode.forInt((int) c.asFloat(), graph());
-                case D2I: return ConstantNode.forInt((int) c.asDouble(), graph());
-                case L2F: return ConstantNode.forFloat(c.asLong(), graph());
-                case L2D: return ConstantNode.forDouble(c.asLong(), graph());
-                case F2L: return ConstantNode.forLong((long) c.asFloat(), graph());
-                case D2L: return ConstantNode.forLong((long) c.asDouble(), graph());
-                case MOV_I2F: return ConstantNode.forFloat(java.lang.Float.intBitsToFloat(c.asInt()), graph());
-                case MOV_L2D: return ConstantNode.forDouble(java.lang.Double.longBitsToDouble(c.asLong()), graph());
-                case MOV_F2I: return ConstantNode.forInt(java.lang.Float.floatToRawIntBits(c.asFloat()), graph());
-                case MOV_D2L: return ConstantNode.forLong(java.lang.Double.doubleToRawLongBits(c.asDouble()), graph());
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitConvert(opcode, gen.operand(value())));
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static <S, T> S convert(@ConstantNodeParameter Op op, T value) {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatAddNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "+")
-public final class FloatAddNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public FloatAddNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
-        super(kind, x, y, isStrictFP);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && !y().isConstant()) {
-            return graph().unique(new FloatAddNode(kind(), y(), x(), isStrictFP()));
-        }
-        if (x().isConstant()) {
-            if (kind() == CiKind.Float) {
-                return ConstantNode.forFloat(x().asConstant().asFloat() + y().asConstant().asFloat(), graph());
-            } else {
-                assert kind() == CiKind.Double;
-                return ConstantNode.forDouble(x().asConstant().asDouble() + y().asConstant().asDouble(), graph());
-            }
-        } else if (y().isConstant()) {
-            if (kind() == CiKind.Float) {
-                float c = y().asConstant().asFloat();
-                if (c == 0.0f) {
-                    return x();
-                }
-            } else {
-                assert kind() == CiKind.Double;
-                double c = y().asConstant().asDouble();
-                if (c == 0.0) {
-                    return x();
-                }
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        CiValue op1 = gen.operand(x());
-        CiValue op2 = gen.operand(y());
-        if (!y().isConstant() && !livesLonger(this, y(), gen)) {
-            CiValue op = op1;
-            op1 = op2;
-            op2 = op;
-        }
-        gen.setResult(this, gen.emitAdd(op1, op2));
-    }
-
-    public static boolean livesLonger(ValueNode after, ValueNode value, LIRGeneratorTool gen) {
-        for (Node usage : value.usages()) {
-            if (usage != after && usage instanceof ValueNode && gen.operand(((ValueNode) usage)) != null) {
-                return true;
-            }
-        }
-        return false;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatArithmeticNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-
-public abstract class FloatArithmeticNode extends ArithmeticNode {
-
-    public FloatArithmeticNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
-        super(kind, x, y, isStrictFP);
-    }
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatDivNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "/")
-public final class FloatDivNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public FloatDivNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
-        super(kind, x, y, isStrictFP);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && y().isConstant()) {
-            if (kind() == CiKind.Float) {
-                if (y().asConstant().asFloat() != 0) {
-                    return ConstantNode.forFloat(x().asConstant().asFloat() / y().asConstant().asFloat(), graph());
-                }
-            } else {
-                assert kind() == CiKind.Double;
-                if (y().asConstant().asDouble() != 0) {
-                    return ConstantNode.forDouble(x().asConstant().asDouble() / y().asConstant().asDouble(), graph());
-                }
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitDiv(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatMulNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "*")
-public final class FloatMulNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public FloatMulNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
-        super(kind, x, y, isStrictFP);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && !y().isConstant()) {
-            return graph().unique(new FloatMulNode(kind(), y(), x(), isStrictFP()));
-        }
-        if (x().isConstant()) {
-            if (kind() == CiKind.Float) {
-                return ConstantNode.forFloat(x().asConstant().asFloat() * y().asConstant().asFloat(), graph());
-            } else {
-                assert kind() == CiKind.Double;
-                return ConstantNode.forDouble(x().asConstant().asDouble() * y().asConstant().asDouble(), graph());
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        CiValue op1 = gen.operand(x());
-        CiValue op2 = gen.operand(y());
-        if (!y().isConstant() && !FloatAddNode.livesLonger(this, y(), gen)) {
-            CiValue op = op1;
-            op1 = op2;
-            op2 = op;
-        }
-        gen.setResult(this, gen.emitMul(op1, op2));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatRemNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "%")
-public final class FloatRemNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public FloatRemNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
-        super(kind, x, y, isStrictFP);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && y().isConstant()) {
-            if (kind() == CiKind.Float) {
-                return ConstantNode.forFloat(x().asConstant().asFloat() % y().asConstant().asFloat(), graph());
-            } else {
-                assert kind() == CiKind.Double;
-                return ConstantNode.forDouble(x().asConstant().asDouble() % y().asConstant().asDouble(), graph());
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitRem(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatSubNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "-")
-public final class FloatSubNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public FloatSubNode(CiKind kind, ValueNode x, ValueNode y, boolean isStrictFP) {
-        super(kind, x, y, isStrictFP);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x() == y()) {
-            return ConstantNode.forFloatingKind(kind(), 0.0f, graph());
-        }
-        if (x().isConstant() && y().isConstant()) {
-            if (kind() == CiKind.Float) {
-                return ConstantNode.forFloat(x().asConstant().asFloat() - y().asConstant().asFloat(), graph());
-            } else {
-                assert kind() == CiKind.Double;
-                return ConstantNode.forDouble(x().asConstant().asDouble() - y().asConstant().asDouble(), graph());
-            }
-        } else if (y().isConstant()) {
-            if (kind() == CiKind.Float) {
-                float c = y().asConstant().asFloat();
-                if (c == 0.0f) {
-                    return x();
-                }
-                return graph().unique(new FloatAddNode(kind(), x(), ConstantNode.forFloat(-c, graph()), isStrictFP()));
-            } else {
-                assert kind() == CiKind.Double;
-                double c = y().asConstant().asDouble();
-                if (c == 0.0) {
-                    return x();
-                }
-                return graph().unique(new FloatAddNode(kind(), x(), ConstantNode.forDouble(-c, graph()), isStrictFP()));
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitSub(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/FloatingNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-public abstract class FloatingNode extends ValueNode implements Node.ValueNumberable {
-    public FloatingNode(Stamp stamp) {
-        super(stamp);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerAddNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "+")
-public class IntegerAddNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public IntegerAddNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && !y().isConstant()) {
-            return graph().unique(new IntegerAddNode(kind(), y(), x()));
-        }
-        if (x().isConstant()) {
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() + y().asConstant().asInt(), graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() + y().asConstant().asLong(), graph());
-            }
-        } else if (y().isConstant()) {
-            if (kind() == CiKind.Int) {
-                int c = y().asConstant().asInt();
-                if (c == 0) {
-                    return x();
-                }
-            } else {
-                assert kind() == CiKind.Long;
-                long c = y().asConstant().asLong();
-                if (c == 0) {
-                    return x();
-                }
-            }
-        }
-        return this;
-    }
-
-    public static boolean isIntegerAddition(ValueNode result, ValueNode a, ValueNode b) {
-        CiKind kind = result.kind();
-        if (kind != a.kind() || kind != b.kind() || !(kind.isInt() || kind.isLong())) {
-            return false;
-        }
-        if (result.isConstant() && a.isConstant() && b.isConstant()) {
-            if (kind.isInt()) {
-                return result.asConstant().asInt() == a.asConstant().asInt() + b.asConstant().asInt();
-            } else if (kind.isLong()) {
-                return result.asConstant().asLong() == a.asConstant().asLong() + b.asConstant().asLong();
-            }
-        } else if (result instanceof IntegerAddNode) {
-            IntegerAddNode add = (IntegerAddNode) result;
-            return (add.x() == a && add.y() == b) || (add.y() == a && add.x() == b);
-        }
-        return false;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        CiValue op1 = gen.operand(x());
-        assert op1 != null : x() + ", this=" + this;
-        CiValue op2 = gen.operand(y());
-        if (!y().isConstant() && !FloatAddNode.livesLonger(this, y(), gen)) {
-            CiValue op = op1;
-            op1 = op2;
-            op2 = op;
-        }
-        gen.setResult(this, gen.emitAdd(op1, op2));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-
-public abstract class IntegerArithmeticNode extends ArithmeticNode {
-
-    public IntegerArithmeticNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y, false);
-        assert kind == CiKind.Int || kind == CiKind.Long;
-    }
-
-    public static IntegerAddNode add(ValueNode v1, ValueNode v2) {
-        assert v1.kind() == v2.kind() && v1.graph() == v2.graph();
-        Graph graph = v1.graph();
-        switch(v1.kind()) {
-            case Int:
-                return graph.unique(new IntegerAddNode(CiKind.Int, v1, v2));
-            case Long:
-                return graph.unique(new IntegerAddNode(CiKind.Long, v1, v2));
-            default:
-                throw ValueUtil.shouldNotReachHere();
-        }
-    }
-
-    public static IntegerMulNode mul(ValueNode v1, ValueNode v2) {
-        assert v1.kind() == v2.kind() && v1.graph() == v2.graph();
-        Graph graph = v1.graph();
-        switch(v1.kind()) {
-            case Int:
-                return graph.unique(new IntegerMulNode(CiKind.Int, v1, v2));
-            case Long:
-                return graph.unique(new IntegerMulNode(CiKind.Long, v1, v2));
-            default:
-                throw ValueUtil.shouldNotReachHere();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "/")
-public final class IntegerDivNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public IntegerDivNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && y().isConstant()) {
-            long yConst = y().asConstant().asLong();
-            if (yConst == 0) {
-                return this; // this will trap, can not canonicalize
-            }
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() / (int) yConst, graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() / yConst, graph());
-            }
-        } else if (y().isConstant()) {
-            long c = y().asConstant().asLong();
-            if (c == 1) {
-                return x();
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitDiv(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "*")
-public final class IntegerMulNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public IntegerMulNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && !y().isConstant()) {
-            return graph().unique(new IntegerMulNode(kind(), y(), x()));
-        }
-        if (x().isConstant()) {
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() * y().asConstant().asInt(), graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() * y().asConstant().asLong(), graph());
-            }
-        } else if (y().isConstant()) {
-            long c = y().asConstant().asLong();
-            if (c == 1) {
-                return x();
-            }
-            if (c == 0) {
-                return ConstantNode.forInt(0, graph());
-            }
-            if (c > 0 && CiUtil.isPowerOf2(c)) {
-                return graph().unique(new LeftShiftNode(kind(), x(), ConstantNode.forInt(CiUtil.log2(c), graph())));
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        CiValue op1 = gen.operand(x());
-        CiValue op2 = gen.operand(y());
-        if (!y().isConstant() && !FloatAddNode.livesLonger(this, y(), gen)) {
-            CiValue op = op1;
-            op1 = op2;
-            op2 = op;
-        }
-        gen.setResult(this, gen.emitMul(op1, op2));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "%")
-public final class IntegerRemNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public IntegerRemNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant() && y().isConstant()) {
-            long yConst = y().asConstant().asLong();
-            if (yConst == 0) {
-                return this; // this will trap, can not canonicalize
-            }
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() % (int) yConst, graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() % yConst, graph());
-            }
-        } else if (y().isConstant()) {
-            long c = y().asConstant().asLong();
-            if (c == 1 || c == -1) {
-                return ConstantNode.forIntegerKind(kind(), 0, graph());
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitRem(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerSubNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "-")
-public final class IntegerSubNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
-
-    public IntegerSubNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x() == y()) {
-            return ConstantNode.forIntegerKind(kind(), 0, graph());
-        }
-        if (x().isConstant() && y().isConstant()) {
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() - y().asConstant().asInt(), graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() - y().asConstant().asLong(), graph());
-            }
-        } else if (y().isConstant()) {
-            long c = y().asConstant().asLong();
-            if (c == 0) {
-                return x();
-            }
-            if (kind() == CiKind.Int) {
-                return graph().unique(new IntegerAddNode(kind(), x(), ConstantNode.forInt((int) -c, graph())));
-            } else {
-                assert kind() == CiKind.Long;
-                return graph().unique(new IntegerAddNode(kind(), x(), ConstantNode.forLong(-c, graph())));
-            }
-        } else if (x().isConstant()) {
-            long c = x().asConstant().asLong();
-            if (c == 0) {
-                return graph().unique(new NegateNode(y()));
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitSub(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "<<")
-public final class LeftShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
-
-    public LeftShiftNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (y().isConstant()) {
-            int amount = y().asConstant().asInt();
-            int originalAmout = amount;
-            int mask;
-            if (kind() == CiKind.Int) {
-                mask = 0x1f;
-            } else {
-                assert kind() == CiKind.Long;
-                mask = 0x3f;
-            }
-            amount &= mask;
-            if (x().isConstant()) {
-                if (kind() == CiKind.Int) {
-                    return ConstantNode.forInt(x().asConstant().asInt() << amount, graph());
-                } else {
-                    assert kind() == CiKind.Long;
-                    return ConstantNode.forLong(x().asConstant().asLong() << amount, graph());
-                }
-            }
-            if (amount == 0) {
-                return x();
-            }
-            if (x() instanceof ShiftNode) {
-                ShiftNode other = (ShiftNode) x();
-                if (other.y().isConstant()) {
-                    int otherAmount = other.y().asConstant().asInt() & mask;
-                    if (other instanceof LeftShiftNode) {
-                        int total = amount + otherAmount;
-                        if (total != (total & mask)) {
-                            return ConstantNode.forInt(0, graph());
-                        }
-                        return graph().unique(new LeftShiftNode(kind(), other.x(), ConstantNode.forInt(total, graph())));
-                    } else if ((other instanceof RightShiftNode || other instanceof UnsignedRightShiftNode) && otherAmount == amount) {
-                        if (kind() == CiKind.Long) {
-                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forLong(-1L << amount, graph())));
-                        } else {
-                            assert kind() == CiKind.Int;
-                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forInt(-1 << amount, graph())));
-                        }
-                    }
-                }
-            }
-            if (originalAmout != amount) {
-                return graph().unique(new LeftShiftNode(kind(), x(), ConstantNode.forInt(amount, graph())));
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitShl(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/LogicNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * The {@code LogicNode} class definition.
- */
-public abstract class LogicNode extends BinaryNode {
-
-    /**
-     * Constructs a new logic operation node.
-     * @param x the first input into this node
-     * @param y the second input into this node
-     */
-    public LogicNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.calc;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code NegateNode} node negates its operand.
- */
-public final class NegateNode extends FloatingNode implements Canonicalizable, LIRLowerable {
-
-    @Input
-    private ValueNode x;
-
-    public ValueNode x() {
-        return x;
-    }
-
-    /**
-     * Creates new NegateOp instance.
-     *
-     * @param x the instruction producing the value that is input to this instruction
-     */
-    public NegateNode(ValueNode x) {
-        super(StampFactory.forKind(x.kind()));
-        this.x = x;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant()) {
-            switch (x().kind()) {
-                case Int:
-                    return ConstantNode.forInt(-x().asConstant().asInt(), graph());
-                case Long:
-                    return ConstantNode.forLong(-x().asConstant().asLong(), graph());
-                case Float:
-                    return ConstantNode.forFloat(-x().asConstant().asFloat(), graph());
-                case Double:
-                    return ConstantNode.forDouble(-x().asConstant().asDouble(), graph());
-            }
-        }
-        if (x() instanceof NegateNode) {
-            return ((NegateNode) x()).x();
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitNegate(gen.operand(x())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/NormalizeCompareNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-/**
- * Returns -1, 0, or 1 if either x < y, x == y, or x > y.
- */
-public final class NormalizeCompareNode extends BinaryNode implements Lowerable {
-    @Data public final boolean isUnorderedLess;
-
-    /**
-     * Creates a new compare operation.
-     * @param x the first input
-     * @param y the second input
-     * @param isUnorderedLess true when an unordered floating point comparison is interpreted as less, false when greater.
-     */
-    public NormalizeCompareNode(ValueNode x, ValueNode y, boolean isUnorderedLess) {
-        super(CiKind.Int, x, y);
-        this.isUnorderedLess = isUnorderedLess;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        StructuredGraph graph = (StructuredGraph) graph();
-
-        CompareNode equalComp = graph.unique(new CompareNode(x(), Condition.EQ, false, y()));
-        MaterializeNode equalValue = MaterializeNode.create(equalComp, graph, ConstantNode.forInt(0, graph), ConstantNode.forInt(1, graph));
-
-        CompareNode lessComp = graph.unique(new CompareNode(x(), Condition.LT, isUnorderedLess, y()));
-        MaterializeNode value =  MaterializeNode.create(lessComp, graph, ConstantNode.forInt(-1, graph), equalValue);
-
-        graph.replaceFloating(this, value);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/NullCheckNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public final class NullCheckNode extends BooleanNode implements Canonicalizable, LIRLowerable {
-
-    @Input private ValueNode object;
-    @Data public final boolean expectedNull;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    /**
-     * Constructs a new NullCheck instruction.
-     *
-     * @param object the instruction producing the object to check against null
-     * @param expectedNull True when this node checks that the value is null, false when this node checks for non-null
-     */
-    public NullCheckNode(ValueNode object, boolean expectedNull) {
-        super(StampFactory.illegal());
-        assert object.kind() == CiKind.Object : object.kind();
-        this.object = object;
-        this.expectedNull = expectedNull;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // Nothing to do.
-    }
-
-    @Override
-    public boolean verify() {
-        assertTrue(object().kind().isObject(), "null check input must be an object");
-        return super.verify();
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        CiConstant constant = object().asConstant();
-        if (constant != null) {
-            assert constant.kind == CiKind.Object;
-            return ConstantNode.forBoolean(constant.isNull() == expectedNull, graph());
-        }
-        if (object.stamp().nonNull()) {
-            return ConstantNode.forBoolean(!expectedNull, graph());
-        }
-        return this;
-    }
-
-    @Override
-    public BooleanNode negate() {
-        return graph().unique(new NullCheckNode(object(), !expectedNull));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "|")
-public final class OrNode extends LogicNode implements Canonicalizable, LIRLowerable {
-
-    public OrNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x() == y()) {
-            return x();
-        }
-        if (x().isConstant() && !y().isConstant()) {
-            return graph().unique(new OrNode(kind(), y(), x()));
-        }
-        if (x().isConstant()) {
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() | y().asConstant().asInt(), graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() | y().asConstant().asLong(), graph());
-            }
-        } else if (y().isConstant()) {
-            if (kind() == CiKind.Int) {
-                int c = y().asConstant().asInt();
-                if (c == -1) {
-                    return ConstantNode.forInt(-1, graph());
-                }
-                if (c == 0) {
-                    return x();
-                }
-            } else {
-                assert kind() == CiKind.Long;
-                long c = y().asConstant().asLong();
-                if (c == -1) {
-                    return ConstantNode.forLong(-1, graph());
-                }
-                if (c == 0) {
-                    return x();
-                }
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitOr(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = ">>")
-public final class RightShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
-
-    public RightShiftNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (y().isConstant()) {
-            int amount = y().asConstant().asInt();
-            int originalAmout = amount;
-            int mask;
-            if (kind() == CiKind.Int) {
-                mask = 0x1f;
-            } else {
-                assert kind() == CiKind.Long;
-                mask = 0x3f;
-            }
-            amount &= mask;
-            if (x().isConstant()) {
-                if (kind() == CiKind.Int) {
-                    return ConstantNode.forInt(x().asConstant().asInt() >> amount, graph());
-                } else {
-                    assert kind() == CiKind.Long;
-                    return ConstantNode.forLong(x().asConstant().asLong() >> amount, graph());
-                }
-            }
-            if (amount == 0) {
-                return x();
-            }
-            if (x() instanceof ShiftNode) {
-                ShiftNode other = (ShiftNode) x();
-                if (other.y().isConstant()) {
-                    int otherAmount = other.y().asConstant().asInt() & mask;
-                    if (other instanceof RightShiftNode) {
-                        int total = amount + otherAmount;
-                        if (total != (total & mask)) {
-                            return ConstantNode.forInt(0, graph());
-                        }
-                        return graph().unique(new RightShiftNode(kind(), other.x(), ConstantNode.forInt(total, graph())));
-                    }
-                }
-            }
-            if (originalAmout != amount) {
-                return graph().unique(new RightShiftNode(kind(), x(), ConstantNode.forInt(amount, graph())));
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitShr(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * The {@code ShiftOp} class represents shift operations.
- */
-public abstract class ShiftNode extends BinaryNode {
-
-    /**
-     * Creates a new shift operation.
-     * @param x the first input value
-     * @param s the second input value
-     */
-    public ShiftNode(CiKind kind, ValueNode x, ValueNode s) {
-        super(kind, x, s);
-        // TODO (cwimmer) Why check for null here - what is a shift with no left operand?
-        assert x == null || x.kind() == kind;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = ">>>")
-public final class UnsignedRightShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
-
-    public UnsignedRightShiftNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (y().isConstant()) {
-            int amount = y().asConstant().asInt();
-            int originalAmout = amount;
-            int mask;
-            if (kind() == CiKind.Int) {
-                mask = 0x1f;
-            } else {
-                assert kind() == CiKind.Long;
-                mask = 0x3f;
-            }
-            amount &= mask;
-            if (x().isConstant()) {
-                if (kind() == CiKind.Int) {
-                    return ConstantNode.forInt(x().asConstant().asInt() >>> amount, graph());
-                } else {
-                    assert kind() == CiKind.Long;
-                    return ConstantNode.forLong(x().asConstant().asLong() >>> amount, graph());
-                }
-            }
-            if (amount == 0) {
-                return x();
-            }
-            if (x() instanceof ShiftNode) {
-                ShiftNode other = (ShiftNode) x();
-                if (other.y().isConstant()) {
-                    int otherAmount = other.y().asConstant().asInt() & mask;
-                    if (other instanceof UnsignedRightShiftNode) {
-                        int total = amount + otherAmount;
-                        if (total != (total & mask)) {
-                            return ConstantNode.forInt(0, graph());
-                        }
-                        return graph().unique(new UnsignedRightShiftNode(kind(), other.x(), ConstantNode.forInt(total, graph())));
-                    } else if (other instanceof LeftShiftNode && otherAmount == amount) {
-                        if (kind() == CiKind.Long) {
-                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forLong(-1L >>> amount, graph())));
-                        } else {
-                            assert kind() == CiKind.Int;
-                            return graph().unique(new AndNode(kind(), other.x(), ConstantNode.forInt(-1 >>> amount, graph())));
-                        }
-                    }
-                }
-            }
-            if (originalAmout != amount) {
-                return graph().unique(new UnsignedRightShiftNode(kind(), x(), ConstantNode.forInt(amount, graph())));
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitUShr(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.calc;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-@NodeInfo(shortName = "^")
-public final class XorNode extends LogicNode implements Canonicalizable, LIRLowerable {
-
-    public XorNode(CiKind kind, ValueNode x, ValueNode y) {
-        super(kind, x, y);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x() == y()) {
-            return ConstantNode.forIntegerKind(kind(), 0, graph());
-        }
-        if (x().isConstant() && !y().isConstant()) {
-            return graph().unique(new XorNode(kind(), y(), x()));
-        }
-        if (x().isConstant()) {
-            if (kind() == CiKind.Int) {
-                return ConstantNode.forInt(x().asConstant().asInt() ^ y().asConstant().asInt(), graph());
-            } else {
-                assert kind() == CiKind.Long;
-                return ConstantNode.forLong(x().asConstant().asLong() ^ y().asConstant().asLong(), graph());
-            }
-        } else if (y().isConstant()) {
-            if (kind() == CiKind.Int) {
-                int c = y().asConstant().asInt();
-                if (c == 0) {
-                    return x();
-                }
-            } else {
-                assert kind() == CiKind.Long;
-                long c = y().asConstant().asLong();
-                if (c == 0) {
-                    return x();
-                }
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitXor(gen.operand(x()), gen.operand(y())));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/AbstractCallNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-public abstract class AbstractCallNode extends AbstractStateSplit implements MemoryCheckpoint {
-
-    @Input
-    protected final NodeInputList<ValueNode> arguments;
-
-    public AbstractCallNode(Stamp stamp, ValueNode[] arguments) {
-        super(stamp);
-        this.arguments = new NodeInputList<>(this, arguments);
-    }
-
-    public NodeInputList<ValueNode> arguments() {
-        return arguments;
-    }
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/Access.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.graal.nodes.*;
-
-public interface Access {
-
-    ValueNode object();
-
-    LocationNode location();
-
-    void setNullCheck(boolean check);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/AccessNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-public abstract class AccessNode extends AbstractStateSplit implements Access {
-
-    @Input private ValueNode object;
-    @Input private GuardNode guard;
-    @Input private LocationNode location;
-    @Data private boolean nullCheck;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public GuardNode guard() {
-        return guard;
-    }
-
-    public void setGuard(GuardNode x) {
-        updateUsages(guard, x);
-        guard = x;
-    }
-
-    public LocationNode location() {
-        return location;
-    }
-
-    public boolean getNullCheck() {
-        return nullCheck;
-    }
-
-    public void setNullCheck(boolean check) {
-        this.nullCheck = check;
-    }
-
-    public AccessNode(CiKind kind, ValueNode object, LocationNode location) {
-        super(StampFactory.forKind(kind));
-        this.object = object;
-        this.location = location;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.java.MethodCallTargetNode.*;
-import com.oracle.graal.nodes.type.*;
-
-
-public final class BoxNode extends AbstractStateSplit implements Node.IterableNodeType {
-
-    @Input private ValueNode source;
-    @Data private int bci;
-    @Data private CiKind sourceKind;
-
-    public BoxNode(ValueNode value, RiResolvedType type, CiKind sourceKind, int bci) {
-        super(StampFactory.exactNonNull(type));
-        this.source = value;
-        this.bci = bci;
-        this.sourceKind = sourceKind;
-        assert value.kind() != CiKind.Object : "can only box from primitive type";
-    }
-
-    public ValueNode source() {
-        return source;
-    }
-
-
-    public CiKind getSourceKind() {
-        return sourceKind;
-    }
-
-    public void expand(BoxingMethodPool pool) {
-        RiResolvedMethod boxingMethod = pool.getBoxingMethod(sourceKind);
-        MethodCallTargetNode callTarget = graph().add(new MethodCallTargetNode(InvokeKind.Static, boxingMethod, new ValueNode[]{source}, boxingMethod.signature().returnType(boxingMethod.holder())));
-        InvokeNode invokeNode = graph().add(new InvokeNode(callTarget, bci));
-        invokeNode.setProbability(this.probability());
-        invokeNode.setStateAfter(stateAfter());
-        ((StructuredGraph) graph()).replaceFixedWithFixed(this, invokeNode);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/BoxingMethodPool.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-
-public class BoxingMethodPool {
-
-    private final Set<RiMethod> specialMethods = new HashSet<>();
-    private final RiRuntime runtime;
-    private final RiResolvedMethod[] boxingMethods = new RiResolvedMethod[CiKind.values().length];
-    private final RiResolvedMethod[] unboxingMethods = new RiResolvedMethod[CiKind.values().length];
-    private final RiResolvedField[] boxFields = new RiResolvedField[CiKind.values().length];
-
-    public BoxingMethodPool(RiRuntime runtime) {
-        this.runtime = runtime;
-        initialize();
-    }
-
-    private void initialize() {
-        try {
-            initialize(CiKind.Boolean, Boolean.class, "booleanValue");
-            initialize(CiKind.Byte, Byte.class, "byteValue");
-            initialize(CiKind.Char, Character.class, "charValue");
-            initialize(CiKind.Short, Short.class, "shortValue");
-            initialize(CiKind.Int, Integer.class, "intValue");
-            initialize(CiKind.Long, Long.class, "longValue");
-            initialize(CiKind.Float, Float.class, "floatValue");
-            initialize(CiKind.Double, Double.class, "doubleValue");
-        } catch (SecurityException e) {
-            throw new RuntimeException(e);
-        } catch (NoSuchMethodException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private void initialize(CiKind kind, Class<?> type, String unboxMethod) throws SecurityException, NoSuchMethodException {
-
-        // Get boxing method from runtime.
-        RiResolvedMethod boxingMethod = runtime.getRiMethod(type.getDeclaredMethod("valueOf", kind.toJavaClass()));
-        specialMethods.add(boxingMethod);
-        boxingMethods[kind.ordinal()] = boxingMethod;
-
-        // Get unboxing method from runtime.
-        RiResolvedMethod unboxingMethod = runtime.getRiMethod(type.getDeclaredMethod(unboxMethod));
-        unboxingMethods[kind.ordinal()] = unboxingMethod;
-        specialMethods.add(unboxingMethod);
-
-        // Get the field that contains the boxed value.
-        RiResolvedField[] fields = runtime.getType(type).declaredFields();
-        RiResolvedField boxField = fields[0];
-        assert fields.length == 1 && boxField.kind(false) == kind;
-        boxFields[kind.ordinal()] = boxField;
-    }
-
-    public boolean isSpecialMethod(RiResolvedMethod method) {
-        return specialMethods.contains(method);
-    }
-
-    public boolean isBoxingMethod(RiResolvedMethod method) {
-        return isSpecialMethod(method) && method.signature().returnKind(false) == CiKind.Object;
-    }
-
-    public boolean isUnboxingMethod(RiResolvedMethod method) {
-        return isSpecialMethod(method) && method.signature().returnKind(false) != CiKind.Object;
-    }
-
-    public RiResolvedMethod getBoxingMethod(CiKind kind) {
-        return boxingMethods[kind.ordinal()];
-    }
-
-    public RiResolvedMethod getUnboxingMethod(CiKind kind) {
-        return unboxingMethods[kind.ordinal()];
-    }
-
-    public RiResolvedField getBoxField(CiKind kind) {
-        return boxFields[kind.ordinal()];
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingAccessNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.type.*;
-
-public abstract class FloatingAccessNode extends FloatingNode implements Access {
-
-    @Input private ValueNode object;
-    @Input private GuardNode guard;
-    @Input private LocationNode location;
-    @Data private boolean nullCheck;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public GuardNode guard() {
-        return guard;
-    }
-
-    public void setGuard(GuardNode x) {
-        updateUsages(guard, x);
-        guard = x;
-    }
-
-    public LocationNode location() {
-        return location;
-    }
-
-    public boolean getNullCheck() {
-        return nullCheck;
-    }
-
-    public void setNullCheck(boolean check) {
-        this.nullCheck = check;
-    }
-
-    public FloatingAccessNode(CiKind kind, ValueNode object, GuardNode guard, LocationNode location) {
-        super(StampFactory.forKind(kind));
-        this.object = object;
-        this.guard = guard;
-        this.location = location;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public final class FloatingReadNode extends FloatingAccessNode implements Node.IterableNodeType, LIRLowerable, Canonicalizable {
-
-    @Input private final NodeInputList<Node> dependencies;
-
-    public NodeInputList<Node> dependencies() {
-        return dependencies;
-    }
-
-    public FloatingReadNode(CiKind kind, ValueNode object, GuardNode guard, LocationNode location, Node... dependencies) {
-        super(kind, object, guard, location);
-        this.dependencies = new NodeInputList<>(this, dependencies);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitLoad(gen.makeAddress(location(), object()), getNullCheck()));
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (object() != null && object().isConstant() && object().kind() == CiKind.Object) {
-            if (this.location() == LocationNode.FINAL_LOCATION && location().getClass() == LocationNode.class) {
-                Object value = object().asConstant().asObject();
-                long displacement = location().displacement();
-                CiKind kind = location().kind();
-                RiRuntime runtime = tool.runtime();
-                CiConstant constant = kind.readUnsafeConstant(value, displacement);
-                if (constant != null) {
-                    return ConstantNode.forCiConstant(constant, runtime, graph());
-                }
-            }
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-public final class IndexedLocationNode extends LocationNode implements LIRLowerable, Canonicalizable {
-    @Input private ValueNode index;
-    @Data private boolean indexScalingEnabled;
-
-    public ValueNode index() {
-        return index;
-    }
-
-    public static Object getArrayLocation(CiKind elementKind) {
-        return elementKind;
-    }
-
-    /**
-     * @return whether scaling of the index by the value kind's size is enabled (the default) or disabled.
-     */
-    public boolean indexScalingEnabled() {
-        return indexScalingEnabled;
-    }
-
-    /**
-     * Enables or disables scaling of the index by the value kind's size. Has no effect if the index input is not used.
-     */
-    public void setIndexScalingEnabled(boolean enable) {
-        this.indexScalingEnabled = enable;
-    }
-
-    public static IndexedLocationNode create(Object identity, CiKind kind, int displacement, ValueNode index, Graph graph) {
-        return create(identity, kind, displacement, index, graph, true);
-    }
-
-    public static IndexedLocationNode create(Object identity, CiKind kind, int displacement, ValueNode index, Graph graph, boolean indexScalingEnabled) {
-        return graph.unique(new IndexedLocationNode(identity, kind, index, displacement, indexScalingEnabled));
-    }
-
-    private IndexedLocationNode(Object identity, CiKind kind, ValueNode index, int displacement, boolean indexScalingEnabled) {
-        super(identity, kind, displacement);
-        this.index = index;
-        this.indexScalingEnabled = indexScalingEnabled;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        CiConstant constantIndex = index.asConstant();
-        if (constantIndex != null && constantIndex.kind.stackKind().isInt()) {
-            long constantIndexLong = constantIndex.asInt();
-            if (indexScalingEnabled && tool.target() != null) {
-                constantIndexLong *= tool.target().sizeInBytes(getValueKind());
-            }
-            constantIndexLong += displacement();
-            int constantIndexInt = (int) constantIndexLong;
-            if (constantIndexLong == constantIndexInt) {
-                return LocationNode.create(locationIdentity(), getValueKind(), constantIndexInt, graph());
-            }
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.ValueNumberable;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class LocationNode extends FloatingNode implements LIRLowerable, ValueNumberable {
-
-    @Data private int displacement;
-    @Data private CiKind valueKind;
-    @Data private Object locationIdentity;
-
-    public static final Object ANY_LOCATION = new Object() {
-        @Override
-        public String toString() {
-            return "ANY_LOCATION";
-        }
-    };
-    public static final Object FINAL_LOCATION = new Object();
-
-    public static Object getArrayLocation(CiKind elementKind) {
-        return elementKind;
-    }
-
-    public int displacement() {
-        return displacement;
-    }
-
-    public static LocationNode create(Object identity, CiKind kind, int displacement, Graph graph) {
-        return graph.unique(new LocationNode(identity, kind, displacement));
-    }
-
-    protected LocationNode(Object identity, CiKind kind, int displacement) {
-        super(StampFactory.illegal());
-        assert kind != CiKind.Illegal && kind != CiKind.Void;
-        this.displacement = displacement;
-        this.valueKind = kind;
-        this.locationIdentity = identity;
-    }
-
-    public CiKind getValueKind() {
-        return valueKind;
-    }
-
-    public Object locationIdentity() {
-        return locationIdentity;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        // nothing to do...
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/LookupSwitchNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-/**
- * The {@code LookupSwitchNode} represents a lookup switch bytecode, which has a sorted
- * array of key values.
- */
-public final class LookupSwitchNode extends SwitchNode implements LIRLowerable, Simplifiable {
-
-    @Data private final int[] keys;
-
-    /**
-     * Constructs a new LookupSwitch instruction.
-     * @param value the instruction producing the value being switched on
-     * @param successors the list of successors
-     * @param keys the list of keys, sorted
-     */
-    public LookupSwitchNode(ValueNode value, BeginNode[] successors, int[] keys, double[] probability) {
-        super(value, successors, probability);
-        assert successors.length == keys.length + 1;
-        this.keys = keys;
-    }
-
-    public LookupSwitchNode(ValueNode value, int[] keys, double[] switchProbability) {
-        this(value, new BeginNode[switchProbability.length], keys, switchProbability);
-    }
-
-    /**
-     * Gets the key at the specified index.
-     * @param i the index
-     * @return the key at that index
-     */
-    public int keyAt(int i) {
-        return keys[i];
-    }
-
-    public int keysLength() {
-        return keys.length;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitLookupSwitch(this);
-    }
-
-    @Override
-    public void simplify(SimplifierTool tool) {
-        if (value() instanceof ConstantNode) {
-            ConstantNode constant = (ConstantNode) value();
-            int value = constant.value.asInt();
-
-            BeginNode remainingSux = (BeginNode) defaultSuccessor();
-            int remainingSuxIndex = blockSuccessorCount() - 1;
-            for (int i = 0; i < keys.length; i++) {
-                if (value == keys[i]) {
-                    remainingSux = blockSuccessor(i);
-                    remainingSuxIndex = i;
-                    break;
-                }
-            }
-
-            for (int i = 0; i < blockSuccessorCount(); i++) {
-                BeginNode sux = blockSuccessor(i);
-                if (sux != remainingSux) {
-                    tool.deleteBranch(sux);
-                }
-            }
-
-            tool.addToWorkList(remainingSux);
-            ((StructuredGraph) graph()).removeSplit(this, remainingSuxIndex);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * Cretes a memory barrier.
- */
-public class MembarNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
-
-    private final int barriers;
-
-    public MembarNode(int barriers) {
-        super(StampFactory.illegal());
-        this.barriers = barriers;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        generator.emitMembar(barriers);
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void get(@ConstantNodeParameter int barriers) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-
-public interface MemoryCheckpoint {
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/ReadHubNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-// TODO (chaeubl) this should be a FloatingNode but Lowering is not possible in that case
-public final class ReadHubNode extends FixedWithNextNode implements Lowerable {
-    @Input private ValueNode object;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public ReadHubNode(ValueNode object) {
-        super(StampFactory.forKind(CiKind.Object));
-        this.object = object;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public final class ReadNode extends AccessNode implements Node.IterableNodeType, LIRLowerable, Canonicalizable {
-
-    public ReadNode(CiKind kind, ValueNode object, LocationNode location) {
-        super(kind, object, location);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.setResult(this, gen.emitLoad(gen.makeAddress(location(), object()), getNullCheck()));
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (object() != null && object().isConstant() && object().kind() == CiKind.Object) {
-            if (location() == LocationNode.FINAL_LOCATION && location().getClass() == LocationNode.class) {
-                Object value = object().asConstant().asObject();
-                long displacement = location().displacement();
-                CiKind kind = location().kind();
-                RiRuntime runtime = tool.runtime();
-                CiConstant constant = kind.readUnsafeConstant(value, displacement);
-                if (constant != null) {
-                    return ConstantNode.forCiConstant(constant, runtime, graph());
-                }
-            }
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public final class RuntimeCallNode extends AbstractCallNode implements LIRLowerable {
-
-    @Data private final CiRuntimeCall call;
-
-    public CiRuntimeCall call() {
-        return call;
-    }
-
-    public RuntimeCallNode(CiRuntimeCall call) {
-        this(call, new ValueNode[0]);
-    }
-
-    public RuntimeCallNode(CiRuntimeCall call, ValueNode arg1) {
-        this(call, new ValueNode[] {arg1});
-    }
-
-    public RuntimeCallNode(CiRuntimeCall call, ValueNode[] arguments) {
-        super(StampFactory.forKind(call.resultKind), arguments);
-        this.call = call;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitRuntimeCall(this);
-    }
-
-    // specialized on return type (instead of public static <T> T performCall) until boxing/unboxing is sorted out in intrinsification
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static <S> double performCall(@ConstantNodeParameter CiRuntimeCall call, S arg1) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static long performCall(@ConstantNodeParameter CiRuntimeCall call) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SafeAccessNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-
-public abstract class SafeAccessNode extends AbstractStateSplit {
-
-    @Input private ValueNode object;
-    @Input private LocationNode location;
-
-    public SafeAccessNode(CiKind kind, ValueNode object, LocationNode location) {
-        super(StampFactory.forKind(kind));
-        this.object = object;
-        this.location = location;
-    }
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public LocationNode location() {
-        return location;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SafeReadNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public class SafeReadNode extends SafeAccessNode implements Lowerable {
-
-    public SafeReadNode(CiKind kind, ValueNode object, LocationNode location) {
-        super(kind, object, location);
-        assert object != null && location != null;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        StructuredGraph graph = (StructuredGraph) graph();
-        GuardNode guard = (GuardNode) tool.createGuard(graph.unique(new NullCheckNode(object(), false)));
-        ReadNode read = graph.add(new ReadNode(kind(), object(), location()));
-        read.setGuard(guard);
-
-        graph.replaceFixedWithFixed(this, read);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SafeWriteNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public class SafeWriteNode extends SafeAccessNode implements Lowerable{
-
-    @Input private ValueNode value;
-
-    public SafeWriteNode(ValueNode object, ValueNode value, LocationNode location) {
-        super(CiKind.Void, object, location);
-        this.value = value;
-    }
-
-    public ValueNode value() {
-        return value;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        StructuredGraph graph = (StructuredGraph) graph();
-        GuardNode guard = (GuardNode) tool.createGuard(graph.unique(new NullCheckNode(object(), false)));
-        WriteNode write = graph.add(new WriteNode(object(), value(), location()));
-        write.setGuard(guard);
-        graph.replaceFixedWithFixed(this, write);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code SwitchNode} class is the base of both lookup and table switches.
- */
-public abstract class SwitchNode extends ControlSplitNode {
-
-    @Input private ValueNode value;
-
-    public ValueNode value() {
-        return value;
-    }
-
-    /**
-     * Constructs a new Switch.
-     * @param value the instruction that provides the value to be switched over
-     * @param successors the list of successors of this switch
-     * @param stateAfter the state after the switch
-     */
-    public SwitchNode(ValueNode value, BeginNode[] successors, double[] probability) {
-        super(StampFactory.illegal(), successors, probability);
-        this.value = value;
-    }
-
-    /**
-     * Gets the number of cases that this switch covers (excluding the default case).
-     * @return the number of cases
-     */
-    public int numberOfCases() {
-        return blockSuccessorCount() - 1;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/TableSwitchNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-/**
- * The {@code TableSwitchNode} represents a table switch.
- */
-public final class TableSwitchNode extends SwitchNode implements LIRLowerable, Simplifiable {
-
-    @Data private final int lowKey;
-
-    /**
-     * Constructs a new TableSwitch instruction.
-     * @param value the instruction producing the value being switched on
-     * @param successors the list of successors
-     * @param lowKey the lowest integer key in the table
-     */
-    public TableSwitchNode(ValueNode value, BeginNode[] successors, int lowKey, double[] probability) {
-        super(value, successors, probability);
-        this.lowKey = lowKey;
-    }
-
-    public TableSwitchNode(ValueNode value, int lowKey, double[] switchProbability) {
-        this(value, new BeginNode[switchProbability.length], lowKey, switchProbability);
-    }
-
-    /**
-     * Gets the lowest key in the table switch (inclusive).
-     * @return the low key
-     */
-    public int lowKey() {
-        return lowKey;
-    }
-
-    /**
-     * Gets the highest key in the table switch (exclusive).
-     * @return the high key
-     */
-    public int highKey() {
-        return lowKey + numberOfCases();
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitTableSwitch(this);
-    }
-
-    @Override
-    public void simplify(SimplifierTool tool) {
-        if (value() instanceof ConstantNode) {
-            ConstantNode constant = (ConstantNode) value();
-            int value = constant.value.asInt();
-
-            int remainingSuxIndex;
-            if (value >= lowKey() && value <= highKey()) {
-                remainingSuxIndex = value - lowKey();
-            } else {
-                remainingSuxIndex = blockSuccessorCount() - 1;
-            }
-
-            BeginNode remainingSux = blockSuccessor(remainingSuxIndex);
-            for (int i = 0; i < blockSuccessorCount(); i++) {
-                BeginNode sux = blockSuccessor(i);
-                if (sux != remainingSux) {
-                    tool.deleteBranch(sux);
-                }
-            }
-
-            tool.addToWorkList(remainingSux);
-            ((StructuredGraph) graph()).removeSplit(this, remainingSuxIndex);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-
-public final class UnboxNode extends FixedWithNextNode implements Node.IterableNodeType, Canonicalizable {
-
-    @Input private ValueNode source;
-    @Data private CiKind destinationKind;
-
-    public UnboxNode(CiKind kind, ValueNode source) {
-        super(StampFactory.forKind(kind));
-        this.source = source;
-        this.destinationKind = kind;
-        assert kind != CiKind.Object : "can only unbox to primitive";
-        assert source.kind() == CiKind.Object : "can only unbox objects";
-    }
-
-    public ValueNode source() {
-        return source;
-    }
-
-    public CiKind destinationKind() {
-        return destinationKind;
-    }
-
-    public void expand(BoxingMethodPool pool) {
-        RiResolvedField field = pool.getBoxField(kind());
-        LoadFieldNode loadField = graph().add(new LoadFieldNode(source, field));
-        loadField.setProbability(probability());
-        ((StructuredGraph) graph()).replaceFixedWithFixed(this, loadField);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (source.isConstant()) {
-            CiConstant constant = source.asConstant();
-            Object o = constant.asObject();
-            if (o != null) {
-                switch (destinationKind) {
-                    case Boolean:
-                        return ConstantNode.forBoolean((Boolean) o, graph());
-                    case Byte:
-                        return ConstantNode.forByte((Byte) o, graph());
-                    case Char:
-                        return ConstantNode.forChar((Character) o, graph());
-                    case Short:
-                        return ConstantNode.forShort((Short) o, graph());
-                    case Int:
-                        return ConstantNode.forInt((Integer) o, graph());
-                    case Long:
-                        return ConstantNode.forLong((Long) o, graph());
-                    case Float:
-                        return ConstantNode.forFloat((Long) o, graph());
-                    case Double:
-                        return ConstantNode.forDouble((Long) o, graph());
-                    default:
-                        ValueUtil.shouldNotReachHere();
-                }
-            }
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code UnsafeCastNode} produces the same value as its input, but with a different type.
- */
-public final class UnsafeCastNode extends FloatingNode implements Canonicalizable, Lowerable {
-
-    @Input private ValueNode x;
-    @Data private RiResolvedType toType;
-
-    public ValueNode x() {
-        return x;
-    }
-
-    public UnsafeCastNode(ValueNode x, RiResolvedType toType) {
-        super(StampFactory.declared(toType));
-        this.x = x;
-        this.toType = toType;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x != null && x.declaredType() != null && x.declaredType().isSubtypeOf(toType)) {
-            return x;
-        }
-        return this;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        ((StructuredGraph) graph()).replaceFloating(this, x);
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static <T> T cast(Object object, @ConstantNodeParameter Class<?> toType) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * Load of a value from a location specified as an offset relative to an object.
- */
-public class UnsafeLoadNode extends AbstractStateSplit implements Lowerable {
-
-    @Input private ValueNode object;
-    @Input private ValueNode offset;
-    @Data private final int displacement;
-    @Data private final CiKind loadKind;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public int displacement() {
-        return displacement;
-    }
-
-    public ValueNode offset() {
-        return offset;
-    }
-
-    public UnsafeLoadNode(ValueNode object, ValueNode offset, CiKind kind) {
-        this(object, 0, offset, kind);
-    }
-
-    public UnsafeLoadNode(ValueNode object, int displacement, ValueNode offset, CiKind kind) {
-        super(StampFactory.forKind(kind.stackKind()));
-        this.object = object;
-        this.displacement = displacement;
-        this.offset = offset;
-        this.loadKind = kind;
-    }
-
-    public CiKind loadKind() {
-        return loadKind;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static <T> T load(Object object, long offset, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * Store of a value at a location specified as an offset relative to an object.
- */
-public class UnsafeStoreNode extends AbstractStateSplit implements Lowerable {
-
-    @Input private ValueNode object;
-    @Input private ValueNode offset;
-    @Input private ValueNode value;
-    @Data private final int displacement;
-    @Data private final CiKind storeKind;
-
-    public UnsafeStoreNode(ValueNode object, ValueNode offset, ValueNode value, CiKind kind) {
-        this(object, 0, offset, value, kind);
-    }
-
-    public UnsafeStoreNode(ValueNode object, int displacement, ValueNode offset, ValueNode value, CiKind kind) {
-        super(StampFactory.illegal());
-        assert kind != CiKind.Void && kind != CiKind.Illegal;
-        this.object = object;
-        this.displacement = displacement;
-        this.offset = offset;
-        this.value = value;
-        this.storeKind = kind;
-    }
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public int displacement() {
-        return displacement;
-    }
-
-    public ValueNode offset() {
-        return offset;
-    }
-
-    public ValueNode value() {
-        return value;
-    }
-
-    public CiKind storeKind() {
-        return storeKind;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-
-    // specialized on value type until boxing/unboxing is sorted out in intrinsification
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, Object value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, boolean value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, byte value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, char value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, double value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, float value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, int value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, long value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static void store(Object object, long offset, short value, @ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The ValueAnchor instruction keeps non-CFG (floating) nodes above a certain point in the graph.
- */
-
-public final class ValueAnchorNode extends FixedWithNextNode implements Canonicalizable, LIRLowerable, Node.IterableNodeType {
-
-    @Input private ValueNode object;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public ValueAnchorNode(ValueNode object) {
-        super(StampFactory.illegal());
-        this.object = object;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // Nothing to emit, since this is node is used for structural purposes only.
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (object == null) {
-            return null;
-        }
-        if (object instanceof ConstantNode) {
-            return null;
-        }
-        if (object instanceof IntegerDivNode || object instanceof IntegerRemNode) {
-            if (((ArithmeticNode) object).y().isConstant()) {
-                CiConstant  constant = ((ArithmeticNode) object).y().asConstant();
-                assert constant.kind == object.kind() : constant.kind + " != " + object.kind();
-                if (constant.asLong() != 0) {
-                    return null;
-                }
-            }
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/WriteMemoryCheckpointNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-
-public final class WriteMemoryCheckpointNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
-
-    public WriteMemoryCheckpointNode() {
-        this(StampFactory.illegal());
-    }
-
-    public WriteMemoryCheckpointNode(Stamp stamp) {
-        super(stamp);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool generator) {
-        // nothing to do...
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.extended;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public final class WriteNode extends AccessNode implements LIRLowerable {
-    @Input private ValueNode value;
-
-    public ValueNode value() {
-        return value;
-    }
-
-    public WriteNode(ValueNode object, ValueNode value, LocationNode location) {
-        super(CiKind.Void, object, location);
-        this.value = value;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitStore(gen.makeAddress(location(), object()), gen.operand(value()), getNullCheck());
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessArrayNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.java;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * This the base class of all array operations.
- */
-public abstract class AccessArrayNode extends AbstractStateSplit {
-
-    @Input private ValueNode array;
-
-    public ValueNode array() {
-        return array;
-    }
-
-    /**
-     * Creates a new AccessArrayNode.
-     * @param kind the type of the result of this instruction
-     * @param array the instruction that produces the array object value
-     */
-    public AccessArrayNode(Stamp stamp, ValueNode array) {
-        super(stamp);
-        this.array = array;
-    }
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The base class of all instructions that access fields.
- */
-public abstract class AccessFieldNode extends AbstractStateSplit implements Lowerable {
-
-    @Input private ValueNode object;
-
-    @Data protected final RiResolvedField field;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    /**
-     * Constructs a new access field object.
-     * @param kind the result kind of the access
-     * @param object the instruction producing the receiver object
-     * @param field the compiler interface representation of the field
-     * @param graph
-     */
-    public AccessFieldNode(Stamp stamp, ValueNode object, RiResolvedField field) {
-        super(stamp);
-        this.object = object;
-        this.field = field;
-        assert field.holder().isInitialized();
-    }
-
-    /**
-     * Gets the compiler interface field for this field access.
-     * @return the compiler interface field for this field access
-     */
-    public RiResolvedField field() {
-        return field;
-    }
-
-    /**
-     * Checks whether this field access is an access to a static field.
-     * @return {@code true} if this field access is to a static field
-     */
-    public boolean isStatic() {
-        return Modifier.isStatic(field.accessFlags());
-    }
-
-    /**
-     * Checks whether this field is declared volatile.
-     * @return {@code true} if the field is resolved and declared volatile
-     */
-    public boolean isVolatile() {
-        return Modifier.isVolatile(field.accessFlags());
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> debugProperties = super.getDebugProperties();
-        debugProperties.put("field", CiUtil.format("%h.%n", field));
-        return debugProperties;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code AccessIndexedNode} class is the base class of instructions that read or write
- * elements of an array.
- */
-public abstract class AccessIndexedNode extends AccessArrayNode {
-
-    @Input private ValueNode index;
-    @Input private ValueNode length;
-
-    public ValueNode index() {
-        return index;
-    }
-
-    public ValueNode length() {
-        return length;
-    }
-
-    private final CiKind elementType;
-
-    /**
-     * Create an new AccessIndexedNode.
-     * @param kind the result kind of the access
-     * @param array the instruction producing the array
-     * @param index the instruction producing the index
-     * @param length the instruction producing the length
-     * @param elementKind the type of the elements of the array
-     */
-    protected AccessIndexedNode(Stamp stamp, ValueNode array, ValueNode index, ValueNode length, CiKind elementKind) {
-        super(stamp, array);
-        this.index = index;
-        this.length = length;
-        this.elementType = elementKind;
-    }
-
-    /**
-     * Gets the element type of the array.
-     * @return the element type
-     */
-    public CiKind elementKind() {
-        return elementType;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/AccessMonitorNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code AccessMonitorNode} is the base class of both monitor acquisition and release.
- * <br>
- * The VM needs information about monitors in the debug information. This information is built from
- * the nesting level of {@link MonitorEnterNode} when the LIR is constructed. Therefore, monitor
- * nodes must not be removed from the graph unless it is guaranteed that the nesting level does not change.
- * For example, you must not remove a {@link MonitorEnterNode} for a thread-local object or for a recursive locking.
- * Instead, mark the node as {@link #eliminated}. This makes sure that the meta data still contains the complete
- * locking hierarchy.
- * <br>
- * The Java bytecode specification allows non-balanced locking. Graal does not handle such cases and throws a
- * {@link CiBailout} instead. Detecting non-balanced monitors during bytecode parsing is difficult, since the
- * node flowing into the {@link MonitorExitNode} can be a phi function hiding the node that was flowing into the
- * {@link MonitorEnterNode}. Optimization phases are free to throw {@link CiBailout} if they detect such cases.
- * Otherwise, they are detected during LIR construction.
- */
-public abstract class AccessMonitorNode extends AbstractStateSplit implements MemoryCheckpoint {
-
-    @Input private ValueNode object;
-    @Data private boolean eliminated;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public boolean eliminated() {
-        return eliminated;
-    }
-
-    public void eliminate() {
-        eliminated = true;
-    }
-
-    /**
-     * Creates a new AccessMonitor instruction.
-     *
-     * @param object the instruction producing the object
-     */
-    public AccessMonitorNode(ValueNode object) {
-        super(StampFactory.illegal());
-        this.object = object;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code ArrayLength} instruction gets the length of an array.
- */
-public final class ArrayLengthNode extends FixedWithNextNode implements Canonicalizable, Lowerable, LIRLowerable {
-
-    @Input private ValueNode array;
-
-    public ValueNode array() {
-        return array;
-    }
-
-    public ArrayLengthNode(ValueNode array) {
-        super(StampFactory.intValue());
-        this.array = array;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitArrayLength(this);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (array() instanceof NewArrayNode) {
-            ValueNode length = ((NewArrayNode) array()).dimension(0);
-            assert length != null;
-            return length;
-        }
-        CiConstant constantValue = null;
-        if (array().isConstant() && !array().isNullConstant()) {
-            constantValue = array().asConstant();
-            if (constantValue != null && constantValue.isNonNull()) {
-                RiRuntime runtime = tool.runtime();
-                return ConstantNode.forInt(runtime.getArrayLength(constantValue), graph());
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code CheckCastNode} represents a {@link Bytecodes#CHECKCAST}.
- *
- * The {@link #targetClass()} of a CheckCastNode can be null for array store checks!
- */
-public final class CheckCastNode extends TypeCheckNode implements Canonicalizable, LIRLowerable, Node.IterableNodeType {
-
-    @Input protected final FixedNode anchor;
-    @Data  protected final boolean emitCode;
-
-    public FixedNode anchor() {
-        return anchor;
-    }
-
-    public boolean emitCode() {
-        return emitCode;
-    }
-
-    /**
-     * Creates a new CheckCast instruction.
-     *
-     * @param targetClassInstruction the instruction which produces the class which is being cast to
-     * @param targetClass the class being cast to
-     * @param object the instruction producing the object
-     */
-    public CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object) {
-        this(anchor, targetClassInstruction, targetClass, object, EMPTY_HINTS, false);
-    }
-
-    public CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, boolean emitCode) {
-        this(anchor, targetClassInstruction, targetClass, object, EMPTY_HINTS, false, emitCode);
-    }
-
-    public CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact) {
-        this(anchor, targetClassInstruction, targetClass, object, hints, hintsExact, true);
-    }
-
-    private CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact, boolean emitCode) {
-        super(targetClassInstruction, targetClass, object, hints, hintsExact, targetClass == null ? StampFactory.forKind(CiKind.Object) : StampFactory.declared(targetClass));
-        this.anchor = anchor;
-        this.emitCode = emitCode;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitCheckCast(this);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        RiResolvedType objectDeclaredType = object().declaredType();
-        RiResolvedType targetClass = targetClass();
-        if (objectDeclaredType != null && targetClass != null && objectDeclaredType.isSubtypeOf(targetClass)) {
-            freeAnchor();
-            return object();
-        }
-        CiConstant constant = object().asConstant();
-        if (constant != null) {
-            assert constant.kind == CiKind.Object;
-            if (constant.isNull()) {
-                freeAnchor();
-                return object();
-            }
-        }
-
-        if (tool.assumptions() != null && hints() != null && targetClass() != null) {
-            if (!hintsExact() && hints().length == 1 && hints()[0] == targetClass().uniqueConcreteSubtype()) {
-                tool.assumptions().recordConcreteSubtype(targetClass(), hints()[0]);
-                return graph().unique(new CheckCastNode(anchor, targetClassInstruction(), targetClass(), object(), hints(), true));
-            }
-        }
-        return this;
-    }
-
-    // TODO (thomaswue): Find a better way to handle anchors.
-    private void freeAnchor() {
-        ValueAnchorNode anchorUsage = usages().filter(ValueAnchorNode.class).first();
-        if (anchorUsage != null) {
-            anchorUsage.replaceFirstInput(this, null);
-        }
-    }
-
-    @Override
-    public BooleanNode negate() {
-        throw new Error("A CheckCast does not produce a boolean value, so it should actually not be a subclass of BooleanNode");
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * Represents an atomic compare-and-swap operation. If {@link #directResult} is true then the value read from the memory location is produced.
- * Otherwise the result is a boolean that contains whether the value matched the expected value.
- */
-public class CompareAndSwapNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
-
-    @Input private ValueNode object;
-    @Input private ValueNode offset;
-    @Input private ValueNode expected;
-    @Input private ValueNode newValue;
-    @Data private final boolean directResult;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public ValueNode offset() {
-        return offset;
-    }
-
-    public ValueNode expected() {
-        return expected;
-    }
-
-    public ValueNode newValue() {
-        return newValue;
-    }
-
-    public boolean directResult() {
-        return directResult;
-    }
-
-    public CompareAndSwapNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue) {
-        this(object, offset, expected, newValue, false);
-    }
-
-    public CompareAndSwapNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, boolean directResult) {
-        super(StampFactory.forKind(directResult ? expected.kind().stackKind() : CiKind.Boolean.stackKind()));
-        assert expected.kind() == newValue.kind();
-        this.object = object;
-        this.offset = offset;
-        this.expected = expected;
-        this.newValue = newValue;
-        this.directResult = directResult;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitCompareAndSwap(this);
-    }
-
-    // specialized on value type until boxing/unboxing is sorted out in intrinsification
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static boolean compareAndSwap(Object object, long offset, Object expected, Object newValue) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static boolean compareAndSwap(Object object, long offset, long expected, long newValue) {
-        throw new UnsupportedOperationException();
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static boolean compareAndSwap(Object object, long offset, int expected, int newValue) {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code ExceptionObject} instruction represents the incoming exception object to an exception handler.
- */
-public final class ExceptionObjectNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
-
-    /**
-     * Constructs a new ExceptionObject instruction.
-     */
-    public ExceptionObjectNode() {
-        super(StampFactory.forKind(CiKind.Object));
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitExceptionObject(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code InstanceOfNode} represents an instanceof test.
- */
-public final class InstanceOfNode extends TypeCheckNode implements Canonicalizable, LIRLowerable {
-
-    @Data private final boolean negated;
-
-    public boolean negated() {
-        return negated;
-    }
-
-    /**
-     * Constructs a new InstanceOfNode.
-     *
-     * @param targetClassInstruction the instruction which produces the target class of the instanceof check
-     * @param targetClass the class which is the target of the instanceof check
-     * @param object the instruction producing the object input to this instruction
-     */
-    public InstanceOfNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, boolean negated) {
-        this(targetClassInstruction, targetClass, object, EMPTY_HINTS, false, negated);
-    }
-
-    public InstanceOfNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact, boolean negated) {
-        super(targetClassInstruction, targetClass, object, hints, hintsExact, StampFactory.illegal());
-        this.negated = negated;
-        assert targetClass != null;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        assert object() != null : this;
-        RiResolvedType exact = object().exactType();
-        if (exact != null) {
-            boolean result = exact.isSubtypeOf(targetClass());
-            if (result != negated) {
-                // The instanceof check reduces to a null check.
-                return graph().unique(new NullCheckNode(object(), false));
-            } else {
-                // The instanceof check can never succeed.
-                return ConstantNode.forBoolean(false, graph());
-            }
-        }
-        CiConstant constant = object().asConstant();
-        if (constant != null) {
-            assert constant.kind == CiKind.Object;
-            if (constant.isNull()) {
-                return ConstantNode.forBoolean(negated, graph());
-            } else {
-                assert false : "non-null constants are always expected to provide an exactType";
-            }
-        }
-        if (tool.assumptions() != null && hints() != null && targetClass() != null) {
-            if (!hintsExact() && hints().length == 1 && hints()[0] == targetClass().uniqueConcreteSubtype()) {
-                tool.assumptions().recordConcreteSubtype(targetClass(), hints()[0]);
-                return graph().unique(new InstanceOfNode(targetClassInstruction(), targetClass(), object(), hints(), true, negated));
-            }
-        }
-        return this;
-    }
-
-    @Override
-    public BooleanNode negate() {
-        return graph().unique(new InstanceOfNode(targetClassInstruction(), targetClass(), object(), hints(), hintsExact(), !negated));
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public final class IsTypeNode extends BooleanNode implements Canonicalizable, LIRLowerable {
-
-    @Input private ValueNode objectClass;
-    @Data private final RiResolvedType type;
-
-    public ValueNode objectClass() {
-        return objectClass;
-    }
-
-    /**
-     * Constructs a new IsTypeNode.
-     *
-     * @param object the instruction producing the object to check against the given type
-     * @param type the type for this check
-     */
-    public IsTypeNode(ValueNode objectClass, RiResolvedType type) {
-        super(StampFactory.illegal());
-        assert objectClass == null || objectClass.kind() == CiKind.Object;
-        this.type = type;
-        this.objectClass = objectClass;
-    }
-
-    public RiResolvedType type() {
-        return type;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // nothing to do
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("type", type);
-        return properties;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        RiResolvedType exactType = objectClass() instanceof ReadHubNode ? ((ReadHubNode) objectClass()).object().exactType() : null;
-        if (exactType != null) {
-            return ConstantNode.forBoolean(exactType == type(), graph());
-        }
-        // constants return the correct exactType, so they are handled by the code above
-        return this;
-    }
-
-    @Override
-    public BooleanNode negate() {
-        throw new Error("unimplemented");
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code LoadFieldNode} represents a read of a static or instance field.
- */
-public final class LoadFieldNode extends AccessFieldNode implements Canonicalizable, LIRLowerable, Node.IterableNodeType {
-
-    /**
-     * Creates a new LoadFieldNode instance.
-     *
-     * @param object the receiver object
-     * @param field the compiler interface field
-     */
-    public LoadFieldNode(ValueNode object, RiResolvedField field) {
-        super(createStamp(field), object, field);
-    }
-
-    private static Stamp createStamp(RiResolvedField field) {
-        CiKind kind = field.kind(false);
-        if (kind == CiKind.Object && field.type() instanceof RiResolvedType) {
-            RiResolvedType resolvedType = (RiResolvedType) field.type();
-            return StampFactory.declared(resolvedType);
-        } else {
-            return StampFactory.forKind(kind);
-        }
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitLoadField(this);
-    }
-
-    @Override
-    public boolean needsStateAfter() {
-        return false;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        CiConstant constant = null;
-        if (isStatic()) {
-            constant = field().constantValue(null);
-        } else if (object().isConstant() && !object().isNullConstant()) {
-            constant = field().constantValue(object().asConstant());
-        }
-        if (constant != null) {
-            return ConstantNode.forCiConstant(constant, tool.runtime(), graph());
-        }
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code LoadIndexedNode} represents a read from an element of an array.
- */
-public final class LoadIndexedNode extends AccessIndexedNode implements Lowerable, LIRLowerable, Node.IterableNodeType {
-
-    /**
-     * Creates a new LoadIndexedNode.
-     * @param array the instruction producing the array
-     * @param index the instruction producing the index
-     * @param length the instruction producing the length
-     * @param elementKind the element type
-     */
-    public LoadIndexedNode(ValueNode array, ValueNode index, ValueNode length, CiKind elementKind) {
-        super(createStamp(array, elementKind), array, index, length, elementKind);
-    }
-
-    private static Stamp createStamp(ValueNode array, CiKind kind) {
-        if (kind == CiKind.Object && array.declaredType() != null) {
-            return StampFactory.declared(array.declaredType().componentType());
-        } else {
-            return StampFactory.forKind(kind);
-        }
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitLoadIndexed(this);
-    }
-
-    @Override
-    public boolean needsStateAfter() {
-        return false;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class MethodCallTargetNode extends CallTargetNode implements Node.IterableNodeType, Canonicalizable {
-    public enum InvokeKind {
-        Interface,
-        Special,
-        Static,
-        Virtual
-    }
-
-    @Data private final RiType returnType;
-    @Data private RiResolvedMethod targetMethod;
-    @Data private InvokeKind invokeKind;
-    private final Stamp returnStamp;
-
-    /**
-     * @param arguments
-     */
-    public MethodCallTargetNode(InvokeKind invokeKind, RiResolvedMethod targetMethod, ValueNode[] arguments, RiType returnType) {
-        super(arguments);
-        this.invokeKind = invokeKind;
-        this.returnType = returnType;
-        this.targetMethod = targetMethod;
-        CiKind returnKind = targetMethod.signature().returnKind(false);
-        if (returnKind == CiKind.Object && returnType instanceof RiResolvedType) {
-            returnStamp = StampFactory.declared((RiResolvedType) returnType);
-        } else {
-            returnStamp = StampFactory.forKind(returnKind);
-        }
-    }
-
-    @Override
-    public RiType returnType() {
-        return returnType;
-    }
-
-    /**
-     * Gets the target method for this invocation instruction.
-     * @return the target method
-     */
-    public RiResolvedMethod targetMethod() {
-        return targetMethod;
-    }
-
-    public InvokeKind invokeKind() {
-        return invokeKind;
-    }
-
-    public void setInvokeKind(InvokeKind kind) {
-        this.invokeKind = kind;
-    }
-
-    public void setTargetMethod(RiResolvedMethod method) {
-        targetMethod = method;
-    }
-
-    /**
-     * Gets the instruction that produces the receiver object for this invocation, if any.
-     * @return the instruction that produces the receiver object for this invocation if any, {@code null} if this
-     *         invocation does not take a receiver object
-     */
-    public ValueNode receiver() {
-        return isStatic() ? null : arguments().get(0);
-    }
-
-    /**
-     * Checks whether this is an invocation of a static method.
-     * @return {@code true} if the invocation is a static invocation
-     */
-    public boolean isStatic() {
-        return invokeKind() == InvokeKind.Static;
-    }
-
-    @Override
-    public CiKind returnKind() {
-        return targetMethod().signature().returnKind(false);
-    }
-
-    public Invoke invoke() {
-        return (Invoke) this.usages().first();
-    }
-
-
-    @Override
-    public boolean verify() {
-        assert usages().size() <= 1 : "call target may only be used by a single invoke";
-        for (Node n : usages()) {
-            assertTrue(n instanceof Invoke, "call target can only be used from an invoke (%s)", n);
-        }
-        return super.verify();
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Long) {
-            return super.toString(Verbosity.Short) + "(" + targetMethod() + ")";
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (!isStatic()) {
-            ValueNode receiver = receiver();
-            if (receiver != null && receiver.exactType() != null) {
-                if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) {
-                    RiResolvedMethod method = receiver.exactType().resolveMethodImpl(targetMethod);
-                    if (method != null) {
-                        invokeKind = InvokeKind.Special;
-                        targetMethod = method;
-                    }
-                }
-            }
-        }
-        return this;
-    }
-
-    public Stamp returnStamp() {
-        return returnStamp;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-/**
- * The {@code MonitorEnterNode} represents the acquisition of a monitor.
- */
-public final class MonitorEnterNode extends AccessMonitorNode implements LIRLowerable {
-
-    /**
-     * Creates a new MonitorEnterNode.
-     *
-     * @param object the instruction producing the object
-     */
-    public MonitorEnterNode(ValueNode object) {
-        super(object);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitMonitorEnter(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.graph.*;
-
-/**
- * The {@code MonitorEnterNode} represents a monitor release.
- */
-public final class MonitorExitNode extends AccessMonitorNode implements LIRLowerable, Node.IterableNodeType {
-
-    /**
-     * Creates a new MonitorExitNode.
-     *
-     * @param object the instruction produces the object value
-     */
-    public MonitorExitNode(ValueNode object) {
-        super(object);
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitMonitorExit(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code NewArrayNode} class is the base of all instructions that allocate arrays.
- */
-public abstract class NewArrayNode extends FixedWithNextNode implements EscapeAnalyzable{
-
-    @Input private ValueNode length;
-
-    public static final int MaximumEscapeAnalysisArrayLength = 32;
-
-    public ValueNode length() {
-        return length;
-    }
-
-    /**
-     * Constructs a new NewArrayNode.
-     * @param length the node that produces the length for this allocation
-     */
-    protected NewArrayNode(Stamp stamp, ValueNode length) {
-        super(stamp);
-        this.length = length;
-    }
-
-    /**
-     * The list of node which produce input for this instruction.
-     */
-    public ValueNode dimension(int index) {
-        assert index == 0;
-        return length();
-    }
-
-    /**
-     * The rank of the array allocated by this node, i.e. how many array dimensions.
-     */
-    public int dimensionCount() {
-        return 1;
-    }
-
-    /**
-     * Gets the element type of the array.
-     * @return the element type of the array
-     */
-    public abstract RiResolvedType elementType();
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("exactType", exactType());
-        return properties;
-    }
-
-    public EscapeOp getEscapeOp() {
-        return ESCAPE;
-    }
-
-    private static final EscapeOp ESCAPE = new EscapeOp() {
-
-        @Override
-        public boolean canAnalyze(Node node) {
-            NewArrayNode x = (NewArrayNode) node;
-            CiConstant length = x.dimension(0).asConstant();
-            return length != null && length.asInt() >= 0 && length.asInt() < MaximumEscapeAnalysisArrayLength;
-        }
-
-        @Override
-        public EscapeField[] fields(Node node) {
-            NewArrayNode x = (NewArrayNode) node;
-            int length = x.dimension(0).asConstant().asInt();
-            EscapeField[] fields = new EscapeField[length];
-            for (int i = 0; i < length; i++) {
-                Integer representation = i;
-                fields[i] = new EscapeField("[" + i + "]", representation, ((NewArrayNode) node).elementType());
-            }
-            return fields;
-        }
-
-        @Override
-        public void beforeUpdate(Node node, Node usage) {
-            if (usage instanceof ArrayLengthNode) {
-                ArrayLengthNode x = (ArrayLengthNode) usage;
-                StructuredGraph graph = (StructuredGraph) node.graph();
-                x.replaceAtUsages(((NewArrayNode) node).dimension(0));
-                graph.removeFixed(x);
-            } else {
-                super.beforeUpdate(node, usage);
-            }
-        }
-
-        @Override
-        public int updateState(Node node, Node current, Map<Object, Integer> fieldIndex, ValueNode[] fieldState) {
-            if (current instanceof AccessIndexedNode) {
-                AccessIndexedNode x = (AccessIndexedNode) current;
-                if (x.array() == node) {
-                    int index = ((AccessIndexedNode) current).index().asConstant().asInt();
-                    if (current instanceof LoadIndexedNode) {
-                        x.replaceAtUsages(fieldState[index]);
-                        ((StructuredGraph) x.graph()).removeFixed(x);
-                    } else if (current instanceof StoreIndexedNode) {
-                        fieldState[index] = ((StoreIndexedNode) x).value();
-                        ((StructuredGraph) x.graph()).removeFixed(x);
-                        return index;
-                    }
-                }
-            }
-            return -1;
-        }
-    };
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import java.util.*;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code NewInstanceNode} represents the allocation of an instance class object.
- */
-public final class NewInstanceNode extends FixedWithNextNode implements EscapeAnalyzable, LIRLowerable, Node.IterableNodeType {
-
-    private final RiResolvedType instanceClass;
-
-    /**
-     * Constructs a NewInstanceNode.
-     * @param type the class being allocated
-     */
-    public NewInstanceNode(RiResolvedType type) {
-        super(StampFactory.exactNonNull(type));
-        this.instanceClass = type;
-    }
-
-    /**
-     * Gets the instance class being allocated by this node.
-     * @return the instance class allocated
-     */
-    public RiResolvedType instanceClass() {
-        return instanceClass;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitNewInstance(this);
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("instanceClass", instanceClass);
-        return properties;
-    }
-
-    public EscapeOp getEscapeOp() {
-        return ESCAPE;
-    }
-
-    private static final EscapeOp ESCAPE = new EscapeOp() {
-
-        @Override
-        public boolean canAnalyze(Node node) {
-            return true;
-        }
-
-        private void fillEscapeFields(RiResolvedType type, List<EscapeField> escapeFields) {
-            if (type != null) {
-                fillEscapeFields(type.superType(), escapeFields);
-                RiField[] declaredFields = type.declaredFields();
-                assert declaredFields != null : "the runtime must specify the declared fields of that type";
-                for (RiField field : declaredFields) {
-                    escapeFields.add(new EscapeField(field.name(), field, field.type()));
-                }
-            }
-        }
-
-        @Override
-        public EscapeField[] fields(Node node) {
-            NewInstanceNode x = (NewInstanceNode) node;
-            List<EscapeField> escapeFields = new ArrayList<>();
-            fillEscapeFields(x.instanceClass(), escapeFields);
-            return escapeFields.toArray(new EscapeField[escapeFields.size()]);
-        }
-
-        @Override
-        public void beforeUpdate(Node node, Node usage) {
-            if (usage instanceof RegisterFinalizerNode) {
-                RegisterFinalizerNode x = (RegisterFinalizerNode) usage;
-                ((StructuredGraph) x.graph()).removeFixed(x);
-            } else {
-                super.beforeUpdate(node, usage);
-            }
-        }
-
-        @Override
-        public int updateState(Node node, Node current, Map<Object, Integer> fieldIndex, ValueNode[] fieldState) {
-            if (current instanceof AccessFieldNode) {
-                AccessFieldNode x = (AccessFieldNode) current;
-                if (x.object() == node) {
-                    int field = fieldIndex.get(x.field());
-                    StructuredGraph graph = (StructuredGraph) x.graph();
-                    if (current instanceof LoadFieldNode) {
-                        assert fieldState[field] != null : field + ", " + x.field();
-                        x.replaceAtUsages(fieldState[field]);
-                        graph.removeFixed(x);
-                    } else if (current instanceof StoreFieldNode) {
-                        fieldState[field] = ((StoreFieldNode) x).value();
-                        graph.removeFixed(x);
-                        return field;
-                    }
-                }
-            }
-            return -1;
-        }
-    };
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java	Thu Mar 08 19:11:12 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.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code NewMultiArrayNode} represents an allocation of a multi-dimensional object
- * array.
- */
-public final class NewMultiArrayNode extends FixedWithNextNode implements LIRLowerable {
-
-    @Input private final NodeInputList<ValueNode> dimensions;
-    @Data private final RiResolvedType type;
-
-    public ValueNode dimension(int index) {
-        return dimensions.get(index);
-    }
-
-    public int dimensionCount() {
-        return dimensions.size();
-    }
-
-    /**
-     * Constructs a new NewMultiArrayNode.
-     * @param elementType the element type of the array
-     * @param dimensions the node which produce the dimensions for this array
-     * @param cpi the constant pool index for resolution
-     * @param riConstantPool the constant pool for resolution
-     */
-    public NewMultiArrayNode(RiResolvedType type, ValueNode[] dimensions) {
-        super(StampFactory.exactNonNull(type));
-        this.type = type;
-        this.dimensions = new NodeInputList<>(this, dimensions);
-        assert dimensions.length > 0 && type.isArrayClass();
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitNewMultiArray(this);
-    }
-
-    public RiResolvedType type() {
-        return type;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewObjectArrayNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code NewObjectArrayNode} represents an allocation of an object array.
- */
-public final class NewObjectArrayNode extends NewArrayNode implements LIRLowerable, Node.IterableNodeType {
-
-    private final RiResolvedType elementClass;
-
-    /**
-     * Constructs a new NewObjectArrayNode.
-     * @param elementClass the class of elements in this array
-     * @param length the node producing the length of the array
-     * @param graph
-     */
-    public NewObjectArrayNode(RiResolvedType elementClass, ValueNode length) {
-        super(StampFactory.exactNonNull(elementClass.arrayOf()), length);
-        this.elementClass = elementClass;
-    }
-
-    @Override
-    public RiResolvedType elementType() {
-        return elementClass;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitNewObjectArray(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/NewTypeArrayNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code NewTypeArrayNode} class definition.
- */
-public final class NewTypeArrayNode extends NewArrayNode implements LIRLowerable {
-
-    private final RiResolvedType elementType;
-
-    public NewTypeArrayNode(ValueNode length, RiResolvedType elementType) {
-        super(StampFactory.exactNonNull(elementType.arrayOf()), length);
-        this.elementType = elementType;
-    }
-
-    @Override
-    public RiResolvedType elementType() {
-        return elementType;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitNewTypeArray(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * This node is used to perform the finalizer registration at the end of the java.lang.Object constructor.
- */
-public final class RegisterFinalizerNode extends AbstractStateSplit implements Canonicalizable, LIRLowerable {
-
-    @Input private ValueNode object;
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public RegisterFinalizerNode(ValueNode object) {
-        super(StampFactory.illegal());
-        this.object = object;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.emitCallToRuntime(CiRuntimeCall.RegisterFinalizer, true, gen.operand(object()));
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        RiResolvedType declaredType = object.declaredType();
-        RiResolvedType exactType = object.exactType();
-        if (exactType == null && declaredType != null) {
-            exactType = declaredType.exactType();
-        }
-
-        boolean needsCheck = true;
-        if (exactType != null) {
-            // we have an exact type
-            needsCheck = exactType.hasFinalizer();
-        } else {
-            // if either the declared type of receiver or the holder can be assumed to have no finalizers
-            if (declaredType != null && !declaredType.hasFinalizableSubclass()) {
-                if (tool.assumptions() != null && tool.assumptions().recordNoFinalizableSubclassAssumption(declaredType)) {
-                    needsCheck = false;
-                }
-            }
-        }
-
-        if (!needsCheck) {
-            return null;
-        }
-
-        return this;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code StoreFieldNode} represents a write to a static or instance field.
- */
-public final class StoreFieldNode extends AccessFieldNode implements LIRLowerable {
-
-    @Input private ValueNode value;
-
-    public ValueNode value() {
-        return value;
-    }
-
-    /**
-     * Creates a new StoreFieldNode.
-     * @param object the receiver object
-     * @param field the compiler interface field
-     * @param value the node representing the value to store to the field
-     */
-    public StoreFieldNode(ValueNode object, RiResolvedField field, ValueNode value) {
-        super(StampFactory.illegal(), object, field);
-        this.value = value;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitStoreField(this);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code StoreIndexedNode} represents a write to an array element.
- */
-public final class StoreIndexedNode extends AccessIndexedNode implements Lowerable, LIRLowerable {
-
-    @Input private ValueNode value;
-
-    public ValueNode value() {
-        return value;
-    }
-
-    /**
-     * Creates a new StoreIndexedNode.
-     * @param array the node producing the array
-     * @param index the node producing the index
-     * @param length the node producing the length
-     * @param elementKind the element type
-     * @param value the value to store into the array
-     */
-    public StoreIndexedNode(ValueNode array, ValueNode index, ValueNode length, CiKind elementKind, ValueNode value) {
-        super(StampFactory.illegal(), array, index, length, elementKind);
-        this.value = value;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitStoreIndexed(this);
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/java/TypeCheckNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.java;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.type.*;
-
-/**
- * The {@code TypeCheckNode} is the base class of casts and instanceof tests.
- */
-public abstract class TypeCheckNode extends BooleanNode {
-
-    protected static final RiResolvedType[] EMPTY_HINTS = new RiResolvedType[0];
-    @Input private ValueNode object;
-    @Input private ValueNode targetClassInstruction;
-    @Data private final RiResolvedType targetClass;
-    @Data private final RiResolvedType[] hints;
-    @Data private final boolean hintsExact;
-
-    /**
-     * Creates a new TypeCheckNode.
-     * @param targetClassInstruction the instruction which produces the class which is being cast to or checked against
-     * @param targetClass the class that is being casted to or checked against
-     * @param object the node which produces the object
-     * @param kind the result type of this node
-     */
-    public TypeCheckNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact, Stamp stamp) {
-        super(stamp);
-        this.targetClassInstruction = targetClassInstruction;
-        this.targetClass = targetClass;
-        this.object = object;
-        this.hints = hints;
-        this.hintsExact = hintsExact;
-    }
-
-    public ValueNode object() {
-        return object;
-    }
-
-    public ValueNode targetClassInstruction() {
-        return targetClassInstruction;
-    }
-
-    /**
-     * Gets the target class, i.e. the class being cast to, or the class being tested against.
-     * @return the target class
-     */
-    public RiResolvedType targetClass() {
-        return targetClass;
-    }
-
-    public RiResolvedType[] hints() {
-        return hints;
-    }
-
-    public boolean hintsExact() {
-        return hintsExact;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/Canonicalizable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-import com.oracle.graal.nodes.*;
-
-public interface Canonicalizable {
-
-    ValueNode canonical(CanonicalizerTool tool);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-
-
-public interface CanonicalizerTool {
-    CiTarget target();
-    CiAssumptions assumptions();
-    RiRuntime runtime();
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeAnalyzable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-public interface EscapeAnalyzable {
-
-    EscapeOp getEscapeOp();
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeField.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-import com.oracle.max.cri.ri.*;
-
-public class EscapeField {
-
-    private String name;
-    private Object representation;
-    private RiType type;
-
-    public EscapeField(String name, Object representation, RiType type) {
-        this.name = name;
-        this.representation = representation;
-        this.type = type;
-    }
-
-    public String name() {
-        return name;
-    }
-
-    public Object representation() {
-        return representation;
-    }
-
-    public RiType type() {
-        return type;
-    }
-
-    @Override
-    public String toString() {
-        return name();
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeOp.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.java.*;
-import com.oracle.graal.nodes.virtual.*;
-
-
-public abstract class EscapeOp {
-
-    public abstract boolean canAnalyze(Node node);
-
-    public boolean escape(Node node, Node usage) {
-        if (usage instanceof NullCheckNode) {
-            assert ((NullCheckNode) usage).object() == node;
-            return false;
-        } else if (usage instanceof IsTypeNode) {
-            assert ((IsTypeNode) usage).objectClass() == node;
-            return false;
-        } else if (usage instanceof FrameState) {
-            assert usage.inputs().contains(node);
-            return true;
-        } else if (usage instanceof AccessMonitorNode) {
-            assert ((AccessMonitorNode) usage).object() == node;
-            return false;
-        } else if (usage instanceof LoadFieldNode) {
-            assert ((LoadFieldNode) usage).object() == node;
-            return false;
-        } else if (usage instanceof StoreFieldNode) {
-            StoreFieldNode x = (StoreFieldNode) usage;
-            // self-references do escape
-            return x.value() == node; // TODO (thomaswue) Check if we can add this condition? && x.object() != node;
-        } else if (usage instanceof LoadIndexedNode) {
-            LoadIndexedNode x = (LoadIndexedNode) usage;
-            if (x.index() == node) {
-                return true;
-            } else {
-                assert x.array() == node;
-                return !isValidConstantIndex(x);
-            }
-        } else if (usage instanceof StoreIndexedNode) {
-            StoreIndexedNode x = (StoreIndexedNode) usage;
-            if (x.index() == node) {
-                return true;
-            } else {
-                assert x.array() == node || x.value() == node;
-                // in order to not escape the access needs to have a valid constant index and either a store into node or self-referencing
-                return !isValidConstantIndex(x) || x.value() == node && x.array() != node;
-            }
-        } else if (usage instanceof VirtualObjectFieldNode) {
-            return false;
-        } else if (usage instanceof RegisterFinalizerNode) {
-            assert ((RegisterFinalizerNode) usage).object() == node;
-            return false;
-        } else if (usage instanceof ArrayLengthNode) {
-            assert ((ArrayLengthNode) usage).array() == node;
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    public static boolean isValidConstantIndex(AccessIndexedNode x) {
-        CiConstant index = x.index().asConstant();
-        if (x.array() instanceof NewArrayNode) {
-            CiConstant length = ((NewArrayNode) x.array()).dimension(0).asConstant();
-            return index != null && length != null && index.asInt() >= 0 && index.asInt() < length.asInt();
-        } else {
-            return false;
-        }
-    }
-
-    public abstract EscapeField[] fields(Node node);
-
-    public void beforeUpdate(Node node, Node usage) {
-        // IsNonNullNode and IsTypeNode should have been eliminated by the CanonicalizerPhase, but we can't rely on this
-        if (usage instanceof NullCheckNode) {
-            NullCheckNode x = (NullCheckNode) usage;
-            ((StructuredGraph) x.graph()).replaceFloating(x, ConstantNode.forBoolean(!x.expectedNull, node.graph()));
-        } else if (usage instanceof IsTypeNode) {
-            IsTypeNode x = (IsTypeNode) usage;
-            assert x.type() == ((ValueNode) node).exactType();
-            ((StructuredGraph) x.graph()).replaceFloating(x, ConstantNode.forBoolean(true, node.graph()));
-        } else if (usage instanceof AccessMonitorNode) {
-            ((AccessMonitorNode) usage).eliminate();
-        }
-    }
-
-    public abstract int updateState(Node node, Node current, Map<Object, Integer> fieldIndex, ValueNode[] fieldState);
-
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-
-public abstract class LIRGeneratorTool {
-    public abstract CiTarget target();
-
-    /**
-     * Checks whether the supplied constant can be used without loading it into a register
-     * for most operations, i.e., for commonly used arithmetic, logical, and comparison operations.
-     * @param c The constant to check.
-     * @return True if the constant can be used directly, false if the constant needs to be in a register.
-     */
-    public abstract boolean canInlineConstant(CiConstant c);
-
-    /**
-     * Checks whether the supplied constant can be used without loading it into a register
-     * for store operations, i.e., on the right hand side of a memory access.
-     * @param c The constant to check.
-     * @return True if the constant can be used directly, false if the constant needs to be in a register.
-     */
-    public abstract boolean canStoreConstant(CiConstant c);
-
-    public abstract CiValue operand(ValueNode object);
-    public abstract CiValue newVariable(CiKind kind);
-    public abstract CiValue setResult(ValueNode x, CiValue operand);
-
-    public abstract CiAddress makeAddress(LocationNode location, ValueNode object);
-
-    public abstract CiValue emitMove(CiValue input);
-    public abstract void emitMove(CiValue src, CiValue dst);
-    public abstract CiValue emitLoad(CiValue loadAddress, boolean canTrap);
-    public abstract void emitStore(CiValue storeAddress, CiValue input, boolean canTrap);
-    public abstract CiValue emitLea(CiValue address);
-
-    public abstract CiValue emitNegate(CiValue input);
-    public abstract CiValue emitAdd(CiValue a, CiValue b);
-    public abstract CiValue emitSub(CiValue a, CiValue b);
-    public abstract CiValue emitMul(CiValue a, CiValue b);
-    public abstract CiValue emitDiv(CiValue a, CiValue b);
-    public abstract CiValue emitRem(CiValue a, CiValue b);
-    public abstract CiValue emitUDiv(CiValue a, CiValue b);
-    public abstract CiValue emitURem(CiValue a, CiValue b);
-
-    public abstract CiValue emitAnd(CiValue a, CiValue b);
-    public abstract CiValue emitOr(CiValue a, CiValue b);
-    public abstract CiValue emitXor(CiValue a, CiValue b);
-
-    public abstract CiValue emitShl(CiValue a, CiValue b);
-    public abstract CiValue emitShr(CiValue a, CiValue b);
-    public abstract CiValue emitUShr(CiValue a, CiValue b);
-
-    public abstract CiValue emitConvert(ConvertNode.Op opcode, CiValue inputVal);
-    public abstract void emitMembar(int barriers);
-    public abstract void emitDeoptimizeOn(Condition of, DeoptAction action, Object deoptInfo);
-    public abstract CiValue emitCallToRuntime(CiRuntimeCall runtimeCall, boolean canTrap, CiValue... args);
-
-    public abstract void emitIf(IfNode i);
-    public abstract void emitConditional(ConditionalNode i);
-    public abstract void emitGuardCheck(BooleanNode comp);
-
-    public abstract void emitLookupSwitch(LookupSwitchNode i);
-    public abstract void emitTableSwitch(TableSwitchNode i);
-
-    public abstract void emitInvoke(Invoke i);
-    public abstract void emitRuntimeCall(RuntimeCallNode i);
-
-    // Handling of block-end nodes still needs to be unified in the LIRGenerator.
-    public abstract void visitMerge(MergeNode i);
-    public abstract void visitEndNode(EndNode i);
-    public abstract void visitLoopEnd(LoopEndNode i);
-
-    // The CompareAndSwapNode in its current form needs to be lowered to several Nodes before code generation to separate three parts:
-    // * The write barriers (and possibly read barriers) when accessing an object field
-    // * The distinction of returning a boolean value (semantic similar to a BooleanNode to be used as a condition?) or the old value being read
-    // * The actual compare-and-swap
-    public abstract void visitCompareAndSwap(CompareAndSwapNode i);
-
-    // Functionality that is currently implemented in XIR.
-    // These methods will go away eventually when lowering is done via snippets in the front end.
-    public abstract void visitArrayLength(ArrayLengthNode i);
-    public abstract void visitCheckCast(CheckCastNode i);
-    public abstract void visitMonitorEnter(MonitorEnterNode i);
-    public abstract void visitMonitorExit(MonitorExitNode i);
-    public abstract void visitLoadField(LoadFieldNode i);
-    public abstract void visitStoreField(StoreFieldNode i);
-    public abstract void visitLoadIndexed(LoadIndexedNode i);
-    public abstract void visitStoreIndexed(StoreIndexedNode i);
-    public abstract void visitNewInstance(NewInstanceNode i);
-    public abstract void visitNewTypeArray(NewTypeArrayNode i);
-    public abstract void visitNewObjectArray(NewObjectArrayNode i);
-    public abstract void visitNewMultiArray(NewMultiArrayNode i);
-    public abstract void visitExceptionObject(ExceptionObjectNode i);
-    public abstract void visitReturn(ReturnNode i);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/LIRLowerable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-public interface LIRLowerable {
-
-    void generate(LIRGeneratorTool generator);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/Lowerable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-import com.oracle.graal.cri.*;
-
-public interface Lowerable {
-
-    void lower(CiLoweringTool tool);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/Simplifiable.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-/**
- * This interface allows nodes to perform more complicated simplifications, in contrast to {@link Canonicalizable},
- * which supports only replacing the current node.
- *
- * Implementors of this interface need to be aware that they need to call {@link SimplifierTool#addToWorkList(com.oracle.graal.graph.Node)} for each node that might
- * be influenced (in terms of simplification and canonicalization) by the actions performed in simplify.
- */
-public interface Simplifiable {
-
-    void simplify(SimplifierTool tool);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/spi/SimplifierTool.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.spi;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-
-public interface SimplifierTool extends CanonicalizerTool {
-    void deleteBranch(FixedNode branch);
-    void addToWorkList(Node node);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.type;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-
-
-public interface Stamp {
-    boolean nonNull();
-    RiResolvedType declaredType();
-    RiResolvedType exactType();
-    CiKind kind();
-    boolean alwaysDistinct(Stamp other);
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.type;
-
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-
-
-public class StampFactory {
-
-    private static class BasicValueStamp implements Stamp {
-
-        private final CiKind kind;
-        private final boolean nonNull;
-        private RiResolvedType declaredType;
-        private RiResolvedType exactType;
-
-        public BasicValueStamp(CiKind kind) {
-            this(kind, false, null, null);
-        }
-
-        public BasicValueStamp(CiKind kind, boolean nonNull, RiResolvedType declaredType, RiResolvedType exactType) {
-            this.kind = kind;
-            this.nonNull = nonNull;
-            this.declaredType = declaredType;
-            this.exactType = exactType;
-        }
-
-        @Override
-        public CiKind kind() {
-            return kind;
-        }
-
-        @Override
-        public boolean nonNull() {
-            return nonNull;
-        }
-
-        @Override
-        public RiResolvedType declaredType() {
-            return declaredType;
-        }
-
-        @Override
-        public RiResolvedType exactType() {
-            return exactType;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj == this) {
-                return true;
-            }
-            if (obj instanceof Stamp) {
-                Stamp other = (Stamp) obj;
-                return kind == other.kind() && nonNull() == other.nonNull() && declaredType() == other.declaredType() && exactType() == other.exactType();
-            }
-            return false;
-        }
-
-        @Override
-        public int hashCode() {
-            return kind.hashCode();
-        }
-
-        @Override
-        public String toString() {
-            return String.format("%c%s %s %s", kind().typeChar, nonNull ? "!" : "", declaredType == null ? "-" : declaredType.name(), exactType == null ? "-" : exactType.name());
-        }
-
-        @Override
-        public boolean alwaysDistinct(Stamp other) {
-            if (other.kind() != kind()) {
-                return true;
-            } else if (kind() != CiKind.Object) {
-                return false;
-            } else if (other.declaredType() == null || declaredType() == null) {
-                // We have no type information for one of the values.
-                return false;
-            } else if (other.nonNull() || nonNull()) {
-                // One of the two values cannot be null.
-                return !other.declaredType().isInterface() && !declaredType().isInterface() && !other.declaredType().isSubtypeOf(declaredType()) && !declaredType().isSubtypeOf(other.declaredType());
-            } else {
-                // Both values may be null.
-                return false;
-            }
-        }
-    }
-
-    private static final Stamp[] stampCache = new Stamp[CiKind.values().length];
-    static {
-        for (CiKind k : CiKind.values()) {
-            stampCache[k.ordinal()] = new BasicValueStamp(k);
-        }
-    }
-
-    public static Stamp illegal() {
-        return forKind(CiKind.Illegal);
-    }
-
-    public static Stamp intValue() {
-        return forKind(CiKind.Int);
-    }
-
-    public static Stamp forKind(CiKind kind) {
-        return stampCache[kind.stackKind().ordinal()];
-    }
-
-    public static Stamp exactNonNull(final RiResolvedType type) {
-        // (cwimmer) type can be null for certain Maxine-internal objects such as the static hub. Is this a problem here?
-        assert type == null || type.kind(false) == CiKind.Object;
-        return new BasicValueStamp(CiKind.Object, true, type, type);
-    }
-
-    public static Stamp forConstant(CiConstant value, RiRuntime runtime) {
-        if (runtime != null && value.kind == CiKind.Object && !value.isNull()) {
-            return exactNonNull(runtime.getTypeOf(value));
-        } else {
-            return forKind(value.kind.stackKind());
-        }
-    }
-
-    public static Stamp objectNonNull() {
-        return new BasicValueStamp(CiKind.Object, true, null, null);
-    }
-
-    public static Stamp declared(final RiResolvedType type) {
-        assert type != null;
-        assert type.kind(false) == CiKind.Object;
-        return new BasicValueStamp(CiKind.Object, false, type, type.exactType());
-    }
-
-    public static Stamp declaredNonNull(final RiResolvedType type) {
-        assert type != null;
-        assert type.kind(false) == CiKind.Object;
-        return new BasicValueStamp(CiKind.Object, true, type, type.exactType());
-    }
-
-    public static Stamp or(Collection<? extends StampProvider> values) {
-        if (values.size() == 0) {
-            return illegal();
-        } else {
-            Iterator< ? extends StampProvider> iterator = values.iterator();
-            Stamp first = iterator.next().stamp();
-            if (values.size() == 1) {
-                return first;
-            }
-
-            boolean nonNull = first.nonNull();
-            RiResolvedType declaredType = first.declaredType();
-            RiResolvedType exactType = first.exactType();
-            while (iterator.hasNext()) {
-                Stamp current = iterator.next().stamp();
-                assert current.kind() == first.kind() : values + " first=" + first + " current=" + current + " first kind=" + first.kind() + " current kind=" + current.kind();
-                nonNull &= current.nonNull();
-                declaredType = orTypes(declaredType, current.declaredType());
-                if (exactType != current.exactType()) {
-                    exactType = null;
-                }
-            }
-
-            if (nonNull != first.nonNull() || declaredType != first.declaredType() || exactType != first.exactType()) {
-                return new BasicValueStamp(first.kind(), nonNull, declaredType, exactType);
-            } else {
-                return first;
-            }
-        }
-    }
-
-    private static RiResolvedType orTypes(RiResolvedType a, RiResolvedType b) {
-        if (a == b) {
-            return a;
-        } else if (a == null || b == null) {
-            return null;
-        } else {
-            if (a.isSubtypeOf(b)) {
-                return b;
-            } else if (b.isSubtypeOf(a)) {
-                return a;
-            } else {
-                return null;
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.type;
-
-
-public interface StampProvider {
-    Stamp stamp();
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.util;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-
-public class GraphUtil {
-
-    public static void killCFG(FixedNode node) {
-        assert node.isAlive();
-        if (node instanceof EndNode) {
-            // We reached a control flow end.
-            EndNode end = (EndNode) node;
-            killEnd(end);
-        } else {
-            // Normal control flow node.
-            for (Node successor : node.successors().snapshot()) {
-                killCFG((FixedNode) successor);
-            }
-        }
-        propagateKill(node);
-    }
-
-    private static void killEnd(EndNode end) {
-        MergeNode merge = end.merge();
-        merge.removeEnd(end);
-        if (merge instanceof LoopBeginNode && merge.forwardEndCount() == 0) { //dead loop
-            for (PhiNode phi : merge.phis().snapshot()) {
-                propagateKill(phi);
-            }
-            LoopBeginNode begin = (LoopBeginNode) merge;
-            // disconnect and delete loop ends
-            for (LoopEndNode loopend : begin.loopEnds().snapshot()) {
-                loopend.predecessor().replaceFirstSuccessor(loopend, null);
-                loopend.safeDelete();
-            }
-            FixedNode next = begin.next();
-            begin.safeDelete();
-            killCFG(next);
-        } else if (merge instanceof LoopBeginNode && ((LoopBeginNode) merge).loopEnds().isEmpty()) { // not a loop anymore
-            ((StructuredGraph) end.graph()).reduceDegenerateLoopBegin((LoopBeginNode) merge);
-        } else if (merge.phiPredecessorCount() == 1) { // not a merge anymore
-            ((StructuredGraph) end.graph()).reduceTrivialMerge(merge);
-        }
-    }
-
-    public static void propagateKill(Node node) {
-        if (node != null && node.isAlive()) {
-            List<Node> usagesSnapshot = node.usages().filter(isA(FloatingNode.class).or(CallTargetNode.class).or(FrameState.class)).snapshot();
-
-            // null out remaining usages
-            node.replaceAtUsages(null);
-            node.replaceAtPredecessors(null);
-            killUnusedFloatingInputs(node);
-
-            for (Node usage : usagesSnapshot) {
-                if (!usage.isDeleted()) {
-                    if (usage instanceof PhiNode) {
-                        usage.replaceFirstInput(node, null);
-                    } else {
-                        propagateKill(usage);
-                    }
-                }
-            }
-        }
-    }
-
-    public static void killUnusedFloatingInputs(Node node) {
-        List<Node> floatingInputs = node.inputs().filter(isA(FloatingNode.class).or(CallTargetNode.class).or(FrameState.class)).snapshot();
-        node.safeDelete();
-
-        for (Node in : floatingInputs) {
-            if (in.isAlive() && in.usages().isEmpty()) {
-                killUnusedFloatingInputs(in);
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/virtual/BoxedVirtualObjectNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.virtual;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-
-
-public class BoxedVirtualObjectNode extends VirtualObjectNode implements LIRLowerable, Node.ValueNumberable {
-
-    @Input ValueNode unboxedValue;
-
-    public BoxedVirtualObjectNode(RiResolvedType type, ValueNode unboxedValue) {
-        super(type, 1);
-        this.unboxedValue = unboxedValue;
-    }
-
-
-    public ValueNode getUnboxedValue() {
-        return unboxedValue;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectFieldNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.virtual;
-
-import java.util.*;
-
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class VirtualObjectFieldNode extends ValueNode implements LIRLowerable {
-
-    @Input private VirtualObjectNode object;
-    @Input private ValueNode lastState;
-    @Input private ValueNode input;
-
-    private int index;
-
-    public VirtualObjectNode object() {
-        return object;
-    }
-
-    public ValueNode lastState() {
-        return lastState;
-    }
-
-    public ValueNode input() {
-        return input;
-    }
-
-    public VirtualObjectFieldNode(VirtualObjectNode object, ValueNode lastState, ValueNode input, int index) {
-        super(StampFactory.illegal());
-        this.index = index;
-        this.object = object;
-        this.lastState = lastState;
-        this.input = input;
-    }
-
-    public int index() {
-        return index;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // nothing to do...
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("index", index);
-        return properties;
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Name && object().fields() != null) {
-            return super.toString(Verbosity.Name) + " " + object().fields()[index].name();
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodes.virtual;
-
-import java.util.*;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-
-public class VirtualObjectNode extends ValueNode implements LIRLowerable {
-
-    @Data private RiType type;
-    private EscapeField[] fields;
-    private int fieldsCount;
-
-    public VirtualObjectNode(RiType type, EscapeField[] fields) {
-        super(StampFactory.illegal());
-        this.type = type;
-        this.fields = fields;
-        this.fieldsCount = fields.length;
-    }
-
-    public VirtualObjectNode(RiType type, int fieldCount) {
-        super(StampFactory.illegal());
-        this.type = type;
-        this.fieldsCount = fieldCount;
-    }
-
-    public RiType type() {
-        return type;
-    }
-
-    public EscapeField[] fields() {
-        return fields;
-    }
-
-    @Override
-    public void generate(LIRGeneratorTool gen) {
-        // nothing to do...
-    }
-
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("type", type);
-        return properties;
-    }
-
-    @Override
-    public String toString(Verbosity verbosity) {
-        if (verbosity == Verbosity.Name) {
-            return super.toString(Verbosity.Name) + " " + type.name();
-        } else {
-            return super.toString(verbosity);
-        }
-    }
-
-    public int fieldsCount() {
-        return fieldsCount;
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/util/ComputeImmediateDominator.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.util;
-
-import java.util.*;
-
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-
-public final class ComputeImmediateDominator {
-    private final MergeNode dominated;
-    private final Queue<FixedNode> toExplore;
-    private final Queue<FixedNode> speculativeExplore;
-    private final NodeMap<DominatorInfo> infoMap;
-    private final DominatorInfo fullInfo;
-    private FixedNode dominator;
-    private int nextBit = 1;
-
-    public ComputeImmediateDominator(MergeNode dominated) {
-        this.dominated = dominated;
-        this.toExplore = new LinkedList<>();
-        this.speculativeExplore = new LinkedList<>();
-        this.infoMap = dominated.graph().createNodeMap();
-        fullInfo = new DominatorInfo(dominated, true);
-
-        this.processMerge(dominated, fullInfo);
-        if (toExplore.size() == 1) {
-            dominator = toExplore.remove();
-        }
-    }
-
-    public FixedNode compute() {
-        try {
-            while (dominator == null && (!toExplore.isEmpty() || !speculativeExplore.isEmpty())) {
-                while (!toExplore.isEmpty()) {
-                    exploreUp(toExplore.remove());
-                    if (dominator != null) {
-                        return dominator;
-                    }
-                }
-                exploreUp(speculativeExplore.remove());
-            }
-            return dominator;
-        } catch (Throwable t) {
-            throw new GraalInternalError(t).addContext("Could not find a dominator").addContext(dominated);
-        }
-    }
-
-    private void exploreUp(FixedNode from) {
-        FixedNode p = from;
-        DominatorInfo info = infoMap.get(from);
-        if (info.isExplored()) {
-            return;
-        }
-        //TTY.println("exploreUp(" + from + ") with " + info);
-        info.setExplored();
-        while (p != null) {
-            if (p instanceof MergeNode) {
-                processMerge((MergeNode) p, info);
-                p = null;
-            } else if (p instanceof ControlSplitNode) {
-                processControlSplit((ControlSplitNode) p, info);
-                p = null;
-            } else {
-                p = (FixedNode) p.predecessor();
-            }
-        }
-    }
-
-    private void processControlSplit(ControlSplitNode cs, DominatorInfo info) {
-        //TTY.println("processControlSplit(" + cs + ", " + info + ")");
-        DominatorInfo csInfo = infoMap.get(cs);
-        if (csInfo == null) {
-            csInfo = new DominatorInfo(cs, false);
-            infoMap.set(cs, csInfo);
-        }
-        csInfo.add(info);
-        FixedNode next = (FixedNode) cs.predecessor();
-        if (checkControlSplitInfo(csInfo)) {
-            return;
-        }
-        if (csInfo.isExplored()) {
-            //TTY.println("  Already explored, propagate update");
-            propagateUpdate(csInfo);
-        } else {
-            if (csInfo.parentCount() == cs.blockSuccessorCount()) { // all paths leading to this CS have been explored
-                //TTY.println("  All parents explored, Enqueue");
-                toExplore.add(next);
-                speculativeExplore.remove(next);
-            } else {
-                //TTY.println("  Not all parents explored : Enqueue speculative");
-                speculativeExplore.add(next);
-            }
-        }
-        infoMap.set(next, csInfo);
-    }
-
-    private boolean propagateUpdate(DominatorInfo di) {
-        //TTY.println("   propagateUpdate(" + di + ")");
-        for (DominatorInfo child : di.children()) {
-            //TTY.println("      add to child " + child);
-            if (child.add(di, false)) {
-                if (child.equals(fullInfo)) {
-                    //TTY.println("   Found DOM!");
-                    dominator = child.node();
-                    return true;
-                }
-                if (propagateUpdate(child)) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    private boolean checkControlSplitInfo(DominatorInfo di) {
-        //TTY.println("   checkControlSplitInfo(" + di + ")");
-        if (di.equals(fullInfo)) {
-            dominator = di.node();
-            //TTY.println("   Found DOM!");
-            return true;
-        }
-        return false;
-    }
-
-    private void processMerge(MergeNode merge, DominatorInfo info) {
-        //TTY.println("processMerge(" + merge + ", " + info + ")");
-        for (EndNode end : merge.cfgPredecessors()) {
-            toExplore.add(end);
-            infoMap.set(end, info.createChild(end));
-            //TTY.println("  Enqueue end : " + end + " with " + infoMap.get(end));
-        }
-    }
-
-    private class DominatorInfo {
-        private final FixedNode node;
-        private final BitSet bits;
-        private final BitSet ownBits;
-        private final Collection<DominatorInfo> children;
-        private final Collection<DominatorInfo> parents;
-        private boolean explored;
-
-        public DominatorInfo(FixedNode node, boolean full) {
-            this.node = node;
-            this.bits = new BitSet();
-            this.ownBits = new BitSet();
-            this.children = new ArrayList<>(2);
-            this.parents = new ArrayList<>(2);
-            if (full) {
-                addOwnBits(0);
-            }
-        }
-
-        public boolean isExplored() {
-            return explored;
-        }
-
-        public void setExplored() {
-            explored = true;
-        }
-
-        public DominatorInfo createChild(FixedNode childNode) {
-            DominatorInfo di = new DominatorInfo(childNode, false);
-            di.bits.or(bits);
-            di.ownBits.or(ownBits);
-            if (!children.isEmpty() || di.ownBits.isEmpty()) {
-                int newBit = nextBit++;
-                di.bits.xor(ownBits);
-                di.bits.set(newBit);
-                di.ownBits.clear();
-                di.ownBits.set(newBit);
-                addOwnBits(newBit);
-            }
-            children.add(di);
-            di.parents.add(this);
-            return di;
-        }
-
-        private void addOwnBits(int newBit) {
-            if (!bits.get(newBit)) {
-                ownBits.set(newBit);
-                bits.set(newBit);
-                for (DominatorInfo parent : parents) {
-                    parent.addOwnBits(newBit);
-                }
-            }
-        }
-
-        public boolean add(DominatorInfo i) {
-            return add(i, true);
-        }
-
-        public boolean add(DominatorInfo i, boolean addParent) {
-            boolean ret = true;
-            if (addParent) {
-                parents.add(i);
-                i.children.add(this);
-                bits.or(i.bits);
-            } else {
-                BitSet newBits = (BitSet) i.bits.clone();
-                newBits.andNot(bits);
-                newBits.andNot(i.ownBits);
-                ret = !newBits.isEmpty();
-                bits.or(newBits);
-            }
-            return ret;
-        }
-
-        public int parentCount() {
-            return parents.size();
-        }
-
-
-        public FixedNode node() {
-            return node;
-        }
-
-        public Collection<DominatorInfo> children() {
-            return children;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof DominatorInfo)) {
-                return false;
-            }
-            return ((DominatorInfo) obj).bits.equals(bits);
-        }
-
-        @Override
-        public String toString() {
-            return bits + " (o" + ownBits + ") " + node;
-        }
-
-        @Override
-        public int hashCode() {
-            return bits.hashCode();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/util/NodeIterators.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.util;
-
-import java.util.*;
-
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.*;
-
-public class NodeIterators {
-
-    public static NodeIterable<FixedNode> dominators(final FixedNode n) {
-        return new NodeIterable<FixedNode>() {
-            @Override
-            public Iterator<FixedNode> iterator() {
-                return new NodeIterator<FixedNode>(){
-                    FixedNode p = n;
-                    @Override
-                    protected void forward() {
-                        if (current == null) {
-                            if (p instanceof MergeNode) {
-                                current = new ComputeImmediateDominator((MergeNode) p).compute();
-                            } else {
-                                current = (FixedNode) p.predecessor();
-                            }
-                            p = current;
-                        }
-                    }
-                };
-            }
-        };
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/graal/util/TreeIterators.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.util;
-
-import java.util.*;
-
-public class TreeIterators {
-
-    public abstract static class PrefixTreeIterator<T> implements Iterator<T>{
-        private Deque<T> stack = new LinkedList<>();
-
-        public PrefixTreeIterator(T root) {
-            stack.push(root);
-        }
-
-        public PrefixTreeIterator(Iterable<T> roots) {
-            for (T root : roots) {
-                stack.addLast(root);
-            }
-        }
-
-        @Override
-        public boolean hasNext() {
-            return !stack.isEmpty();
-        }
-
-        @Override
-        public T next() {
-            T top = stack.pop();
-            LinkedList<T> list = new LinkedList<>();
-            for (T child : children(top)) {
-                list.addFirst(child);
-            }
-            for (T child : list) {
-                stack.push(child);
-            }
-            return top;
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-
-        protected abstract Iterable<T> children(T node);
-    }
-}
--- a/graal/com.oracle.max.graal.nodes/test/test/com/oracle/graal/nodes/Main.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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 test.com.oracle.graal.nodes;
-
-
-public class Main {
-    public static void main(String[] args) {
-    }
-}
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/BasicIdealGraphPrinter.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.printer;
-
-import java.io.*;
-import java.util.*;
-import java.util.Map.Entry;
-
-/**
- * Elementary, generic generator of Ideal Graph Visualizer input for use in printers for specific data structures.
- */
-class BasicIdealGraphPrinter {
-
-    /**
-     * Edge between two nodes.
-     */
-    protected static class Edge {
-        final String from;
-        final int fromIndex;
-        final String to;
-        final int toIndex;
-        final String label;
-
-        public Edge(String from, int fromIndex, String to, int toIndex, String label) {
-            assert (from != null && to != null);
-            this.from = from;
-            this.fromIndex = fromIndex;
-            this.to = to;
-            this.toIndex = toIndex;
-            this.label = label;
-        }
-
-        @Override
-        public int hashCode() {
-            int h = from.hashCode() ^ to.hashCode();
-            h = 3 * h + fromIndex;
-            h = 5 * h + toIndex;
-            if (label != null) {
-                h ^= label.hashCode();
-            }
-            return h;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj == this) {
-                return true;
-            }
-            if (obj instanceof Edge) {
-                Edge other = (Edge) obj;
-                return from.equals(other.from)
-                        && fromIndex == other.fromIndex
-                        && to.equals(other.to)
-                        && toIndex == other.toIndex
-                        && (label == other.label || (label != null && label.equals(other.label)));
-            }
-            return false;
-        }
-    }
-
-    private final PrintStream stream;
-
-    /**
-     * Creates a new {@link IdealGraphPrinter} that writes to the specified output stream.
-     */
-    protected BasicIdealGraphPrinter(OutputStream stream) {
-        try {
-            this.stream = new PrintStream(stream, false, "US-ASCII");
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Flushes any buffered output.
-     */
-    protected void flush() {
-        stream.flush();
-    }
-
-    /**
-     * Starts a new graph document.
-     */
-    protected void begin() {
-        stream.println("<graphDocument>");
-    }
-
-    protected void beginGroup() {
-        stream.println("<group>");
-    }
-
-    protected void beginMethod(String name, String shortName, int bci) {
-        stream.printf(" <method name='%s' shortName='%s' bci='%d'>%n", escape(name), escape(shortName), bci);
-    }
-
-    protected void beginBytecodes() {
-        stream.println("  <bytecodes>\n<![CDATA[");
-    }
-
-    protected void printBytecode(int bci, String mnemonic, int[] extra) {
-        stream.print(bci);
-        stream.print(' ');
-        stream.print(mnemonic);
-        if (extra != null) {
-            for (int b : extra) {
-                stream.print(' ');
-                stream.print(b);
-            }
-        }
-        stream.println();
-    }
-
-    protected void endBytecodes() {
-        stream.println("  ]]></bytecodes>");
-    }
-
-    protected void endMethod() {
-        stream.println(" </method>");
-    }
-
-    protected void beginGraph(String title) {
-        stream.printf(" <graph name='%s'>%n", escape(title));
-    }
-
-    protected void beginProperties() {
-        stream.print("<properties>");
-    }
-
-    protected void printProperty(String name, String value) {
-        stream.printf("<p name='%s'>%s</p>", escape(name), escape(value));
-    }
-
-    protected void endProperties() {
-        stream.print("</properties>");
-    }
-
-    protected void printProperties(Map<String, String> properties) {
-        beginProperties();
-        for (Entry<String, String> entry : properties.entrySet()) {
-            printProperty(entry.getKey(), entry.getValue());
-        }
-        endProperties();
-    }
-
-    protected void beginNodes() {
-        stream.println("  <nodes>");
-    }
-
-    protected void beginNode(String id) {
-        stream.printf("   <node id='%s'>", escape(id));
-    }
-
-    protected void endNode() {
-        stream.println("   </node>");
-    }
-
-    protected void printNode(String id, Map<String, String> properties) {
-        beginNode(id);
-        if (properties != null) {
-            printProperties(properties);
-        }
-        endNode();
-    }
-
-    protected void endNodes() {
-        stream.println("  </nodes>");
-    }
-
-    protected void beginEdges() {
-        stream.println("  <edges>");
-    }
-
-    protected void printEdge(Edge edge) {
-        stream.printf("   <edge from='%s' fromIndex='%d' to='%s' toIndex='%d' label='%s' />%n", escape(edge.from), edge.fromIndex, escape(edge.to), edge.toIndex, escape(edge.label));
-    }
-
-    protected void endEdges() {
-        stream.println("  </edges>");
-    }
-
-    protected void beginControlFlow() {
-        stream.println("  <controlFlow>");
-    }
-
-    protected void beginBlock(String name) {
-        stream.printf("   <block name='%s'>%n", escape(name));
-    }
-
-    protected void beginSuccessors() {
-        stream.println("    <successors>");
-    }
-
-    protected void printSuccessor(String name) {
-        stream.printf("     <successor name='%s'/>%n", escape(name));
-    }
-
-    protected void endSuccessors() {
-        stream.println("    </successors>");
-    }
-
-    protected void beginBlockNodes() {
-        stream.println("    <nodes>");
-    }
-
-    protected void printBlockNode(String nodeId) {
-        stream.printf("     <node id='%s'/>%n", escape(nodeId));
-    }
-
-    protected void endBlockNodes() {
-        stream.println("    </nodes>");
-    }
-
-    protected void endBlock() {
-        stream.println("   </block>");
-    }
-
-    protected void endControlFlow() {
-        stream.println("  </controlFlow>");
-    }
-
-    protected void endGraph() {
-        stream.println(" </graph>");
-    }
-
-    /**
-     * Ends the current group.
-     */
-    protected void endGroup() {
-        stream.println("</group>");
-    }
-
-    /**
-     * Finishes the graph document and flushes the output stream.
-     */
-    protected void end() {
-        stream.println("</graphDocument>");
-        flush();
-    }
-
-
-    public boolean isValid() {
-        return !stream.checkError();
-    }
-
-
-    private static String escape(String s) {
-        StringBuilder str = null;
-        for (int i = 0; i < s.length(); i++) {
-            char c = s.charAt(i);
-            switch (c) {
-                case '&':
-                case '<':
-                case '>':
-                case '"':
-                case '\'':
-                    if (str == null) {
-                        str = new StringBuilder();
-                        str.append(s, 0, i);
-                    }
-                    switch(c) {
-                        case '&':
-                            str.append("&amp;");
-                            break;
-                        case '<':
-                            str.append("&lt;");
-                            break;
-                        case '>':
-                            str.append("&gt;");
-                            break;
-                        case '"':
-                            str.append("&quot;");
-                            break;
-                        case '\'':
-                            str.append("&apos;");
-                            break;
-                        default:
-                            assert false;
-                    }
-                    break;
-                default:
-                    if (str != null) {
-                        str.append(c);
-                    }
-                    break;
-            }
-        }
-        if (str == null) {
-            return s;
-        } else {
-            return str.toString();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,563 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.printer;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import java.io.*;
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.alloc.util.*;
-import com.oracle.graal.compiler.alloc.*;
-import com.oracle.graal.compiler.alloc.Interval.UsePosList;
-import com.oracle.graal.compiler.gen.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.Verbosity;
-import com.oracle.graal.graph.NodeClass.NodeClassIterator;
-import com.oracle.graal.graph.NodeClass.Position;
-import com.oracle.graal.java.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-
-/**
- * Utility for printing Graal IR at various compilation phases.
- */
-class CFGPrinter extends CompilationPrinter {
-
-    protected CiTarget target;
-    protected LIR lir;
-    protected LIRGenerator lirGenerator;
-    protected ControlFlowGraph cfg;
-
-    /**
-     * Creates a control flow graph printer.
-     *
-     * @param buffer where the output generated via this printer shown be written
-     */
-    public CFGPrinter(OutputStream out) {
-        super(out);
-    }
-
-    /**
-     * Prints the control flow graph denoted by a given block map.
-     *
-     * @param label A label describing the compilation phase that produced the control flow graph.
-     * @param blockMap A data structure describing the blocks in a method and how they are connected.
-     */
-    public void printCFG(String label, BciBlockMapping blockMap) {
-        begin("cfg");
-        out.print("name \"").print(label).println('"');
-        for (BciBlockMapping.Block block : blockMap.blocks) {
-            begin("block");
-            printBlock(block);
-            end("block");
-        }
-        end("cfg");
-    }
-
-    private void printBlock(BciBlockMapping.Block block) {
-        out.print("name \"B").print(block.startBci).println('"');
-        out.print("from_bci ").println(block.startBci);
-        out.print("to_bci ").println(block.endBci);
-
-        out.println("predecessors ");
-
-        out.print("successors ");
-        for (BciBlockMapping.Block succ : block.successors) {
-            if (!succ.isExceptionEntry) {
-                out.print("\"B").print(succ.startBci).print("\" ");
-            }
-        }
-        out.println();
-
-        out.print("xhandlers");
-        for (BciBlockMapping.Block succ : block.successors) {
-            if (succ.isExceptionEntry) {
-                out.print("\"B").print(succ.startBci).print("\" ");
-            }
-        }
-        out.println();
-
-        out.print("flags ");
-        if (block.isExceptionEntry) {
-            out.print("\"ex\" ");
-        }
-        if (block.isLoopHeader) {
-            out.print("\"plh\" ");
-        }
-        out.println();
-
-        out.print("loop_depth ").println(Long.bitCount(block.loops));
-    }
-
-
-    private NodeMap<Block> latestScheduling;
-    private NodeBitMap printedNodes;
-
-    private boolean inFixedSchedule(Node node) {
-        return lir != null || node.isDeleted() || cfg.getNodeToBlock().get(node) != null;
-    }
-
-    /**
-     * Prints the specified list of blocks.
-     *
-     * @param label A label describing the compilation phase that produced the control flow graph.
-     * @param blocks The list of blocks to be printed.
-     */
-    public void printCFG(String label, List<Block> blocks) {
-        if (lir == null) {
-            latestScheduling = new NodeMap<>(cfg.getNodeToBlock());
-            for (Block block : blocks) {
-                Node cur = block.getBeginNode();
-                while (true) {
-                    assert inFixedSchedule(cur) && latestScheduling.get(cur) == block;
-                    scheduleInputs(cur, block);
-
-                    if (cur == block.getEndNode()) {
-                        break;
-                    }
-                    assert cur.successors().count() == 1;
-                    cur = cur.successors().first();
-                }
-            }
-        }
-        printedNodes = new NodeBitMap(cfg.graph);
-
-        begin("cfg");
-        out.print("name \"").print(label).println('"');
-        for (Block block : blocks) {
-            printBlock(block);
-        }
-        end("cfg");
-
-        latestScheduling = null;
-        printedNodes = null;
-    }
-
-    private void scheduleInputs(Node node, Block nodeBlock) {
-        if (node instanceof PhiNode) {
-            PhiNode phi = (PhiNode) node;
-            assert nodeBlock.getBeginNode() == phi.merge();
-            for (Block pred : nodeBlock.getPredecessors()) {
-                schedule(phi.valueAt((EndNode) pred.getEndNode()), pred);
-            }
-
-        } else {
-            for (Node input : node.inputs()) {
-                schedule(input, nodeBlock);
-            }
-        }
-    }
-
-    private void schedule(Node input, Block block) {
-        if (!inFixedSchedule(input)) {
-            Block inputBlock = block;
-            if (latestScheduling.get(input) != null) {
-                inputBlock = ControlFlowGraph.commonDominator(inputBlock, latestScheduling.get(input));
-            }
-            if (inputBlock != latestScheduling.get(input)) {
-                latestScheduling.set(input, inputBlock);
-                scheduleInputs(input, inputBlock);
-            }
-        }
-    }
-
-    private void printBlock(Block block) {
-        begin("block");
-
-        out.print("name \"").print(blockToString(block)).println('"');
-        out.println("from_bci -1");
-        out.println("to_bci -1");
-
-        out.print("predecessors ");
-        for (Block pred : block.getPredecessors()) {
-            out.print("\"").print(blockToString(pred)).print("\" ");
-        }
-        out.println();
-
-        out.print("successors ");
-        for (Block succ : block.getSuccessors()) {
-            if (!succ.isExceptionEntry()) {
-                out.print("\"").print(blockToString(succ)).print("\" ");
-            }
-        }
-        out.println();
-
-        out.print("xhandlers");
-        for (Block succ : block.getSuccessors()) {
-            if (succ.isExceptionEntry()) {
-                out.print("\"").print(blockToString(succ)).print("\" ");
-            }
-        }
-        out.println();
-
-        out.print("flags ");
-        if (block.isLoopHeader()) {
-            out.print("\"llh\" ");
-        }
-        if (block.isLoopEnd()) {
-            out.print("\"lle\" ");
-        }
-        if (block.isExceptionEntry()) {
-            out.print("\"ex\" ");
-        }
-        out.println();
-
-        if (block.getLoop() != null) {
-            out.print("loop_index ").println(block.getLoop().index);
-            out.print("loop_depth ").println(block.getLoop().depth);
-        }
-
-        printNodes(block);
-        printLIR(block);
-        end("block");
-    }
-
-    private void printNodes(Block block) {
-        begin("IR");
-        out.println("HIR");
-        out.disableIndentation();
-
-        if (block.getPredecessors().size() == 0) {
-            // Currently method parameters are not in the schedule, so print them separately here.
-            for (ValueNode param : block.getBeginNode().graph().getNodes(LocalNode.class)) {
-                printNode(param, false);
-            }
-        }
-        if (block.getBeginNode() instanceof MergeNode) {
-            // Currently phi functions are not in the schedule, so print them separately here.
-            for (ValueNode phi : ((MergeNode) block.getBeginNode()).phis()) {
-                printNode(phi, false);
-            }
-        }
-
-        if (lir != null) {
-            for (Node node : lir.nodesFor(block)) {
-                printNode(node, false);
-            }
-        } else {
-            Node cur = block.getBeginNode();
-            while (true) {
-                printNode(cur, false);
-
-                if (cur == block.getEndNode()) {
-                    for (Map.Entry<Node, Block> entry : latestScheduling.entries()) {
-                        if (entry.getValue() == block && !inFixedSchedule(entry.getKey()) && !printedNodes.isMarked(entry.getKey())) {
-                            printNode(entry.getKey(), true);
-                        }
-                    }
-                    break;
-                }
-                assert cur.successors().count() == 1;
-                cur = cur.successors().first();
-            }
-
-        }
-
-        out.enableIndentation();
-        end("IR");
-    }
-
-    private void printNode(Node node, boolean unscheduled) {
-        assert !printedNodes.isMarked(node);
-        printedNodes.mark(node);
-
-        if (!(node instanceof PhiNode)) {
-            for (Node input : node.inputs()) {
-                if (!inFixedSchedule(input) && !printedNodes.isMarked(input)) {
-                    printNode(input, true);
-                }
-            }
-        }
-
-        if (unscheduled) {
-            assert lir == null : "unscheduled nodes can only be present before LIR generation";
-            out.print("f ").print(HOVER_START).print("u").print(HOVER_SEP).print("unscheduled").print(HOVER_END).println(COLUMN_END);
-        } else if (node instanceof FixedWithNextNode) {
-            out.print("f ").print(HOVER_START).print("#").print(HOVER_SEP).print("fixed with next").print(HOVER_END).println(COLUMN_END);
-        } else if (node instanceof FixedNode) {
-            out.print("f ").print(HOVER_START).print("*").print(HOVER_SEP).print("fixed").print(HOVER_END).println(COLUMN_END);
-        } else if (node instanceof FloatingNode) {
-            out.print("f ").print(HOVER_START).print("~").print(HOVER_SEP).print("floating").print(HOVER_END).println(COLUMN_END);
-        }
-        out.print("tid ").print(nodeToString(node)).println(COLUMN_END);
-
-        if (lirGenerator != null) {
-            CiValue operand = lirGenerator.nodeOperands.get(node);
-            if (operand != null) {
-                out.print("result ").print(operand.toString()).println(COLUMN_END);
-            }
-        }
-
-        if (node instanceof StateSplit) {
-            StateSplit stateSplit = (StateSplit) node;
-            if (stateSplit.stateAfter() != null) {
-                String state = stateToString(stateSplit.stateAfter());
-                out.print("st ").print(HOVER_START).print("st").print(HOVER_SEP).print(state).print(HOVER_END).println(COLUMN_END);
-            }
-        }
-
-        Map<Object, Object> props = new TreeMap<>(node.getDebugProperties());
-        out.print("d ").print(HOVER_START).print("d").print(HOVER_SEP);
-        out.println("=== Debug Properties ===");
-        for (Map.Entry<Object, Object> entry : props.entrySet()) {
-            out.print(entry.getKey().toString()).print(": ").print(entry.getValue() == null ? "[null]" : entry.getValue().toString()).println();
-        }
-        out.println("=== Inputs ===");
-        printNamedNodes(node, node.inputs().iterator(), "", "\n", null);
-        out.println("=== Succesors ===");
-        printNamedNodes(node, node.successors().iterator(), "", "\n", null);
-        out.println("=== Usages ===");
-        if (!node.usages().isEmpty()) {
-            for (Node usage : node.usages()) {
-                out.print(nodeToString(usage)).print(" ");
-            }
-            out.println();
-        }
-        out.println("=== Predecessor ===");
-        out.print(nodeToString(node.predecessor())).print(" ");
-        out.print(HOVER_END).println(COLUMN_END);
-
-        out.print("instruction ");
-        out.print(HOVER_START).print(node.getNodeClass().shortName()).print(HOVER_SEP).print(node.getClass().getName()).print(HOVER_END).print(" ");
-        printNamedNodes(node, node.inputs().iterator(), "", "", "#NDF");
-        printNamedNodes(node, node.successors().iterator(), "#", "", "#NDF");
-        for (Map.Entry<Object, Object> entry : props.entrySet()) {
-            String key = entry.getKey().toString();
-            if (key.startsWith("data.") && !key.equals("data.stamp")) {
-                out.print(key.substring("data.".length())).print(": ").print(entry.getValue() == null ? "[null]" : entry.getValue().toString()).print(" ");
-            }
-        }
-        out.print(COLUMN_END).print(' ').println(COLUMN_END);
-    }
-
-    private void printNamedNodes(Node node, NodeClassIterator iter, String prefix, String suffix, String hideSuffix) {
-        int lastIndex = -1;
-        while (iter.hasNext()) {
-            Position pos = iter.nextPosition();
-            if (hideSuffix != null && node.getNodeClass().getName(pos).endsWith(hideSuffix)) {
-                continue;
-            }
-
-            if (pos.index != lastIndex) {
-                if (lastIndex != -1) {
-                    out.print(suffix);
-                }
-                out.print(prefix).print(node.getNodeClass().getName(pos)).print(": ");
-                lastIndex = pos.index;
-            }
-            out.print(nodeToString(node.getNodeClass().get(node, pos))).print(" ");
-        }
-        if (lastIndex != -1) {
-            out.print(suffix);
-        }
-    }
-
-    private String stateToString(FrameState state) {
-        StringBuilder buf = new StringBuilder();
-        FrameState curState = state;
-        do {
-            buf.append(CiUtil.toLocation(curState.method(), curState.bci)).append('\n');
-
-            if (curState.stackSize() > 0) {
-                buf.append("stack: ");
-                for (int i = 0; i < curState.stackSize(); i++) {
-                    buf.append(stateValueToString(curState.stackAt(i))).append(' ');
-                }
-                buf.append("\n");
-            }
-
-            buf.append("locals: ");
-            for (int i = 0; i < curState.localsSize(); i++) {
-                buf.append(stateValueToString(curState.localAt(i))).append(' ');
-            }
-            buf.append("\n");
-
-            curState = curState.outerFrameState();
-        } while (curState != null);
-
-        return buf.toString();
-    }
-
-    private String stateValueToString(ValueNode value) {
-        String result = nodeToString(value);
-        if (lirGenerator != null && lirGenerator.nodeOperands != null && value != null) {
-            CiValue operand = lirGenerator.nodeOperands.get(value);
-            if (operand != null) {
-                result += ": " + operand;
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Prints the LIR for each instruction in a given block.
-     *
-     * @param block the block to print
-     */
-    private void printLIR(Block block) {
-        List<LIRInstruction> lirInstructions = block.lir;
-        if (lirInstructions == null) {
-            return;
-        }
-
-        begin("IR");
-        out.println("LIR");
-
-        for (int i = 0; i < lirInstructions.size(); i++) {
-            LIRInstruction inst = lirInstructions.get(i);
-            out.printf("nr %4d ", inst.id()).print(COLUMN_END);
-
-            if (inst.info != null) {
-                int level = out.indentationLevel();
-                out.adjustIndentation(-level);
-                String state;
-                if (inst.info.hasDebugInfo()) {
-                    state = debugInfoToString(inst.info.debugInfo().codePos, inst.info.debugInfo().registerRefMap, inst.info.debugInfo().frameRefMap, target.arch);
-                } else {
-                    state = debugInfoToString(inst.info.topFrame, null, null, target.arch);
-                }
-                if (state != null) {
-                    out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(state).print(HOVER_END).print(COLUMN_END);
-                }
-                out.adjustIndentation(level);
-            }
-
-            out.print(" instruction ").print(inst.toString()).print(COLUMN_END);
-            out.println(COLUMN_END);
-        }
-        end("IR");
-    }
-
-    private String nodeToString(Node node) {
-        if (node == null) {
-            return "-";
-        }
-        String prefix;
-        if (node instanceof BeginNode && lir == null) {
-            prefix = "B";
-        } else if (node instanceof ValueNode) {
-            ValueNode value = (ValueNode) node;
-            if (value.kind() == CiKind.Illegal) {
-                prefix = "v";
-            } else {
-                prefix = String.valueOf(value.kind().typeChar);
-            }
-        } else {
-            prefix = "?";
-        }
-        return prefix + node.toString(Verbosity.Id);
-    }
-
-    private String blockToString(Block block) {
-        if (lir == null) {
-            // During all the front-end phases, the block schedule is built only for the debug output.
-            // Therefore, the block numbers would be different for every CFG printed -> use the id of the first instruction.
-            return "B" + block.getBeginNode().toString(Verbosity.Id);
-        } else {
-            // LIR instructions contain references to blocks and these blocks are printed as the blockID -> use the blockID.
-            return "B" + block.getId();
-        }
-    }
-
-
-    public void printIntervals(String label, Interval[] intervals) {
-        begin("intervals");
-        out.println(String.format("name \"%s\"", label));
-
-        for (Interval interval : intervals) {
-            if (interval != null) {
-                printInterval(interval);
-            }
-        }
-
-        end("intervals");
-    }
-
-    private void printInterval(Interval interval) {
-        out.printf("%s %s ", interval.operand, (isRegister(interval.operand) ? "fixed" : interval.kind().name()));
-        if (isRegister(interval.operand)) {
-            out.printf("\"[%s|%c]\"", interval.operand, interval.operand.kind.typeChar);
-        } else {
-            if (interval.location() != null) {
-                out.printf("\"[%s|%c]\"", interval.location(), interval.location().kind.typeChar);
-            }
-        }
-
-        Interval hint = interval.locationHint(false);
-        out.printf("%s %s ", interval.splitParent().operand, hint != null ? hint.operand : -1);
-
-        // print ranges
-        Range cur = interval.first();
-        while (cur != Range.EndMarker) {
-            out.printf("[%d, %d[", cur.from, cur.to);
-            cur = cur.next;
-            assert cur != null : "range list not closed with range sentinel";
-        }
-
-        // print use positions
-        int prev = 0;
-        UsePosList usePosList = interval.usePosList();
-        for (int i = usePosList.size() - 1; i >= 0; --i) {
-            assert prev < usePosList.usePos(i) : "use positions not sorted";
-            out.printf("%d %s ", usePosList.usePos(i), usePosList.registerPriority(i));
-            prev = usePosList.usePos(i);
-        }
-
-        out.printf(" \"%s\"", interval.spillState());
-        out.println();
-    }
-
-    public void printIntervals(String label, IntervalPrinter.Interval[] intervals) {
-        begin("intervals");
-        out.println(String.format("name \"%s\"", label));
-
-        for (IntervalPrinter.Interval interval : intervals) {
-            printInterval(interval);
-        }
-
-        end("intervals");
-    }
-
-    private void printInterval(IntervalPrinter.Interval interval) {
-        out.printf("%s %s \"%s\" %s %s ", interval.name, interval.type, interval.description, interval.variable, "no");
-        if (interval.ranges.size() == 0) {
-            // One range is required in the spec, so output a dummy range.
-            out.printf("[0, 0[ ");
-        } else {
-            for (IntervalPrinter.Range range : interval.ranges) {
-                out.printf("[%d, %d[ ", range.from, range.to);
-            }
-        }
-        for (IntervalPrinter.UsePosition usePos : interval.uses) {
-            out.printf("%d %s ", usePos.pos, usePos.kind);
-        }
-        out.printf("\"%s\"", "no");
-        out.println();
-    }
-}
-
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.printer;
-
-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.graal.alloc.util.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.alloc.*;
-import com.oracle.graal.compiler.gen.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.java.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * Observes compilation events and uses {@link CFGPrinter} to produce a control flow graph for the <a
- * href="http://java.net/projects/c1visualizer/">C1 Visualizer</a>.
- */
-public class CFGPrinterObserver implements DebugDumpHandler {
-
-    private CFGPrinter cfgPrinter;
-    private Graph curGraph;
-
-    @Override
-    public void dump(Object object, String message) {
-        try {
-            dumpSandboxed(object, message);
-        } catch (Throwable ex) {
-            TTY.println("CFGPrinter: Exception during output of " + message + ": " + ex);
-        }
-    }
-
-    public void dumpSandboxed(Object object, String message) {
-        GraalCompiler compiler = Debug.contextLookup(GraalCompiler.class);
-        if (compiler == null) {
-            return;
-        }
-
-        if (cfgPrinter == null) {
-            File file = new File("compilations-" + System.currentTimeMillis() + ".cfg");
-            try {
-                OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
-                cfgPrinter = new CFGPrinter(out);
-            } catch (FileNotFoundException e) {
-                throw new GraalInternalError("Could not open " + file.getAbsolutePath());
-            }
-            TTY.println("CFGPrinter: Output to file %s", file);
-        }
-
-        StructuredGraph newGraph = Debug.contextLookup(StructuredGraph.class);
-        if (newGraph != curGraph) {
-            cfgPrinter.printCompilation(newGraph.method());
-            TTY.println("CFGPrinter: Dumping method %s", newGraph.method());
-            curGraph = newGraph;
-        }
-
-        cfgPrinter.target = compiler.target;
-        if (object instanceof LIR) {
-            cfgPrinter.lir = (LIR) object;
-        } else {
-            cfgPrinter.lir = Debug.contextLookup(LIR.class);
-        }
-        cfgPrinter.lirGenerator = Debug.contextLookup(LIRGenerator.class);
-        if (cfgPrinter.lir != null) {
-            cfgPrinter.cfg = cfgPrinter.lir.cfg;
-        }
-
-        RiRuntime runtime = compiler.runtime;
-
-        if (object instanceof BciBlockMapping) {
-            BciBlockMapping blockMap = (BciBlockMapping) object;
-            cfgPrinter.printCFG(message, blockMap);
-            cfgPrinter.printBytecodes(runtime.disassemble(blockMap.method));
-
-        } else if (object instanceof LIR) {
-            cfgPrinter.printCFG(message, cfgPrinter.lir.codeEmittingOrder());
-
-        } else if (object instanceof StructuredGraph) {
-            if (cfgPrinter.cfg == null) {
-                cfgPrinter.cfg = ControlFlowGraph.compute((StructuredGraph) object, true, true, true, false);
-            }
-            cfgPrinter.printCFG(message, Arrays.asList(cfgPrinter.cfg.getBlocks()));
-
-        } else if (object instanceof CiTargetMethod) {
-            cfgPrinter.printMachineCode(runtime.disassemble((CiTargetMethod) object), null);
-
-        } else if (object instanceof Interval[]) {
-            cfgPrinter.printIntervals(message, (Interval[]) object);
-
-        } else if (object instanceof IntervalPrinter.Interval[]) {
-            cfgPrinter.printIntervals(message, (IntervalPrinter.Interval[]) object);
-        }
-
-        cfgPrinter.target = null;
-        cfgPrinter.lir = null;
-        cfgPrinter.lirGenerator = null;
-        cfgPrinter.cfg = null;
-        cfgPrinter.flush();
-    }
-}
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,278 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.printer;
-
-import java.io.*;
-import java.util.*;
-import java.util.Map.Entry;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.schedule.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.Verbosity;
-import com.oracle.graal.graph.NodeClass.NodeClassIterator;
-import com.oracle.graal.graph.NodeClass.Position;
-import com.oracle.graal.java.bytecode.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a
- * href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>.
- */
-class IdealGraphPrinter extends BasicIdealGraphPrinter {
-    /**
-     * Creates a new {@link IdealGraphPrinter} that writes to the specified output stream.
-     */
-    public IdealGraphPrinter(OutputStream stream) {
-        super(stream);
-    }
-
-    /**
-     * Starts a new group of graphs with the given name, short name and method byte code index (BCI) as properties.
-     */
-    public void beginGroup(String name, String shortName, RiResolvedMethod method, int bci) {
-        beginGroup();
-        beginProperties();
-        printProperty("name", name);
-        endProperties();
-        beginMethod(name, shortName, bci);
-        if (method != null) {
-            beginBytecodes();
-            BytecodeStream bytecodes = new BytecodeStream(method.code());
-            while (bytecodes.currentBC() != Bytecodes.END) {
-                int startBCI = bytecodes.currentBCI();
-                String mnemonic = Bytecodes.nameOf(bytecodes.currentBC());
-                int[] extra = null;
-                if (bytecodes.nextBCI() > startBCI + 1) {
-                    extra = new int[bytecodes.nextBCI() - (startBCI + 1)];
-                    for (int i = 0; i < extra.length; i++) {
-                        extra[i] = bytecodes.readUByte(startBCI + 1 + i);
-                    }
-                }
-                printBytecode(startBCI, mnemonic, extra);
-                bytecodes.next();
-            }
-            endBytecodes();
-        }
-        endMethod();
-    }
-
-    public void print(Graph graph, String title) {
-        print(graph, title, null);
-    }
-
-    /**
-     * Prints an entire {@link Graph} with the specified title, optionally using short names for nodes.
-     */
-    public void print(Graph graph, String title, SchedulePhase predefinedSchedule) {
-        beginGraph(title);
-        Set<Node> noBlockNodes = new HashSet<>();
-        SchedulePhase schedule = predefinedSchedule;
-        if (schedule == null) {
-            try {
-                schedule = new SchedulePhase();
-                schedule.apply((StructuredGraph) graph);
-            } catch (Throwable t) {
-                schedule = null;
-            }
-        }
-
-        beginNodes();
-        List<Edge> edges = printNodes(graph, schedule == null ? null : schedule.getCFG().getNodeToBlock(), noBlockNodes);
-        endNodes();
-
-        beginEdges();
-        for (Edge edge : edges) {
-            printEdge(edge);
-        }
-        endEdges();
-
-        if (schedule != null) {
-            beginControlFlow();
-            for (Block block : schedule.getCFG().getBlocks()) {
-                printBlock(graph, block, schedule.getCFG().getNodeToBlock());
-            }
-            printNoBlock(noBlockNodes);
-            endControlFlow();
-        }
-
-        endGraph();
-        flush();
-    }
-
-    private List<Edge> printNodes(Graph graph, NodeMap<Block> nodeToBlock, Set<Node> noBlockNodes) {
-        ArrayList<Edge> edges = new ArrayList<>();
-
-        NodeMap<Set<Entry<String, Integer>>> colors = graph.createNodeMap();
-        NodeMap<Set<Entry<String, String>>> colorsToString = graph.createNodeMap();
-        NodeMap<Set<String>> bits = graph.createNodeMap();
-
-        for (Node node : graph.getNodes()) {
-
-            beginNode(node.toString(Verbosity.Id));
-            beginProperties();
-            printProperty("idx", node.toString(Verbosity.Id));
-
-            Map<Object, Object> props = node.getDebugProperties();
-            if (!props.containsKey("name") || props.get("name").toString().trim().length() == 0) {
-                String name = node.toString(Verbosity.Name);
-                printProperty("name", name);
-            }
-            printProperty("class", node.getClass().getSimpleName());
-            Block block = nodeToBlock == null ? null : nodeToBlock.get(node);
-            if (block != null) {
-                printProperty("block", Integer.toString(block.getId()));
-//                if (!(node instanceof PhiNode || node instanceof FrameState || node instanceof LocalNode) && !block.nodes().contains(node)) {
-//                    printProperty("notInOwnBlock", "true");
-//                }
-            } else {
-                printProperty("block", "noBlock");
-                noBlockNodes.add(node);
-            }
-
-            Set<Entry<String, Integer>> nodeColors = colors.get(node);
-            if (nodeColors != null) {
-                for (Entry<String, Integer> color : nodeColors) {
-                    String name = color.getKey();
-                    Integer value = color.getValue();
-                    printProperty(name, Integer.toString(value));
-                }
-            }
-            Set<Entry<String, String>> nodeColorStrings = colorsToString.get(node);
-            if (nodeColorStrings != null) {
-                for (Entry<String, String> color : nodeColorStrings) {
-                    String name = color.getKey();
-                    String value = color.getValue();
-                    printProperty(name, value);
-                }
-            }
-            Set<String> nodeBits = bits.get(node);
-            if (nodeBits != null) {
-                for (String bit : nodeBits) {
-                    printProperty(bit, "true");
-                }
-            }
-
-            for (Entry<Object, Object> entry : props.entrySet()) {
-                String key = entry.getKey().toString();
-                String value = entry.getValue() == null ? "null" : entry.getValue().toString();
-                printProperty(key, value);
-            }
-
-            endProperties();
-            endNode();
-
-            // successors
-            int fromIndex = 0;
-            NodeClassIterator succIter = node.successors().iterator();
-            while (succIter.hasNext()) {
-                Position position = succIter.nextPosition();
-                Node successor = node.getNodeClass().get(node, position);
-                if (successor != null) {
-                    edges.add(new Edge(node.toString(Verbosity.Id), fromIndex, successor.toString(Verbosity.Id), 0, node.getNodeClass().getName(position)));
-                }
-                fromIndex++;
-            }
-
-            // inputs
-            int toIndex = 1;
-            NodeClassIterator inputIter = node.inputs().iterator();
-            while (inputIter.hasNext()) {
-                Position position = inputIter.nextPosition();
-                Node input = node.getNodeClass().get(node, position);
-                if (input != null) {
-                    edges.add(new Edge(input.toString(Verbosity.Id), input.successors().count(), node.toString(Verbosity.Id), toIndex, node.getNodeClass().getName(position)));
-                }
-                toIndex++;
-            }
-        }
-
-        return edges;
-    }
-
-    private void printBlock(Graph graph, Block block, NodeMap<Block> nodeToBlock) {
-        beginBlock(Integer.toString(block.getId()));
-        beginSuccessors();
-        for (Block sux : block.getSuccessors()) {
-            if (sux != null) {
-                printSuccessor(Integer.toString(sux.getId()));
-            }
-        }
-        endSuccessors();
-        beginBlockNodes();
-
-        Set<Node> nodes = new HashSet<>();
-
-        if (nodeToBlock != null) {
-            for (Node n : graph.getNodes()) {
-                Block blk = nodeToBlock.get(n);
-                if (blk == block) {
-                    nodes.add(n);
-                }
-            }
-        }
-
-        if (nodes.size() > 0) {
-            // if this is the first block: add all locals to this block
-            if (block.getBeginNode() == ((StructuredGraph) graph).start()) {
-                for (Node node : graph.getNodes()) {
-                    if (node instanceof LocalNode) {
-                        nodes.add(node);
-                    }
-                }
-            }
-
-            Set<Node> snapshot = new HashSet<>(nodes);
-            // add all framestates and phis to their blocks
-            for (Node node : snapshot) {
-                if (node instanceof StateSplit && ((StateSplit) node).stateAfter() != null) {
-                    nodes.add(((StateSplit) node).stateAfter());
-                }
-                if (node instanceof MergeNode) {
-                    for (PhiNode phi : ((MergeNode) node).phis()) {
-                        nodes.add(phi);
-                    }
-                }
-            }
-
-            for (Node node : nodes) {
-                printBlockNode(node.toString(Verbosity.Id));
-            }
-        }
-        endBlockNodes();
-        endBlock();
-    }
-
-    private void printNoBlock(Set<Node> noBlockNodes) {
-        if (!noBlockNodes.isEmpty()) {
-            beginBlock("noBlock");
-            beginBlockNodes();
-            for (Node node : noBlockNodes) {
-                printBlockNode(node.toString(Verbosity.Id));
-            }
-            endBlockNodes();
-            endBlock();
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.printer;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.criutils.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-
-/**
- * Observes compilation events and uses {@link IdealGraphPrinter} to generate a graph representation that can be
- * inspected with the <a href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>.
- */
-public class IdealGraphPrinterDumpHandler implements DebugDumpHandler {
-
-    private static final String DEFAULT_FILE_NAME = "output.igv.xml";
-
-    private IdealGraphPrinter printer;
-    private List<String> previousInlineContext = new ArrayList<>();
-    private String fileName;
-    private String host;
-    private int port;
-    private boolean initialized;
-
-    /**
-     * Creates a new {@link IdealGraphPrinterDumpHandler} that writes output to a file named after the compiled method.
-     */
-    public IdealGraphPrinterDumpHandler() {
-        this.fileName = DEFAULT_FILE_NAME;
-    }
-
-    /**
-     * Creates a new {@link IdealGraphPrinterDumpHandler} that sends output to a remote IdealGraphVisualizer instance.
-     */
-    public IdealGraphPrinterDumpHandler(String host, int port) {
-        this.host = host;
-        this.port = port;
-    }
-
-    private void ensureInitialized() {
-        if (!initialized) {
-            initialized = true;
-            if (fileName != null) {
-                initializeFilePrinter();
-            } else {
-                initializeNetworkPrinter();
-            }
-        }
-    }
-
-    private void initializeFilePrinter() {
-        try {
-            FileOutputStream stream = new FileOutputStream(fileName);
-            printer = new IdealGraphPrinter(stream);
-            printer.begin();
-        } catch (IOException e) {
-            printer = null;
-        }
-    }
-
-    private void initializeNetworkPrinter() {
-        try {
-            Socket socket = new Socket(host, port);
-            BufferedOutputStream stream = new BufferedOutputStream(socket.getOutputStream(), 0x4000);
-            printer = new IdealGraphPrinter(stream);
-            printer.begin();
-            TTY.println("Connected to the IGV on port %d", port);
-        } catch (IOException e) {
-            TTY.println("Could not connect to the IGV on port %d: %s", port, e);
-            printer = null;
-        }
-    }
-
-    @Override
-    public void dump(Object object, final String message) {
-        if (object instanceof Graph) {
-            ensureInitialized();
-            final Graph graph = (Graph) object;
-
-            if (printer != null && printer.isValid()) {
-                // Get all current RiResolvedMethod instances in the context.
-                List<String> inlineContext = getInlineContext();
-                Debug.contextSnapshot(RiResolvedMethod.class);
-
-                // Reverse list such that inner method comes after outer method.
-                Collections.reverse(inlineContext);
-
-                // Check for method scopes that must be closed since the previous dump.
-                for (int i = 0; i < previousInlineContext.size(); ++i) {
-                    if (i >= inlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
-                        for (int j = previousInlineContext.size() - 1; j >= i; --j) {
-                            closeScope();
-                        }
-                        break;
-                    }
-                }
-
-                // Check for method scopes that must be opened since the previous dump.
-                for (int i = 0; i < inlineContext.size(); ++i) {
-                    if (i >= previousInlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
-                        for (int j = i; j < inlineContext.size(); ++j) {
-                            openScope(inlineContext.get(j));
-                        }
-                        break;
-                    }
-                }
-
-                // Save inline context for next dump.
-                previousInlineContext = inlineContext;
-
-                Debug.sandbox("PrintingGraph", new Runnable() {
-
-                    @Override
-                    public void run() {
-                        // Finally, output the graph.
-                        printer.print(graph, message);
-
-                    }
-                });
-            }
-        }
-    }
-
-    private static List<String> getInlineContext() {
-        List<String> result = new ArrayList<>();
-        for (Object o : Debug.context()) {
-            if (o instanceof RiResolvedMethod) {
-                RiResolvedMethod method = (RiResolvedMethod) o;
-                result.add(CiUtil.format("%H::%n(%p)", method));
-            } else if (o instanceof DebugDumpScope) {
-                DebugDumpScope debugDumpScope = (DebugDumpScope) o;
-                result.add(debugDumpScope.getName());
-            }
-        }
-        return result;
-    }
-
-    private void openScope(String name) {
-        printer.beginGroup(name, name, Debug.contextLookup(RiResolvedMethod.class), -1);
-    }
-
-    private void closeScope() {
-        printer.endGroup();
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/ClassSubstitution.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import java.lang.annotation.*;
-
-/**
- * Denotes a class that substitutes methods of another specified class with snippets.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface ClassSubstitution {
-
-    Class<?> value();
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/DoubleSnippets.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import com.oracle.max.cri.util.*;
-import com.oracle.graal.nodes.calc.*;
-
-/**
- * Snippets for {@link java.lang.Double} methods.
- */
-@ClassSubstitution(java.lang.Double.class)
-public class DoubleSnippets implements SnippetsInterface {
-
-    private static final long NAN_RAW_LONG_BITS = Double.doubleToRawLongBits(Double.NaN);
-
-    public static long doubleToRawLongBits(double value) {
-        @JavacBug(id = 6995200)
-        Long result = ConvertNode.convert(ConvertNode.Op.MOV_D2L, value);
-        return result;
-    }
-
-    // TODO This method is not necessary, since the JDK method does exactly this
-    public static long doubleToLongBits(double value) {
-        if (value != value) {
-            return NAN_RAW_LONG_BITS;
-        } else {
-            return doubleToRawLongBits(value);
-        }
-    }
-
-    public static double longBitsToDouble(long bits) {
-        @JavacBug(id = 6995200)
-        Double result = ConvertNode.convert(ConvertNode.Op.MOV_L2D, bits);
-        return result;
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/FloatSnippets.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import com.oracle.max.cri.util.*;
-import com.oracle.graal.nodes.calc.*;
-
-/**
- * Snippets for {@link java.lang.Float} methods.
- */
-@ClassSubstitution(java.lang.Float.class)
-public class FloatSnippets implements SnippetsInterface {
-
-    private static final int NAN_RAW_INT_BITS = Float.floatToRawIntBits(Float.NaN);
-
-    public static int floatToRawIntBits(float value) {
-        @JavacBug(id = 6995200)
-        Integer result = ConvertNode.convert(ConvertNode.Op.MOV_F2I, value);
-        return result;
-    }
-
-    // TODO This method is not necessary, since the JDK method does exactly this
-    public static int floatToIntBits(float value) {
-        if (value != value) {
-            return NAN_RAW_INT_BITS;
-        } else {
-            return floatToRawIntBits(value);
-        }
-    }
-
-    public static float intBitsToFloat(int bits) {
-        @JavacBug(id = 6995200)
-        Float result = ConvertNode.convert(ConvertNode.Op.MOV_I2F, bits);
-        return result;
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.cri.*;
-
-/**
- * Definition of the snippets that are VM-independent and can be intrinsified by Graal in any VM.
- */
-public class GraalIntrinsics {
-    public static void installIntrinsics(GraalRuntime runtime, CiTarget target, PhasePlan plan) {
-        if (GraalOptions.Intrinsify) {
-            Snippets.install(runtime, target, new MathSnippetsX86(), plan);
-            Snippets.install(runtime, target, new DoubleSnippets(), plan);
-            Snippets.install(runtime, target, new FloatSnippets(), plan);
-            Snippets.install(runtime, target, new NodeClassSnippets(), plan);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.snippets.nodes.*;
-import com.oracle.graal.snippets.nodes.MathIntrinsicNode.Operation;
-
-/**
- * Snippets for {@link java.lang.Math} methods.
- */
-@ClassSubstitution(java.lang.Math.class)
-public class MathSnippetsX86 implements SnippetsInterface {
-
-    private static final double PI_4 = 0.7853981633974483;
-
-    public static double abs(double x) {
-        return MathIntrinsicNode.compute(x, Operation.ABS);
-    }
-
-    public static double sqrt(double x) {
-        return MathIntrinsicNode.compute(x, Operation.SQRT);
-    }
-
-    public static double log(double x) {
-        return MathIntrinsicNode.compute(x, Operation.LOG);
-    }
-
-    public static double log10(double x) {
-        return MathIntrinsicNode.compute(x, Operation.LOG10);
-    }
-
-    // NOTE on snippets below:
-    //   Math.sin(), .cos() and .tan() guarantee a value within 1 ULP of the
-    //   exact result, but x87 trigonometric FPU instructions are only that
-    //   accurate within [-pi/4, pi/4]. Examine the passed value and provide
-    //   a slow path for inputs outside of that interval.
-
-    public static double sin(double x) {
-        if (abs(x) < PI_4) {
-            return MathIntrinsicNode.compute(x, Operation.SIN);
-        } else {
-            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticSin, x);
-        }
-    }
-
-    public static double cos(double x) {
-        if (abs(x) < PI_4) {
-            return MathIntrinsicNode.compute(x, Operation.COS);
-        } else {
-            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticCos, x);
-        }
-    }
-
-    public static double tan(double x) {
-        if (abs(x) < PI_4) {
-            return MathIntrinsicNode.compute(x, Operation.TAN);
-        } else {
-            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticTan, x);
-        }
-    }
-
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/NodeClassSnippets.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.extended.*;
-
-/**
- * Snippets for {@link NodeClass} methods.
- */
-@SuppressWarnings("unused")
-@ClassSubstitution(NodeClass.class)
-public class NodeClassSnippets implements SnippetsInterface {
-
-
-    private static Node getNode(Node node, long offset) {
-        return UnsafeCastNode.cast(UnsafeLoadNode.load(node, offset, CiKind.Object), Node.class);
-    }
-
-    private static NodeList<Node> getNodeList(Node node, long offset) {
-        return UnsafeCastNode.cast(UnsafeLoadNode.load(node, offset, CiKind.Object), NodeList.class);
-    }
-
-    private static void putNode(Node node, long offset, Node value) {
-        UnsafeStoreNode.store(node, offset, value, CiKind.Object);
-    }
-
-    private static void putNodeList(Node node, long offset, NodeList value) {
-        UnsafeStoreNode.store(node, offset, value, CiKind.Object);
-    }
-
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/Snippet.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import java.lang.annotation.*;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface Snippet {
-
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/Snippets.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-import java.lang.reflect.*;
-import java.util.concurrent.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.util.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.java.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-
-/**
- * Utilities for snippet installation and management.
- */
-public class Snippets {
-
-    public static void install(GraalRuntime runtime, CiTarget target, SnippetsInterface obj, PhasePlan plan) {
-        Class<? extends SnippetsInterface> clazz = obj.getClass();
-        BoxingMethodPool pool = new BoxingMethodPool(runtime);
-        if (clazz.isAnnotationPresent(ClassSubstitution.class)) {
-            installSubstitution(runtime, target, plan, clazz, pool, clazz.getAnnotation(ClassSubstitution.class).value());
-        } else {
-            installSnippets(runtime, target, plan, clazz, pool);
-        }
-    }
-
-    private static void installSnippets(GraalRuntime runtime, CiTarget target, PhasePlan plan, Class< ? extends SnippetsInterface> clazz,
-                    BoxingMethodPool pool) {
-        for (Method snippet : clazz.getDeclaredMethods()) {
-            int modifiers = snippet.getModifiers();
-            if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) {
-                throw new RuntimeException("Snippet must not be abstract or native");
-            }
-            RiResolvedMethod snippetRiMethod = runtime.getRiMethod(snippet);
-            if (snippetRiMethod.compilerStorage().get(Graph.class) == null) {
-                buildSnippetGraph(snippetRiMethod, runtime, target, pool, plan);
-            }
-        }
-    }
-
-    private static void installSubstitution(GraalRuntime runtime, CiTarget target, PhasePlan plan, Class< ? extends SnippetsInterface> clazz,
-                    BoxingMethodPool pool, Class<?> original) throws GraalInternalError {
-        for (Method snippet : clazz.getDeclaredMethods()) {
-            try {
-                Method method = original.getDeclaredMethod(snippet.getName(), snippet.getParameterTypes());
-                if (!method.getReturnType().isAssignableFrom(snippet.getReturnType())) {
-                    throw new RuntimeException("Snippet has incompatible return type");
-                }
-                int modifiers = snippet.getModifiers();
-                if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) {
-                    throw new RuntimeException("Snippet must not be abstract or native");
-                }
-                RiResolvedMethod snippetRiMethod = runtime.getRiMethod(snippet);
-                StructuredGraph graph = buildSnippetGraph(snippetRiMethod, runtime, target, pool, plan);
-                runtime.getRiMethod(method).compilerStorage().put(Graph.class, graph);
-            } catch (NoSuchMethodException e) {
-                throw new RuntimeException("Could not resolve method to substitute with: " + snippet.getName(), e);
-            }
-        }
-    }
-
-    private static StructuredGraph buildSnippetGraph(final RiResolvedMethod snippetRiMethod, final GraalRuntime runtime, final CiTarget target, final BoxingMethodPool pool, final PhasePlan plan) {
-        return Debug.scope("BuildSnippetGraph", snippetRiMethod, new Callable<StructuredGraph>() {
-
-            @Override
-            public StructuredGraph call() throws Exception {
-                GraphBuilderConfiguration config = GraphBuilderConfiguration.getSnippetDefault();
-                GraphBuilderPhase graphBuilder = new GraphBuilderPhase(runtime, config);
-                StructuredGraph graph = new StructuredGraph(snippetRiMethod);
-                graphBuilder.apply(graph);
-
-                Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName());
-
-                new SnippetIntrinsificationPhase(runtime, pool).apply(graph);
-
-                for (Invoke invoke : graph.getInvokes()) {
-                    MethodCallTargetNode callTarget = invoke.callTarget();
-                    RiResolvedMethod targetMethod = callTarget.targetMethod();
-                    RiResolvedType holder = targetMethod.holder();
-                    if (holder.isSubtypeOf(runtime.getType(SnippetsInterface.class))) {
-                        StructuredGraph targetGraph = (StructuredGraph) targetMethod.compilerStorage().get(Graph.class);
-                        if (targetGraph == null) {
-                            targetGraph = buildSnippetGraph(targetMethod, runtime, target, pool, plan);
-                        }
-                        InliningUtil.inline(invoke, targetGraph, true);
-                        if (GraalOptions.OptCanonicalizer) {
-                            new CanonicalizerPhase(target, runtime, null).apply(graph);
-                        }
-                    }
-                }
-
-                new SnippetIntrinsificationPhase(runtime, pool).apply(graph);
-
-                Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName());
-                new DeadCodeEliminationPhase().apply(graph);
-                if (GraalOptions.OptCanonicalizer) {
-                    new CanonicalizerPhase(target, runtime, null).apply(graph);
-                }
-
-                // TODO (gdub) remove when we have good safepoint polling elimination
-                for (LoopEndNode end : graph.getNodes(LoopEndNode.class)) {
-                    end.setSafepointPolling(false);
-                }
-                new InsertStateAfterPlaceholderPhase().apply(graph);
-
-                Debug.dump(graph, "%s: Final", snippetRiMethod.name());
-
-                snippetRiMethod.compilerStorage().put(Graph.class, graph);
-
-                return graph;
-            }
-        });
-
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/SnippetsInterface.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets;
-
-/**
- * Tagging interface for interfaces or classes providing snippets.
- */
-public interface SnippetsInterface {
-
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/nodes/ArrayHeaderSizeNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets.nodes;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-
-public class ArrayHeaderSizeNode extends FloatingNode implements Lowerable {
-    @Data private final CiKind elementKind;
-
-    public ArrayHeaderSizeNode(CiKind elementKind) {
-        super(StampFactory.forKind(CiKind.Long));
-        this.elementKind = elementKind;
-    }
-
-    @Override
-    public void lower(CiLoweringTool tool) {
-        tool.getRuntime().lower(this, tool);
-    }
-
-    public CiKind elementKind() {
-        return elementKind;
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static long sizeFor(@ConstantNodeParameter CiKind kind) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets.nodes;
-
-import static com.oracle.graal.lir.amd64.AMD64Arithmetic.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.compiler.target.amd64.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op2Reg;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.calc.*;
-import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.nodes.type.*;
-import com.oracle.graal.snippets.target.amd64.*;
-
-public class MathIntrinsicNode extends FloatingNode implements Canonicalizable, AMD64LIRLowerable {
-
-    @Input private ValueNode x;
-    @Data private final Operation operation;
-
-    public enum Operation {
-        ABS, SQRT, LOG, LOG10, SIN, COS, TAN,
-    }
-
-    public ValueNode x() {
-        return x;
-    }
-
-    public Operation operation() {
-        return operation;
-    }
-
-    public MathIntrinsicNode(ValueNode x, Operation op) {
-        super(StampFactory.forKind(x.kind()));
-        assert x.kind() == CiKind.Double;
-        this.x = x;
-        this.operation = op;
-    }
-
-    @Override
-    public void generateAmd64(AMD64LIRGenerator gen) {
-        Variable input = gen.load(gen.operand(x()));
-        Variable result = gen.newVariable(kind());
-        switch (operation()) {
-            case ABS:   gen.append(new Op2Reg(DAND, result, input, CiConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)))); break;
-            case SQRT:  gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.SQRT, result, input)); break;
-            case LOG:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.LOG, result, input)); break;
-            case LOG10: gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.LOG10, result, input)); break;
-            case SIN:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.SIN, result, input)); break;
-            case COS:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.COS, result, input)); break;
-            case TAN:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.TAN, result, input)); break;
-            default:    throw GraalInternalError.shouldNotReachHere();
-        }
-        gen.setResult(this, result);
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool) {
-        if (x().isConstant()) {
-            double value = x().asConstant().asDouble();
-            switch (operation()) {
-                case ABS:   return ConstantNode.forDouble(Math.abs(value), graph());
-                case SQRT:  return ConstantNode.forDouble(Math.sqrt(value), graph());
-                case LOG:   return ConstantNode.forDouble(Math.log(value), graph());
-                case LOG10: return ConstantNode.forDouble(Math.log10(value), graph());
-                case SIN:   return ConstantNode.forDouble(Math.sin(value), graph());
-                case COS:   return ConstantNode.forDouble(Math.cos(value), graph());
-                case TAN:   return ConstantNode.forDouble(Math.tan(value), graph());
-            }
-        }
-        return this;
-    }
-
-    @SuppressWarnings("unused")
-    @NodeIntrinsic
-    public static double compute(double x, @ConstantNodeParameter Operation op) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64MathIntrinsicOp.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.snippets.target.amd64;
-
-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.graal.graph.*;
-import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.amd64.*;
-import com.oracle.graal.lir.asm.*;
-
-public class AMD64MathIntrinsicOp extends AMD64LIRInstruction {
-    public enum Opcode  {
-        SQRT,
-        SIN, COS, TAN,
-        LOG, LOG10;
-    }
-
-    public AMD64MathIntrinsicOp(Opcode opcode, CiValue result, CiValue input) {
-        super(opcode, new CiValue[] {result}, null, new CiValue[] {input}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
-    }
-
-    @Override
-    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        Opcode opcode = (Opcode) code;
-        CiValue result = output(0);
-        CiValue input = input(0);
-
-        switch (opcode) {
-            case SQRT:  masm.sqrtsd(asDoubleReg(result), asDoubleReg(input)); break;
-            case LOG:   masm.flog(asDoubleReg(result), asDoubleReg(input), false); break;
-            case LOG10: masm.flog(asDoubleReg(result), asDoubleReg(input), true); break;
-            case SIN:   masm.fsin(asDoubleReg(result), asDoubleReg(input)); break;
-            case COS:   masm.fcos(asDoubleReg(result), asDoubleReg(input)); break;
-            case TAN:   masm.ftan(asDoubleReg(result), asDoubleReg(input)); break;
-            default:    throw GraalInternalError.shouldNotReachHere();
-        }
-    }
-
-    @Override
-    protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-        if (mode == OperandMode.Input && index == 0) {
-            return EnumSet.of(OperandFlag.Register);
-        } else if (mode == OperandMode.Output && index == 0) {
-            return EnumSet.of(OperandFlag.Register);
-        }
-        throw GraalInternalError.shouldNotReachHere();
-    }
-}
--- a/graal/com.oracle.max.graal.snippets/test/test/com/oracle/graal/snippets/package-info.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-/**
- * Test cases for Graal snippets.
- */
-package test.com.oracle.graal.snippets;
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/BoxingEliminationTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-
-/**
- * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
- * Then boxing elimination is applied and it is verified that the resulting graph is equal to the
- * graph of the method that just has a "return 1" statement in it.
- */
-public class BoxingEliminationTest extends GraphTest {
-    private static final Short s = 2;
-    private static final String REFERENCE_SNIPPET = "referenceSnippet";
-
-    @SuppressWarnings("all")
-    public static short referenceSnippet(short a) {
-        return 1;
-    }
-
-    public static Short boxedShort() {
-        return 1;
-    }
-
-    public static Object boxedObject() {
-        return (short) 1;
-    }
-
-    public static Short constantBoxedShort() {
-        return s;
-    }
-
-    @Test
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static short test1Snippet(short a) {
-        return boxedShort();
-    }
-
-    @Test
-    public void test2() {
-        test("test2Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static short test2Snippet(short a) {
-        return (Short) boxedObject();
-    }
-    @Test
-    public void test3() {
-        test("test3Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static short test3Snippet(short a) {
-        short b = boxedShort();
-        if (b < 0) {
-            b = boxedShort();
-        }
-        return b;
-    }
-
-    @Test
-    public void test4() {
-        test("test4Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static short test4Snippet(short a) {
-        return constantBoxedShort();
-    }
-
-    private void test(final String snippet) {
-        Debug.scope("BoxingEliminationTest", new DebugDumpScope(snippet), new Runnable() {
-            @Override
-            public void run() {
-                StructuredGraph graph = parse(snippet);
-                BoxingMethodPool pool = new BoxingMethodPool(runtime());
-                IdentifyBoxingPhase identifyBoxingPhase = new IdentifyBoxingPhase(pool);
-                PhasePlan phasePlan = getDefaultPhasePlan();
-                phasePlan.addPhase(PhasePosition.AFTER_PARSING, identifyBoxingPhase);
-                identifyBoxingPhase.apply(graph);
-                LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
-                ConstantNode constant = ConstantNode.forShort((short) 0, graph);
-                for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
-                    n.replaceFirstInput(local, constant);
-                }
-                Collection<Invoke> hints = new ArrayList<>();
-                for (Invoke invoke : graph.getInvokes()) {
-                    hints.add(invoke);
-                }
-                new InliningPhase(null, runtime(), hints, null, phasePlan).apply(graph);
-                new CanonicalizerPhase(null, runtime(), null).apply(graph);
-                Debug.dump(graph, "Graph");
-                new BoxingEliminationPhase().apply(graph);
-                Debug.dump(graph, "Graph");
-                new ExpandBoxingNodesPhase(pool).apply(graph);
-                new CanonicalizerPhase(null, runtime(), null).apply(graph);
-                new DeadCodeEliminationPhase().apply(graph);
-                StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
-                assertEquals(referenceGraph, graph);
-            }
-        });
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.ri.RiCompiledMethod.MethodInvalidatedException;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.java.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * In the following tests, the usages of local variable "a" are replaced with the integer constant 0. Then
- * canonicalization is applied and it is verified that the resulting graph is equal to the graph of the method that just
- * has a "return 1" statement in it.
- */
-public class CompiledMethodTest extends GraphTest {
-
-    public static Object testMethod(Object arg1, Object arg2, Object arg3) {
-        return arg1 + " " + arg2 + " " + arg3;
-    }
-
-    @Test
-    public void test1() {
-        Method method = getMethod("testMethod");
-        final StructuredGraph graph = parse(method);
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        new DeadCodeEliminationPhase().apply(graph);
-
-        for (Node node : graph.getNodes()) {
-            if (node instanceof ConstantNode) {
-                ConstantNode constant = (ConstantNode) node;
-                if (constant.kind() == CiKind.Object && " ".equals(constant.value.asObject())) {
-                    graph.replaceFloating(constant, ConstantNode.forObject("-", runtime, graph));
-                }
-            }
-        }
-
-        final RiResolvedMethod riMethod = runtime.getRiMethod(method);
-        CiTargetMethod targetMethod = runtime.compile(riMethod, graph);
-        RiCompiledMethod compiledMethod = runtime.addMethod(riMethod, targetMethod);
-        try {
-            Object result = compiledMethod.execute("1", "2", "3");
-            Assert.assertEquals("1-2-3", result);
-        } catch (MethodInvalidatedException t) {
-            Assert.fail("method invalidated");
-        }
-
-    }
-
-    @Test
-    public void test2() throws NoSuchMethodException, SecurityException {
-        Method method = CompilableObjectImpl.class.getDeclaredMethod("executeHelper", ObjectCompiler.class, String.class);
-        RiResolvedMethod riMethod = runtime.getRiMethod(method);
-        StructuredGraph graph = new StructuredGraph(riMethod);
-        new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault()).apply(graph);
-        new CanonicalizerPhase(null, runtime, null).apply(graph);
-        new DeadCodeEliminationPhase().apply(graph);
-
-        for (Node node : graph.getNodes()) {
-            if (node instanceof ConstantNode) {
-                ConstantNode constant = (ConstantNode) node;
-                if (constant.kind() == CiKind.Object && "1 ".equals(constant.value.asObject())) {
-                    graph.replaceFloating(constant, ConstantNode.forObject("1-", runtime, graph));
-                }
-            }
-        }
-
-        CiTargetMethod targetMethod = runtime.compile(riMethod, graph);
-        final RiCompiledMethod compiledMethod = runtime.addMethod(riMethod, targetMethod);
-
-        final CompilableObject compilableObject = new CompilableObjectImpl(0);
-
-        Object result;
-        result = compilableObject.execute(new ObjectCompilerImpl(compiledMethod), "3");
-        Assert.assertEquals("1-3", result);
-    }
-
-    public abstract class CompilableObject {
-
-        private CompiledObject compiledObject;
-        private final int compileThreshold;
-        private int counter;
-
-        public CompilableObject(int compileThreshold) {
-            this.compileThreshold = compileThreshold;
-        }
-
-        public final Object execute(ObjectCompiler compiler, String args) {
-            if (counter++ < compileThreshold || compiler == null) {
-                return executeHelper(compiler, args);
-            } else {
-                compiledObject = compiler.compile(this);
-                return compiledObject.execute(compiler, args);
-            }
-        }
-
-        protected abstract Object executeHelper(ObjectCompiler context, String args);
-    }
-
-    private final class CompilableObjectImpl extends CompilableObject {
-
-        private CompilableObjectImpl(int compileThreshold) {
-            super(compileThreshold);
-        }
-
-        @Override
-        protected Object executeHelper(ObjectCompiler compiler, String args) {
-            return "1 " + args;
-        }
-    }
-
-    public interface CompiledObject {
-        Object execute(ObjectCompiler context, String args);
-    }
-
-    public interface ObjectCompiler {
-        CompiledObject compile(CompilableObject node);
-    }
-
-    private final class ObjectCompilerImpl implements ObjectCompiler {
-
-        private final RiCompiledMethod compiledMethod;
-
-        private ObjectCompilerImpl(RiCompiledMethod compiledMethod) {
-            this.compiledMethod = compiledMethod;
-        }
-
-        @Override
-        public CompiledObject compile(final CompilableObject node) {
-            return new CompiledObject() {
-                @Override
-                public Object execute(ObjectCompiler compiler, String args) {
-                    return compiledMethod.execute(node, compiler, args);
-                }
-            };
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/ConditionTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import static org.junit.Assert.*;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.nodes.calc.*;
-
-
-public class ConditionTest {
-
-    @Test
-    public void testImplies() {
-        Random rand = new Random(13);
-        for (Condition c1 : Condition.values()) {
-            for (Condition c2 : Condition.values()) {
-                boolean implies = c1.implies(c2);
-                if (implies && c1 != Condition.OF && c2 != Condition.OF && c1 != Condition.NOF && c2 != Condition.NOF) {
-                    for (int i = 0; i < 10000; i++) {
-                        CiConstant a = CiConstant.forInt(rand.nextInt());
-                        CiConstant b = CiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
-                        boolean result1 = c1.foldCondition(a, b, null, false);
-                        boolean result2 = c2.foldCondition(a, b, null, false);
-                        if (result1 && implies) {
-                            assertTrue(result2);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    @Test
-    public void testJoin() {
-        Random rand = new Random(13);
-        for (Condition c1 : Condition.values()) {
-            for (Condition c2 : Condition.values()) {
-                Condition join = c1.join(c2);
-                assertTrue(join == c2.join(c1));
-                if (join != null && c1 != Condition.OF && c2 != Condition.OF && c1 != Condition.NOF && c2 != Condition.NOF) {
-                    for (int i = 0; i < 10000; i++) {
-                        CiConstant a = CiConstant.forInt(rand.nextInt());
-                        CiConstant b = CiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
-                        boolean result1 = c1.foldCondition(a, b, null, false);
-                        boolean result2 = c2.foldCondition(a, b, null, false);
-                        boolean resultJoin = join.foldCondition(a, b, null, false);
-                        if (result1 && result2) {
-                            assertTrue(resultJoin);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    @Test
-    public void testMeet() {
-        Random rand = new Random(13);
-        for (Condition c1 : Condition.values()) {
-            for (Condition c2 : Condition.values()) {
-                Condition meet = c1.meet(c2);
-                assertTrue(meet == c2.meet(c1));
-                if (meet != null && c1 != Condition.OF && c2 != Condition.OF && c1 != Condition.NOF && c2 != Condition.NOF) {
-                    for (int i = 0; i < 10000; i++) {
-                        CiConstant a = CiConstant.forInt(rand.nextInt());
-                        CiConstant b = CiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
-                        boolean result1 = c1.foldCondition(a, b, null, false);
-                        boolean result2 = c2.foldCondition(a, b, null, false);
-                        boolean resultMeet = meet.foldCondition(a, b, null, false);
-                        if (result1 || result2) {
-                            assertTrue(resultMeet);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/DegeneratedLoopsTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
- * Then canonicalization is applied and it is verified that the resulting graph is equal to the
- * graph of the method that just has a "return 1" statement in it.
- */
-public class DegeneratedLoopsTest extends GraphTest {
-
-    private static final String REFERENCE_SNIPPET = "referenceSnippet";
-
-    @SuppressWarnings("all")
-    public static int referenceSnippet(int a) {
-        return 1;
-    }
-
-    @Test
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    private static class UnresolvedException extends RuntimeException {
-        private static final long serialVersionUID = 5215434338750728440L;
-
-        static {
-            if (true) {
-                throw new UnsupportedOperationException("this class may never be initialized");
-            }
-        }
-    }
-
-    @SuppressWarnings("all")
-    public static int test1Snippet(int a) {
-        for (;;) {
-            try {
-                test();
-                break;
-            } catch (UnresolvedException e) {
-            }
-        }
-        return a;
-    }
-
-    private static void test() {
-
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        Debug.dump(graph, "Graph");
-        LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
-        ConstantNode constant = ConstantNode.forInt(0, graph);
-        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
-            n.replaceFirstInput(local, constant);
-        }
-        for (Invoke invoke : graph.getInvokes()) {
-            invoke.intrinsify(null);
-        }
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET); Debug.dump(referenceGraph, "Graph");
-        assertEquals(referenceGraph, graph);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/EscapeAnalysisTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import junit.framework.*;
-
-import org.junit.Test;
-
-import com.oracle.max.cri.ci.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.java.*;
-
-/**
- * In these test cases the probability of all invokes is set to a high value, such that an InliningPhase should inline them all.
- * After that, the EscapeAnalysisPhase is expected to remove all allocations and return the correct values.
- */
-public class EscapeAnalysisTest extends GraphTest {
-
-    @Test
-    public void test1() {
-        test("test1Snippet", CiConstant.forInt(101));
-    }
-
-    @SuppressWarnings("all")
-    public static int test1Snippet(int a) {
-        Integer x = new Integer(101);
-        return x.intValue();
-    }
-
-    @Test
-    public void test2() {
-        test("test2Snippet", CiConstant.forInt(0));
-    }
-
-    @SuppressWarnings("all")
-    public static int test2Snippet(int a) {
-        Integer[] x = new Integer[0];
-        return x.length;
-    }
-
-    @Test
-    public void test3() {
-        test("test3Snippet", CiConstant.forObject(null));
-    }
-
-    @SuppressWarnings("all")
-    public static Object test3Snippet(int a) {
-        Integer[] x = new Integer[1];
-        return x[0];
-    }
-
-    @Test
-    public void testMonitor() {
-        test("testMonitorSnippet", CiConstant.forInt(0));
-    }
-
-    private static native void notInlineable();
-
-    @SuppressWarnings("all")
-    public static int testMonitorSnippet(int a) {
-        Integer x = new Integer(0);
-        Integer[] y = new Integer[0];
-        Integer[] z = new Integer[1];
-        synchronized (x) {
-            synchronized (y) {
-                synchronized (z) {
-                    notInlineable();
-                }
-            }
-        }
-        return x.intValue();
-    }
-
-    public void testMonitor2() {
-        test("testMonitor2Snippet", CiConstant.forInt(0));
-    }
-
-    /**
-     * This test case differs from the last one in that it requires inlining within a synchronized region.
-     */
-    @SuppressWarnings("all")
-    public static int testMonitor2Snippet(int a) {
-        Integer x = new Integer(0);
-        Integer[] y = new Integer[0];
-        Integer[] z = new Integer[1];
-        synchronized (x) {
-            synchronized (y) {
-                synchronized (z) {
-                    notInlineable();
-                    return x.intValue();
-                }
-            }
-        }
-    }
-
-    private void test(String snippet, CiConstant expectedResult) {
-        StructuredGraph graph = parse(snippet);
-        for (Invoke n : graph.getInvokes()) {
-            n.node().setProbability(100000);
-        }
-
-        new InliningPhase(null, runtime(), null, null, getDefaultPhasePlan()).apply(graph);
-        new DeadCodeEliminationPhase().apply(graph);
-        Debug.dump(graph, "Graph");
-        new EscapeAnalysisPhase(null, runtime(), null, getDefaultPhasePlan()).apply(graph);
-        Debug.dump(graph, "Graph");
-        int retCount = 0;
-        for (ReturnNode ret : graph.getNodes(ReturnNode.class)) {
-            Assert.assertTrue(ret.result().isConstant());
-            Assert.assertEquals(ret.result().asConstant(), expectedResult);
-            retCount++;
-        }
-        Assert.assertEquals(1, retCount);
-        int newInstanceCount = 0;
-        for (@SuppressWarnings("unused") NewInstanceNode n : graph.getNodes(NewInstanceNode.class)) {
-            newInstanceCount++;
-        }
-        for (@SuppressWarnings("unused") NewObjectArrayNode n : graph.getNodes(NewObjectArrayNode.class)) {
-            newInstanceCount++;
-        }
-        Assert.assertEquals(0, newInstanceCount);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/FloatingReadTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-import com.oracle.graal.nodes.java.*;
-
-public class FloatingReadTest extends GraphScheduleTest {
-
-    public static class Container {
-        public int a;
-    }
-
-    public static void changeField(Container c) {
-        c.a = 0xcafebabe;
-    }
-
-    public static synchronized int test1Snippet() {
-        Container c = new Container();
-        return c.a;
-    }
-
-    @Test
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        new LoweringPhase(runtime()).apply(graph);
-        new FloatingReadPhase().apply(graph);
-
-        ReturnNode returnNode = null;
-        MonitorExitNode monitor = null;
-
-        for (Node n : graph.getNodes()) {
-            if (n instanceof ReturnNode) {
-                returnNode = (ReturnNode) n;
-            } else if (n instanceof MonitorExitNode) {
-                monitor = (MonitorExitNode) n;
-            }
-        }
-
-        Assert.assertNotNull(returnNode);
-        Assert.assertNotNull(monitor);
-        Assert.assertTrue(returnNode.result() instanceof FloatingReadNode);
-
-        FloatingReadNode read = (FloatingReadNode) returnNode.result();
-
-        assertOrderedAfterSchedule(graph, read, monitor);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/GraalRuntimeAccess.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.graal.cri.*;
-
-/**
- * Utility for getting a {@link GraalRuntime} instance from the current execution environment.
- */
-class GraalRuntimeAccess {
-
-    /**
-     * The known classes declaring a {@code getGraalRuntime()} method. These class names
-     * have aliases that can be used with the {@code "graal.runtime"} system property to
-     * specify the VM environment to try first when getting a Graal runtime instance.
-     */
-    private static Map<String, String> graalRuntimeFactoryClasses = new LinkedHashMap<>();
-    static {
-        graalRuntimeFactoryClasses.put("HotSpot", "com.oracle.graal.hotspot.CompilerImpl");
-        graalRuntimeFactoryClasses.put("Maxine", "com.oracle.max.vm.ext.maxri.MaxRuntime");
-    }
-
-    /**
-     * Gets a Graal runtime instance from the current execution environment.
-     */
-    static GraalRuntime getGraalRuntime() {
-        String vm = System.getProperty("graal.runtime");
-        if (vm != null) {
-            String cn = graalRuntimeFactoryClasses.get(vm);
-            if (cn != null) {
-                GraalRuntime graal = getGraalRuntime(cn);
-                if (graal != null) {
-                    return graal;
-                }
-            }
-        }
-
-        for (String className : graalRuntimeFactoryClasses.values()) {
-            GraalRuntime graal = getGraalRuntime(className);
-            if (graal != null) {
-                return graal;
-            }
-        }
-        throw new InternalError("Could not create a GraalRuntime instance");
-    }
-
-    /**
-     * Calls {@code getGraalRuntime()} via reflection on a given class.
-     *
-     * @return {@code null} if there was an error invoking the methodor if the method return {@code null} itself
-     */
-    private static GraalRuntime getGraalRuntime(String className) {
-        try {
-            Class<?> c = Class.forName(className);
-            Method m = c.getDeclaredMethod("getGraalRuntime");
-            return (GraalRuntime) m.invoke(null);
-        } catch (Exception e) {
-            //e.printStackTrace();
-            System.err.println(e);
-            return null;
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/GraphScheduleTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.schedule.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-
-public class GraphScheduleTest extends GraphTest {
-    protected void assertOrderedAfterSchedule(StructuredGraph graph, Node a, Node b) {
-        SchedulePhase ibp = new SchedulePhase();
-        ibp.apply(graph);
-        NodeMap<Block> nodeToBlock = ibp.getCFG().getNodeToBlock();
-        Block bBlock = nodeToBlock.get(b);
-        Block aBlock = nodeToBlock.get(a);
-
-        if (bBlock == aBlock) {
-            List<Node> instructions = ibp.nodesFor(bBlock);
-            Assert.assertTrue(instructions.indexOf(b) > instructions.indexOf(a));
-        } else {
-            Block block = bBlock;
-            while (block != null) {
-                if (block == aBlock) {
-                    break;
-                }
-                block = block.getDominator();
-            }
-            Assert.assertTrue(block == aBlock);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import java.lang.reflect.*;
-
-import junit.framework.Assert;
-
-import com.oracle.max.cri.ri.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.phases.PhasePlan.*;
-import com.oracle.graal.cri.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.java.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * Base class for Graal compiler unit tests. These are white box tests
- * for Graal compiler transformations. The general pattern for a test is:
- * <ol>
- * <li>Create a graph by {@linkplain #parse(String) parsing} a method.</li>
- * <li>Manually modify the graph (e.g. replace a paramter node with a constant).</li>
- * <li>Apply a transformation to the graph.</li>
- * <li>Assert that the transformed graph is equal to an expected graph.</li>
- * </ol>
- * <p>
- * See {@link InvokeTest} as an example.
- * <p>
- * The tests can be run in Eclipse with the "Compiler Unit Test" Eclipse
- * launch configuration found in the top level of this project or by
- * running {@code mx unittest} on the command line.
- */
-public abstract class GraphTest {
-
-    protected final GraalRuntime runtime;
-
-    public GraphTest() {
-        this.runtime = GraalRuntimeAccess.getGraalRuntime();
-    }
-
-    protected void assertEquals(StructuredGraph expected, StructuredGraph graph) {
-        if (expected.getNodeCount() != graph.getNodeCount()) {
-            Debug.dump(expected, "Node count not matching - expected");
-            Debug.dump(graph, "Node count not matching - actual");
-            Assert.fail("Graphs do not have the same number of nodes");
-        }
-    }
-
-    protected GraalRuntime runtime() {
-        return runtime;
-    }
-
-    /**
-     * Parses a Java method to produce a graph.
-     *
-     * @param methodName the name of the method in {@code this.getClass()} to be parsed
-     */
-    protected StructuredGraph parse(String methodName) {
-        return parse(getMethod(methodName));
-    }
-
-    protected Method getMethod(String methodName) {
-        Method found = null;
-        for (Method m : this.getClass().getMethods()) {
-            if (m.getName().equals(methodName)) {
-                Assert.assertNull(found);
-                found = m;
-            }
-        }
-        if (found != null) {
-            return found;
-        } else {
-            throw new RuntimeException("method not found: " + methodName);
-        }
-    }
-
-    /**
-     * Parses a Java method to produce a graph.
-     *
-     * @param methodName the name of the method in {@code this.getClass()} to be parsed
-     */
-    protected StructuredGraph parseProfiled(String methodName) {
-        return parseProfiled(getMethod(methodName));
-    }
-
-    /**
-     * Parses a Java method to produce a graph.
-     */
-    protected StructuredGraph parse(Method m) {
-        RiResolvedMethod riMethod = runtime.getRiMethod(m);
-        StructuredGraph graph = new StructuredGraph(riMethod);
-        new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault()).apply(graph);
-        return graph;
-    }
-
-    /**
-     * Parses a Java method to produce a graph.
-     */
-    protected StructuredGraph parseProfiled(Method m) {
-        RiResolvedMethod riMethod = runtime.getRiMethod(m);
-        StructuredGraph graph = new StructuredGraph(riMethod);
-        new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault()).apply(graph);
-        return graph;
-    }
-
-    protected PhasePlan getDefaultPhasePlan() {
-        PhasePlan plan = new PhasePlan();
-        plan.addPhase(PhasePosition.AFTER_PARSING, new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault()));
-        return plan;
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/IfBoxingEliminationTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.phases.PhasePlan.PhasePosition;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.extended.*;
-
-public class IfBoxingEliminationTest extends GraphTest {
-
-    private static final String REFERENCE_SNIPPET = "referenceSnippet";
-
-    public static int referenceSnippet(int a) {
-        int result;
-        if (a < 0) {
-            result = 1;
-        } else {
-            result = 2;
-        }
-        return result;
-    }
-
-    public static Integer boxedInteger() {
-        return 1;
-    }
-
-    public static Object boxedObject() {
-        return 2;
-    }
-
-    @Test
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    public static int test1Snippet(int a) {
-        Integer result;
-        if (a < 0) {
-            result = boxedInteger();
-        } else {
-            result = (Integer) boxedObject();
-        }
-        return result;
-    }
-
-    private void test(final String snippet) {
-        Debug.scope("IfBoxingEliminationTest", new DebugDumpScope(snippet), new Runnable() {
-            @Override
-            public void run() {
-                StructuredGraph graph = parse(snippet);
-                BoxingMethodPool pool = new BoxingMethodPool(runtime());
-                IdentifyBoxingPhase identifyBoxingPhase = new IdentifyBoxingPhase(pool);
-                PhasePlan phasePlan = getDefaultPhasePlan();
-                phasePlan.addPhase(PhasePosition.AFTER_PARSING, identifyBoxingPhase);
-                phasePlan.addPhase(PhasePosition.AFTER_PARSING, new PhiStampPhase());
-                identifyBoxingPhase.apply(graph);
-                Collection<Invoke> hints = new ArrayList<>();
-                for (Invoke invoke : graph.getInvokes()) {
-                    hints.add(invoke);
-                }
-                new InliningPhase(null, runtime(), hints, null, phasePlan).apply(graph);
-                new CanonicalizerPhase(null, runtime(), null).apply(graph);
-                new PhiStampPhase().apply(graph);
-                new CanonicalizerPhase(null, runtime(), null).apply(graph);
-                Debug.dump(graph, "Graph");
-                new BoxingEliminationPhase().apply(graph);
-                Debug.dump(graph, "Graph");
-                new ExpandBoxingNodesPhase(pool).apply(graph);
-                new CanonicalizerPhase(null, runtime(), null).apply(graph);
-                new DeadCodeEliminationPhase().apply(graph);
-                StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
-                new CanonicalizerPhase(null, runtime(), null).apply(referenceGraph);
-                new DeadCodeEliminationPhase().apply(referenceGraph);
-
-                assertEquals(referenceGraph, graph);
-            }
-        });
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/IfCanonicalizerTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
- * Then canonicalization is applied and it is verified that the resulting graph is equal to the
- * graph of the method that just has a "return 1" statement in it.
- */
-public class IfCanonicalizerTest extends GraphTest {
-
-    private static final String REFERENCE_SNIPPET = "referenceSnippet";
-
-    @SuppressWarnings("all")
-    public static int referenceSnippet(int a) {
-        return 1;
-    }
-
-    @Test
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static int test1Snippet(int a) {
-        if (a == 0) {
-            return 1;
-        } else {
-            return 2;
-        }
-    }
-
-    @Test
-    public void test2() {
-        test("test2Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static int test2Snippet(int a) {
-        if (a == 0) {
-            if (a == 0) {
-                if (a == 0) {
-                    return 1;
-                }
-            }
-        } else {
-            return 2;
-        }
-        return 3;
-    }
-
-    @Test
-    public void test3() {
-        test("test3Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static int test3Snippet(int a) {
-        if (a == 0) {
-            if (a != 1) {
-                if (a == 1) {
-                    return 3;
-                } else {
-                    if (a >= 0) {
-                        if (a <= 0) {
-                            if (a > -1) {
-                                if (a < 1) {
-                                    return 1;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        } else {
-            return 2;
-        }
-        return 3;
-    }
-
-    @Test
-    public void test4() {
-        test("test4Snippet");
-    }
-
-    public static int test4Snippet(int a) {
-        if (a == 0) {
-            return 1;
-        }
-        return 1;
-    }
-
-    @Test
-    public void test5() {
-        test("test5Snippet");
-    }
-
-    public static int test5Snippet(int a) {
-        int val = 2;
-        if (a == 0) {
-            val = 1;
-        }
-        if (a * (3 + val) == 0) {
-            return 1;
-        }
-        return 1;
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
-        ConstantNode constant = ConstantNode.forInt(0, graph);
-        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
-            n.replaceFirstInput(local, constant);
-        }
-        Debug.dump(graph, "Graph");
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
-        assertEquals(referenceGraph, graph);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/InvokeExceptionTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.nodes.*;
-
-public class InvokeExceptionTest extends GraphTest {
-
-    public static synchronized void throwException(int i) {
-        if (i == 1) {
-            throw new RuntimeException();
-        }
-    }
-
-    @Test
-    public void test1() {
-        // fill the profiling data...
-        for (int i = 0; i < 10000; i++) {
-            try {
-                throwException(i & 1);
-                test1Snippet(0);
-            } catch (Throwable t) {
-                // nothing to do...
-            }
-        }
-        test("test1Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static void test1Snippet(int a) {
-        throwException(a);
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parseProfiled(snippet);
-        Collection<Invoke> hints = new ArrayList<>();
-        for (Invoke invoke : graph.getInvokes()) {
-            hints.add(invoke);
-        }
-        new InliningPhase(null, runtime(), hints, null, getDefaultPhasePlan()).apply(graph);
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        new DeadCodeEliminationPhase().apply(graph);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/InvokeTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
- * Then canonicalization is applied and it is verified that the resulting graph is equal to the
- * graph of the method that just has a "return 1" statement in it.
- */
-public class InvokeTest extends GraphTest {
-
-    private static final String REFERENCE_SNIPPET = "referenceSnippet";
-
-    @SuppressWarnings("all")
-    public static int referenceSnippet(int a) {
-        return 1;
-    }
-
-    public static int const1() {
-        return 1;
-    }
-
-    @Test
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static int test1Snippet(int a) {
-        return const1();
-    }
-
-    @Test
-    public void test2() {
-        test("test2Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static int test2Snippet(int a) {
-        return const1() + const1() + const1() + const1() + const1() + const1() + const1();
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        LocalNode local = graph.getNodes(LocalNode.class).iterator().next();
-        ConstantNode constant = ConstantNode.forInt(0, graph);
-        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
-            n.replaceFirstInput(local, constant);
-        }
-        Collection<Invoke> hints = new ArrayList<>();
-        for (Invoke invoke : graph.getInvokes()) {
-            hints.add(invoke);
-        }
-        new InliningPhase(null, runtime(), hints, null, getDefaultPhasePlan()).apply(graph);
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        new DeadCodeEliminationPhase().apply(graph);
-        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
-        assertEquals(referenceGraph, graph);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/MonitorTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import static com.oracle.graal.graph.iterators.NodePredicates.*;
-
-import java.util.*;
-
-import junit.framework.*;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.iterators.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.java.*;
-
-/**
- * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
- * Then canonicalization is applied and it is verified that the resulting graph is equal to the
- * graph of the method that just has a "return 1" statement in it.
- */
-public class MonitorTest extends GraphTest {
-
-    private static final String REFERENCE_SNIPPET = "referenceSnippet";
-
-    @SuppressWarnings("all")
-    public static synchronized int referenceSnippet(int a) {
-        return 1;
-    }
-
-    public static int const1() {
-        return 1;
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static synchronized int test1Snippet(int a) {
-        return const1();
-    }
-
-    @Test
-    public void test2() {
-        StructuredGraph graph = parseAndProcess("test2Snippet");
-        NodeIterable<MonitorExitNode> monitors = graph.getNodes(MonitorExitNode.class);
-        Assert.assertEquals(1, monitors.count());
-        Assert.assertEquals(monitors.first().stateAfter().bci, 3);
-    }
-
-    @SuppressWarnings("all")
-    public static int test2Snippet(int a) {
-        return const2();
-    }
-
-    public static synchronized int const2() {
-        return 1;
-    }
-
-    private StructuredGraph parseAndProcess(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        LocalNode local = graph.getNodes(LocalNode.class).first();
-        ConstantNode constant = ConstantNode.forInt(0, graph);
-        for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) {
-            n.replaceFirstInput(local, constant);
-        }
-        Collection<Invoke> hints = new ArrayList<>();
-        for (Invoke invoke : graph.getInvokes()) {
-            hints.add(invoke);
-        }
-        new InliningPhase(null, runtime(), hints, null, getDefaultPhasePlan()).apply(graph);
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        new DeadCodeEliminationPhase().apply(graph);
-        return graph;
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parseAndProcess(snippet);
-        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
-        assertEquals(referenceGraph, graph);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/NestedLoopTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import org.junit.*;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.lir.cfg.*;
-import com.oracle.graal.nodes.*;
-
-public class NestedLoopTest extends GraphTest {
-
-    @Test
-    public void test1() {
-        test("test1Snippet", 1, 2, 2);
-    }
-
-    @Test
-    public void test2() {
-        test("test2Snippet", 1, 2, 2);
-    }
-
-    @Test
-    public void test3() {
-        test("test3Snippet", 1, 2, 2);
-    }
-
-    @Test
-    public void test4() {
-        test("test4Snippet", 1, 3, 2);
-    }
-
-    @SuppressWarnings("all")
-    public static void test1Snippet(int a) {
-        while (a()) { // a() exits root, while() exits root
-            m1: while (b()) { // b() exits nested & root, while() exits nested
-                while (c()) { // c() exits innermost & nested & root, while() exits innermost
-                    if (d()) { // d() exits innermost & nested & root
-                        break m1; // break exits innermost & nested
-                    }
-                }
-            }
-        }
-    }// total : root = 5 exits, nested = 5, innermost = 4
-
-    @SuppressWarnings("all")
-    public static void test2Snippet(int a) {
-        while (a()) { // a() exits root, while() exits root
-            try {
-                m1: while (b()) { // b() exits nested, while() exits nested
-                    while (c()) { // c() exits innermost & nested, while() exits innermost
-                        if (d()) { // d() exits innermost & nested
-                            break m1; // break exits innermost & nested
-                        }
-                    }
-                }
-            } catch (Throwable t) {
-            }
-        }
-    }// total : root = 2 exits, nested = 5, innermost = 4
-
-    @SuppressWarnings("all")
-    public static void test3Snippet(int a) {
-        while (a == 0) { // while() exits root
-            try {
-                m1: while (b()) { // b() exits nested, while() exits nested
-                    while (c()) { // c() exits innermost & nested, while() exits innermost
-                        if (d()) { // d() exits innermost & nested
-                            a(); // a() exits nothing (already outside innermost & nested)
-                            break m1; // break exits innermost & nested
-                        }
-                    }
-                }
-            } catch (Throwable t) {
-            }
-        }
-    }// total : root = 1 exit, nested = 5, innermost = 4
-
-    public static void test4Snippet(int a) {
-        while (a != 0) { // while() exits root
-            try {
-                m1: while (a != 0) { // while() exits nested
-                    b(); // b() exits nested
-                    while (c()) { // c() exits innermost & nested, while() exits innermost
-                        if (d()) { // d() exits innermost & nested
-                            break m1; // break exits innermost & nested
-                        }
-                    }
-                    if (a != 2) {
-                        a(); // a() exits nothing (already outside innermost & nested)
-                        throw new Exception(); // throw exits nested
-                    }
-                }
-            } catch (Throwable t) {
-            }
-        }
-    } // total : root = 1 exit, nested = 6, innermost = 4
-
-    private static boolean a() {
-        return false;
-    }
-
-    private static boolean b() {
-        return false;
-    }
-
-    private static boolean c() {
-        return false;
-    }
-
-    private static boolean d() {
-        return false;
-    }
-
-    private static Invoke getInvoke(String name, StructuredGraph graph) {
-        for (Invoke invoke : graph.getInvokes()) {
-            if (invoke.callTarget().targetMethod().name().equals(name)) {
-                return invoke;
-            }
-        }
-        return null;
-    }
-
-    private void test(String snippet, int rootExits, int nestedExits, int innerExits) {
-        StructuredGraph graph = parse(snippet);
-        Debug.dump(graph, "Graph");
-        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, true, true);
-
-        Assert.assertTrue(cfg.getLoops().length == 3);
-        Loop rootLoop = cfg.getLoops()[0];
-        Loop nestedLoop = cfg.getLoops()[1];
-        Loop innerMostLoop = cfg.getLoops()[2];
-        Invoke a = getInvoke("a", graph);
-        Invoke b = getInvoke("b", graph);
-        Invoke c = getInvoke("c", graph);
-        Invoke d = getInvoke("d", graph);
-        Assert.assertTrue(containsDirect(rootLoop, a, cfg));
-        Assert.assertTrue(containsDirect(nestedLoop, b, cfg));
-        Assert.assertTrue(containsDirect(innerMostLoop, c, cfg));
-        Assert.assertTrue(containsDirect(innerMostLoop, d, cfg));
-        Assert.assertTrue(contains(rootLoop, d, cfg));
-        Assert.assertTrue(contains(nestedLoop, d, cfg));
-        Assert.assertEquals(rootExits, rootLoop.exits.size());
-        Assert.assertEquals(nestedExits, nestedLoop.exits.size());
-        Assert.assertEquals(innerExits, innerMostLoop.exits.size());
-        Debug.dump(graph, "Graph");
-    }
-
-    private static boolean contains(Loop loop, Invoke node, ControlFlowGraph cfg) {
-        Block block = cfg.blockFor((Node) node);
-        Assert.assertNotNull(block);
-        return loop.blocks.contains(block);
-    }
-
-    private static boolean containsDirect(Loop loop, Invoke node, ControlFlowGraph cfg) {
-        for (Loop child : loop.children) {
-            if (contains(child, node, cfg)) {
-                return false;
-            }
-        }
-        return contains(loop, node, cfg);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/PhiCreationTests.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import org.junit.*;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * In the following tests, the correct removal of redundant phis during graph building is tested.
- */
-public class PhiCreationTests extends GraphTest {
-
-    /**
-     * Dummy method to avoid javac dead code elimination.
-     */
-    private static void test() {
-    }
-
-    @Test
-    public void test1() {
-        StructuredGraph graph = parse("test1Snippet");
-        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
-    }
-
-    public static int test1Snippet(int a) {
-        if (a > 1) {
-            test();
-        }
-        return a;
-    }
-
-    @Test
-    public void test2() {
-        StructuredGraph graph = parse("test2Snippet");
-        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
-    }
-
-    public static int test2Snippet(int a) {
-        while (a > 1) {
-            test();
-        }
-        return a;
-    }
-
-    @Test
-    public void test3() {
-        StructuredGraph graph = parse("test3Snippet");
-        Debug.dump(graph, "Graph");
-        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
-    }
-
-    public static int test3Snippet(int a) {
-        while (a > 1) {
-            while (a > 1) {
-                test();
-            }
-        }
-        return a;
-    }
-
-    @Test
-    public void test4() {
-        StructuredGraph graph = parse("test4Snippet");
-        Debug.dump(graph, "Graph");
-        Assert.assertFalse(graph.getNodes(PhiNode.class).iterator().hasNext());
-    }
-
-    public static int test4Snippet(int a) {
-        int b = 5;
-        while (a > 1) {
-            while (a > 1) {
-                while (a > 1) {
-                    try {
-                        test();
-                    } catch (Throwable t) {
-
-                    }
-                }
-            }
-            while (a > 1) {
-                while (a > 1) {
-                    try {
-                        test();
-                    } catch (Throwable t) {
-
-                    }
-                }
-            }
-        }
-        return a + b;
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/ScalarTypeSystemTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import junit.framework.AssertionFailedError;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * In the following tests, the scalar type system of the compiler should be complete enough to see the relation between the different conditions.
- */
-public class ScalarTypeSystemTest extends GraphTest {
-
-    public static int referenceSnippet1(int a) {
-        if (a > 0) {
-            return 1;
-        } else {
-            return 2;
-        }
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test1() {
-        test("test1Snippet", "referenceSnippet1");
-    }
-
-    public static int test1Snippet(int a) {
-        if (a > 0) {
-            if (a > -1) {
-                return 1;
-            } else {
-                return 3;
-            }
-        } else {
-            return 2;
-        }
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test2() {
-        test("test2Snippet", "referenceSnippet1");
-    }
-
-    public static int test2Snippet(int a) {
-        if (a > 0) {
-            if (a == -15) {
-                return 3;
-            } else {
-                return 1;
-            }
-        } else {
-            return 2;
-        }
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test3() {
-        test("test3Snippet", "referenceSnippet2");
-    }
-
-    public static int referenceSnippet2(int a, int b) {
-        if (a > b) {
-            return 1;
-        } else {
-            return 2;
-        }
-    }
-
-    public static int test3Snippet(int a, int b) {
-        if (a > b) {
-            if (a == b) {
-                return 3;
-            } else {
-                return 1;
-            }
-        } else {
-            return 2;
-        }
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test4() {
-        test("test4Snippet", "referenceSnippet2");
-    }
-
-    public static int test4Snippet(int a, int b) {
-        if (a > b) {
-            if (a <= b) {
-                return 3;
-            } else {
-                return 1;
-            }
-        } else {
-            return 2;
-        }
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test5() {
-        test("test5Snippet", "referenceSnippet3");
-    }
-
-    public static int referenceSnippet3(int a, int b) {
-        if (a == b) {
-            return 1;
-        } else {
-            return 2;
-        }
-    }
-
-    public static int test5Snippet(int a, int b) {
-        if (a == b) {
-            if (a != b) {
-                return 3;
-            } else {
-                return 1;
-            }
-        } else {
-            return 2;
-        }
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test6() {
-        test("test6Snippet", "referenceSnippet3");
-    }
-
-    public static int test6Snippet(int a, int b) {
-        if (a == b) {
-            if (a == b + 1) {
-                return 3;
-            } else {
-                return 1;
-            }
-        } else {
-            return 2;
-        }
-    }
-
-    private void test(String snippet, String referenceSnippet) {
-        StructuredGraph graph = parse(snippet);
-        Debug.dump(graph, "Graph");
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        StructuredGraph referenceGraph = parse(referenceSnippet);
-        assertEquals(referenceGraph, graph);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/StraighteningTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import junit.framework.AssertionFailedError;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.nodes.*;
-
-public class StraighteningTest extends GraphTest {
-
-    private static final String REFERENCE_SNIPPET = "ref";
-
-    public static boolean ref(int a, int b) {
-        return a == b;
-    }
-
-    public static boolean test1Snippet(int a, int b) {
-        int c = a;
-        if (c == b) {
-            c = 0x55;
-        }
-        if (c != 0x55) {
-            return false;
-        }
-        return true;
-    }
-
-    public static boolean test3Snippet(int a, int b) {
-        int val = (int) System.currentTimeMillis();
-        int c = val + 1;
-        if (a == b) {
-            c = val;
-        }
-        if (c != val) {
-            return false;
-        }
-        return true;
-    }
-
-    public static boolean test2Snippet(int a, int b) {
-        int c;
-        if (a == b) {
-            c = 1;
-        } else {
-            c = 0;
-        }
-        return c == 1;
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test2() {
-        test("test2Snippet");
-    }
-
-    @Test(expected = AssertionFailedError.class)
-    public void test3() {
-        test("test3Snippet");
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        Debug.dump(graph, "Graph");
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
-        assertEquals(referenceGraph, graph);
-    }
-}
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/graal/compiler/tests/TypeSystemTest.java	Thu Mar 08 19:11:12 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.compiler.types.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.nodes.*;
-import com.oracle.graal.nodes.java.*;
-
-/**
- * In the following tests, the scalar type system of the compiler should be complete enough to see the relation between the different conditions.
- */
-public class TypeSystemTest extends GraphTest {
-
-    @Test
-    public void test1() {
-        test("test1Snippet", CheckCastNode.class);
-    }
-
-    public static int test1Snippet(Object a) {
-        if (a instanceof Boolean) {
-            return ((Boolean) a).booleanValue() ? 0 : 1;
-        }
-        return 1;
-    }
-
-    @Test
-    public void test2() {
-        test("test2Snippet", CheckCastNode.class);
-    }
-
-    public static int test2Snippet(Object a) {
-        if (a instanceof Integer) {
-            return ((Number) a).intValue();
-        }
-        return 1;
-    }
-
-    private <T extends Node & Node.IterableNodeType> void test(String snippet, Class<T> clazz) {
-        StructuredGraph graph = parse(snippet);
-        Debug.dump(graph, "Graph");
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        new PropagateTypesPhase(null, null, null).apply(graph);
-        Debug.dump(graph, "Graph");
-        Assert.assertFalse("shouldn't have nodes of type " + clazz, graph.getNodes(clazz).iterator().hasNext());
-    }
-}