changeset 4656:c1160de36474

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 20 Feb 2012 18:01:22 +0100
parents 0c392b1bd7cc (current diff) 4e9d904a4d1a (diff)
children d4e039a3e083
files graal/com.oracle.max.graal.lir.amd64/src/com/oracle/max/graal/lir/amd64/AMD64CompareToIntOpcode.java visualizer/nbproject/build-impl.xml visualizer/nbproject/genfiles.properties
diffstat 835 files changed, 49939 insertions(+), 1672 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiUtil.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiUtil.java	Mon Feb 20 18:01:22 2012 +0100
@@ -577,6 +577,8 @@
             } else {
                 sb.append(CiUtil.format("%H.%n(%p)", method));
             }
+        } else {
+            sb.append("Null method");
         }
         return sb.append(" [bci: ").append(bci).append(']');
     }
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiExceptionSeen.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiExceptionSeen.java	Mon Feb 20 18:01:22 2012 +0100
@@ -29,7 +29,7 @@
 public enum RiExceptionSeen {
     TRUE,
     FALSE,
-    UNKNOWN;
+    NOT_SUPPORTED;
 
     public static RiExceptionSeen get(boolean value) {
         return value ? TRUE : FALSE;
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiProfilingInfo.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiProfilingInfo.java	Mon Feb 20 18:01:22 2012 +0100
@@ -24,9 +24,10 @@
 
 
 /**
- * Represents profiling information for one specific method.
- * Every accessor method returns the information that is available at the time of its invocation.
- * If a method is invoked multiple times, it may return a significantly different results for every invocation.
+ * Provides access to the profiling information of one specific method.
+ * Every accessor method returns the information that is available at the time of invocation.
+ * If a method is invoked multiple times, it may return significantly different results for every invocation
+ * as the profiling information may be changed by other Java threads at any time.
  */
 public interface RiProfilingInfo {
     /**
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java	Mon Feb 20 18:01:22 2012 +0100
@@ -55,6 +55,12 @@
     int compiledCodeSize();
 
     /**
+     * Gets an estimate how complex it is to compile this method.
+     * @return A value >= 0, where higher means more complex.
+     */
+    int compilationComplexity();
+
+    /**
      * Gets the symbol used to link this method if it is native, otherwise {@code null}.
      */
     String jniSymbol();
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedType.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedType.java	Mon Feb 20 18:01:22 2012 +0100
@@ -122,6 +122,13 @@
     RiResolvedType superType();
 
     /**
+     * Walks the class hierarchy upwards and returns the least common type that is a super type of both
+     * the current and the given type.
+     * @return the least common type that is a super type of both the current and the given type, or null if primitive types are involved.
+     */
+    RiResolvedType leastCommonAncestor(RiResolvedType otherType);
+
+    /**
      * Attempts to get the unique concrete subtype of this type.
      * @return the exact type of this type, if it exists; {@code null} otherwise
      */
--- a/graal/com.oracle.max.graal.alloc/src/com/oracle/max/graal/alloc/simple/LinearScanAllocator.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.alloc/src/com/oracle/max/graal/alloc/simple/LinearScanAllocator.java	Mon Feb 20 18:01:22 2012 +0100
@@ -446,7 +446,7 @@
 
             // 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 CiBailout("No register available");
+            throw new GraalInternalError("No register available");
         }
 
         spill(bestSpillCandidate);
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Mon Feb 20 18:01:22 2012 +0100
@@ -36,6 +36,7 @@
 import com.oracle.max.graal.compiler.phases.PhasePlan.PhasePosition;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.compiler.target.*;
+import com.oracle.max.graal.compiler.types.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.debug.*;
 import com.oracle.max.graal.lir.*;
@@ -83,10 +84,10 @@
         Debug.dump(this, "compiler");
         Debug.dump(method, "method");
 
-        return Debug.scope(createScopeName(method), new Callable<CiTargetMethod>() {
+        return Debug.scope(createScopeName(method), graph, new Callable<CiTargetMethod>() {
             public CiTargetMethod call() {
                 final CiAssumptions assumptions = GraalOptions.OptAssumptions ? new CiAssumptions() : null;
-                final LIR lir = Debug.scope("FrontEnd", graph, new Callable<LIR>() {
+                final LIR lir = Debug.scope("FrontEnd", new Callable<LIR>() {
                     public LIR call() {
                         return emitHIR(graph, assumptions, plan);
                     }
@@ -144,6 +145,14 @@
             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);
@@ -154,6 +163,10 @@
             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) {
@@ -163,7 +176,9 @@
         if (GraalOptions.EscapeAnalysis && !plan.isPhaseDisabled(EscapeAnalysisPhase.class)) {
             new EscapeAnalysisPhase(target, runtime, assumptions, plan).apply(graph);
             new PhiStampPhase().apply(graph);
-            new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
+            if (GraalOptions.OptCanonicalizer) {
+                new CanonicalizerPhase(target, runtime, assumptions).apply(graph);
+            }
         }
 
         if (GraalOptions.OptGVN) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java	Mon Feb 20 18:01:22 2012 +0100
@@ -44,23 +44,27 @@
     public static boolean CacheGraphs                        = ____;
     public static boolean InlineMonomorphicCalls             = true;
     public static boolean InlinePolymorphicCalls             = true;
-    public static boolean InlineMegamorphicCalls             = true;
-    public static int     InliningPolicy                     = 0;
+    public static boolean InlineMegamorphicCalls             = ____;
+    public static int     InliningPolicy                     = 4;
+    public static int     WeightComputationPolicy            = 2;
     public static int     MaximumTrivialSize                 = 6;
     public static int     MaximumInlineLevel                 = 30;
     public static int     MaximumDesiredSize                 = 6000;
+    public static int     MaximumRecursiveInlining           = 1;
+    public static int     SmallCompiledCodeSize              = 1500;
+    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), DynamicSizeBasedInliningPolicy (2), GreedySizeBasedInlining (3)
+    // StaticSizeBasedInliningPolicy (1), MinimumCodeSizeBasedInlining (2),
+    // DynamicSizeBasedInliningPolicy (3), GreedySizeBasedInlining (4)
     public static int     MaximumInlineSize                  = 35;
-    public static float   NestedInliningSizeRatio            = 0.9f;
+    public static float   NestedInliningSizeRatio            = 1f;
     public static float   BoostInliningForEscapeAnalysis     = 2f;
+    public static int     MaximumGreedyInlineSize            = 250;
     public static float   ProbabilityCapForInlining          = 1f;
-    public static int     MaximumGreedyInlineSize            = 250;
-    public static int     SmallCompiledCodeSize              = 1500;
 
     // escape analysis settings
     public static boolean EscapeAnalysis                     = true;
@@ -69,6 +73,12 @@
 
     // absolute probability analysis
     public static boolean ProbabilityAnalysis                = true;
+    public static int     LoopFrequencyPropagationPolicy     = 1;
+
+    // profiling information
+    public static int     MatureExecutionsBranch             = 50;
+    public static int     MatureExecutionsPerSwitchCase      = 15;
+    public static int     MatureExecutionsTypeProfile        = 100;
 
     //rematerialize settings
     public static float   MinimumUsageProbability            = 0.95f;
@@ -90,8 +100,12 @@
     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;
@@ -127,6 +141,7 @@
     public static boolean AssumeVerifiedBytecode             = true;
 
     // Code generator settings
+    public static boolean PropagateTypes                     = true;
     public static boolean UseBranchPrediction                = true;
     public static boolean UseExceptionProbability            = true;
     public static boolean AllowExplicitExceptionChecks       = true;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/ComputeLinearScanOrder.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/ComputeLinearScanOrder.java	Mon Feb 20 18:01:22 2012 +0100
@@ -29,6 +29,7 @@
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.lir.cfg.*;
+import com.oracle.max.graal.nodes.*;
 
 public final class ComputeLinearScanOrder {
 
@@ -261,18 +262,19 @@
         if (cur.isLoopEnd() && cur.isLoopHeader()) {
             codeEmittingOrder.add(cur);
         } else {
-            if (!cur.isLoopHeader() || !GraalOptions.OptReorderLoops) {
+            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];
-                    assert loopHeader != null;
-                    codeEmittingOrder.add(loopHeader);
+                    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;
+                        for (int i = 0; i < loopHeader.numberOfSux(); i++) {
+                            Block succ = loopHeader.suxAt(i);
+                            if (succ.getLoopDepth() == loopHeader.getLoopDepth()) {
+                                succ.align = true;
+                            }
                         }
                     }
                 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/Interval.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/Interval.java	Mon Feb 20 18:01:22 2012 +0100
@@ -30,6 +30,7 @@
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.util.*;
+import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.lir.*;
 
 /**
@@ -790,7 +791,7 @@
                 Interval lastChild = splitChildren.get(splitChildren.size() - 1);
                 msg.append(" (first = ").append(firstChild).append(", last = ").append(lastChild).append(")");
             }
-            throw new CiBailout("Linear Scan Error: " + msg);
+            throw new GraalInternalError("Linear Scan Error: %s", msg);
         }
 
         if (!splitChildren.isEmpty()) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Mon Feb 20 18:01:22 2012 +0100
@@ -1951,38 +1951,38 @@
             if (i1.operandNumber != i) {
                 TTY.println("Interval %d is on position %d in list", i1.operandNumber, i);
                 TTY.println(i1.logString(this));
-                throw new CiBailout("");
+                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 CiBailout("");
+                throw new GraalInternalError("");
             }
 
             if (i1.location() == null) {
                 TTY.println("Interval %d has no register assigned", i1.operandNumber);
                 TTY.println(i1.logString(this));
-                throw new CiBailout("");
+                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 CiBailout("");
+                throw new GraalInternalError("");
             }
 
             if (i1.first() == Range.EndMarker) {
                 TTY.println("Interval %d has no Range", i1.operandNumber);
                 TTY.println(i1.logString(this));
-                throw new CiBailout("");
+                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 CiBailout("");
+                    throw new GraalInternalError("");
                 }
             }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Mon Feb 20 18:01:22 2012 +0100
@@ -30,6 +30,7 @@
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.util.*;
+import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.lir.*;
 import com.oracle.max.graal.lir.LIRInstruction.*;
 import com.oracle.max.graal.lir.cfg.*;
@@ -197,7 +198,7 @@
     static boolean checkState(Interval[] inputState, CiValue reg, Interval interval) {
         if (reg != null && isRegister(reg)) {
             if (inputState[asRegister(reg).number] != interval) {
-                throw new CiBailout("!! Error in register allocation: register " + reg + " does not contain interval " + interval.operand + " but interval " + inputState[asRegister(reg).number]);
+                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;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Mon Feb 20 18:01:22 2012 +0100
@@ -387,11 +387,16 @@
                 stateAfter = ((StateSplit) instr).stateAfter();
             }
             if (instr instanceof ValueNode) {
-                doRoot((ValueNode) instr);
+                try {
+                    doRoot((ValueNode) instr);
+                } catch (Throwable e) {
+                    throw new GraalInternalError(e).addContext(instr);
+                }
             }
             if (stateAfter != null) {
                 lastState = stateAfter;
                 assert checkStartOperands(instr, lastState);
+                assert checkStateReady(lastState);
                 if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
                     TTY.println("STATE CHANGE");
                     if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
@@ -402,7 +407,7 @@
         }
         if (block.numberOfSux() >= 1 && !endsWithJump(block)) {
             NodeSuccessorsIterable successors = block.getEndNode().successors();
-            assert successors.count() >= 1 : "should have at least one successor : " + block.getEndNode();
+            assert successors.isNotEmpty() : "should have at least one successor : " + block.getEndNode();
 
             emitJump(getLIRBlock((FixedNode) successors.first()), null);
         }
@@ -420,6 +425,20 @@
         }
     }
 
+    private boolean checkStateReady(FrameState state) {
+        FrameState fs = state;
+        while (fs != null) {
+            for (int i = 0; i < fs.valuesSize(); i++) {
+                ValueNode v = fs.valueAt(i);
+                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;
@@ -502,8 +521,10 @@
 
     @Override
     public void visitCheckCast(CheckCastNode x) {
-        XirSnippet snippet = xir.genCheckCast(site(x), toXirArgument(x.object()), toXirArgument(x.targetClassInstruction()), x.targetClass(), x.hints(), x.hintsExact());
-        emitXir(snippet, x, state(), true);
+        if (x.emitCode()) {
+            XirSnippet snippet = xir.genCheckCast(site(x), 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()));
     }
@@ -682,12 +703,11 @@
         if (GraalOptions.GenLoopSafepoints && x.hasSafepointPolling()) {
             emitSafepointPoll(x);
         }
-        moveToPhi(x.loopBegin(), x);
     }
 
     private ArrayList<CiValue> phiValues = new ArrayList<>();
 
-    private void moveToPhi(MergeNode merge, FixedNode pred) {
+    private void moveToPhi(MergeNode merge, EndNode pred) {
         if (GraalOptions.AllocSSA) {
             assert phiValues.isEmpty();
             for (PhiNode phi : merge.phis()) {
@@ -820,9 +840,6 @@
     }
 
     public Variable emitConditional(BooleanNode node, CiValue trueValue, CiValue falseValue) {
-        assert trueValue instanceof CiConstant && (trueValue.kind.stackKind() == CiKind.Int || trueValue.kind == CiKind.Long);
-        assert falseValue instanceof CiConstant && (falseValue.kind.stackKind() == CiKind.Int || trueValue.kind == CiKind.Long);
-
         if (node instanceof NullCheckNode) {
             return emitNullCheckConditional((NullCheckNode) node, trueValue, falseValue);
         } else if (node instanceof CompareNode) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/MergeableState.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/MergeableState.java	Mon Feb 20 18:01:22 2012 +0100
@@ -30,6 +30,6 @@
     T clone();
     boolean merge(MergeNode merge, Collection<T> withStates);
     void loopBegin(LoopBeginNode loopBegin);
-    void loopEnd(LoopEndNode loopEnd, T loopEndState);
+    void loopEnds(LoopBeginNode loopBegin, Collection<T> loopEndStates);
     void afterSplit(FixedNode node);
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/PostOrderNodeIterator.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/PostOrderNodeIterator.java	Mon Feb 20 18:01:22 2012 +0100
@@ -48,7 +48,7 @@
         FixedNode current = start;
 
         do {
-            if (current instanceof Invoke) {
+            if (current instanceof InvokeWithExceptionNode) {
                 invoke((Invoke) current);
                 queueSuccessors(current, null);
                 current = nextQueuedNode();
@@ -60,11 +60,8 @@
                 current = ((LoopBeginNode) current).next();
                 assert current != null;
             } else if (current instanceof LoopEndNode) {
-                T loopBeginState = nodeStates.get(((LoopEndNode) current).loopBegin());
-                if (loopBeginState != null) {
-                    loopBeginState.loopEnd((LoopEndNode) current, state);
-                }
                 loopEnd((LoopEndNode) current);
+                finishLoopEnds((LoopEndNode) current);
                 current = nextQueuedNode();
             } else if (current instanceof MergeNode) {
                 merge((MergeNode) current);
@@ -122,10 +119,10 @@
             FixedNode node = nodeQueue.removeFirst();
             if (node instanceof MergeNode) {
                 MergeNode merge = (MergeNode) node;
-                state = nodeStates.get(merge.endAt(0)).clone();
-                ArrayList<T> states = new ArrayList<>(merge.endCount() - 1);
-                for (int i = 1; i < merge.endCount(); i++) {
-                    T other = nodeStates.get(merge.endAt(i));
+                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);
                 }
@@ -145,6 +142,31 @@
         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);
@@ -152,8 +174,8 @@
         visitedEnds.mark(end);
         MergeNode merge = end.merge();
         boolean endsVisited = true;
-        for (int i = 0; i < merge.endCount(); i++) {
-            if (!visitedEnds.isMarked(merge.endAt(i))) {
+        for (int i = 0; i < merge.forwardEndCount(); i++) {
+            if (!visitedEnds.isMarked(merge.forwardEndAt(i))) {
                 endsVisited = false;
                 break;
             }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -57,7 +57,7 @@
     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.destinationKind();
+            assert unboxedValue.kind() == unboxNode.kind();
             unboxNode.replaceAtUsages(unboxedValue);
             graph.removeFixed(unboxNode);
         }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/CanonicalizerPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/CanonicalizerPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -22,8 +22,6 @@
  */
 package com.oracle.max.graal.compiler.phases;
 
-import static com.oracle.max.graal.graph.iterators.NodePredicates.*;
-
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.debug.*;
@@ -31,6 +29,7 @@
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
+import com.oracle.max.graal.nodes.util.*;
 
 public class CanonicalizerPhase extends Phase {
     private static final int MAX_ITERATION_PER_NODE = 10;
@@ -62,6 +61,7 @@
     }
 
     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) {
@@ -113,36 +113,23 @@
                             }
                         }
                     }
-
-                    for (Node newNode : graph.getNewNodes()) {
-                        nodeWorkList.add(newNode);
-                    }
-                    if (canonical != null) {
-                        nodeWorkList.replaced(canonical, node, false);
-                    }
+                    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) {
-                    killFloating((FloatingNode) n);
+                    n.clearInputs();
+                    n.safeDelete();
                 }
             }
         }
     }
 
-
-    private static void killFloating(FloatingNode node) {
-        if (node.usages().size() == 0) {
-            node.clearInputs();
-            node.safeDelete();
-        }
-    }
-
     private static final class Tool implements SimplifierTool {
 
         private final NodeWorkList nodeWorkList;
@@ -160,89 +147,7 @@
         @Override
         public void deleteBranch(FixedNode branch) {
             branch.predecessor().replaceFirstSuccessor(branch, null);
-            killCFG(branch);
-        }
-
-        public void killCFG(FixedNode node) {
-            for (Node successor : node.successors()) {
-                if (successor != null) {
-                    node.replaceFirstSuccessor(successor, null);
-                    assert !node.isDeleted();
-                    killCFG((FixedNode) successor);
-                }
-            }
-            if (node instanceof LoopEndNode) {
-                LoopEndNode loopEnd = (LoopEndNode) node;
-                LoopBeginNode loopBegin = loopEnd.loopBegin();
-                if (loopBegin != null) {
-                    assert loopBegin.isAlive();
-                    assert loopBegin.endCount() == 1;
-                    EndNode predEnd = loopBegin.endAt(0);
-
-                    for (PhiNode phi : loopBegin.phis().snapshot()) {
-                        ValueNode value = phi.valueAt(0);
-                        phi.replaceAndDelete(value);
-                        nodeWorkList.replaced(value, phi, false);
-                    }
-                    FixedNode next = loopBegin.next();
-                    loopEnd.setLoopBegin(null);
-                    loopBegin.safeDelete();
-
-                    predEnd.replaceAndDelete(next);
-                }
-            } else if (node instanceof EndNode) {
-                EndNode end = (EndNode) node;
-                MergeNode merge = end.merge();
-                if (merge instanceof LoopBeginNode) {
-                    for (PhiNode phi : merge.phis().snapshot()) {
-                        ValueNode value = phi.valueAt(0);
-                        phi.replaceAndDelete(value);
-                        nodeWorkList.replaced(value, phi, false);
-                    }
-                    if (((LoopBeginNode) merge).loopEnd() != null) {
-                        ((LoopBeginNode) merge).loopEnd().setLoopBegin(null);
-                    }
-                    killCFG(merge);
-                } else {
-                    merge.removeEnd(end);
-                    if (merge.phiPredecessorCount() == 1) {
-                        for (PhiNode phi : merge.phis().snapshot()) {
-                            ValueNode value = phi.valueAt(0);
-                            phi.replaceAndDelete(value);
-                            nodeWorkList.replaced(value, phi, false);
-                        }
-                        Node replacedSux = merge.phiPredecessorAt(0);
-                        Node pred = replacedSux.predecessor();
-                        assert replacedSux instanceof EndNode;
-                        FixedNode next = merge.next();
-                        merge.setNext(null);
-                        pred.replaceFirstSuccessor(replacedSux, next);
-                        FrameState stateAfter = merge.stateAfter();
-                        merge.setStateAfter(null);
-                        if (stateAfter != null && stateAfter.usages().isEmpty()) {
-                            stateAfter.safeDelete();
-                        }
-                        merge.safeDelete();
-                        replacedSux.safeDelete();
-                    }
-                }
-            }
-            killNonCFG(node, null);
-        }
-
-        public void killNonCFG(Node node, Node input) {
-            if (node instanceof PhiNode) {
-                node.replaceFirstInput(input, null);
-            } else {
-                for (Node usage : node.usages().filter(isA(FloatingNode.class).or(CallTargetNode.class)).snapshot()) {
-                    if (!usage.isDeleted()) {
-                        killNonCFG(usage, node);
-                    }
-                }
-                // null out remaining usages
-                node.replaceAtUsages(null);
-                node.safeDelete();
-            }
+            GraphUtil.killCFG(branch);
         }
 
         /**
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/ComputeProbabilityPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/ComputeProbabilityPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -24,6 +24,7 @@
 
 import java.util.*;
 
+import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.graph.*;
 import com.oracle.max.graal.debug.*;
 import com.oracle.max.graal.graph.*;
@@ -70,26 +71,32 @@
     public static class LoopInfo {
         public final LoopBeginNode loopBegin;
 
-        public final Set<LoopInfo> requires = new HashSet<>(4);
+        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 factor = 1;
-                for (LoopInfo required : requires) {
-                    double t = required.loopFrequency();
-                    if (t == -1) {
-                        return -1;
+                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;
                     }
-                    factor *= t;
+                    backEdgeProb += le.probability() * factor;
                 }
-                double d = loopBegin.loopEnd().probability() * factor;
+                double d = backEdgeProb;
                 if (d < EPSILON) {
                     d = EPSILON;
                 } else if (d > loopBegin.probability() - EPSILON) {
@@ -125,7 +132,7 @@
 
         @Override
         public boolean merge(MergeNode merge, Collection<Probability> withStates) {
-            if (merge.endCount() > 1) {
+            if (merge.forwardEndCount() > 1) {
                 HashSet<LoopInfo> intersection = new HashSet<>(loops);
                 for (Probability other : withStates) {
                     intersection.retainAll(other.loops);
@@ -167,11 +174,21 @@
         }
 
         @Override
-        public void loopEnd(LoopEndNode loopEnd, Probability loopEndState) {
+        public void loopEnds(LoopBeginNode loopBegin, Collection<Probability> loopEndStates) {
             assert loopInfo != null;
-            for (LoopInfo innerLoop : loopEndState.loops) {
-                if (innerLoop != loopInfo && !loops.contains(innerLoop)) {
-                    loopInfo.requires.add(innerLoop);
+            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;
@@ -226,8 +243,8 @@
 
         @Override
         public boolean merge(MergeNode merge, Collection<LoopCount> withStates) {
-            assert merge.endCount() == withStates.size() + 1;
-            if (merge.endCount() > 1) {
+            assert merge.forwardEndCount() == withStates.size() + 1;
+            if (merge.forwardEndCount() > 1) {
                 Set<LoopInfo> loops = mergeLoops.get(merge);
                 assert loops != null;
                 double countProd = 1;
@@ -245,7 +262,7 @@
         }
 
         @Override
-        public void loopEnd(LoopEndNode loopEnd, LoopCount loopEndState) {
+        public void loopEnds(LoopBeginNode loopBegin, Collection<LoopCount> loopEndStates) {
             // nothing to do...
         }
 
@@ -256,14 +273,51 @@
     }
 
     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(node.probability() * state.count);
+            node.setProbability(policy.compute(node.probability(), state.count));
+        }
+
+        private FrequencyPropagationPolicy createFrequencyPropagationPolicy() {
+            switch (GraalOptions.LoopFrequencyPropagationPolicy) {
+                case 0: return new FullFrequencyPropagation();
+                case 1: return new NoFrequencyPropagation();
+                case 2: return new LogarithmicFrequencyPropagation();
+                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;
+        }
+    }
+
+    private static class LogarithmicFrequencyPropagation implements FrequencyPropagationPolicy {
+        @Override
+        public double compute(double probability, double frequency) {
+            double result = Math.pow(probability, 1.5) * Math.log(frequency);
+            return Math.max(probability, result);
         }
     }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -43,9 +43,9 @@
 
         // remove chained Merges
         for (MergeNode merge : graph.getNodes(MergeNode.class)) {
-            if (merge.endCount() == 1 && !(merge instanceof LoopBeginNode)) {
+            if (merge.forwardEndCount() == 1 && !(merge instanceof LoopBeginNode)) {
                 replacePhis(merge);
-                EndNode endNode = merge.endAt(0);
+                EndNode endNode = merge.forwardEndAt(0);
                 FixedNode next = merge.next();
                 merge.safeDelete();
                 endNode.replaceAndDelete(next);
@@ -76,21 +76,21 @@
                 }
             }
         }
-        for (LoopEndNode node : graph.getNodes(LoopEndNode.class)) {
-            if (!flood.isMarked(node)) {
-                LoopBeginNode loop = node.loopBegin();
-                if (flood.isMarked(loop)) {
+        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);
-                    node.setLoopBegin(null);
-                    EndNode endNode = loop.endAt(0);
-                    assert endNode.predecessor() != null;
-                    replacePhis(loop);
-                    loop.removeEnd(endNode);
-
-                    FixedNode next = loop.next();
-                    loop.setNext(null);
-                    endNode.replaceAndDelete(next);
-                    loop.safeDelete();
+                    for (LoopEndNode end : loop.loopEnds().snapshot()) {
+                        loop.removeEnd(end);
+                    }
+                    graph.reduceDegenerateLoopBegin(loop);
                 }
             }
         }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -28,6 +28,7 @@
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.graph.*;
+import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.debug.*;
 import com.oracle.max.graal.graph.*;
@@ -40,67 +41,6 @@
 
 
 public class EscapeAnalysisPhase extends Phase {
-    public static class GraphOrder implements Iterable<Node> {
-
-        private final ArrayList<Node> nodes = new ArrayList<>();
-
-        public GraphOrder(Graph graph) {
-            NodeBitMap visited = graph.createNodeBitMap();
-
-            for (ReturnNode node : graph.getNodes(ReturnNode.class)) {
-                visit(visited, node);
-            }
-            for (UnwindNode node : graph.getNodes(UnwindNode.class)) {
-                visit(visited, node);
-            }
-            for (DeoptimizeNode node : graph.getNodes(DeoptimizeNode.class)) {
-                visit(visited, node);
-            }
-        }
-
-        private void visit(NodeBitMap visited, Node node) {
-            if (node != null && !visited.isMarked(node)) {
-                visited.mark(node);
-                for (Node input : node.inputs()) {
-                    visit(visited, input);
-                }
-                if (node.predecessor() != null) {
-                    visit(visited, node.predecessor());
-                }
-                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();
-                }
-            };
-        }
-    }
 
     public static class BlockExitState implements MergeableState<BlockExitState> {
         public final ValueNode[] fieldState;
@@ -189,15 +129,15 @@
         }
 
         @Override
-        public void loopEnd(LoopEndNode x, BlockExitState loopEndState) {
+        public void loopEnds(LoopBeginNode loopBegin, Collection<BlockExitState> loopEndStates) {
             while (!(virtualObjectField instanceof PhiNode)) {
                 virtualObjectField = ((VirtualObjectFieldNode) virtualObjectField).lastState();
             }
-            ((PhiNode) virtualObjectField).addInput(loopEndState.virtualObjectField);
-            assert ((PhiNode) virtualObjectField).valueCount() == 2;
-            for (int i2 = 0; i2 < fieldState.length; i2++) {
-                ((PhiNode) fieldState[i2]).addInput(loopEndState.fieldState[i2]);
-                assert ((PhiNode) fieldState[i2]).valueCount() == 2;
+            for (BlockExitState loopEndState : loopEndStates) {
+                ((PhiNode) virtualObjectField).addInput(loopEndState.virtualObjectField);
+                for (int i2 = 0; i2 < fieldState.length; i2++) {
+                    ((PhiNode) fieldState[i2]).addInput(loopEndState.fieldState[i2]);
+                }
             }
         }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FloatingReadPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FloatingReadPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -57,10 +57,8 @@
 
             for (Map.Entry<Object, Node> entry : loopEntryMap.entrySet()) {
                 PhiNode phiNode = (PhiNode) entry.getValue();
-                assert phiNode.valueCount() == 1;
-
+                Object key = entry.getKey();
                 Node other;
-                Object key = entry.getKey();
                 if (otherMemoryMap.map.containsKey(key)) {
                     other = otherMemoryMap.map.get(key);
                 } else {
@@ -113,7 +111,7 @@
                 PhiNode phi = (PhiNode) original;
                 phi.addInput((ValueNode) newValue);
                 Debug.log("Add new input to %s: %s.", original, newValue);
-                assert phi.valueCount() <= phi.merge().endCount() : phi.merge();
+                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) {
@@ -121,7 +119,7 @@
                 }
                 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().endCount() + ((phi.merge() instanceof LoopBeginNode) ? 1 : 0) : phi.merge() + "/" + phi.valueCount() + "/" + phi.merge().endCount() + "/" + mergeOperationCount;
+                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()) {
@@ -263,10 +261,10 @@
             if (b.isLoopHeader()) {
                 Loop loop = b.getLoop();
                 map.createLoopEntryMemoryMap(modifiedValues.get(loop), loop);
-            } else {
-                for (int i = 1; i < b.getPredecessors().size(); ++i) {
-                    assert b.getBeginNode() instanceof MergeNode : b.getBeginNode();
-                    Block block = b.getPredecessors().get(i);
+            }
+            for (int i = 1; i < b.getPredecessors().size(); ++i) {
+                Block block = b.getPredecessors().get(i);
+                if (!block.isLoopEnd()) {
                     map.mergeWith(memoryMaps[block.getId()], b);
                 }
             }
@@ -313,40 +311,4 @@
     private static void traceWrite(Loop loop, Object locationIdentity, HashMap<Loop, Set<Object>> modifiedValues) {
         modifiedValues.get(loop).add(locationIdentity);
     }
-
-    private void mark(LoopBeginNode begin, LoopBeginNode outer, NodeMap<LoopBeginNode> nodeToLoop) {
-
-        if (nodeToLoop.get(begin) != null) {
-            // Loop already processed.
-            return;
-        }
-        nodeToLoop.set(begin, begin);
-
-        NodeFlood workCFG = begin.graph().createNodeFlood();
-        workCFG.add(begin.loopEnd());
-        for (Node n : workCFG) {
-            if (n == begin) {
-                // Stop at loop begin.
-                continue;
-            }
-            markNode(n, begin, outer, nodeToLoop);
-
-            for (Node pred : n.cfgPredecessors()) {
-                workCFG.add(pred);
-            }
-        }
-    }
-
-    private void markNode(Node n, LoopBeginNode begin, LoopBeginNode outer, NodeMap<LoopBeginNode> nodeToLoop) {
-        LoopBeginNode oldMark = nodeToLoop.get(n);
-        if (oldMark == null || oldMark == outer) {
-
-            // We have an inner loop, start marking it.
-            if (n instanceof LoopBeginNode) {
-                mark((LoopBeginNode) n, begin, nodeToLoop);
-            }
-
-            nodeToLoop.set(n, begin);
-        }
-    }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -53,11 +53,13 @@
     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;
@@ -65,6 +67,7 @@
         this.hints = hints;
         this.assumptions = assumptions;
         this.plan = plan;
+        this.weightComputationPolicy = createWeightComputationPolicy();
         this.inliningPolicy = createInliningPolicy();
     }
 
@@ -74,7 +77,7 @@
         graph.createNodeMap();
 
         if (hints != null) {
-            scanInvokes((Iterable<? extends Node>) Util.uncheckedCast(this.hints), 0, graph);
+            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);
@@ -88,7 +91,7 @@
                     try {
                         info.inline(graph, runtime, this);
                         Debug.log("inlining %f: %s", info.weight, info);
-                        Debug.dump(graph, "after inlining %s", info);
+                        Debug.dump(graph, "after %s", info);
                         // get the new nodes here, the canonicalizer phase will reset the mark
                         newNodes = graph.getNewNodes();
                         if (GraalOptions.OptCanonicalizer) {
@@ -109,11 +112,15 @@
                         throw e.addContext(info.toString());
                     }
                 }
-                if (newNodes != null && info.level <= GraalOptions.MaximumInlineLevel) {
+                if (newNodes != null && info.level < GraalOptions.MaximumInlineLevel) {
                     scanInvokes(newNodes, info.level + 1, graph);
                 }
             }
         }
+
+        if (GraalOptions.Debug && graph.getNodeCount() >= GraalOptions.MaximumDesiredSize) {
+            metricInliningStoppedByMaxDesiredSize.increment();
+        }
     }
 
     private void scanInvokes(Iterable<? extends Node> newNodes, int level, StructuredGraph graph) {
@@ -132,8 +139,9 @@
     }
 
     private void scanInvoke(Invoke invoke, int level) {
-        InlineInfo info = InliningUtil.getInlineInfo(invoke, level, runtime, assumptions, this);
+        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);
         }
@@ -153,14 +161,16 @@
             new DeadCodeEliminationPhase().apply(newGraph);
             new ComputeProbabilityPhase().apply(newGraph);
         }
-        new CanonicalizerPhase(target, runtime, assumptions).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 inliningPolicy.computeWeight(caller, method, invoke, preferred);
+        return weightComputationPolicy.computeWeight(caller, method, invoke, preferred);
     }
 
     public static int graphComplexity(StructuredGraph graph) {
@@ -187,27 +197,119 @@
         assumptions.recordConcreteMethod(method, context, impl);
     }
 
-    private InliningPolicy createInliningPolicy() {
-        if (GraalOptions.InliningPolicy == 0) {
-            return new WeightBasedInliningPolicy();
-        } else if (GraalOptions.InliningPolicy == 1) {
-            return new StaticSizeBasedInliningPolicy();
-        } else if (GraalOptions.InliningPolicy == 2) {
-            return new DynamicSizeBasedInliningPolicy();
-        } else if (GraalOptions.InliningPolicy == 3) {
-            return new GreedySizeBasedInliningPolicy();
-        } else {
-            GraalInternalError.shouldNotReachHere();
-            return null;
+    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 {
-        double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke);
         boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info);
     }
 
-    private class WeightBasedInliningPolicy implements InliningPolicy {
+    private static class WeightBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            if (GraalOptions.SmallCompiledCodeSize >= 0 && info.compiledCodeSize() > GraalOptions.SmallCompiledCodeSize) {
+                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", info.weight);
+                return false;
+            }
+            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 info.weight <= maxSize;
+        }
+    }
+
+    private static class MinimumCodeSizeBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            assert GraalOptions.ProbabilityAnalysis;
+            if (GraalOptions.SmallCompiledCodeSize >= 0 && info.compiledCodeSize() > GraalOptions.SmallCompiledCodeSize) {
+                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 info.weight <= maxSize;
+        }
+    }
+
+    private static class DynamicSizeBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            assert GraalOptions.ProbabilityAnalysis;
+            if (GraalOptions.SmallCompiledCodeSize >= 0 && info.compiledCodeSize() > GraalOptions.SmallCompiledCodeSize) {
+                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 info.weight <= maxSize;
+        }
+    }
+
+    private static class GreedySizeBasedInliningPolicy implements InliningPolicy {
+        @Override
+        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
+            assert GraalOptions.ProbabilityAnalysis;
+            if (GraalOptions.SmallCompiledCodeSize >= 0 && info.compiledCodeSize() > GraalOptions.SmallCompiledCodeSize) {
+                return false;
+            }
+
+            double inlineRatio = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability());
+            double maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumGreedyInlineSize * inlineRatio;
+            maxSize = Math.max(maxSize, GraalOptions.MaximumInlineSize);
+            return info.weight <= maxSize;
+        }
+    }
+
+    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;
@@ -252,7 +354,9 @@
                     if (plan != null) {
                         plan.runPhases(PhasePosition.AFTER_PARSING, newGraph);
                     }
-                    new CanonicalizerPhase(target, runtime, assumptions).apply(newGraph);
+                    if (GraalOptions.OptCanonicalizer) {
+                        new CanonicalizerPhase(target, runtime, assumptions).apply(newGraph);
+                    }
                     count = graphComplexity(newGraph);
                     parsedMethods.put(method, count);
                 } else {
@@ -264,36 +368,9 @@
 
             return count / normalSize;
         }
-
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            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", info.weight);
-                return false;
-            }
-            return true;
-        }
     }
 
-    private class StaticSizeBasedInliningPolicy implements InliningPolicy {
-        @Override
-        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
-            double codeSize = method.codeSize();
-            if (preferredInvoke) {
-                codeSize = codeSize / GraalOptions.BoostInliningForEscapeAnalysis;
-            }
-            return codeSize;
-        }
-
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            double maxSize = Math.max(GraalOptions.MaximumTrivialSize, Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize);
-            return info.weight <= maxSize;
-        }
-    }
-
-    private class DynamicSizeBasedInliningPolicy implements InliningPolicy {
+    private static class BytecodeSizeBasedWeightComputationPolicy implements WeightComputationPolicy {
         @Override
         public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
             double codeSize = method.codeSize();
@@ -302,41 +379,16 @@
             }
             return codeSize;
         }
-
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            assert GraalOptions.ProbabilityAnalysis;
-            if (info.compiledCodeSize() <= GraalOptions.SmallCompiledCodeSize) {
-                double inlineBoost = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability());
-                double maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumInlineSize;
-                maxSize = maxSize + maxSize * inlineBoost;
-                maxSize = Math.max(GraalOptions.MaximumTrivialSize, maxSize);
-                return info.weight <= maxSize;
-            }
-            return false;
-        }
     }
 
-    private class GreedySizeBasedInliningPolicy implements InliningPolicy {
+    private static class ComplexityBasedWeightComputationPolicy implements WeightComputationPolicy {
         @Override
         public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
-            double codeSize = method.codeSize();
+            double complexity = method.compilationComplexity();
             if (preferredInvoke) {
-                codeSize = codeSize / GraalOptions.BoostInliningForEscapeAnalysis;
+                complexity = complexity / GraalOptions.BoostInliningForEscapeAnalysis;
             }
-            return codeSize;
-        }
-
-        @Override
-        public boolean isWorthInlining(StructuredGraph callerGraph, InlineInfo info) {
-            assert GraalOptions.ProbabilityAnalysis;
-            if (info.compiledCodeSize() <= GraalOptions.SmallCompiledCodeSize) {
-                double inlineRatio = Math.min(GraalOptions.ProbabilityCapForInlining, info.invoke.probability());
-                double maxSize = Math.pow(GraalOptions.NestedInliningSizeRatio, info.level) * GraalOptions.MaximumGreedyInlineSize * inlineRatio;
-                maxSize = Math.max(maxSize, GraalOptions.MaximumInlineSize);
-                return info.weight <= maxSize;
-            }
-            return false;
+            return complexity;
         }
     }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IntrinsificationPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IntrinsificationPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -47,20 +47,31 @@
         }
     }
 
-    public static void tryIntrinsify(Invoke invoke, GraalRuntime runtime) {
-        RiResolvedMethod target = invoke.callTarget().targetMethod();
-        tryIntrinsify(invoke, target, runtime);
+    public static boolean canIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
+        return getIntrinsicGraph(invoke, target, runtime) != null;
     }
 
-    public static void tryIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) {
+    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 (ph) remove once all intrinsics are available via RiMethod
             intrinsicGraph = runtime.intrinsicGraph(invoke.stateAfter().method(), invoke.bci(), target, invoke.callTarget().arguments());
         }
-        if (intrinsicGraph != null) {
-            Debug.log(" > Intrinsify %s", target);
-            InliningUtil.inline(invoke, intrinsicGraph, true);
-        }
+        return intrinsicGraph;
     }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/SchedulePhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/SchedulePhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -24,7 +24,6 @@
 
 import java.util.*;
 
-import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.phases.*;
@@ -55,6 +54,21 @@
         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;
     }
@@ -102,6 +116,7 @@
         } 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 : inconsisitant for " + n;
         } else {
             block = latestBlock;
         }
@@ -204,10 +219,11 @@
                         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));
+                    closure.apply(mergeBlock.getPredecessors().get(i));
                 }
             }
         } else if (usage instanceof FrameState && ((FrameState) usage).block() != null) {
@@ -272,9 +288,11 @@
             if (canNotMove) {
                 // (cwi) this was the assertion commented out below.  However, it is failing frequently when the
                 // scheduler is used for debug printing in early compiler phases. This was annoying during debugging
-                // when an excpetion breakpoint is set for assertion errors, so I changed it to a bailout.
+                // when an exception breakpoint is set for assertion errors, so I changed it to a bailout.
                 if (b.getEndNode() instanceof ControlSplitNode) {
-                    throw new CiBailout("");
+                    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());
                 }
                 //assert !(b.lastNode() instanceof ControlSplitNode);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/UnscheduleNodes.java	Mon Feb 20 18:01:22 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.max.graal.compiler.schedule;
+
+import java.util.*;
+
+import com.oracle.max.graal.compiler.graph.*;
+import com.oracle.max.graal.compiler.types.*;
+import com.oracle.max.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/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Mon Feb 20 18:01:22 2012 +0100
@@ -26,7 +26,6 @@
 import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static com.oracle.max.graal.lir.amd64.AMD64Arithmetic.*;
 import static com.oracle.max.graal.lir.amd64.AMD64Compare.*;
-import static com.oracle.max.graal.lir.amd64.AMD64CompareToIntOpcode.*;
 
 import java.util.*;
 
@@ -599,27 +598,4 @@
             postGCWriteBarrier(address.base, newValue);
         }
     }
-
-    // TODO The class NormalizeCompareNode should be lowered away in the front end, since the code generated is long and uses branches anyway.
-    @Override
-    public void visitNormalizeCompare(NormalizeCompareNode x) {
-        emitCompare(operand(x.x()), operand(x.y()));
-        Variable result = newVariable(x.kind());
-        switch (x.x().kind()){
-            case Float:
-            case Double:
-                if (x.isUnorderedLess) {
-                    append(CMP2INT_UL.create(result));
-                } else {
-                    append(CMP2INT_UG.create(result));
-                }
-                break;
-            case Long:
-                append(CMP2INT.create(result));
-                break;
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-        setResult(x, result);
-    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/types/PostOrderBlockIterator.java	Mon Feb 20 18:01:22 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.max.graal.compiler.types;
+
+import java.util.*;
+
+import com.oracle.max.graal.graph.*;
+import com.oracle.max.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.max.graal.compiler/src/com/oracle/max/graal/compiler/types/PropagateTypesPhase.java	Mon Feb 20 18:01:22 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.max.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.max.graal.compiler.graph.*;
+import com.oracle.max.graal.compiler.phases.*;
+import com.oracle.max.graal.compiler.schedule.*;
+import com.oracle.max.graal.debug.*;
+import com.oracle.max.graal.graph.*;
+import com.oracle.max.graal.graph.NodeClass.NodeClassIterator;
+import com.oracle.max.graal.graph.NodeClass.Position;
+import com.oracle.max.graal.nodes.*;
+import com.oracle.max.graal.nodes.calc.*;
+import com.oracle.max.graal.nodes.java.*;
+import com.oracle.max.graal.nodes.spi.*;
+import com.oracle.max.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.max.graal.compiler/src/com/oracle/max/graal/compiler/types/ScheduledNodeIterator.java	Mon Feb 20 18:01:22 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.max.graal.compiler.types;
+
+import java.util.*;
+
+import com.oracle.max.graal.compiler.graph.*;
+import com.oracle.max.graal.graph.*;
+import com.oracle.max.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.max.graal.compiler/src/com/oracle/max/graal/compiler/util/GraphOrder.java	Mon Feb 20 18:01:22 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.max.graal.compiler.util;
+
+import java.util.*;
+
+import com.oracle.max.graal.graph.*;
+import com.oracle.max.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/max/graal/compiler/util/InliningUtil.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java	Mon Feb 20 18:01:22 2012 +0100
@@ -28,7 +28,9 @@
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.Representation;
 import com.oracle.max.graal.compiler.*;
+import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.debug.*;
 import com.oracle.max.graal.graph.*;
@@ -126,6 +128,7 @@
         @Override
         public void inline(StructuredGraph compilerGraph, GraalRuntime runtime, final InliningCallback callback) {
             StructuredGraph graph = getGraph(concrete, callback);
+            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
             InliningUtil.inline(invoke, graph, true);
         }
 
@@ -168,17 +171,24 @@
         public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) {
             // receiver null check must be before the type check
             InliningUtil.receiverNullCheck(invoke);
-            ReadHubNode objectClass = graph.add(new ReadHubNode(invoke.callTarget().receiver()));
+            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);
 
             Debug.log("inlining 1 method using 1 type check");
 
             StructuredGraph calleeGraph = getGraph(concrete, callback);
+            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
             InliningUtil.inline(invoke, calleeGraph, false);
         }
 
@@ -234,9 +244,9 @@
             // receiver null check must be the first node
             InliningUtil.receiverNullCheck(invoke);
             if (numberOfMethods > 1 || shouldFallbackToInvoke()) {
-                inlineMultipleMethods(graph, callback, numberOfMethods, hasReturnValue);
+                inlineMultipleMethods(graph, runtime, callback, numberOfMethods, hasReturnValue);
             } else {
-                inlineSingleMethod(graph, callback);
+                inlineSingleMethod(graph, runtime, callback);
             }
 
             Debug.log("inlining %d methods with %d type checks and falling back to %s if violated", numberOfMethods, types.length, shouldFallbackToInvoke() ? "invocation" : "deoptimization");
@@ -246,13 +256,13 @@
             return notRecordedTypeProbability > 0;
         }
 
-        private void inlineMultipleMethods(StructuredGraph graph, InliningCallback callback, int numberOfMethods, boolean hasReturnValue) {
+        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());
+            returnMerge.setStateAfter(invoke.stateAfter().duplicate(invoke.stateAfter().bci));
 
             PhiNode returnValuePhi = null;
             if (hasReturnValue) {
@@ -268,7 +278,7 @@
 
                 exceptionMerge = graph.add(new MergeNode());
                 exceptionMerge.setProbability(exceptionEdge.probability());
-                exceptionMerge.setStateAfter(exceptionEdge.stateAfter());
+                exceptionMerge.setStateAfter(exceptionEdge.stateAfter().duplicate(invoke.stateAfter().bci));
 
                 FixedNode exceptionSux = exceptionObject.next();
                 graph.addBeforeFixed(exceptionSux, exceptionMerge);
@@ -315,12 +325,35 @@
             for (int i = 0; i < calleeEntryNodes.length; i++) {
                 BeginNode node = calleeEntryNodes[i];
                 Invoke invokeForInlining = (Invoke) node.next();
-                StructuredGraph calleeGraph = getGraph(concretes.get(i), callback);
+
+                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);
+                assert !IntrinsificationPhase.canIntrinsify(invokeForInlining, concrete, runtime);
                 InliningUtil.inline(invokeForInlining, calleeGraph, false);
             }
         }
 
-        private void inlineSingleMethod(StructuredGraph graph, InliningCallback callback) {
+        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());
@@ -335,7 +368,9 @@
             pred.setNext(dispatchOnType);
             calleeEntryNode.setNext(invoke.node());
 
-            StructuredGraph calleeGraph = getGraph(concretes.get(0), callback);
+            RiResolvedMethod concrete = concretes.get(0);
+            StructuredGraph calleeGraph = getGraph(concrete, callback);
+            assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
             InliningUtil.inline(invoke, calleeGraph, false);
         }
 
@@ -358,7 +393,7 @@
             if (tsux instanceof MergeNode) {
                 EndNode endNode = graph.add(new EndNode());
                 result = graph.add(new IfNode(isTypeNode, endNode, nextNode, tsuxProbability));
-                ((MergeNode) tsux).addEnd(endNode);
+                ((MergeNode) tsux).addForwardEnd(endNode);
             } else {
                 result = graph.add(new IfNode(isTypeNode, tsux, nextNode, tsuxProbability));
             }
@@ -389,7 +424,7 @@
             EndNode endNode = graph.add(new EndNode());
             // TODO (ch) set probability
             duplicatedInvoke.setNext(endNode);
-            returnMerge.addEnd(endNode);
+            returnMerge.addForwardEnd(endNode);
             if (returnValuePhi != null) {
                 returnValuePhi.addInput(duplicatedInvoke.node());
             }
@@ -398,6 +433,8 @@
 
         private static Invoke duplicateInvokeForInlining(StructuredGraph graph, Invoke invoke, MergeNode exceptionMerge, PhiNode exceptionObjectPhi, boolean useForInlining) {
             Invoke result = (Invoke) invoke.node().copyWithInputs();
+            Node callTarget = result.callTarget().copyWithInputs();
+            result.node().replaceFirstInput(result.callTarget(), callTarget);
             result.setUseForInlining(useForInlining);
 
             CiKind kind = invoke.node().kind();
@@ -424,7 +461,7 @@
 
                 EndNode endNode = graph.add(new EndNode());
                 newExceptionObject.setNext(endNode);
-                exceptionMerge.addEnd(endNode);
+                exceptionMerge.addForwardEnd(endNode);
                 exceptionObjectPhi.addInput(newExceptionObject);
 
                 ((InvokeWithExceptionNode) result).setExceptionEdge(newExceptionEdge);
@@ -497,25 +534,29 @@
         }
         RiResolvedMethod parent = invoke.stateAfter().method();
         MethodCallTargetNode callTarget = invoke.callTarget();
+        RiResolvedMethod targetMethod = callTarget.targetMethod();
 
-        if (callTarget.invokeKind() == InvokeKind.Special || callTarget.targetMethod().canBeStaticallyBound()) {
-            if (checkTargetConditions(callTarget.targetMethod())) {
-                double weight = callback == null ? 0 : callback.inliningWeight(parent, callTarget.targetMethod(), invoke);
-                return new ExactInlineInfo(invoke, weight, level, 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(callTarget.targetMethod().holder()) : exact + " subtype of " + callTarget.targetMethod().holder();
-            RiResolvedMethod resolved = exact.resolveMethodImpl(callTarget.targetMethod());
-            if (checkTargetConditions(resolved)) {
+            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 = callTarget.targetMethod().holder();
+        RiResolvedType holder = targetMethod.holder();
 
         if (callTarget.receiver().declaredType() != null) {
             RiResolvedType declared = callTarget.receiver().declaredType();
@@ -527,9 +568,9 @@
         }
         // TODO (tw) fix this
         if (assumptions != null) {
-            RiResolvedMethod concrete = holder.uniqueConcreteMethod(callTarget.targetMethod());
+            RiResolvedMethod concrete = holder.uniqueConcreteMethod(targetMethod);
             if (concrete != null) {
-                if (checkTargetConditions(concrete)) {
+                if (checkTargetConditions(invoke, concrete)) {
                     double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
                     return new AssumptionInlineInfo(invoke, weight, level, holder, concrete);
                 }
@@ -550,16 +591,16 @@
                 if (types.length == 1 && notRecordedTypeProbability == 0) {
                     if (GraalOptions.InlineMonomorphicCalls) {
                         RiResolvedType type = types[0];
-                        RiResolvedMethod concrete = type.resolveMethodImpl(callTarget.targetMethod());
-                        if (checkTargetConditions(concrete)) {
+                        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(callTarget.targetMethod(), invoke));
+                        Debug.log("not inlining %s because method can't be inlined", methodName(targetMethod, invoke));
                         return null;
                     } else {
-                        Debug.log("not inlining %s because GraalOptions.InlinePolymorphicCalls == false", methodName(callTarget.targetMethod(), invoke));
+                        Debug.log("not inlining %s because GraalOptions.InlinePolymorphicCalls == false", methodName(targetMethod, invoke));
                         return null;
                     }
                 } else {
@@ -576,7 +617,7 @@
                         ArrayList<RiResolvedMethod> concreteMethods = new ArrayList<>();
                         int[] typesToConcretes = new int[types.length];
                         for (int i = 0; i < types.length; i++) {
-                            RiResolvedMethod concrete = types[i].resolveMethodImpl(callTarget.targetMethod());
+                            RiResolvedMethod concrete = types[i].resolveMethodImpl(targetMethod);
 
                             int index = concreteMethods.indexOf(concrete);
                             if (index < 0) {
@@ -589,7 +630,7 @@
                         double totalWeight = 0;
                         boolean canInline = true;
                         for (RiResolvedMethod concrete: concreteMethods) {
-                            if (!checkTargetConditions(concrete)) {
+                            if (!checkTargetConditions(invoke, concrete)) {
                                 canInline = false;
                                 break;
                             }
@@ -600,24 +641,31 @@
                             convertTypeToBranchProbabilities(probabilities, notRecordedTypeProbability);
                             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(callTarget.targetMethod(), invoke));
+                            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 {
-                        Debug.log("not inlining %s because GraalOptions.InlineMonomorphicCalls == false", methodName(callTarget.targetMethod(), invoke));
+                        Debug.log("not inlining %s because GraalOptions.InlineMonomorphicCalls == false", methodName(targetMethod, invoke));
                         return null;
                     }
                 }
             }
 
-            Debug.log("not inlining %s because no types/probabilities were recorded", methodName(callTarget.targetMethod(), invoke));
+            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(callTarget.targetMethod(), invoke));
+            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 void convertTypeToBranchProbabilities(double[] typeProbabilities, double notRecordedTypeProbability) {
         // avoid branches with 0.0/1.0 probability
         double total = Math.max(1E-10, notRecordedTypeProbability);
@@ -645,9 +693,9 @@
         return true;
     }
 
-    private static boolean checkTargetConditions(RiMethod method) {
+    private static boolean checkTargetConditions(Invoke invoke, RiMethod method) {
         if (method == null) {
-            Debug.log("method not resolved");
+            Debug.log("not inlining because method is not resolved");
             return false;
         }
         if (!(method instanceof RiResolvedMethod)) {
@@ -671,9 +719,28 @@
             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
@@ -761,7 +828,11 @@
             if (GraalOptions.ProbabilityAnalysis) {
                 if (node instanceof FixedNode) {
                     FixedNode fixed = (FixedNode) node;
-                    fixed.setProbability(fixed.probability() * invokeProbability);
+                    double newProbability = fixed.probability() * invokeProbability;
+                    if (GraalOptions.LimitInlinedProbability) {
+                        newProbability = Math.min(newProbability, invokeProbability);
+                    }
+                    fixed.setProbability(newProbability);
                 }
             }
             if (node instanceof FrameState) {
@@ -775,7 +846,6 @@
                     frameState.replaceAndDelete(stateAfter);
                 } else if (frameState.bci == FrameState.AFTER_EXCEPTION_BCI) {
                     if (frameState.isAlive()) {
-                        // TODO (ch) it happens sometimes that we have a FrameState.AFTER_EXCEPTION_BCI but no stateAtExceptionEdge
                         assert stateAtExceptionEdge != null;
                         frameState.replaceAndDelete(stateAtExceptionEdge);
                     } else {
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/max/graal/debug/Debug.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.debug/src/com/oracle/max/graal/debug/Debug.java	Mon Feb 20 18:01:22 2012 +0100
@@ -156,7 +156,7 @@
         }
     }
 
-    public static DebugConfig fixedConfig(final boolean isLogEnabled, final boolean isDumpEnabled, final boolean isMeterEnabled, final boolean isTimerEnabled, final List<DebugDumpHandler> dumpHandlers) {
+    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
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/max/graal/debug/internal/DebugScope.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.debug/src/com/oracle/max/graal/debug/internal/DebugScope.java	Mon Feb 20 18:01:22 2012 +0100
@@ -185,7 +185,7 @@
                     try {
                         return config.interceptException(e);
                     } catch (Throwable t) {
-                        return new RuntimeException("Exception while intercepting exception", e);
+                        return new RuntimeException("Exception while intercepting exception", t);
                     }
                 }
             }, false, new Object[] {e});
--- a/graal/com.oracle.max.graal.debug/src/com/oracle/max/graal/debug/internal/DebugValueMap.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.debug/src/com/oracle/max/graal/debug/internal/DebugValueMap.java	Mon Feb 20 18:01:22 2012 +0100
@@ -140,10 +140,12 @@
     }
 
     public void group() {
-        List<DebugValueMap> oldChildren = new ArrayList<>(this.children);
-        this.children.clear();
-        for (DebugValueMap map : oldChildren) {
-            mergeWith(map);
+        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.graph/src/com/oracle/max/graal/graph/GraalInternalError.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/GraalInternalError.java	Mon Feb 20 18:01:22 2012 +0100
@@ -77,7 +77,7 @@
         StringBuilder str = new StringBuilder();
         str.append(super.toString());
         for (String s : context) {
-            str.append("\n\t\tat ").append(s);
+            str.append("\n\tat ").append(s);
         }
         return str.toString();
     }
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Graph.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Graph.java	Mon Feb 20 18:01:22 2012 +0100
@@ -49,6 +49,7 @@
     private GraphEventLog eventLog;
 
     ArrayList<Node> usagesDropped = new ArrayList<>();
+    NodeWorkList inputChanged;
     private final HashMap<CacheEntry, Node> cachedNodes = new HashMap<>();
 
     private static final class CacheEntry {
@@ -159,6 +160,14 @@
         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
@@ -167,21 +176,24 @@
     @SuppressWarnings("unchecked")
     public <T extends Node & ValueNumberable> T unique(T node) {
         assert checkValueNumberable(node);
-        if (!node.getNodeClass().hasOutgoingEdges()) {
-            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;
+
+        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 duplicate = findDuplicate(node);
-            if (duplicate != null) {
-                return (T) duplicate;
-            }
-            return add(node);
+            Node result = add(node);
+            cachedNodes.put(new CacheEntry(node), result);
+            return (T) result;
         }
     }
 
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Node.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Node.java	Mon Feb 20 18:01:22 2012 +0100
@@ -86,7 +86,7 @@
     @Target(ElementType.METHOD)
     public static @interface NodeIntrinsic {
         /**
-         * Gets the {@link Node} subclass instantiated when intrinsifyng a call to the annotated method.
+         * 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).
          */
@@ -120,7 +120,7 @@
         nodeClass = NodeClass.get(getClass());
     }
 
-    int id() {
+    protected int id() {
         return id;
     }
 
@@ -180,6 +180,10 @@
                 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);
             }
         }
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/CompilerToVM.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/CompilerToVM.java	Mon Feb 20 18:01:22 2012 +0100
@@ -51,8 +51,6 @@
 
     HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
 
-    boolean HotSpotMethodData_isMature(HotSpotMethodData methodData);
-
     RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
 
     Object RiConstantPool_lookupConstant(HotSpotTypeResolved pool, int cpi);
@@ -75,6 +73,8 @@
 
     boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
 
+    RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
+
     RiType getPrimitiveArrayType(CiKind kind);
 
     RiType RiType_arrayOf(HotSpotTypeResolved klass);
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/CompilerToVMImpl.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/CompilerToVMImpl.java	Mon Feb 20 18:01:22 2012 +0100
@@ -93,6 +93,9 @@
     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
@@ -114,9 +117,6 @@
     public native HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
 
     @Override
-    public native boolean HotSpotMethodData_isMature(HotSpotMethodData methodData);
-
-    @Override
     public native RiType getType(Class<?> javaClass);
 
     @Override
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java	Mon Feb 20 18:01:22 2012 +0100
@@ -50,6 +50,7 @@
 
     private final Compiler compiler;
     private int compiledMethodCount;
+    private long totalCompilationTime;
     private IntrinsifyArrayCopyPhase intrinsifyArrayCopy;
 
     public final HotSpotTypePrimitive typeBoolean;
@@ -108,15 +109,26 @@
     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.
-        HotSpotRuntime runtime = (HotSpotRuntime) compiler.getCompiler().runtime;
+        final HotSpotRuntime runtime = (HotSpotRuntime) compiler.getCompiler().runtime;
         if (GraalOptions.Intrinsify) {
-            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);
+            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.
@@ -194,17 +206,58 @@
             List<DebugValueMap> topLevelMaps = DebugValueMap.getTopLevelMaps();
             List<DebugValue> debugValues = KeyRegistry.getDebugValues();
             if (debugValues.size() > 0) {
-                for (DebugValueMap map : topLevelMaps) {
-                    TTY.println("Showing the results for thread: " + map.getName());
-                    map.group();
-                    map.normalize();
-                    printMap(map, debugValues, 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 void printMap(DebugValueMap map, List<DebugValue> debugValues, int level) {
+    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());
@@ -248,16 +301,16 @@
                         final PhasePlan plan = getDefaultPhasePlan();
                         GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(compiler.getRuntime());
                         plan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
-                        long startTime = 0;
+                        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()));
-                            startTime = System.nanoTime();
                         }
 
                         CiTargetMethod result = null;
                         TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
+                        long nanoTime;
                         try {
                             result = Debug.scope("Compiling", method, new Callable<CiTargetMethod>() {
                                 @Override
@@ -267,9 +320,10 @@
                             });
                         } finally {
                             filter.remove();
+                            nanoTime = System.nanoTime() - startTime;
+                            totalCompilationTime += nanoTime;
                             if (printCompilation) {
-                                long time = (System.nanoTime() - startTime) / 100000;
-                                TTY.println(String.format("Graal %4d %-70s %-45s %-50s | %3d.%dms %4dnodes %5dB", index, "", "", "", time / 10, time % 10, 0, (result != null ? result.targetCodeSize()
+                                TTY.println(String.format("Graal %4d %-70s %-45s %-50s | %3d.%dms %4dnodes %5dB", index, "", "", "", nanoTime / 1000000, nanoTime % 1000000, 0, (result != null ? result.targetCodeSize()
                                                 : -1)));
                             }
                         }
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java	Mon Feb 20 18:01:22 2012 +0100
@@ -27,6 +27,7 @@
 import sun.misc.*;
 
 import com.oracle.max.cri.ri.*;
+import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.hotspot.Compiler;
 
@@ -45,7 +46,7 @@
     // TODO (ch) 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_POSSIBLE_ACCESSOR = new NoMethodData(RiExceptionSeen.UNKNOWN);
+    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 = {
@@ -57,7 +58,6 @@
     private Object hotspotMirror;
     private int normalDataSize;
     private int extraDataSize;
-    private boolean mature;
 
     private HotSpotMethodData(Compiler compiler) {
         super(compiler);
@@ -76,19 +76,6 @@
         return normalDataSize;
     }
 
-    public boolean isMature() {
-        // TODO (ch) maturity of profiling information is an issue in general. Not all optimizations require mature data as long as the code
-        // does deoptimize/recompile on violations (might decrease startup and increase peak performance).
-        // Maturity is currently used on several levels:
-        // 1) whole method data
-        // 2) individual branch/switch profiling data
-        // 3) MatureInvocationCount for eliminating exception edges
-        if (!mature) {
-            mature = compiler.getVMEntries().HotSpotMethodData_isMature(this);
-        }
-        return mature;
-    }
-
     public boolean isWithin(int position) {
         return position >= 0 && position < normalDataSize + extraDataSize;
     }
@@ -104,18 +91,18 @@
     }
 
     public HotSpotMethodDataAccessor getExtraData(int position) {
-        if (position >= extraDataSize) {
+        if (position >= normalDataSize + extraDataSize) {
             return null;
         }
         return getData(position);
     }
 
-    public static HotSpotMethodDataAccessor getNoDataNoExceptionAccessor() {
-        return NO_DATA_NO_EXCEPTION_ACCESSOR;
-    }
-
-    public static HotSpotMethodDataAccessor getNoDataExceptionPossibleAccessor() {
-        return NO_DATA_EXCEPTION_POSSIBLE_ACCESSOR;
+    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) {
@@ -381,7 +368,7 @@
             RiResolvedType[] types;
             double[] probabilities;
 
-            if (entries <= 0) {
+            if (entries <= 0 || totalCount < GraalOptions.MatureExecutionsTypeProfile) {
                 return null;
             } else if (entries < sparseTypes.length) {
                 types = Arrays.copyOf(sparseTypes, entries);
@@ -459,7 +446,6 @@
         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);
-        private static final int BRANCH_DATA_MATURE_COUNT = 40;
 
         public BranchData() {
             super(BRANCH_DATA_TAG, BRANCH_DATA_SIZE);
@@ -471,7 +457,7 @@
             long notTakenCount = data.readUnsignedInt(position, NOT_TAKEN_COUNT_OFFSET);
             long total = takenCount + notTakenCount;
 
-            if (total < BRANCH_DATA_MATURE_COUNT) {
+            if (total < GraalOptions.MatureExecutionsBranch) {
                 return -1;
             } else {
                 return takenCount / (double) total;
@@ -536,7 +522,7 @@
                 result[i - 1] = count;
             }
 
-            if (totalCount < 10 * (length + 2)) {
+            if (totalCount < GraalOptions.MatureExecutionsPerSwitchCase * length) {
                 return null;
             } else {
                 for (int i = 0; i < length; i++) {
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Mon Feb 20 18:01:22 2012 +0100
@@ -30,6 +30,7 @@
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
+import com.oracle.max.graal.java.*;
 
 /**
  * Implementation of RiMethod for resolved HotSpot methods.
@@ -59,6 +60,7 @@
     private byte[] code;
     private boolean canBeInlined;
     private CiGenericCallback callback;
+    private int compilationComplexity;
 
     private HotSpotMethodResolvedImpl() {
         super(null);
@@ -198,12 +200,28 @@
     }
 
     @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 || !methodData.isMature()) {
+        if (methodData == null) {
             return new HotSpotNoProfilingInfo(compiler);
         } else {
             return new HotSpotProfilingInfo(compiler, methodData);
@@ -266,8 +284,6 @@
         }
     }
 
-
-
     @Override
     public Annotation[][] getParameterAnnotations() {
         if (isConstructor()) {
@@ -309,7 +325,7 @@
 
     private Method toJava() {
         try {
-            return holder.toJava().getDeclaredMethod(name, CiUtil.signatureToTypes(signature, holder));
+            return holder.toJava().getDeclaredMethod(name, CiUtil.signatureToTypes(signature(), holder));
         } catch (NoSuchMethodException e) {
             return null;
         }
@@ -317,7 +333,7 @@
 
     private Constructor toJavaConstructor() {
         try {
-            return holder.toJava().getDeclaredConstructor(CiUtil.signatureToTypes(signature, holder));
+            return holder.toJava().getDeclaredConstructor(CiUtil.signatureToTypes(signature(), holder));
         } catch (NoSuchMethodException e) {
             return null;
         }
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotNoProfilingInfo.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotNoProfilingInfo.java	Mon Feb 20 18:01:22 2012 +0100
@@ -26,13 +26,17 @@
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.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;
-    private static final HotSpotMethodDataAccessor noData = HotSpotMethodData.getNoDataExceptionPossibleAccessor();
+    // 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);
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java	Mon Feb 20 18:01:22 2012 +0100
@@ -23,6 +23,7 @@
 package com.oracle.max.graal.hotspot.ri;
 
 import com.oracle.max.cri.ri.*;
+import com.oracle.max.graal.debug.*;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.hotspot.Compiler;
 
@@ -33,6 +34,7 @@
      *
      */
     private static final long serialVersionUID = -8307682725047864875L;
+    private static final DebugMetric metricInsufficentSpace = Debug.metric("InsufficientSpaceForProfilingData");
 
     private int position;
     private int hintPosition;
@@ -108,7 +110,10 @@
                 currentPosition = currentPosition + currentAccessor.getSize(methodData, currentPosition);
             }
 
-            exceptionPossiblyNotRecorded = !methodData.isWithin(currentPosition);
+            if (!methodData.isWithin(currentPosition)) {
+                exceptionPossiblyNotRecorded = true;
+                metricInsufficentSpace.increment();
+            }
         }
 
         noDataFound(exceptionPossiblyNotRecorded);
@@ -124,8 +129,8 @@
         setCurrentData(data, pos);
     }
 
-    private void noDataFound(boolean exceptionPossible) {
-        HotSpotMethodDataAccessor accessor = exceptionPossible ? HotSpotMethodData.getNoDataNoExceptionAccessor() : HotSpotMethodData.getNoDataNoExceptionAccessor();
+    private void noDataFound(boolean exceptionPossiblyNotRecorded) {
+        HotSpotMethodDataAccessor accessor = HotSpotMethodData.getNoDataAccessor(exceptionPossiblyNotRecorded);
         setCurrentData(accessor, -1);
     }
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotRuntime.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotRuntime.java	Mon Feb 20 18:01:22 2012 +0100
@@ -269,7 +269,7 @@
                     if (elementType.superType() != null) {
                         AnchorNode anchor = graph.add(new AnchorNode());
                         graph.addBeforeFixed(storeIndexed, anchor);
-                        ConstantNode type = graph.unique(ConstantNode.forCiConstant(elementType.getEncoding(Representation.ObjectHub), this, graph));
+                        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();
@@ -361,7 +361,7 @@
                 LocalNode receiver = graph.unique(new LocalNode(CiKind.Object, 0));
                 SafeReadNode klassOop = safeRead(graph, CiKind.Object, receiver, config.klassOopOffset);
                 graph.start().setNext(klassOop);
-                // TODO(tw): Care about primitive classes!
+                // TODO(tw): 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);
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypePrimitive.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypePrimitive.java	Mon Feb 20 18:01:22 2012 +0100
@@ -23,6 +23,7 @@
 package com.oracle.max.graal.hotspot.ri;
 
 import java.lang.annotation.*;
+import java.lang.reflect.*;
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
@@ -49,7 +50,8 @@
 
     @Override
     public int accessFlags() {
-        return kind.toJavaClass().getModifiers();
+        assert kind != null && kind.toJavaClass() != null;
+        return Modifier.ABSTRACT | Modifier.FINAL | Modifier.PUBLIC;
     }
 
     @Override
@@ -73,6 +75,11 @@
     }
 
     @Override
+    public RiResolvedType leastCommonAncestor(RiResolvedType otherType) {
+        return null;
+    }
+
+    @Override
     public CiConstant getEncoding(Representation r) {
         throw GraalInternalError.unimplemented("HotSpotTypePrimitive.getEncoding");
     }
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Mon Feb 20 18:01:22 2012 +0100
@@ -98,6 +98,15 @@
     }
 
     @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;
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotXirGenerator.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotXirGenerator.java	Mon Feb 20 18:01:22 2012 +0100
@@ -762,8 +762,8 @@
             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.createConstantInputParameter("trueValue", CiKind.Int);
-            XirOperand falseValue = asm.createConstantInputParameter("falseValue", CiKind.Int);
+            XirOperand trueValue = asm.createInputParameter("trueValue", CiKind.Int);
+            XirOperand falseValue = asm.createInputParameter("falseValue", CiKind.Int);
 
             XirOperand objHub = asm.createTemp("objHub", CiKind.Object);
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -26,6 +26,7 @@
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
+import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.cri.*;
@@ -122,7 +123,7 @@
                 InliningUtil.inline(methodCallTarget.invoke(), snippetGraph, false);
             }
         }
-        if (hits) {
+        if (GraalOptions.OptCanonicalizer && hits) {
             new CanonicalizerPhase(null, runtime, null).apply(graph);
         }
     }
--- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/BciBlockMapping.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/BciBlockMapping.java	Mon Feb 20 18:01:22 2012 +0100
@@ -145,6 +145,23 @@
                 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 {
@@ -363,12 +380,6 @@
 
     private static boolean canTrap(int opcode, int bci, RiProfilingInfo profilingInfo) {
         switch (opcode) {
-            case INVOKESTATIC:
-            case INVOKESPECIAL:
-            case INVOKEVIRTUAL:
-            case INVOKEINTERFACE: {
-                return true;
-            }
             case IASTORE:
             case LASTORE:
             case FASTORE:
@@ -388,7 +399,7 @@
             case PUTFIELD:
             case GETFIELD: {
                 if (GraalOptions.AllowExplicitExceptionChecks) {
-                    return profilingInfo.getExceptionSeen(bci) == RiExceptionSeen.TRUE;
+                    return profilingInfo.getExceptionSeen(bci) != RiExceptionSeen.FALSE;
                 }
             }
         }
--- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/Bytecodes.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/Bytecodes.java	Mon Feb 20 18:01:22 2012 +0100
@@ -342,226 +342,231 @@
     }
 
     /**
-     * A array that maps from a bytecode value to a {@link String} for the corresponding instruction mnemonic.
+     * 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];
 
     /**
-     * A array that maps from a bytecode value to the set of {@link Flags} for the corresponding instruction.
+     * 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];
 
     /**
-     * A array that maps from a bytecode value to the length in bytes for the corresponding instruction.
+     * 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"    );
-        def(ACONST_NULL         , "aconst_null"     , "b"    );
-        def(ICONST_M1           , "iconst_m1"       , "b"    );
-        def(ICONST_0            , "iconst_0"        , "b"    );
-        def(ICONST_1            , "iconst_1"        , "b"    );
-        def(ICONST_2            , "iconst_2"        , "b"    );
-        def(ICONST_3            , "iconst_3"        , "b"    );
-        def(ICONST_4            , "iconst_4"        , "b"    );
-        def(ICONST_5            , "iconst_5"        , "b"    );
-        def(LCONST_0            , "lconst_0"        , "b"    );
-        def(LCONST_1            , "lconst_1"        , "b"    );
-        def(FCONST_0            , "fconst_0"        , "b"    );
-        def(FCONST_1            , "fconst_1"        , "b"    );
-        def(FCONST_2            , "fconst_2"        , "b"    );
-        def(DCONST_0            , "dconst_0"        , "b"    );
-        def(DCONST_1            , "dconst_1"        , "b"    );
-        def(BIPUSH              , "bipush"          , "bc"   );
-        def(SIPUSH              , "sipush"          , "bcc"  );
-        def(LDC                 , "ldc"             , "bi"   , TRAP);
-        def(LDC_W               , "ldc_w"           , "bii"  , TRAP);
-        def(LDC2_W              , "ldc2_w"          , "bii"  , TRAP);
-        def(ILOAD               , "iload"           , "bi"   , LOAD);
-        def(LLOAD               , "lload"           , "bi"   , LOAD);
-        def(FLOAD               , "fload"           , "bi"   , LOAD);
-        def(DLOAD               , "dload"           , "bi"   , LOAD);
-        def(ALOAD               , "aload"           , "bi"   , LOAD);
-        def(ILOAD_0             , "iload_0"         , "b"    , LOAD);
-        def(ILOAD_1             , "iload_1"         , "b"    , LOAD);
-        def(ILOAD_2             , "iload_2"         , "b"    , LOAD);
-        def(ILOAD_3             , "iload_3"         , "b"    , LOAD);
-        def(LLOAD_0             , "lload_0"         , "b"    , LOAD);
-        def(LLOAD_1             , "lload_1"         , "b"    , LOAD);
-        def(LLOAD_2             , "lload_2"         , "b"    , LOAD);
-        def(LLOAD_3             , "lload_3"         , "b"    , LOAD);
-        def(FLOAD_0             , "fload_0"         , "b"    , LOAD);
-        def(FLOAD_1             , "fload_1"         , "b"    , LOAD);
-        def(FLOAD_2             , "fload_2"         , "b"    , LOAD);
-        def(FLOAD_3             , "fload_3"         , "b"    , LOAD);
-        def(DLOAD_0             , "dload_0"         , "b"    , LOAD);
-        def(DLOAD_1             , "dload_1"         , "b"    , LOAD);
-        def(DLOAD_2             , "dload_2"         , "b"    , LOAD);
-        def(DLOAD_3             , "dload_3"         , "b"    , LOAD);
-        def(ALOAD_0             , "aload_0"         , "b"    , LOAD);
-        def(ALOAD_1             , "aload_1"         , "b"    , LOAD);
-        def(ALOAD_2             , "aload_2"         , "b"    , LOAD);
-        def(ALOAD_3             , "aload_3"         , "b"    , LOAD);
-        def(IALOAD              , "iaload"          , "b"    , TRAP);
-        def(LALOAD              , "laload"          , "b"    , TRAP);
-        def(FALOAD              , "faload"          , "b"    , TRAP);
-        def(DALOAD              , "daload"          , "b"    , TRAP);
-        def(AALOAD              , "aaload"          , "b"    , TRAP);
-        def(BALOAD              , "baload"          , "b"    , TRAP);
-        def(CALOAD              , "caload"          , "b"    , TRAP);
-        def(SALOAD              , "saload"          , "b"    , TRAP);
-        def(ISTORE              , "istore"          , "bi"   , STORE);
-        def(LSTORE              , "lstore"          , "bi"   , STORE);
-        def(FSTORE              , "fstore"          , "bi"   , STORE);
-        def(DSTORE              , "dstore"          , "bi"   , STORE);
-        def(ASTORE              , "astore"          , "bi"   , STORE);
-        def(ISTORE_0            , "istore_0"        , "b"    , STORE);
-        def(ISTORE_1            , "istore_1"        , "b"    , STORE);
-        def(ISTORE_2            , "istore_2"        , "b"    , STORE);
-        def(ISTORE_3            , "istore_3"        , "b"    , STORE);
-        def(LSTORE_0            , "lstore_0"        , "b"    , STORE);
-        def(LSTORE_1            , "lstore_1"        , "b"    , STORE);
-        def(LSTORE_2            , "lstore_2"        , "b"    , STORE);
-        def(LSTORE_3            , "lstore_3"        , "b"    , STORE);
-        def(FSTORE_0            , "fstore_0"        , "b"    , STORE);
-        def(FSTORE_1            , "fstore_1"        , "b"    , STORE);
-        def(FSTORE_2            , "fstore_2"        , "b"    , STORE);
-        def(FSTORE_3            , "fstore_3"        , "b"    , STORE);
-        def(DSTORE_0            , "dstore_0"        , "b"    , STORE);
-        def(DSTORE_1            , "dstore_1"        , "b"    , STORE);
-        def(DSTORE_2            , "dstore_2"        , "b"    , STORE);
-        def(DSTORE_3            , "dstore_3"        , "b"    , STORE);
-        def(ASTORE_0            , "astore_0"        , "b"    , STORE);
-        def(ASTORE_1            , "astore_1"        , "b"    , STORE);
-        def(ASTORE_2            , "astore_2"        , "b"    , STORE);
-        def(ASTORE_3            , "astore_3"        , "b"    , STORE);
-        def(IASTORE             , "iastore"         , "b"    , TRAP);
-        def(LASTORE             , "lastore"         , "b"    , TRAP);
-        def(FASTORE             , "fastore"         , "b"    , TRAP);
-        def(DASTORE             , "dastore"         , "b"    , TRAP);
-        def(AASTORE             , "aastore"         , "b"    , TRAP);
-        def(BASTORE             , "bastore"         , "b"    , TRAP);
-        def(CASTORE             , "castore"         , "b"    , TRAP);
-        def(SASTORE             , "sastore"         , "b"    , TRAP);
-        def(POP                 , "pop"             , "b"    );
-        def(POP2                , "pop2"            , "b"    );
-        def(DUP                 , "dup"             , "b"    );
-        def(DUP_X1              , "dup_x1"          , "b"    );
-        def(DUP_X2              , "dup_x2"          , "b"    );
-        def(DUP2                , "dup2"            , "b"    );
-        def(DUP2_X1             , "dup2_x1"         , "b"    );
-        def(DUP2_X2             , "dup2_x2"         , "b"    );
-        def(SWAP                , "swap"            , "b"    );
-        def(IADD                , "iadd"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(LADD                , "ladd"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(FADD                , "fadd"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(DADD                , "dadd"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(ISUB                , "isub"            , "b"    );
-        def(LSUB                , "lsub"            , "b"    );
-        def(FSUB                , "fsub"            , "b"    );
-        def(DSUB                , "dsub"            , "b"    );
-        def(IMUL                , "imul"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(LMUL                , "lmul"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(FMUL                , "fmul"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(DMUL                , "dmul"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(IDIV                , "idiv"            , "b"    , TRAP);
-        def(LDIV                , "ldiv"            , "b"    , TRAP);
-        def(FDIV                , "fdiv"            , "b"    );
-        def(DDIV                , "ddiv"            , "b"    );
-        def(IREM                , "irem"            , "b"    , TRAP);
-        def(LREM                , "lrem"            , "b"    , TRAP);
-        def(FREM                , "frem"            , "b"    );
-        def(DREM                , "drem"            , "b"    );
-        def(INEG                , "ineg"            , "b"    );
-        def(LNEG                , "lneg"            , "b"    );
-        def(FNEG                , "fneg"            , "b"    );
-        def(DNEG                , "dneg"            , "b"    );
-        def(ISHL                , "ishl"            , "b"    );
-        def(LSHL                , "lshl"            , "b"    );
-        def(ISHR                , "ishr"            , "b"    );
-        def(LSHR                , "lshr"            , "b"    );
-        def(IUSHR               , "iushr"           , "b"    );
-        def(LUSHR               , "lushr"           , "b"    );
-        def(IAND                , "iand"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(LAND                , "land"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(IOR                 , "ior"             , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(LOR                 , "lor"             , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(IXOR                , "ixor"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(LXOR                , "lxor"            , "b"    , COMMUTATIVE | ASSOCIATIVE);
-        def(IINC                , "iinc"            , "bic"  , LOAD | STORE);
-        def(I2L                 , "i2l"             , "b"    );
-        def(I2F                 , "i2f"             , "b"    );
-        def(I2D                 , "i2d"             , "b"    );
-        def(L2I                 , "l2i"             , "b"    );
-        def(L2F                 , "l2f"             , "b"    );
-        def(L2D                 , "l2d"             , "b"    );
-        def(F2I                 , "f2i"             , "b"    );
-        def(F2L                 , "f2l"             , "b"    );
-        def(F2D                 , "f2d"             , "b"    );
-        def(D2I                 , "d2i"             , "b"    );
-        def(D2L                 , "d2l"             , "b"    );
-        def(D2F                 , "d2f"             , "b"    );
-        def(I2B                 , "i2b"             , "b"    );
-        def(I2C                 , "i2c"             , "b"    );
-        def(I2S                 , "i2s"             , "b"    );
-        def(LCMP                , "lcmp"            , "b"    );
-        def(FCMPL               , "fcmpl"           , "b"    );
-        def(FCMPG               , "fcmpg"           , "b"    );
-        def(DCMPL               , "dcmpl"           , "b"    );
-        def(DCMPG               , "dcmpg"           , "b"    );
-        def(IFEQ                , "ifeq"            , "boo"  , FALL_THROUGH | BRANCH);
-        def(IFNE                , "ifne"            , "boo"  , FALL_THROUGH | BRANCH);
-        def(IFLT                , "iflt"            , "boo"  , FALL_THROUGH | BRANCH);
-        def(IFGE                , "ifge"            , "boo"  , FALL_THROUGH | BRANCH);
-        def(IFGT                , "ifgt"            , "boo"  , FALL_THROUGH | BRANCH);
-        def(IFLE                , "ifle"            , "boo"  , FALL_THROUGH | BRANCH);
-        def(IF_ICMPEQ           , "if_icmpeq"       , "boo"  , COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(IF_ICMPNE           , "if_icmpne"       , "boo"  , COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(IF_ICMPLT           , "if_icmplt"       , "boo"  , FALL_THROUGH | BRANCH);
-        def(IF_ICMPGE           , "if_icmpge"       , "boo"  , FALL_THROUGH | BRANCH);
-        def(IF_ICMPGT           , "if_icmpgt"       , "boo"  , FALL_THROUGH | BRANCH);
-        def(IF_ICMPLE           , "if_icmple"       , "boo"  , FALL_THROUGH | BRANCH);
-        def(IF_ACMPEQ           , "if_acmpeq"       , "boo"  , COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(IF_ACMPNE           , "if_acmpne"       , "boo"  , COMMUTATIVE | FALL_THROUGH | BRANCH);
-        def(GOTO                , "goto"            , "boo"  , STOP | BRANCH);
-        def(JSR                 , "jsr"             , "boo"  , STOP | BRANCH);
-        def(RET                 , "ret"             , "bi"   , STOP);
-        def(TABLESWITCH         , "tableswitch"     , ""     , STOP);
-        def(LOOKUPSWITCH        , "lookupswitch"    , ""     , STOP);
-        def(IRETURN             , "ireturn"         , "b"    , TRAP | STOP);
-        def(LRETURN             , "lreturn"         , "b"    , TRAP | STOP);
-        def(FRETURN             , "freturn"         , "b"    , TRAP | STOP);
-        def(DRETURN             , "dreturn"         , "b"    , TRAP | STOP);
-        def(ARETURN             , "areturn"         , "b"    , TRAP | STOP);
-        def(RETURN              , "return"          , "b"    , TRAP | STOP);
-        def(GETSTATIC           , "getstatic"       , "bjj"  , TRAP | FIELD_READ);
-        def(PUTSTATIC           , "putstatic"       , "bjj"  , TRAP | FIELD_WRITE);
-        def(GETFIELD            , "getfield"        , "bjj"  , TRAP | FIELD_READ);
-        def(PUTFIELD            , "putfield"        , "bjj"  , TRAP | FIELD_WRITE);
-        def(INVOKEVIRTUAL       , "invokevirtual"   , "bjj"  , TRAP | INVOKE);
-        def(INVOKESPECIAL       , "invokespecial"   , "bjj"  , TRAP | INVOKE);
-        def(INVOKESTATIC        , "invokestatic"    , "bjj"  , TRAP | INVOKE);
-        def(INVOKEINTERFACE     , "invokeinterface" , "bjja_", TRAP | INVOKE);
-        def(XXXUNUSEDXXX        , "xxxunusedxxx"    , ""     );
-        def(NEW                 , "new"             , "bii"  , TRAP);
-        def(NEWARRAY            , "newarray"        , "bc"   , TRAP);
-        def(ANEWARRAY           , "anewarray"       , "bii"  , TRAP);
-        def(ARRAYLENGTH         , "arraylength"     , "b"    , TRAP);
-        def(ATHROW              , "athrow"          , "b"    , TRAP | STOP);
-        def(CHECKCAST           , "checkcast"       , "bii"  , TRAP);
-        def(INSTANCEOF          , "instanceof"      , "bii"  , TRAP);
-        def(MONITORENTER        , "monitorenter"    , "b"    , TRAP);
-        def(MONITOREXIT         , "monitorexit"     , "b"    , TRAP);
-        def(WIDE                , "wide"            , ""     );
-        def(MULTIANEWARRAY      , "multianewarray"  , "biic" , TRAP);
-        def(IFNULL              , "ifnull"          , "boo"  , FALL_THROUGH | BRANCH);
-        def(IFNONNULL           , "ifnonnull"       , "boo"  , FALL_THROUGH | BRANCH);
-        def(GOTO_W              , "goto_w"          , "boooo", STOP | BRANCH);
-        def(JSR_W               , "jsr_w"           , "boooo", STOP | BRANCH);
-        def(BREAKPOINT          , "breakpoint"      , "b"    , TRAP);
+        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
 
@@ -622,6 +627,15 @@
     }
 
     /**
+     * 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
@@ -836,8 +850,8 @@
      * @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) {
-        def(opcode, name, format, 0);
+    private static void def(int opcode, String name, String format, int compilationComplexity) {
+        def(opcode, name, format, compilationComplexity, 0);
     }
 
     /**
@@ -847,11 +861,12 @@
      * @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 flags) {
+    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";
--- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java	Mon Feb 20 18:01:22 2012 +0100
@@ -243,12 +243,7 @@
         return blocksVisited.contains(block);
     }
 
-    public void mergeOrClone(Block target, FrameStateAccess newState) {
-        AbstractStateSplit first = (AbstractStateSplit) target.firstInstruction;
-
-        if (target.isLoopHeader && isVisited(target)) {
-            first = (AbstractStateSplit) loopBegin(target).loopEnd().predecessor();
-        }
+    public void mergeOrClone(Block target, FrameStateAccess newState, StateSplit first) {
 
         int bci = target.startBci;
         if (target instanceof ExceptionBlock) {
@@ -256,10 +251,11 @@
         }
 
         FrameState existingState = first.stateAfter();
-
         if (existingState == null) {
+            // There was no state : new target
             // copy state because it is modified
             first.setStateAfter(newState.duplicate(bci));
+            return;
         } else {
             if (!GraalOptions.AssumeVerifiedBytecode && !existingState.isCompatibleWith(newState)) {
                 // stacks or locks do not match--bytecodes would not verify
@@ -271,27 +267,31 @@
             assert existingState.stackSize() == newState.stackSize();
 
             if (first instanceof PlaceholderNode) {
+                // there is no merge yet here
                 PlaceholderNode p = (PlaceholderNode) first;
                 if (p.predecessor() == null) {
+                    //nothing seems to come here, yet there's a state?
+                    Debug.log("Funky control flow going to @bci %d : we already have a state but no predecessor", bci);
                     p.setStateAfter(newState.duplicate(bci));
                     return;
                 } else {
+                    //create a merge
                     MergeNode merge = currentGraph.add(new MergeNode());
                     FixedNode next = p.next();
-                    EndNode end = currentGraph.add(new EndNode());
-                    p.setNext(end);
+                    if (p.predecessor() != null) {
+                        EndNode end = currentGraph.add(new EndNode());
+                        p.setNext(end);
+                        merge.addForwardEnd(end);
+                    }
                     merge.setNext(next);
-                    merge.addEnd(end);
-                    merge.setStateAfter(existingState);
-                    p.setStateAfter(existingState.duplicate(bci));
-                    if (!(next instanceof LoopEndNode)) {
-                        target.firstInstruction = merge;
-                    }
-                    first = merge;
+                    FrameState mergeState = existingState.duplicate(bci);
+                    merge.setStateAfter(mergeState);
+                    mergeState.merge(merge, newState);
+                    target.firstInstruction = merge;
                 }
+            } else {
+                existingState.merge((MergeNode) first, newState);
             }
-
-            existingState.merge((MergeNode) first, newState);
         }
     }
 
@@ -324,7 +324,7 @@
 
         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.TRUE) {
+            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));
@@ -534,7 +534,7 @@
             case FREM:
             case DREM: v = new FloatRemNode(result, x, y, isStrictFP); break;
             default:
-                throw new CiBailout("should not reach");
+                throw new GraalInternalError("should not reach");
         }
         ValueNode result1 = append(currentGraph.unique(v));
         if (canTrap) {
@@ -559,7 +559,7 @@
             case IUSHR:
             case LUSHR: v = new UnsignedRightShiftNode(kind, x, s); break;
             default:
-                throw new CiBailout("should not reach");
+                throw new GraalInternalError("should not reach");
         }
         frameState.push(kind, append(currentGraph.unique(v)));
     }
@@ -576,7 +576,7 @@
             case IXOR:
             case LXOR: v = new XorNode(kind, x, y); break;
             default:
-                throw new CiBailout("should not reach");
+                throw new GraalInternalError("should not reach");
         }
         frameState.push(kind, append(currentGraph.unique(v)));
     }
@@ -921,7 +921,7 @@
                 for (ExceptionInfo info : exceptions) {
                     EndNode end = currentGraph.add(new EndNode());
                     info.exceptionEdge.setNext(end);
-                    merge.addEnd(end);
+                    merge.addForwardEnd(end);
                     phi.addInput(info.exception);
                 }
                 merge.setStateAfter(frameState.duplicate(bci()));
@@ -1264,48 +1264,42 @@
 
         if (block.firstInstruction == null) {
             if (block.isLoopHeader) {
-                LoopBeginNode loopBegin = currentGraph.add(new LoopBeginNode());
-                loopBegin.addEnd(currentGraph.add(new EndNode()));
-                LoopEndNode loopEnd = currentGraph.add(new LoopEndNode());
-                loopEnd.setLoopBegin(loopBegin);
-                PlaceholderNode pBegin = currentGraph.add(new PlaceholderNode());
-                pBegin.setNext(loopBegin.forwardEdge());
-                PlaceholderNode pEnd = currentGraph.add(new PlaceholderNode());
-                pEnd.setNext(loopEnd);
-                loopBegin.setStateAfter(stateAfter.duplicate(block.startBci));
-                block.firstInstruction = pBegin;
+                LoopBeginNode loop = currentGraph.add(new LoopBeginNode());
+                EndNode end = currentGraph.add(new EndNode());
+                loop.addForwardEnd(end);
+                PlaceholderNode p = currentGraph.add(new PlaceholderNode());
+                p.setNext(end);
+                block.firstInstruction = p;
             } else {
                 block.firstInstruction = currentGraph.add(new PlaceholderNode());
             }
         }
-        mergeOrClone(block, stateAfter);
+        LoopEndNode loopend = null;
+        StateSplit mergeAt = null;
+        if (block.isLoopHeader && isVisited(block)) { // backedge
+            loopend = currentGraph.add(new LoopEndNode(loopBegin(block)));
+            mergeAt = loopBegin(block);
+        } else {
+            mergeAt = (StateSplit) block.firstInstruction;
+        }
+
+        mergeOrClone(block, stateAfter, mergeAt);
         addToWorkList(block);
 
         FixedNode result = null;
-        if (block.isLoopHeader && isVisited(block)) {
-            result = (FixedNode) loopBegin(block).loopEnd().predecessor();
+        if (loopend != null) {
+            result = loopend;
         } else {
             result = block.firstInstruction;
         }
 
-        assert result instanceof MergeNode || result instanceof PlaceholderNode : result;
         if (result instanceof MergeNode) {
-            if (result instanceof LoopBeginNode) {
-                result = ((LoopBeginNode) result).forwardEdge();
-            } else {
-                EndNode end = currentGraph.add(new EndNode());
-                ((MergeNode) result).addEnd(end);
-                PlaceholderNode p = currentGraph.add(new PlaceholderNode());
-                int bci = block.startBci;
-                if (block instanceof ExceptionBlock) {
-                    bci = ((ExceptionBlock) block).deoptBci;
-                }
-                p.setStateAfter(stateAfter.duplicate(bci));
-                p.setNext(end);
-                result = p;
-            }
+            EndNode end = currentGraph.add(new EndNode());
+            ((MergeNode) result).addForwardEnd(end);
+            result = end;
         }
-        assert !(result instanceof LoopBeginNode || result instanceof MergeNode);
+        assert !(result instanceof MergeNode);
+        Debug.log("createTarget(%s, state) = %s", block, result);
         return result;
     }
 
@@ -1332,10 +1326,9 @@
                 if (block.isLoopHeader) {
                     LoopBeginNode begin = loopBegin(block);
                     FrameState preLoopState = ((StateSplit) block.firstInstruction).stateAfter();
-                    assert preLoopState != null;
-                    FrameState duplicate = preLoopState.duplicate(preLoopState.bci);
-                    begin.setStateAfter(duplicate);
-                    duplicate.insertLoopPhis(begin);
+                    FrameState loopState = preLoopState.duplicate(preLoopState.bci);
+                    begin.setStateAfter(loopState);
+                    loopState.insertLoopPhis(begin);
                     lastInstr = begin;
                 } else {
                     lastInstr = block.firstInstruction;
@@ -1361,11 +1354,7 @@
 
     private void connectLoopEndToBegin() {
         for (LoopBeginNode begin : currentGraph.getNodes(LoopBeginNode.class)) {
-            LoopEndNode loopEnd = begin.loopEnd();
-            AbstractStateSplit loopEndStateSplit = (AbstractStateSplit) loopEnd.predecessor();
-            if (loopEndStateSplit.stateAfter() != null) {
-                begin.stateAfter().mergeLoop(begin, loopEndStateSplit.stateAfter());
-            } else {
+            if (begin.loopEnds().isEmpty()) {
 //              This can happen with degenerated loops like this one:
 //              for (;;) {
 //                  try {
@@ -1373,30 +1362,18 @@
 //                  } catch (UnresolvedException iioe) {
 //                  }
 //              }
-                // Delete the phis (all of them must have exactly one input).
-                for (PhiNode phi : begin.phis().snapshot()) {
-                    assert phi.valueCount() == 1;
-                    begin.stateAfter().deleteRedundantPhi(phi, phi.firstValue());
-                }
 
-                // Delete the loop end.
-                loopEndStateSplit.safeDelete();
-                loopEnd.safeDelete();
-
-                // Remove the loop begin.
-                EndNode loopEntryEnd = begin.forwardEdge();
-                FixedNode beginSucc = begin.next();
-                FrameState stateAfter = begin.stateAfter();
-                begin.safeDelete();
-                stateAfter.safeDelete();
-                loopEntryEnd.replaceAndDelete(beginSucc);
+                // Remove the loop begin or transform it into a merge.
+                assert begin.forwardEndCount() > 0;
+                currentGraph.reduceDegenerateLoopBegin(begin);
+            } else {
+                begin.stateAfter().simplifyLoopState();
             }
         }
     }
 
     private static LoopBeginNode loopBegin(Block block) {
-        EndNode endNode = (EndNode) block.firstInstruction.next();
-        LoopBeginNode loopBegin = (LoopBeginNode) endNode.merge();
+        LoopBeginNode loopBegin = (LoopBeginNode) ((EndNode) block.firstInstruction.next()).merge();
         return loopBegin;
     }
 
@@ -1446,7 +1423,7 @@
             if (config.eagerResolving()) {
                 catchType = lookupType(block.handler.catchTypeCPI(), INSTANCEOF);
             }
-            boolean initialized = (catchType instanceof RiResolvedType) && ((RiResolvedType) catchType).isInitialized();
+            boolean initialized = (catchType instanceof RiResolvedType);
             if (initialized && config.getSkippedExceptionTypes() != null) {
                 RiResolvedType resolvedCatchType = (RiResolvedType) catchType;
                 for (RiResolvedType skippedType : config.getSkippedExceptionTypes()) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.jtt/src/com/oracle/max/graal/jtt/ConvertJTT.java	Mon Feb 20 18:01:22 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.max.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.max.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.max.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.max.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.max.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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_aaload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_aaload_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_aastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_aload_0.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_aload_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_aload_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_aload_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_anewarray.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_areturn.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_arraylength.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_athrow.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_baload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_bastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_caload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_castore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_checkcast01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_checkcast02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_d2f.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_d2i01.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_d2i02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_d2l01.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_d2l02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dadd.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_daload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp07.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp08.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp09.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dcmp10.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ddiv.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dmul.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dneg.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dneg2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_drem.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dreturn.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dsub.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_dsub2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_f2d.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_f2i01.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_f2i02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_f2l01.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_f2l02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fadd.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_faload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp07.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp08.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp09.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fcmp10.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fdiv.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fload_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fmul.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fneg.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_frem.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_freturn.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_fsub.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getfield.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_b.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_c.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_d.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_f.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_i.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_l.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_s.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_getstatic_z.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_i2b.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_i2c.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_i2d.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_i2f.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_i2l.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_i2s.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iadd.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iadd2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iadd3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iaload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iand.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iconst.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_idiv.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_idiv2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifeq.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifeq_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifeq_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifge.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifge_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifge_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifgt.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ificmplt1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ificmplt2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ificmpne1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ificmpne2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifle.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iflt.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifne.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifnonnull.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifnonnull_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifnonnull_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifnull.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifnull_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ifnull_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iinc_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iinc_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iinc_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iinc_4.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iload_0.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iload_0_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iload_0_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iload_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iload_1_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iload_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iload_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_imul.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ineg.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_instanceof.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_invokeinterface.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_invokespecial.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_invokespecial2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_invokestatic.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_invokevirtual.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ior.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_irem.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_irem2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_irem3.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ireturn.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ishl.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ishr.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_isub.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_iushr.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ixor.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_l2d.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_l2f.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_l2i.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_l2i_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ladd.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ladd2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_laload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_land.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lcmp.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldc_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldc_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldc_03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldc_04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldc_05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldc_06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.bytecode.BC_ldc_06", test());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldiv.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_ldiv2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lload_0.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lload_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lload_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lload_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lload_3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lmul.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lneg.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lookupswitch01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lookupswitch02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lookupswitch03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lookupswitch04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lookupswitch05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lor.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lrem.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lrem2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lreturn.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lshl.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lshr.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lsub.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lushr.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_lxor.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_monitorenter.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_monitorenter02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_multianewarray01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_multianewarray02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_multianewarray03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_multianewarray04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_new.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_newarray.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_putfield.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_putstatic.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_saload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_sastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_tableswitch.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_tableswitch2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_tableswitch3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_tableswitch4.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_wide01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/bytecode/BC_wide02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_aaload0.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_aaload1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_aastore0.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_aastore1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_anewarray.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_arraylength.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_athrow0.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_athrow1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_athrow2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_athrow3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_baload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_bastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_caload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_castore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_checkcast.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_checkcast1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_checkcast2.java	Mon Feb 20 18:01:22 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.max.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_checkcast2 {
+
+    static Object object2 = new Object();
+    static Object object3 = "";
+    static Object object4 = new com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_checkcast3.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_checkcast4.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_checkcast5.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_checkcast6.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_daload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_dastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_faload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_fastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_getfield.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_iaload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_iastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_idiv.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_idiv2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_invokespecial01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_invokevirtual01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_invokevirtual02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_irem.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_laload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_lastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_ldiv.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_ldiv2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_lrem.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_monitorenter.java	Mon Feb 20 18:01:22 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.max.graal.jtt.except;
+
+import org.junit.*;
+
+/*
+ */
+public class BC_monitorenter {
+
+    static com.oracle.max.graal.jtt.bytecode.BC_monitorenter object = new com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_multianewarray.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_newarray.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_putfield.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_saload.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/BC_sastore.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Loop01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Loop02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Loop03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NASE_1.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NASE_2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_00.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_07.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_08.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_09.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_10.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_NPE_11.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_StackOverflowError_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_StackOverflowError_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_StackOverflowError_03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Two01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Two02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Two03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Unresolved.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Unresolved01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Unresolved02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Catch_Unresolved03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Except_Locals.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Except_Synchronized01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Except_Synchronized02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Except_Synchronized03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Except_Synchronized04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Except_Synchronized05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Finally01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Finally02.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/StackTrace_AIOOBE_00.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/StackTrace_CCE_00.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/StackTrace_NPE_00.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/StackTrace_NPE_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/StackTrace_NPE_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/StackTrace_NPE_03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_InCatch01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_InCatch02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_InCatch03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_InNested.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_NPE_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_Synchronized01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_Synchronized02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_Synchronized03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_Synchronized04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/except/Throw_Synchronized05.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_allocate01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_allocate02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_allocate03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_allocate04.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_array01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_array02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_array03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_array04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_control01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_control02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_convert01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_count.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_dead01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_demo01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_field01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_field02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_field03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_field04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_idea.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_inline01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_inline02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_invoke01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_life.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_nest01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_nest02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_scope01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_scope02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_series.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotpath/HP_trees01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotspot/Test6186134.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotspot/Test6196102.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotspot/Test6753639.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotspot/Test6850611.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotspot/Test6959129.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/hotspot/Test7005594.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/Class_getName.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/EnumMap01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/EnumMap02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/System_currentTimeMillis01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/System_currentTimeMillis02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/System_nanoTime01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/System_nanoTime02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/System_setOut.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/Thread_setName.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/jdk/UnsafeAccess01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Boxed_TYPE_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Bridge_method01.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/ClassLoader_loadClass01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_Literal01.java	Mon Feb 20 18:01:22 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.max.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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_asSubclass01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_cast01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_cast02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_forName01.java	Mon Feb 20 18:01:22 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.max.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.max.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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_forName02.java	Mon Feb 20 18:01:22 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.max.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.max.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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_forName03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_forName04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_forName05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_getComponentType01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_getInterfaces01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.lang.Class_getInterfaces01$I1", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("com.oracle.max.graal.jtt.lang.Class_getInterfaces01$I1", test(2));
+    }
+
+    @Test
+    public void run3() throws Throwable {
+        Assert.assertEquals("com.oracle.max.graal.jtt.lang.Class_getInterfaces01$I2", test(3));
+    }
+
+    @Test
+    public void run4() throws Throwable {
+        Assert.assertEquals("com.oracle.max.graal.jtt.lang.Class_getInterfaces01$I1 com.oracle.max.graal.jtt.lang.Class_getInterfaces01$I2", test(4));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_getName01.java	Mon Feb 20 18:01:22 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.max.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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_getName02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_getSimpleName01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_getSimpleName02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_getSuperClass01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isArray01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isAssignableFrom01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isAssignableFrom02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isAssignableFrom03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isInstance01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isInstance02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isInstance03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isInstance04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isInstance05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isInstance06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isInterface01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Class_isPrimitive01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Double_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Double_toString.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Float_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Float_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Float_03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_greater01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_greater02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_greater03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_greaterEqual01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_greaterEqual02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_greaterEqual03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_less01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_less02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_less03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_lessEqual01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_lessEqual02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Int_lessEqual03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/JDK_ClassLoaders01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/JDK_ClassLoaders02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_greater01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_greater02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_greater03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_greaterEqual01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_greaterEqual02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_greaterEqual03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_less01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_less02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_less03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_lessEqual01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_lessEqual02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_lessEqual03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_reverseBytes01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Long_reverseBytes02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_abs.java	Mon Feb 20 18:01:22 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.max.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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_cos.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.lang.Math_cos.NaN.class)
+    public void run0() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.max.graal.jtt.lang.Math_cos.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test(expected = com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_log.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.lang.Math_log.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.max.graal.jtt.lang.Math_log.NaN.class)
+    public void run2() throws Throwable {
+        test(-1.0d);
+    }
+
+    @Test(expected = com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_log10.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.lang.Math_log10.NaN.class)
+    public void run3() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.max.graal.jtt.lang.Math_log10.NaN.class)
+    public void run4() throws Throwable {
+        test(-1.0d);
+    }
+
+    @Test(expected = com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_pow.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_sin.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.lang.Math_sin.NaN.class)
+    public void run0() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.max.graal.jtt.lang.Math_sin.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test(expected = com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_sqrt.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.lang.Math_sqrt.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.max.graal.jtt.lang.Math_sqrt.NaN.class)
+    public void run2() throws Throwable {
+        test(-1.0d);
+    }
+
+    @Test(expected = com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Math_tan.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.lang.Math_tan.NaN.class)
+    public void run0() throws Throwable {
+        test(java.lang.Double.NaN);
+    }
+
+    @Test(expected = com.oracle.max.graal.jtt.lang.Math_tan.NaN.class)
+    public void run1() throws Throwable {
+        test(java.lang.Double.NEGATIVE_INFINITY);
+    }
+
+    @Test(expected = com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_clone01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_clone02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_equals01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_getClass01.java	Mon Feb 20 18:01:22 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.max.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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_hashCode01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_notify01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_notify02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_notifyAll01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_notifyAll02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_toString01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_toString02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_wait01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_wait02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/Object_wait03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/ProcessEnvironment_init.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/StringCoding_Scale.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/String_intern01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/String_intern02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/String_intern03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/String_valueOf01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/lang/System_identityHashCode01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/DegeneratedLoop.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop07.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop08.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop09.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop11.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop12.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop13.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/Loop14.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/LoopInline.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/LoopNewInstance.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/LoopPhi.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/loop/LoopSwitch01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/ArrayCompare01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/ArrayCompare02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BC_invokevirtual2.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigByteParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigDoubleParams02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigFloatParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigFloatParams02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigIntParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigIntParams02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigInterfaceParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigLongParams02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigMixedParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigMixedParams02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigMixedParams03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigObjectParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigObjectParams02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigParamsAlignment.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigShortParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/BigVirtualParams01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/Bubblesort.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/Fibonacci.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/InvokeVirtual_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/InvokeVirtual_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/Matrix01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/ReferenceMap01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/StrangeFrames.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/String_format01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/String_format02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_String01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_boolean01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_byte01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_char01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_double01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_float01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_int01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_long01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/micro/VarArgs_short01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/ABCE_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/ABCE_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/ABCE_03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/ArrayCopy01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/ArrayLength01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_idiv_16.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_idiv_4.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_imul_16.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_imul_4.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_ldiv_16.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_ldiv_4.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_lmul_16.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_lmul_4.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_lshr_C16.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_lshr_C24.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BC_lshr_C32.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/BlockSkip01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Cmov01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Cmov02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Conditional01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/DeadCode01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/DeadCode02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Cast01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Convert01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Convert02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Convert03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Convert04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Double01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Double02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Double03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Float01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Float02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_InstanceOf01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Int01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Int02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Long01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Long02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Fold_Math01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Inline01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Inline02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/LLE_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/List_reorder_bug.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_FlowSensitive01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_FlowSensitive02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_FlowSensitive03.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_FlowSensitive04.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/NCE_FlowSensitive05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_byte01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_byte02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_byte03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_char01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_char02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_char03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_short01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_short02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Narrow_short03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Phi01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Phi02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Phi03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Convert01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Double01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Float01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Int01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Int02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Int03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Int04.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_IntShift01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_IntShift02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Long01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Long02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Long03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_Long04.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_LongShift01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Reduce_LongShift02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Switch01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/Switch02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/TypeCastElem.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Cast01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Cast02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Convert01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Convert02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Double01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Double02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Field01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Field02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Float01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Float02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_InstanceOf01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_InstanceOf02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_InstanceOf03.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Int01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Int02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Int03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Long01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Long02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Long03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/optimize/VN_Loop01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_get01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_get02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_get03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getBoolean01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getByte01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getChar01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getDouble01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getFloat01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getInt01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getLength01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getLong01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_getShort01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_newInstance01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_newInstance02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_newInstance03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_newInstance04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_newInstance05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_newInstance06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_set01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_set02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_set03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setBoolean01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setByte01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setChar01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setDouble01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setFloat01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setInt01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setLong01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Array_setShort01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_getDeclaredField01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_getDeclaredMethod01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_getField01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_getField02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_getMethod01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_getMethod02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_newInstance01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_newInstance02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_newInstance03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_newInstance06.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Class_newInstance07.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_get01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_get02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_get03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_get04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_getType01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_set01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_set02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Field_set03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Invoke_except01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Invoke_main01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Invoke_main02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Invoke_main03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Invoke_virtual01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Method_getParameterTypes01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Method_getReturnType01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/reflect/Reflection_getCallerClass01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt.reflect.Reflection_getCallerClass01$Caller1", test(1));
+    }
+
+    @Test
+    public void run2() throws Throwable {
+        Assert.assertEquals("com.oracle.max.graal.jtt.reflect.Reflection_getCallerClass01$Caller2", test(2));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Monitor_contended01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Monitor_notowner01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Monitorenter01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Monitorenter02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Object_wait01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Object_wait02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Object_wait03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Object_wait04.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/ThreadLocal01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/ThreadLocal02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/ThreadLocal03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_currentThread01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_getState01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_getState02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_holdsLock01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_isAlive01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_isInterrupted01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_isInterrupted02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_isInterrupted03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_isInterrupted04.java	Mon Feb 20 18:01:22 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.max.graal.jtt.threads;
+
+import org.junit.*;
+
+/*
+ */
+
+// Interrupted while running, do nothing, just set the flag and continue
+// (tw) This test will exercise deoptimization on HotSpot, because a volatile unloaded field is accessed.
+// (tw) 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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_isInterrupted05.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_join01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_join02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_join03.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_new01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_new02.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_setPriority01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_sleep01.java	Mon Feb 20 18:01:22 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.max.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.max.graal.jtt/src/com/oracle/max/graal/jtt/threads/Thread_yield01.java	Mon Feb 20 18:01:22 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.max.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/max/graal/lir/amd64/AMD64CompareToIntOpcode.java	Mon Feb 20 17:58:46 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.max.graal.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.AMD64Assembler.ConditionFlag;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.graal.graph.*;
-import com.oracle.max.graal.lir.*;
-import com.oracle.max.graal.lir.asm.*;
-
-/**
- * Implementation of the Java bytecodes that compare a long, float, or double value and produce the
- * integer constants -1, 0, 1 on less, equal, or greater, respectively.  For floating point compares,
- * unordered can be either greater {@link #CMP2INT_UG} or less {@link #CMP2INT_UL}.
- */
-public enum AMD64CompareToIntOpcode {
-    CMP2INT, CMP2INT_UG, CMP2INT_UL;
-
-    public LIRInstruction create(CiValue result) {
-        CiValue[] outputs = new CiValue[] {result};
-
-        return new AMD64LIRInstruction(this, outputs, null, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS) {
-            @Override
-            public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-                emit(masm, output(0));
-            }
-
-            @Override
-            protected EnumSet<OperandFlag> flagsFor(OperandMode mode, int index) {
-                if (mode == OperandMode.Output && index == 0) {
-                    return EnumSet.of(OperandFlag.Register);
-                }
-                throw GraalInternalError.shouldNotReachHere();
-            }
-        };
-    }
-
-    private void emit(AMD64MacroAssembler masm, CiValue result) {
-        CiRegister dest = asIntReg(result);
-        Label high = new Label();
-        Label low = new Label();
-        Label done = new Label();
-
-        // comparison is done by a separate LIR instruction before
-        switch (this) {
-            case CMP2INT:
-                masm.jcc(ConditionFlag.greater, high);
-                masm.jcc(ConditionFlag.less, low);
-                break;
-            case CMP2INT_UG:
-                masm.jcc(ConditionFlag.parity, high);
-                masm.jcc(ConditionFlag.above, high);
-                masm.jcc(ConditionFlag.below, low);
-                break;
-            case CMP2INT_UL:
-                masm.jcc(ConditionFlag.parity, low);
-                masm.jcc(ConditionFlag.above, high);
-                masm.jcc(ConditionFlag.below, low);
-                break;
-            default:
-                throw GraalInternalError.shouldNotReachHere();
-        }
-
-        // equal -> 0
-        masm.xorptr(dest, dest);
-        masm.jmp(done);
-
-        // greater -> 1
-        masm.bind(high);
-        masm.xorptr(dest, dest);
-        masm.incrementl(dest, 1);
-        masm.jmp(done);
-
-        // less -> -1
-        masm.bind(low);
-        masm.xorptr(dest, dest);
-        masm.decrementl(dest, 1);
-
-        masm.bind(done);
-    }
-}
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/max/graal/lir/amd64/AMD64ControlFlow.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/max/graal/lir/amd64/AMD64ControlFlow.java	Mon Feb 20 18:01:22 2012 +0100
@@ -354,10 +354,10 @@
         switch (cond) {
             case EQ: return ConditionFlag.equal;
             case NE: return ConditionFlag.notEqual;
-            case BT: return ConditionFlag.below;
-            case BE: return ConditionFlag.belowEqual;
-            case AE: return ConditionFlag.aboveEqual;
-            case AT: return ConditionFlag.above;
+            case LT: return ConditionFlag.below;
+            case LE: return ConditionFlag.belowEqual;
+            case GE: return ConditionFlag.aboveEqual;
+            case GT: return ConditionFlag.above;
             default: throw GraalInternalError.shouldNotReachHere();
         }
     }
--- a/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/max/graal/lir/amd64/AMD64Move.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.lir.amd64/src/com/oracle/max/graal/lir/amd64/AMD64Move.java	Mon Feb 20 18:01:22 2012 +0100
@@ -296,7 +296,7 @@
         if (input.equals(result)) {
             return;
         }
-        switch (result.kind) {
+        switch (input.kind) {
             case Jsr:
             case Int:    masm.movl(asRegister(result),    asRegister(input)); break;
             case Long:   masm.movq(asRegister(result),    asRegister(input)); break;
@@ -308,7 +308,7 @@
     }
 
     private static void reg2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
-        switch (result.kind) {
+        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;
@@ -320,7 +320,7 @@
     }
 
     private static void stack2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue input) {
-        switch (result.kind) {
+        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;
@@ -331,48 +331,51 @@
         }
     }
 
-    private static void const2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiConstant c) {
-        switch (result.kind) {
+    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(c));
+                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), c.asLong());
+                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(c.asFloat()) == Float.floatToRawIntBits(0.0f)) {
+                if (Float.floatToRawIntBits(input.asFloat()) == Float.floatToRawIntBits(0.0f)) {
                     masm.xorps(asFloatReg(result), asFloatReg(result));
                 } else {
-                    masm.movflt(asFloatReg(result), tasm.asFloatConstRef(c));
+                    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(c.asDouble()) == Double.doubleToRawLongBits(0.0d)) {
+                if (Double.doubleToRawLongBits(input.asDouble()) == Double.doubleToRawLongBits(0.0d)) {
                     masm.xorpd(asDoubleReg(result), asDoubleReg(result));
                 } else {
-                    masm.movdbl(asDoubleReg(result), tasm.asDoubleConstRef(c));
+                    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 (c.isNull()) {
+                if (input.isNull()) {
                     masm.movq(asRegister(result), 0x0L);
                 } else if (tasm.target.inlineObjects) {
-                    tasm.recordDataReferenceInCode(c, 0);
+                    tasm.recordDataReferenceInCode(input, 0);
                     masm.movq(asRegister(result), 0xDEADDEADDEADDEADL);
                 } else {
-                    masm.movq(asRegister(result), tasm.recordDataReferenceInCode(c, 0));
+                    masm.movq(asRegister(result), tasm.recordDataReferenceInCode(input, 0));
                 }
                 break;
             default:
@@ -380,15 +383,15 @@
         }
     }
 
-    private static void const2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiConstant c) {
-        switch (result.kind) {
+    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), c.asInt()); break;
-            case Long:   masm.movlong(tasm.asAddress(result), c.asLong()); break;
-            case Float:  masm.movl(tasm.asAddress(result), floatToRawIntBits(c.asFloat())); break;
-            case Double: masm.movlong(tasm.asAddress(result), doubleToRawLongBits(c.asDouble())); break;
+            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 (c.isNull()) {
+                if (input.isNull()) {
                     masm.movlong(tasm.asAddress(result), 0L);
                 } else {
                     throw GraalInternalError.shouldNotReachHere("Non-null object constants must be in register");
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/asm/TargetMethodAssembler.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/asm/TargetMethodAssembler.java	Mon Feb 20 18:01:22 2012 +0100
@@ -97,7 +97,7 @@
         Debug.metric("DataPatches").add(targetMethod.dataReferences.size());
         Debug.metric("ExceptionHandlersEmitted").add(targetMethod.exceptionHandlers.size());
 
-        Debug.log("Finished target method %s, isStub %d", name, isStub);
+        Debug.log("Finished target method %s, isStub %b", name, isStub);
 /*
         if (GraalOptions.PrintAssembly && !TTY.isSuppressed() && !isStub) {
             Util.printSection("Target Method", Util.SECTION_CHARACTER);
--- a/graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/cfg/Block.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/cfg/Block.java	Mon Feb 20 18:01:22 2012 +0100
@@ -196,4 +196,18 @@
         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/max/graal/lir/cfg/ControlFlowGraph.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.lir/src/com/oracle/max/graal/lir/cfg/ControlFlowGraph.java	Mon Feb 20 18:01:22 2012 +0100
@@ -136,7 +136,7 @@
                 // First time we see this block: push all successors.
                 for (Node suxNode : block.getEndNode().cfgSuccessors()) {
                     Block suxBlock = blockFor(suxNode);
-                    assert suxBlock.id != BLOCK_ID_VISITED;
+                    assert suxBlock.id != BLOCK_ID_VISITED : "Sux already visited?? from " + block.getEndNode() + " to " + suxNode;
                     if (suxBlock.id == BLOCK_ID_INITIAL) {
                         stack.add(suxBlock);
                     }
@@ -163,7 +163,9 @@
                 predecessors.add(nodeToBlock.get(predNode));
             }
             if (block.getBeginNode() instanceof LoopBeginNode) {
-                predecessors.add(nodeToBlock.get(((LoopBeginNode) block.getBeginNode()).loopEnd()));
+                for (LoopEndNode predNode : ((LoopBeginNode) block.getBeginNode()).orderedLoopEnds()) {
+                    predecessors.add(nodeToBlock.get(predNode));
+                }
             }
             block.predecessors = predecessors;
 
@@ -186,9 +188,10 @@
                 Loop loop = new Loop(block.getLoop(), loopsList.size(), block);
                 loopsList.add(loop);
 
-                LoopEndNode end = ((LoopBeginNode) beginNode).loopEnd();
-                Block endBlock = nodeToBlock.get(end);
-                computeLoopBlocks(endBlock, loop);
+                for (LoopEndNode end : ((LoopBeginNode) beginNode).loopEnds()) {
+                    Block endBlock = nodeToBlock.get(end);
+                    computeLoopBlocks(endBlock, loop);
+                }
             }
         }
         loops = loopsList.toArray(new Loop[loopsList.size()]);
@@ -228,16 +231,12 @@
             List<Block> predecessors = block.getPredecessors();
             assert predecessors.size() > 0;
 
-            if (block.isLoopHeader()) {
-                // Loop headers have exactly one non-loop predecessor, and that is the dominator.
-                setDominator(block, predecessors.get(0));
-                continue;
-            }
-
             Block dominator = predecessors.get(0);
             for (int j = 1; j < predecessors.size(); j++) {
                 Block pred = predecessors.get(j);
-                dominator = commonDominator(dominator, pred);
+                if (!pred.isLoopEnd()) {
+                    dominator = commonDominator(dominator, pred);
+                }
             }
             setDominator(block, dominator);
         }
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/BeginNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/BeginNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -25,10 +25,11 @@
 import java.util.*;
 
 import com.oracle.max.graal.graph.*;
+import com.oracle.max.graal.graph.iterators.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
 
-public class BeginNode extends AbstractStateSplit implements LIRLowerable, Simplifiable {
+public class BeginNode extends AbstractStateSplit implements LIRLowerable, Simplifiable, Node.IterableNodeType {
     public BeginNode() {
         super(StampFactory.illegal());
     }
@@ -58,15 +59,28 @@
             // This begin node is necessary.
         } else {
             // This begin node can be removed and all guards moved up to the preceding begin node.
-            Node prevBegin = prev;
+            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();
             }
-            for (Node usage : usages()) {
-                tool.addToWorkList(usage);
-            }
             replaceAtUsages(prevBegin);
-            ((StructuredGraph) graph()).removeFixed(this);
         }
     }
 
@@ -80,4 +94,8 @@
     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/max/graal/nodes/EndNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/EndNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -28,7 +28,7 @@
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
 
-public final class EndNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
+public class EndNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
 
     public EndNode() {
         super(StampFactory.illegal());
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FixedWithNextNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FixedWithNextNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -29,15 +29,13 @@
  */
 public abstract class FixedWithNextNode extends FixedNode {
 
-    @Successor private FixedNode next; // the immediate successor of the current node
-
     public FixedNode next() {
-        return next;
+        assert scheduledNext() == null || scheduledNext() instanceof FixedNode : "next() cannot be used while the graph is scheduled";
+        return (FixedNode) scheduledNext();
     }
 
     public void setNext(FixedNode x) {
-        updatePredecessors(next, x);
-        next = x;
+        setScheduledNext(x);
     }
 
     public FixedWithNextNode(Stamp stamp) {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java	Mon Feb 20 18:01:22 2012 +0100
@@ -329,7 +329,7 @@
      * @param block the block begin for which we are creating the phi
      * @param i the index into the stack for which to create a phi
      */
-    public PhiNode setupPhiForStack(MergeNode block, int i) {
+    public PhiNode setupLoopPhiForStack(MergeNode block, int i) {
         ValueNode p = stackAt(i);
         if (p != null) {
             if (p instanceof PhiNode) {
@@ -339,6 +339,7 @@
                 }
             }
             PhiNode phi = graph().unique(new PhiNode(p.kind(), block, PhiType.Value));
+            phi.addInput(p);
             setValueAt(localsSize + i, phi);
             return phi;
         }
@@ -350,7 +351,7 @@
      * @param block the block begin for which we are creating the phi
      * @param i the index of the local variable for which to create the phi
      */
-    public PhiNode setupPhiForLocal(MergeNode block, int i) {
+    public PhiNode setupLoopPhiForLocal(MergeNode block, int i) {
         ValueNode p = localAt(i);
         if (p instanceof PhiNode) {
             PhiNode phi = (PhiNode) p;
@@ -359,6 +360,7 @@
             }
         }
         PhiNode phi = graph().unique(new PhiNode(p.kind(), block, PhiType.Value));
+        phi.addInput(p);
         storeLocal(i, phi);
         return phi;
     }
@@ -401,9 +403,9 @@
         for (int i = 0; i < valuesSize(); i++) {
             ValueNode currentValue = valueAt(i);
             ValueNode otherValue = other.valueAt(i);
-            if (currentValue != otherValue) {
+            if (currentValue != otherValue || block instanceof LoopBeginNode) {
                 if (block.isPhiAtMerge(currentValue)) {
-                    addToPhi((PhiNode) currentValue, otherValue);
+                    addToPhi((PhiNode) currentValue, otherValue, block instanceof LoopBeginNode);
                 } else {
                     setValueAt(i, combineValues(currentValue, otherValue, block));
                 }
@@ -411,12 +413,18 @@
         }
     }
 
-    private ValueNode combineValues(ValueNode currentValue, ValueNode otherValue, MergeNode block) {
+    public void simplifyLoopState() {
+        for (PhiNode phi : values.filter(PhiNode.class).snapshot()) {
+            checkRedundantPhi(phi);
+        }
+    }
+
+    private static ValueNode combineValues(ValueNode currentValue, ValueNode otherValue, MergeNode block) {
         if (currentValue == null || otherValue == null || currentValue.kind() != otherValue.kind()) {
             return null;
         }
 
-        PhiNode phi = graph().unique(new PhiNode(currentValue.kind(), block, PhiType.Value));
+        PhiNode phi = currentValue.graph().add(new PhiNode(currentValue.kind(), block, PhiType.Value));
         for (int j = 0; j < block.phiPredecessorCount(); ++j) {
             phi.addInput(currentValue);
         }
@@ -425,43 +433,28 @@
         return phi;
     }
 
-    private static void addToPhi(PhiNode phiNode, ValueNode otherValue) {
+    private static void addToPhi(PhiNode phiNode, ValueNode otherValue, boolean recursiveInvalidCheck) {
         if (otherValue == null || otherValue.kind() != phiNode.kind()) {
-            phiNode.replaceAtUsages(null);
-            phiNode.safeDelete();
+            if (recursiveInvalidCheck) {
+                deleteInvalidPhi(phiNode);
+            } else {
+                phiNode.replaceAtUsages(null);
+                phiNode.safeDelete();
+            }
         } else {
             phiNode.addInput(otherValue);
         }
     }
 
-    public void mergeLoop(LoopBeginNode block, FrameStateAccess other) {
-        assert checkSize(other);
-        for (int i = 0; i < valuesSize(); i++) {
-            PhiNode currentValue = (PhiNode) valueAt(i);
-            if (currentValue != null) {
-                assert currentValue.merge() == block;
-                assert currentValue.valueCount() == 1;
-                ValueNode otherValue = other.valueAt(i);
-                if (otherValue == currentValue) {
-                    deleteRedundantPhi(currentValue, currentValue.firstValue());
-                } else if (otherValue == null || otherValue.kind() != currentValue.kind()) {
-                    deleteInvalidPhi(currentValue);
-                } else {
-                    currentValue.addInput(otherValue);
-                }
-            }
-        }
-    }
-
-    public void deleteRedundantPhi(PhiNode redundantPhi, ValueNode phiValue) {
+    public static void deleteRedundantPhi(PhiNode redundantPhi, ValueNode phiValue) {
         Collection<PhiNode> phiUsages = redundantPhi.usages().filter(PhiNode.class).snapshot();
-        ((StructuredGraph) graph()).replaceFloating(redundantPhi, phiValue);
+        ((StructuredGraph) redundantPhi.graph()).replaceFloating(redundantPhi, phiValue);
         for (PhiNode phi : phiUsages) {
             checkRedundantPhi(phi);
         }
     }
 
-    private void checkRedundantPhi(PhiNode phiNode) {
+    private static void checkRedundantPhi(PhiNode phiNode) {
         if (phiNode.isDeleted() || phiNode.valueCount() == 1) {
             return;
         }
@@ -472,7 +465,7 @@
         }
     }
 
-    private void deleteInvalidPhi(PhiNode phiNode) {
+    private static void deleteInvalidPhi(PhiNode phiNode) {
         if (!phiNode.isDeleted()) {
             Collection<PhiNode> phiUsages = phiNode.usages().filter(PhiNode.class).snapshot();
             phiNode.replaceAtUsages(null);
@@ -575,13 +568,13 @@
             // always insert phis for the stack
             ValueNode x = stackAt(i);
             if (x != null) {
-                setupPhiForStack(loopBegin, i).addInput(x);
+                setupLoopPhiForStack(loopBegin, i);
             }
         }
         for (int i = 0; i < localsSize(); i++) {
             ValueNode x = localAt(i);
             if (x != null) {
-                setupPhiForLocal(loopBegin, i).addInput(x);
+                setupLoopPhiForLocal(loopBegin, i);
             }
         }
     }
@@ -592,6 +585,8 @@
         properties.put("bci", bci);
         if (method != null) {
             properties.put("method", CiUtil.format("%H.%n(%p):%r", method));
+        } else {
+            properties.put("method", "None");
         }
         StringBuilder str = new StringBuilder();
         for (int i = 0; i < localsSize(); i++) {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/IfNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/IfNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -121,7 +121,7 @@
                 EndNode trueEnd = (EndNode) trueSuccessor().next();
                 EndNode falseEnd = (EndNode) falseSuccessor().next();
                 MergeNode merge = trueEnd.merge();
-                if (merge == falseEnd.merge() && merge.endCount() == 2) {
+                if (merge == falseEnd.merge() && merge.forwardEndCount() == 2) {
                     Iterator<PhiNode> phis = merge.phis().iterator();
                     if (!phis.hasNext()) {
                         // empty if construct with no phis: remove it
@@ -130,7 +130,7 @@
                         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.endAt(FALSE_EDGE);
+                            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()) {
@@ -140,7 +140,7 @@
                                 return;
                             }
                             if (trueValue.isConstant() && falseValue.isConstant()) {
-                                MaterializeNode materialize = MaterializeNode.create(compare(), graph(), (ConstantNode) trueValue, (ConstantNode) falseValue);
+                                MaterializeNode materialize = MaterializeNode.create(compare(), graph(), trueValue, falseValue);
                                 ((StructuredGraph) graph()).replaceFloating(singlePhi, materialize);
                                 removeEmptyIf(tool);
                             }
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -71,7 +71,9 @@
     @Override
     public Map<Object, Object> getDebugProperties() {
         Map<Object, Object> debugProperties = super.getDebugProperties();
-        debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
+        if (callTarget != null && callTarget.targetMethod() != null) {
+            debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
+        }
         return debugProperties;
     }
 
@@ -85,6 +87,9 @@
         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);
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LoopBeginNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LoopBeginNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -25,12 +25,13 @@
 import java.util.*;
 
 import com.oracle.max.graal.graph.*;
+import com.oracle.max.graal.graph.iterators.*;
 import com.oracle.max.graal.nodes.spi.*;
 
 
 public class LoopBeginNode extends MergeNode implements Node.IterableNodeType, LIRLowerable {
-
     private double loopFrequency;
+    private int nextEndIndex;
 
     public LoopBeginNode() {
         loopFrequency = 1;
@@ -44,8 +45,24 @@
         this.loopFrequency = loopFrequency;
     }
 
-    public LoopEndNode loopEnd() {
-        return usages().filter(LoopEndNode.class).first();
+    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
@@ -54,39 +71,62 @@
     }
 
     @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 endCount() + 1;
+        return forwardEndCount() + loopEnds().count();
     }
 
     @Override
-    public int phiPredecessorIndex(FixedNode pred) {
-        if (pred == forwardEdge()) {
-            return 0;
-        } else if (pred == this.loopEnd()) {
-            return 1;
+    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 + "(sp=" + forwardEdge() + ", le=" + this.loopEnd() + ")");
+        throw ValueUtil.shouldNotReachHere("unknown pred : " + pred);
     }
 
     @Override
-    public FixedNode phiPredecessorAt(int index) {
-        if (index == 0) {
-            return forwardEdge();
-        } else if (index == 1) {
-            return loopEnd();
+    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();
     }
 
-    public EndNode forwardEdge() {
-        return this.endAt(0);
-    }
-
     @Override
     public boolean verify() {
-        assertTrue(loopEnd() != null, "missing loopEnd");
-        assertTrue(forwardEdge() != null, "missing forwardEdge");
-        assertTrue(usages().filter(LoopEndNode.class).count() == 1, "multiple loop ends");
+        assertTrue(loopEnds().isNotEmpty(), "missing loopEnd");
+        assertTrue(forwardEndCount() == 1, "LoopBegin should only have one forward edge");
         return super.verify();
     }
 
@@ -96,4 +136,13 @@
         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/max/graal/nodes/LoopEndNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LoopEndNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -22,19 +22,29 @@
  */
 package com.oracle.max.graal.nodes;
 
+import java.util.*;
+
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.oracle.max.graal.nodes.type.*;
 
 
-public class LoopEndNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
+public final class LoopEndNode extends EndNode {
 
     @Input(notDataflow = true) private LoopBeginNode loopBegin;
     @Data private boolean safepointPolling;
+    @Data private int endIndex;
 
-    public LoopEndNode() {
-        super(StampFactory.illegal());
+    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() {
@@ -58,11 +68,26 @@
     @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/max/graal/nodes/MaterializeNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/MaterializeNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -31,7 +31,7 @@
         super(condition, trueValue, falseValue);
     }
 
-    public static MaterializeNode create(BooleanNode condition, Graph graph, ConstantNode trueValue, ConstantNode falseValue) {
+    public static MaterializeNode create(BooleanNode condition, Graph graph, ValueNode trueValue, ValueNode falseValue) {
         MaterializeNode result = new MaterializeNode(condition, trueValue, falseValue);
         return graph.unique(result);
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/MergeNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/MergeNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -22,6 +22,9 @@
  */
 package com.oracle.max.graal.nodes;
 
+import static com.oracle.max.graal.graph.iterators.NodePredicates.*;
+
+import com.oracle.max.graal.debug.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.graph.iterators.*;
 import com.oracle.max.graal.nodes.spi.*;
@@ -43,19 +46,19 @@
         gen.visitMerge(this);
     }
 
-    public int endIndex(EndNode end) {
+    public int forwardEndIndex(EndNode end) {
         return ends.indexOf(end);
     }
 
-    public void addEnd(EndNode end) {
+    public void addForwardEnd(EndNode end) {
         ends.add(end);
     }
 
-    public int endCount() {
+    public int forwardEndCount() {
         return ends.size();
     }
 
-    public EndNode endAt(int index) {
+    public EndNode forwardEndAt(int index) {
         return ends.get(index);
     }
 
@@ -74,70 +77,83 @@
         return value instanceof PhiNode && ((PhiNode) value).merge() == this;
     }
 
-
-    /**
-     * Formats a given instruction as a value in a {@linkplain FrameState frame state}. If the instruction is a phi defined at a given
-     * block, its {@linkplain PhiNode#valueCount() inputs} are appended to the returned string.
-     *
-     * @param index the index of the value in the frame state
-     * @param value the frame state value
-     * @return the instruction representation as a string
-     */
-    public String stateString(int index, ValueNode value) {
-        StringBuilder sb = new StringBuilder(30);
-        sb.append(String.format("%2d  %s", index, ValueUtil.valueString(value)));
-        if (value instanceof PhiNode) {
-            PhiNode phi = (PhiNode) value;
-            // print phi operands
-            if (phi.merge() == this) {
-                sb.append(" [");
-                for (int j = 0; j < phi.valueCount(); j++) {
-                    sb.append(' ');
-                    ValueNode operand = phi.valueAt(j);
-                    if (operand != null) {
-                        sb.append(ValueUtil.valueString(operand));
-                    } else {
-                        sb.append("NULL");
-                    }
-                }
-                sb.append("] ");
-            }
-        }
-        return sb.toString();
-    }
-
     /**
      * 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 = ends.indexOf(pred);
+        int predIndex = phiPredecessorIndex(pred);
         assert predIndex != -1;
-        ends.remove(predIndex);
-
+        deleteEnd(pred);
         for (PhiNode phi : phis()) {
             phi.removeInput(predIndex);
         }
     }
 
+    protected void deleteEnd(EndNode end) {
+        ends.remove(end);
+    }
+
     public void clearEnds() {
         ends.clear();
     }
 
-    public int phiPredecessorCount() {
-        return endCount();
+    public NodeIterable<EndNode> forwardEnds() {
+        return ends;
     }
 
-    public int phiPredecessorIndex(FixedNode pred) {
-        EndNode end = (EndNode) pred;
-        return endIndex(end);
+    public int phiPredecessorCount() {
+        return forwardEndCount();
     }
 
-    public FixedNode phiPredecessorAt(int index) {
-        return endAt(index);
+    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/max/graal/nodes/PhiNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/PhiNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -100,7 +100,7 @@
         values.set(i, x);
     }
 
-    public ValueNode valueAt(FixedNode pred) {
+    public ValueNode valueAt(EndNode pred) {
         return valueAt(merge().phiPredecessorIndex(pred));
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/PiNode.java	Mon Feb 20 18:01:22 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.max.graal.nodes;
+
+import com.oracle.max.graal.nodes.calc.*;
+import com.oracle.max.graal.nodes.spi.*;
+import com.oracle.max.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.max.graal.nodes/src/com/oracle/max/graal/nodes/ScheduledNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.graal.nodes;
+
+import com.oracle.max.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/max/graal/nodes/StructuredGraph.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/StructuredGraph.java	Mon Feb 20 18:01:22 2012 +0100
@@ -194,6 +194,7 @@
         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++) {
@@ -209,6 +210,7 @@
         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++) {
@@ -241,6 +243,7 @@
         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++) {
@@ -255,6 +258,7 @@
         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++) {
@@ -285,4 +289,45 @@
         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/max/graal/nodes/ValueNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ValueNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -24,14 +24,13 @@
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
-import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.type.*;
 
 /**
  * This class represents a value within the graph, including local variables, phis, and
  * all other instructions.
  */
-public abstract class ValueNode extends Node implements StampProvider {
+public abstract class ValueNode extends ScheduledNode implements StampProvider {
 
     /**
      * The kind of this value. This is {@link CiKind#Void} for instructions that produce no value.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/CompareNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/CompareNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -146,17 +146,6 @@
     private ValueNode optimizeNormalizeCmp(CiConstant constant, NormalizeCompareNode normalizeNode) {
         if (constant.kind == CiKind.Int && constant.asInt() == 0) {
             Condition cond = condition();
-            if (normalizeNode.x().kind().isFloatOrDouble()) {
-                switch (cond) {
-                    case LT: cond = Condition.BT; break;
-                    case LE: cond = Condition.BE; break;
-                    case GE: cond = Condition.AE; break;
-                    case GT: cond = Condition.AT; break;
-                }
-            }
-            if (normalizeNode == y()) {
-                cond = cond.mirror();
-            }
             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()));
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/Condition.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/Condition.java	Mon Feb 20 18:01:22 2012 +0100
@@ -134,6 +134,27 @@
         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
@@ -227,13 +248,9 @@
                 switch (this) {
                     case EQ: return x == y;
                     case NE: return x != y;
-                    case BT:
                     case LT: return x < y;
-                    case BE:
                     case LE: return x <= y;
-                    case AT:
                     case GT: return x > y;
-                    case AE:
                     case GE: return x >= y;
                 }
             }
@@ -246,13 +263,9 @@
                 switch (this) {
                     case EQ: return x == y;
                     case NE: return x != y;
-                    case BT:
                     case LT: return x < y;
-                    case BE:
                     case LE: return x <= y;
-                    case AT:
                     case GT: return x > y;
-                    case AE:
                     case GE: return x >= y;
                 }
             }
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConditionalNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConditionalNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -81,8 +81,8 @@
         ifNode.setTrueSuccessor(BeginNode.begin(trueEnd));
         ifNode.setFalseSuccessor(BeginNode.begin(falseEnd));
         MergeNode merge = graph.add(new MergeNode());
-        merge.addEnd(trueEnd);
-        merge.addEnd(falseEnd);
+        merge.addForwardEnd(trueEnd);
+        merge.addForwardEnd(falseEnd);
         PhiNode phi = graph.unique(new PhiNode(kind, merge, PhiType.Value));
         phi.addInput(trueValue);
         phi.addInput(falseValue);
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatDivNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatDivNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -38,10 +38,14 @@
     public ValueNode canonical(CanonicalizerTool tool) {
         if (x().isConstant() && y().isConstant()) {
             if (kind() == CiKind.Float) {
-                return ConstantNode.forFloat(x().asConstant().asFloat() / y().asConstant().asFloat(), graph());
+                if (y().asConstant().asFloat() != 0) {
+                    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());
+                if (y().asConstant().asDouble() != 0) {
+                    return ConstantNode.forDouble(x().asConstant().asDouble() / y().asConstant().asDouble(), graph());
+                }
             }
         }
         return this;
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NormalizeCompareNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NormalizeCompareNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,21 +22,15 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
-import java.util.*;
-
 import com.oracle.max.cri.ci.*;
+import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 
 /**
- * Returns -1, 0, or 1 if either x > y, x == y, or x < y.
+ * Returns -1, 0, or 1 if either x < y, x == y, or x > y.
  */
-// TODO(cwi): Since the machine code representation of this node uses branches and individual constant assignemnts anyway,
-// it should be lowered to explicit control flow nodes.  This removes AMD64CompareToIntOpcode.
-// For code generated by javac, the opcodes are followed by a branch instruction immediately, so in all cases that matter
-// this node is canonicalized away.
-// Consider moving this node and the code that does the lowering / canonicalization in a Java-specific project.
-public final class NormalizeCompareNode extends BinaryNode implements LIRLowerable {
+public final class NormalizeCompareNode extends BinaryNode implements Lowerable {
     @Data public final boolean isUnorderedLess;
 
     /**
@@ -51,14 +45,15 @@
     }
 
     @Override
-    public void generate(LIRGeneratorTool gen) {
-        gen.visitNormalizeCompare(this);
-    }
+    public void lower(CiLoweringTool tool) {
+        StructuredGraph graph = (StructuredGraph) graph();
 
-    @Override
-    public Map<Object, Object> getDebugProperties() {
-        Map<Object, Object> properties = super.getDebugProperties();
-        properties.put("isUnorderedLess", isUnorderedLess);
-        return properties;
+        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/max/graal/nodes/extended/UnboxNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnboxNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -34,10 +34,12 @@
 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";
     }
@@ -47,7 +49,7 @@
     }
 
     public CiKind destinationKind() {
-        return this.kind();
+        return destinationKind;
     }
 
     public void expand(BoxingMethodPool pool) {
@@ -63,7 +65,7 @@
             CiConstant constant = source.asConstant();
             Object o = constant.asObject();
             if (o != null) {
-                switch (kind()) {
+                switch (destinationKind) {
                     case Boolean:
                         return ConstantNode.forBoolean((Boolean) o, graph());
                     case Byte:
@@ -81,7 +83,7 @@
                     case Double:
                         return ConstantNode.forDouble((Long) o, graph());
                     default:
-                        assert false;
+                        ValueUtil.shouldNotReachHere();
                 }
             }
         }
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CheckCastNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CheckCastNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -37,12 +37,17 @@
  */
 public final class CheckCastNode extends TypeCheckNode implements Canonicalizable, LIRLowerable, Node.IterableNodeType {
 
-    @Input protected final AnchorNode anchor;
+    @Input protected final FixedNode anchor;
+    @Data  protected final boolean emitCode;
 
-    public AnchorNode anchor() {
+    public FixedNode anchor() {
         return anchor;
     }
 
+    public boolean emitCode() {
+        return emitCode;
+    }
+
     /**
      * Creates a new CheckCast instruction.
      *
@@ -50,13 +55,22 @@
      * @param targetClass the class being cast to
      * @param object the instruction producing the object
      */
-    public CheckCastNode(AnchorNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object) {
+    public CheckCastNode(FixedNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object) {
         this(anchor, targetClassInstruction, targetClass, object, EMPTY_HINTS, false);
     }
 
-    public CheckCastNode(AnchorNode anchor, ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiResolvedType[] hints, boolean hintsExact) {
+    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
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ExceptionObjectNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ExceptionObjectNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -24,13 +24,14 @@
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
+import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
 
 /**
  * The {@code ExceptionObject} instruction represents the incoming exception object to an exception handler.
  */
-public final class ExceptionObjectNode extends AbstractStateSplit implements LIRLowerable {
+public final class ExceptionObjectNode extends AbstractStateSplit implements LIRLowerable, MemoryCheckpoint {
 
     /**
      * Constructs a new ExceptionObject instruction.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/MethodCallTargetNode.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/MethodCallTargetNode.java	Mon Feb 20 18:01:22 2012 +0100
@@ -133,13 +133,12 @@
         if (!isStatic()) {
             ValueNode receiver = receiver();
             if (receiver != null && receiver.exactType() != null) {
-                if (invokeKind == InvokeKind.Interface) {
-                    invokeKind = InvokeKind.Virtual;
-                    targetMethod = receiver.exactType().resolveMethodImpl(targetMethod);
-                }
-                if (receiver.isConstant() && invokeKind == InvokeKind.Virtual) {
-                    invokeKind = InvokeKind.Special;
-                    targetMethod = receiver.exactType().resolveMethodImpl(targetMethod);
+                if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) {
+                    RiResolvedMethod method = receiver.exactType().resolveMethodImpl(targetMethod);
+                    if (method != null) {
+                        invokeKind = InvokeKind.Special;
+                        targetMethod = method;
+                    }
                 }
             }
         }
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/LIRGeneratorTool.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/LIRGeneratorTool.java	Mon Feb 20 18:01:22 2012 +0100
@@ -103,9 +103,6 @@
     // * The actual compare-and-swap
     public abstract void visitCompareAndSwap(CompareAndSwapNode i);
 
-    // The class NormalizeCompareNode should be lowered away in the front end, since the code generated is long and uses branches anyway.
-    public abstract void visitNormalizeCompare(NormalizeCompareNode 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);
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/StampFactory.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/StampFactory.java	Mon Feb 20 18:01:22 2012 +0100
@@ -101,7 +101,7 @@
                 return false;
             } else if (other.nonNull() || nonNull()) {
                 // One of the two values cannot be null.
-                return !other.declaredType().isSubtypeOf(declaredType()) && !declaredType().isSubtypeOf(other.declaredType());
+                return !other.declaredType().isInterface() && !declaredType().isInterface() && !other.declaredType().isSubtypeOf(declaredType()) && !declaredType().isSubtypeOf(other.declaredType());
             } else {
                 // Both values may be null.
                 return false;
@@ -176,7 +176,9 @@
                 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());
-                exactType = orTypes(exactType, current.exactType());
+                if (exactType != current.exactType()) {
+                    exactType = null;
+                }
             }
 
             if (nonNull != first.nonNull() || declaredType != first.declaredType() || exactType != first.exactType()) {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/util/GraphUtil.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/util/GraphUtil.java	Mon Feb 20 18:01:22 2012 +0100
@@ -22,10 +22,13 @@
  */
 package com.oracle.max.graal.nodes.util;
 
+import static com.oracle.max.graal.graph.iterators.NodePredicates.*;
+
 import java.util.*;
 
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
+import com.oracle.max.graal.nodes.calc.*;
 
 public class GraphUtil {
 
@@ -35,9 +38,6 @@
             // We reached a control flow end.
             EndNode end = (EndNode) node;
             killEnd(end);
-        } else if (node instanceof LoopEndNode) {
-            // We reached a loop end.
-            killLoopEnd(node);
         } else {
             // Normal control flow node.
             for (Node successor : node.successors().snapshot()) {
@@ -47,69 +47,57 @@
         propagateKill(node);
     }
 
-    private static void killLoopEnd(FixedNode node) {
-        LoopEndNode loopEndNode = (LoopEndNode) node;
-        LoopBeginNode loop = loopEndNode.loopBegin();
-        loopEndNode.setLoopBegin(null);
-        EndNode endNode = loop.endAt(0);
-        assert endNode.predecessor() != null;
-        replaceLoopPhis(loop);
-        loop.removeEnd(endNode);
-
-        FixedNode next = loop.next();
-        loop.setNext(null);
-        endNode.replaceAndDelete(next);
-        loop.safeDelete();
-    }
-
-    private static void replaceLoopPhis(MergeNode merge) {
-        for (Node usage : merge.usages().snapshot()) {
-            assert usage instanceof PhiNode;
-            ((StructuredGraph) merge.graph()).replaceFloating((PhiNode) usage, ((PhiNode) usage).valueAt(0));
+    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);
         }
     }
 
-    private static void killEnd(EndNode end) {
-        MergeNode merge = end.merge();
-        if (merge instanceof LoopBeginNode) {
-            for (PhiNode phi : merge.phis().snapshot()) {
-                ValueNode value = phi.valueAt(0);
-                phi.replaceAndDelete(value);
-            }
-            killCFG(merge);
-        } else {
-            merge.removeEnd(end);
-            if (merge.phiPredecessorCount() == 1) {
-                for (PhiNode phi : merge.phis().snapshot()) {
-                    ValueNode value = phi.valueAt(0);
-                    phi.replaceAndDelete(value);
+    public static void propagateKill(Node node) {
+        if (node != null && node.isAlive()) {
+            List<Node> usagesSnapshot = node.usages().filter(isA(FloatingNode.class).or(CallTargetNode.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);
+                    }
                 }
-                Node replacedSux = merge.phiPredecessorAt(0);
-                Node pred = replacedSux.predecessor();
-                assert replacedSux instanceof EndNode;
-                FixedNode next = merge.next();
-                merge.setNext(null);
-                pred.replaceFirstSuccessor(replacedSux, next);
-                merge.safeDelete();
-                replacedSux.safeDelete();
             }
         }
     }
 
-    // TODO(tw): Factor this code with other branch deletion code.
-    public static void propagateKill(Node node) {
-        if (node != null && node.isAlive()) {
-            List<Node> usagesSnapshot = node.usages().snapshot();
+    public static void killUnusedFloatingInputs(Node node) {
+        List<FloatingNode> floatingInputs = node.inputs().filter(FloatingNode.class).snapshot();
+        node.safeDelete();
 
-            // null out remaining usages
-            node.replaceAtUsages(null);
-            node.replaceAtPredecessors(null);
-            node.safeDelete();
-
-            for (Node usage : usagesSnapshot) {
-                if (!usage.isDeleted()) {
-                    propagateKill(usage);
-                }
+        for (FloatingNode in : floatingInputs) {
+            if (in.isAlive() && in.usages().isEmpty()) {
+                killUnusedFloatingInputs(in);
             }
         }
     }
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java	Mon Feb 20 18:01:22 2012 +0100
@@ -27,6 +27,7 @@
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
+import com.oracle.max.criutils.*;
 import com.oracle.max.graal.alloc.util.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
@@ -66,9 +67,6 @@
         } else if (object instanceof SchedulePhase) {
             schedule = (SchedulePhase) object;
             return;
-        } else if (object instanceof LIRGenerator) {
-            cfgPrinter.lirGenerator = (LIRGenerator) object;
-            return;
         }
 
         if (compiler == null) {
@@ -83,16 +81,20 @@
             } catch (FileNotFoundException e) {
                 throw new InternalError("Could not open " + file.getAbsolutePath());
             }
+            TTY.println("CFGPrinter: Output to file %s", file);
         }
 
         RiRuntime runtime = cfgPrinter.runtime;
-        if (object instanceof RiResolvedMethod) {
+        if (object instanceof LIRGenerator) {
+            cfgPrinter.lirGenerator = (LIRGenerator) object;
+        } else if (object instanceof RiResolvedMethod) {
             method = (RiResolvedMethod) object;
             cfgPrinter.printCompilation(method);
 
             cfgPrinter.lir = null;
             cfgPrinter.lirGenerator = null;
             schedule = null;
+            TTY.println("CFGPrinter: Dumping method %s", method);
 
         } else if (object instanceof BciBlockMapping) {
             BciBlockMapping blockMap = (BciBlockMapping) object;
@@ -110,10 +112,13 @@
                     curSchedule = new SchedulePhase();
                     curSchedule.apply((StructuredGraph) object);
                 } catch (Throwable ex) {
+                    curSchedule = null;
                     // ignore
                 }
             }
-            cfgPrinter.printCFG(message, Arrays.asList(curSchedule.getCFG().getBlocks()), curSchedule);
+            if (curSchedule != null && curSchedule.getCFG() != null) {
+                cfgPrinter.printCFG(message, Arrays.asList(curSchedule.getCFG().getBlocks()), curSchedule);
+            }
 
         } else if (object instanceof CiTargetMethod) {
             cfgPrinter.printMachineCode(runtime.disassemble((CiTargetMethod) object), null);
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinter.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinter.java	Mon Feb 20 18:01:22 2012 +0100
@@ -94,7 +94,7 @@
                 schedule = new SchedulePhase();
                 schedule.apply((StructuredGraph) graph);
             } catch (Throwable t) {
-                // nothing to do here...
+                schedule = null;
             }
         }
 
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinterDumpHandler.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinterDumpHandler.java	Mon Feb 20 18:01:22 2012 +0100
@@ -70,7 +70,6 @@
             } else {
                 initializeNetworkPrinter();
             }
-            printer.begin();
         }
     }
 
@@ -78,8 +77,9 @@
         try {
             FileOutputStream stream = new FileOutputStream(fileName);
             printer = new IdealGraphPrinter(stream);
+            printer.begin();
         } catch (IOException e) {
-            throw new RuntimeException(e);
+            printer = null;
         }
     }
 
@@ -88,9 +88,11 @@
             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) {
-            throw new RuntimeException(e);
+            TTY.println("Could not connect to the IGV on port %d: %s", port, e);
+            printer = null;
         }
     }
 
@@ -100,7 +102,7 @@
             ensureInitialized();
             final Graph graph = (Graph) object;
 
-            if (printer.isValid()) {
+            if (printer != null && printer.isValid()) {
                 // Get all current RiResolvedMethod instances in the context.
                 List<String> inlineContext = getInlineContext();
                 Debug.contextSnapshot(RiResolvedMethod.class);
@@ -140,9 +142,6 @@
 
                     }
                 });
-            } else {
-                TTY.println("Fatal error: Printer invalid!");
-                System.exit(-1);
             }
         }
     }
@@ -152,7 +151,7 @@
         for (Object o : Debug.context()) {
             if (o instanceof RiResolvedMethod) {
                 RiResolvedMethod method = (RiResolvedMethod) o;
-                result.add(CiUtil.format("%H::%n", method));
+                result.add(CiUtil.format("%H::%n(%p)", method));
             } else if (o instanceof DebugDumpScope) {
                 DebugDumpScope debugDumpScope = (DebugDumpScope) o;
                 result.add(debugDumpScope.getName());
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java	Mon Feb 20 18:01:22 2012 +0100
@@ -23,9 +23,11 @@
 package com.oracle.max.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.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.cri.*;
@@ -86,47 +88,57 @@
         }
     }
 
-    private static StructuredGraph buildSnippetGraph(RiResolvedMethod snippetRiMethod, GraalRuntime runtime, CiTarget target, BoxingMethodPool pool, PhasePlan plan) {
+    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>() {
 
-        GraphBuilderConfiguration config = GraphBuilderConfiguration.getSnippetDefault();
-        GraphBuilderPhase graphBuilder = new GraphBuilderPhase(runtime, config);
-        StructuredGraph graph = new StructuredGraph(snippetRiMethod);
-        graphBuilder.apply(graph);
+            @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());
+                Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName());
+
+                new SnippetIntrinsificationPhase(runtime, pool).apply(graph);
 
-        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);
+                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);
+                        }
+                    }
                 }
-                InliningUtil.inline(invoke, targetGraph, true);
-                new CanonicalizerPhase(target, runtime, null).apply(graph);
-            }
-        }
+
+                new SnippetIntrinsificationPhase(runtime, pool).apply(graph);
 
-        new SnippetIntrinsificationPhase(runtime, pool).apply(graph);
-
-        Debug.dump(graph, "%s: %s", snippetRiMethod.name(), GraphBuilderPhase.class.getSimpleName());
-        new DeadCodeEliminationPhase().apply(graph);
-        new CanonicalizerPhase(target, runtime, null).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 (gd) remove when we have safepoint polling elimination
-        for (LoopEndNode end : graph.getNodes(LoopEndNode.class)) {
-            end.setSafepointPolling(false);
-        }
-        new InsertStateAfterPlaceholderPhase().apply(graph);
+                // TODO (gd) remove when we have safepoint polling elimination
+                for (LoopEndNode end : graph.getNodes(LoopEndNode.class)) {
+                    end.setSafepointPolling(false);
+                }
+                new InsertStateAfterPlaceholderPhase().apply(graph);
 
-        Debug.dump(graph, "%s: Final", snippetRiMethod.name());
+                Debug.dump(graph, "%s: Final", snippetRiMethod.name());
+
+                snippetRiMethod.compilerStorage().put(Graph.class, graph);
 
-        snippetRiMethod.compilerStorage().put(Graph.class, graph);
+                return graph;
+            }
+        });
 
-        return graph;
     }
 }
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/BoxingEliminationTest.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/BoxingEliminationTest.java	Mon Feb 20 18:01:22 2012 +0100
@@ -41,20 +41,24 @@
  * 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 int referenceSnippet(int a) {
+    public static short referenceSnippet(short a) {
         return 1;
     }
 
-    public static Integer boxedInteger() {
+    public static Short boxedShort() {
         return 1;
     }
 
     public static Object boxedObject() {
-        return 1;
+        return (short) 1;
+    }
+
+    public static Short constantBoxedShort() {
+        return s;
     }
 
     @Test
@@ -63,8 +67,8 @@
     }
 
     @SuppressWarnings("all")
-    public static int test1Snippet(int a) {
-        return boxedInteger();
+    public static short test1Snippet(short a) {
+        return boxedShort();
     }
 
     @Test
@@ -73,8 +77,8 @@
     }
 
     @SuppressWarnings("all")
-    public static int test2Snippet(int a) {
-        return (Integer) boxedObject();
+    public static short test2Snippet(short a) {
+        return (Short) boxedObject();
     }
     @Test
     public void test3() {
@@ -82,39 +86,54 @@
     }
 
     @SuppressWarnings("all")
-    public static int test3Snippet(int a) {
-        int b = boxedInteger();
+    public static short test3Snippet(short a) {
+        short b = boxedShort();
         if (b < 0) {
-            b = boxedInteger();
+            b = boxedShort();
         }
         return b;
     }
 
-    private void test(String snippet) {
-        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.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, 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);
+    @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/max/graal/compiler/tests/DegeneratedLoopsTest.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/DegeneratedLoopsTest.java	Mon Feb 20 18:01:22 2012 +0100
@@ -24,7 +24,7 @@
 
 import static com.oracle.max.graal.graph.iterators.NodePredicates.*;
 
-import org.junit.Test;
+import org.junit.*;
 
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.debug.*;
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/MonitorTest.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/MonitorTest.java	Mon Feb 20 18:01:22 2012 +0100
@@ -26,9 +26,10 @@
 
 import java.util.*;
 
-import junit.framework.AssertionFailedError;
+import junit.framework.*;
 
-import org.junit.*;
+import org.junit.Assert;
+import org.junit.Test;
 
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.graph.*;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/TypeSystemTest.java	Mon Feb 20 18:01:22 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.max.graal.compiler.tests;
+
+import org.junit.*;
+
+import com.oracle.max.graal.compiler.phases.*;
+import com.oracle.max.graal.compiler.types.*;
+import com.oracle.max.graal.debug.*;
+import com.oracle.max.graal.graph.*;
+import com.oracle.max.graal.nodes.*;
+import com.oracle.max.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/hotspot/.project	Mon Feb 20 17:58:46 2012 +0100
+++ b/hotspot/.project	Mon Feb 20 18:01:22 2012 +0100
@@ -96,6 +96,11 @@
 			<locationURI>PARENT-1-PROJECT_LOC/build/linux/linux_amd64_graal/generated</locationURI>
 		</link>
 		<link>
+			<name>make</name>
+			<type>2</type>
+			<locationURI>WORKSPACE_LOC/make</locationURI>
+		</link>
+		<link>
 			<name>os</name>
 			<type>2</type>
 			<locationURI>PARENT-1-PROJECT_LOC/src/os/linux</locationURI>
--- a/make/bsd/Makefile	Mon Feb 20 17:58:46 2012 +0100
+++ b/make/bsd/Makefile	Mon Feb 20 18:01:22 2012 +0100
@@ -199,6 +199,7 @@
 SUBDIRS_CORE      = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
 SUBDIRS_ZERO      = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
 SUBDIRS_SHARK     = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
+SUBDIRS_GRAAL     = $(addprefix $(OSNAME)_$(BUILDARCH)_graal/,$(TARGETS))
 
 TARGETS_C2        = $(TARGETS)
 TARGETS_C1        = $(addsuffix 1,$(TARGETS))
@@ -206,6 +207,7 @@
 TARGETS_CORE      = $(addsuffix core,$(TARGETS))
 TARGETS_ZERO      = $(addsuffix zero,$(TARGETS))
 TARGETS_SHARK     = $(addsuffix shark,$(TARGETS))
+TARGETS_GRAAL     = $(addsuffix graal,$(TARGETS))
 
 BUILDTREE_MAKE    = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
 BUILDTREE_VARS    = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
@@ -223,6 +225,7 @@
 	@echo "  $(TARGETS_CORE)"
 	@echo "  $(TARGETS_ZERO)"
 	@echo "  $(TARGETS_SHARK)"
+	@echo "  $(TARGETS_GRAAL)"
 
 checks: check_os_version check_j2se_version
 
@@ -281,6 +284,10 @@
 	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
 	$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
 
+$(SUBDIRS_GRAAL): $(BUILDTREE_MAKE)
+	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+	$(BUILDTREE) VARIANT=graal
+
 platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
 	$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
 
@@ -328,12 +335,19 @@
 	cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
 endif
 
+$(TARGETS_GRAAL):  $(SUBDIRS_GRAAL)
+	cd $(OSNAME)_$(BUILDARCH)_graal/$(patsubst %graal,%,$@) && $(MAKE) $(MFLAGS)
+ifdef INSTALL
+	cd $(OSNAME)_$(BUILDARCH)_graal/$(patsubst %graal,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
 # Just build the tree, and nothing else:
 tree:      $(SUBDIRS_C2)
 tree1:     $(SUBDIRS_C1)
 treecore:  $(SUBDIRS_CORE)
 treezero:  $(SUBDIRS_ZERO)
 treeshark: $(SUBDIRS_SHARK)
+treegraal: $(SUBDIRS_GRAAL)
 
 # Doc target.  This is the same for all build options.
 #     Hence create a docs directory beside ...$(ARCH)_[...]
@@ -364,8 +378,8 @@
 
 #-------------------------------------------------------------------------------
 
-.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
-.PHONY: tree tree1 treecore treezero treeshark
-.PHONY: all compiler1 compiler2 core zero shark
-.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) $(TARGETS_GRAAL)
+.PHONY: tree tree1 treecore treezero treeshark treegraal
+.PHONY: all compiler1 compiler2 core zero shark graal
+.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs clean_graal
 .PHONY: checks check_os_version check_j2se_version
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/graal.make	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2008, 2010 Red Hat, Inc.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+# Sets make macros for making Graal version of VM
+
+TYPE = GRAAL
+
+VM_SUBDIR = graal
+
+CFLAGS += -DGRAAL -DCOMPILER1
--- a/make/bsd/makefiles/vm.make	Mon Feb 20 17:58:46 2012 +0100
+++ b/make/bsd/makefiles/vm.make	Mon Feb 20 18:01:22 2012 +0100
@@ -118,7 +118,7 @@
 # By default, link the *.o into the library, not the executable.
 LINK_INTO$(LINK_INTO) = LIBJVM
 
-JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
+JDK_LIBDIR = $(JAVA_HOME)/jre/lib
 
 #----------------------------------------------------------------------
 # jvm_db & dtrace
@@ -137,7 +137,7 @@
   LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
 endif
 
-SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
+SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt graal
 
 SOURCE_PATHS=\
   $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
@@ -161,6 +161,11 @@
 
 SHARK_PATHS := $(GAMMADIR)/src/share/vm/shark
 
+GRAAL_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
+GRAAL_PATHS += $(HS_COMMON_SRC)/share/vm/c1
+GRAAL_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/graal)
+GRAAL_PATHS += $(HS_COMMON_SRC)/share/vm/graal
+
 # Include dirs per type.
 Src_Dirs/CORE      := $(CORE_PATHS)
 Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
@@ -168,12 +173,14 @@
 Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
 Src_Dirs/ZERO      := $(CORE_PATHS)
 Src_Dirs/SHARK     := $(CORE_PATHS) $(SHARK_PATHS)
+Src_Dirs/GRAAL     := $(CORE_PATHS) $(GRAAL_PATHS)
 Src_Dirs := $(Src_Dirs/$(TYPE))
 
 COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
 COMPILER1_SPECIFIC_FILES := c1_\*
 SHARK_SPECIFIC_FILES     := shark
 ZERO_SPECIFIC_FILES      := zero
+GRAAL_SPECIFIC_FILES     := graal
 
 # Always exclude these.
 Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
@@ -185,6 +192,7 @@
 Src_Files_EXCLUDE/TIERED    := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
 Src_Files_EXCLUDE/ZERO      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
 Src_Files_EXCLUDE/SHARK     := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
+Src_Files_EXCLUDE/GRAAL     := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
 
 Src_Files_EXCLUDE +=  $(Src_Files_EXCLUDE/$(TYPE))
 
--- a/make/linux/makefiles/vm.make	Mon Feb 20 17:58:46 2012 +0100
+++ b/make/linux/makefiles/vm.make	Mon Feb 20 18:01:22 2012 +0100
@@ -133,7 +133,7 @@
 LIBJVM_DEBUGINFO   = lib$(JVM).debuginfo
 LIBJVM_G_DEBUGINFO = lib$(JVM)$(G_SUFFIX).debuginfo
 
-SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
+SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt graal
 
 SOURCE_PATHS=\
   $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
--- a/make/windows/build.make	Mon Feb 20 17:58:46 2012 +0100
+++ b/make/windows/build.make	Mon Feb 20 18:01:22 2012 +0100
@@ -112,6 +112,8 @@
 VARIANT_TEXT=Tiered
 !elseif "$(Variant)" == "kernel"
 VARIANT_TEXT=Kernel
+!elseif "$(Variant)" == "graal"
+VARIANT_TEXT=Graal
 !endif
 
 #########################################################################
@@ -302,9 +304,9 @@
 checks: checkVariant checkWorkSpace checkSA
 
 checkVariant:
-	@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
-	@ if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \
-          echo Need to specify "Variant=[tiered|compiler2|compiler1|kernel|core]" && false
+	@ if "$(Variant)"=="" echo Need to specify "Variant=[graal|tiered|compiler2|compiler1|kernel|core]" && false
+	@ if "$(Variant)" NEQ "graal" if "$(Variant)" NEQ "tiered" if "$(Variant)" NEQ "compiler2" if "$(Variant)" NEQ "compiler1" if "$(Variant)" NEQ "kernel" if "$(Variant)" NEQ "core" \
+          echo Need to specify "Variant=[graal|tiered|compiler2|compiler1|kernel|core]" && false
 
 checkWorkSpace:
 	@ if "$(WorkSpace)"=="" echo Need to specify "WorkSpace=..." && false
--- a/make/windows/create.bat	Mon Feb 20 17:58:46 2012 +0100
+++ b/make/windows/create.bat	Mon Feb 20 18:01:22 2012 +0100
@@ -150,7 +150,7 @@
 
 REM This is now safe to do.
 :copyfiles
-for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
+for /D %%i in (graal, compiler1, compiler2, tiered, core, kernel) do (
 if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
 copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
 )
@@ -158,7 +158,7 @@
 REM force regneration of ProjectFile
 if exist %ProjectFile% del %ProjectFile%
 
-for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
+for /D %%i in (graal, compiler1, compiler2, tiered, core, kernel) do (
 echo -- %%i --
 echo # Generated file!                                                        >    %HotSpotBuildSpace%\%%i\local.make
 echo # Changing a variable below and then deleting %ProjectFile% will cause  >>    %HotSpotBuildSpace%\%%i\local.make
--- a/make/windows/makefiles/projectcreator.make	Mon Feb 20 17:58:46 2012 +0100
+++ b/make/windows/makefiles/projectcreator.make	Mon Feb 20 18:01:22 2012 +0100
@@ -210,6 +210,14 @@
 $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
 
 ##################################################
+# Graal compiler specific options
+##################################################
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define_graal COMPILER1 \
+ -define_graal GRAAL \
+$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=graal)
+
+##################################################
 # Server(C2) compiler specific options
 ##################################################
 #NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
--- a/make/windows/makefiles/vm.make	Mon Feb 20 17:58:46 2012 +0100
+++ b/make/windows/makefiles/vm.make	Mon Feb 20 18:01:22 2012 +0100
@@ -60,6 +60,10 @@
 CPP_FLAGS=$(CPP_FLAGS) /D "COMPILER1" /D "COMPILER2"
 !endif
 
+!if "$(Variant)" == "graal"
+CPP_FLAGS=$(CPP_FLAGS) /D "COMPILER1" /D "GRAAL"
+!endif
+
 !if "$(BUILDARCH)" == "i486"
 HOTSPOT_LIB_ARCH=i386
 !else
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/windows/projectfiles/graal/Makefile	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+!include ../local.make
+
+!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/windows/projectfiles/graal/vm.def	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,7 @@
+;
+; This .DEF file is a placeholder for one which is automatically
+; generated during the build process. See
+; make\windows\build_vm_def.sh and
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
+; options).
+;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/windows/projectfiles/graal/vm.dsw	Mon Feb 20 18:01:22 2012 +0100
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "vm"=.\vm.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- a/mx/commands.py	Mon Feb 20 17:58:46 2012 +0100
+++ b/mx/commands.py	Mon Feb 20 18:01:22 2012 +0100
@@ -26,7 +26,7 @@
 #
 # ----------------------------------------------------------------------------------------------------
 
-import os, sys, shutil, zipfile, tempfile, re, time, datetime, platform, subprocess, StringIO
+import os, sys, shutil, zipfile, tempfile, re, time, datetime, platform, subprocess, multiprocessing
 from os.path import join, exists, dirname, basename
 from argparse import ArgumentParser, REMAINDER
 import mx
@@ -269,55 +269,65 @@
     
     if len(failed) != 0:
         mx.abort('Scala DaCapo failures: ' + str(failed))
- 
+
+def _vmLibDirInJdk(jdk):
+    """
+    Get the directory within a JDK where jvm.cfg file and the server
+    and client subdirectories are located.
+    """
+    if platform.system() == 'Darwin':
+        return join(jdk, 'jre', 'lib')
+    return join(jdk, 'jre', 'lib', 'amd64')
+
 def _jdk(build='product', create=False):
     """
     Get the JDK into which Graal is installed, creating it first if necessary.
     """
-    jdk = join(_graal_home, 'jdk' + mx.java().version)
+    jdk = join(_graal_home, 'jdk' + mx.java().version, build)
     jdkContents = ['bin', 'db', 'include', 'jre', 'lib']
     if mx.get_os() != 'windows':
         jdkContents.append('man')
-    if not exists(jdk):
-        srcJdk = mx.java().jdk
-        mx.log('Creating ' + jdk + ' from ' + srcJdk)
-        os.mkdir(jdk)
-        for d in jdkContents:
-            src = join(srcJdk, d)
-            dst = join(jdk, d)
-            if not exists(src):
-                mx.abort('Host JDK directory is missing: ' + src)
-            shutil.copytree(src, dst)
-    
-    jvmCfg = join(jdk, 'jre', 'lib', 'amd64', 'jvm.cfg')
-    found = False
-    if not exists(jvmCfg):
-        mx.abort(jvmCfg + ' does not exist')
-        
-    with open(jvmCfg) as f:
-        for line in f:
-            if '-graal KNOWN' in line:
-                found = True
-                break
-    if not found:
-        mx.log('Appending "-graal KNOWN" to ' + jvmCfg)
-        with open(jvmCfg, 'a') as f:
-            f.write('-graal KNOWN\n')
-    
-    if build == 'product':
-        return jdk
-    elif build in ['debug', 'fastdebug']:
-        res = join(jdk, build)
-        if not exists(res):
-            if not create:
-                mx.abort('The ' + build + ' VM has not been created - run \'mx clean; mx make ' + build + '\'') 
-            mx.log('Creating ' + res)
-            os.mkdir(res)
+    if create:
+        if not exists(jdk):
+            srcJdk = mx.java().jdk
+            mx.log('Creating ' + jdk + ' from ' + srcJdk)
+            os.makedirs(jdk)
             for d in jdkContents:
-                shutil.copytree(join(jdk, d), join(res, d))
-        return res
+                src = join(srcJdk, d)
+                dst = join(jdk, d)
+                if not exists(src):
+                    mx.abort('Host JDK directory is missing: ' + src)
+                shutil.copytree(src, dst)
+                
+            # Make a copy of the default VM so that this JDK can be
+            # reliably used as the bootstrap for a HotSpot build.                
+            jvmCfg = join(_vmLibDirInJdk(jdk), 'jvm.cfg')
+            if not exists(jvmCfg):
+                mx.abort(jvmCfg + ' does not exist')
+                
+            lines = []
+            defaultVM = None
+            with open(jvmCfg) as f:
+                for line in f:
+                    if line.startswith('-') and defaultVM is None:
+                        parts = line.split()
+                        assert len(parts) == 2, parts
+                        assert parts[1] == 'KNOWN', parts[1]
+                        defaultVM = parts[0][1:]
+                        lines.append('-' + defaultVM + '0 KNOWN\n')
+                    lines.append(line)
+
+            assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg
+            shutil.copytree(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), defaultVM + '0'))
+            
+            with open(jvmCfg, 'w') as f:
+                for line in lines:
+                    f.write(line)
+                    
     else:
-        mx.abort('Unknown build type: ' + build)
+        if not exists(jdk):
+            mx.abort('The ' + build + ' VM has not been created - run \'mx clean; mx build ' + build + '\'')
+    return jdk 
 
 # run a command in the windows SDK Debug Shell
 def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo={}):
@@ -357,41 +367,39 @@
         log.close()
     return ret
     
-def build(args):
-    """builds the GraalVM binary and compiles the Graal classes
+def build(args, vm=None):
+    """build the VM binary
     
-    The optional last argument specifies what type of VM to build."""
-
-
-    parser = ArgumentParser(prog='mx build');
-    parser.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to be built')
+    The global '--vm' option selects which VM to build. This command also
+    compiles the Graal classes irrespective of what VM is being built.
+    The optional last argument specifies what build level is to be used
+    for the VM binary."""
     
     # Call mx.build to compile the Java sources        
-    opts = mx.build(['--source', '1.7'] + args, parser=parser)
+    opts2 = mx.build(['--source', '1.7'] + args, parser=ArgumentParser(prog='mx build'))
 
-    if not _vmSourcesAvailable or not opts.native:
+    if not _vmSourcesAvailable or not opts2.native:
         return
 
-    builds = opts.remainder
+    builds = opts2.remainder
     if len(builds) == 0:
         builds = ['product']
 
-    vm = opts.vm
+    if vm is None:
+        vm = _vm
+        
     if vm == 'server':
         buildSuffix = ''
     elif vm == 'client':
         buildSuffix = '1'
     else:
-        assert vm is 'graal'
+        assert vm == 'graal', vm
         buildSuffix = 'graal'
         
     for build in builds:
-
-        jdk = _jdk(build, True)
-        if build == 'debug':
-            build = 'jvmg'
+        jdk = _jdk(build, create=True)
             
-        vmDir = join(jdk, 'jre', 'lib', 'amd64', vm)
+        vmDir = join(_vmLibDirInJdk(jdk), vm)
         if not exists(vmDir):
             mx.log('Creating VM directory in JDK7: ' + vmDir)
             os.makedirs(vmDir)
@@ -404,29 +412,61 @@
             compilelogfile = _graal_home + '/graalCompile.log'
             mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin')
 
-            _runInDebugShell('msbuild ' + _graal_home + r'\build\vs-amd64\jvm.vcproj /p:Configuration=compiler1_product /target:clean', _graal_home)
-            winCompileCmd = r'set HotSpotMksHome=' + mksHome + r'& set OUT_DIR=' + jdk + r'& set JAVA_HOME=' + jdk + r'& set path=%JAVA_HOME%\bin;%path%;%HotSpotMksHome%& cd /D "' +_graal_home + r'\make\windows"& call create.bat ' + _graal_home + ''
+            variant = {'client': 'compiler1', 'server': 'compiler2'}.get(vm, vm)
+            project_config = variant + '_' + build
+            _runInDebugShell('msbuild ' + _graal_home + r'\build\vs-amd64\jvm.vcproj /p:Configuration=' + project_config + ' /target:clean', _graal_home)
+            winCompileCmd = r'set HotSpotMksHome=' + mksHome + r'& set OUT_DIR=' + jdk + r'& set JAVA_HOME=' + jdk + r'& set path=%JAVA_HOME%\bin;%path%;%HotSpotMksHome%& cd /D "' +_graal_home + r'\make\windows"& call create.bat ' + _graal_home
             print(winCompileCmd)
             winCompileSuccess = re.compile(r"^Writing \.vcxproj file:")
             if not _runInDebugShell(winCompileCmd, _graal_home, compilelogfile, winCompileSuccess):
                 mx.log('Error executing create command')
                 return 
-            winBuildCmd = 'msbuild ' + _graal_home + r'\build\vs-amd64\jvm.vcxproj /p:Configuration=compiler1_product /p:Platform=x64'
+            winBuildCmd = 'msbuild ' + _graal_home + r'\build\vs-amd64\jvm.vcxproj /p:Configuration=' + project_config + ' /p:Platform=x64'
             winBuildSuccess = re.compile('Build succeeded.')
             if not _runInDebugShell(winBuildCmd, _graal_home, compilelogfile, winBuildSuccess):
                 mx.log('Error building project')
                 return 
         else:
+            cpus = multiprocessing.cpu_count()
+            if build == 'debug':
+                build = 'jvmg'
             env = os.environ
             env.setdefault('ARCH_DATA_MODEL', '64')
             env.setdefault('LANG', 'C')
-            env.setdefault('HOTSPOT_BUILD_JOBS', '3')
+            env.setdefault('HOTSPOT_BUILD_JOBS', str(cpus))
             env['ALT_BOOTDIR'] = jdk
             env.setdefault('INSTALL', 'y')
+            
+            # Clear these 2 variables as having them set can cause very confusing build problems
+            env.pop('LD_LIBRARY_PATH', None)
+            env.pop('CLASSPATH', None)
+            
             mx.run([mx.gmake_cmd(), build + buildSuffix], cwd=join(_graal_home, 'make'), err=filterXusage)
+        
+        jvmCfg = join(_vmLibDirInJdk(jdk), 'jvm.cfg')
+        found = False
+        if not exists(jvmCfg):
+            mx.abort(jvmCfg + ' does not exist')
+        
+        prefix = '-' + vm
+        vmKnown = prefix + ' KNOWN\n'
+        lines = []
+        with open(jvmCfg) as f:
+            for line in f:
+                if vmKnown in line:
+                    found = True
+                    break
+                if not line.startswith(prefix):
+                    lines.append(line)
+        if not found:
+            mx.log('Appending "' + prefix + ' KNOWN" to ' + jvmCfg)
+            lines.append(vmKnown)
+            with open(jvmCfg, 'w') as f:
+                for line in lines:
+                    f.write(line)
     
 def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None):
-    """run the GraalVM"""
+    """run the VM selected by the '--vm' option"""
 
     if vm is None:
         vm = _vm
@@ -442,11 +482,14 @@
 # Table of unit tests.
 # Keys are project names, values are package name lists.
 # All source files in the given (project,package) pairs are scanned for lines
-# containing '@Test'. These are then detemrined to be the classes defining
+# containing '@Test'. These are then determined to be the classes defining
 # unit tests.
 _unittests = {
     'com.oracle.max.graal.tests': ['com.oracle.max.graal.compiler.tests'],
 }
+_jtttests = {
+    'com.oracle.max.graal.jtt': ['com.oracle.max.graal.jtt'],
+}
 
 def _add_test_classes(testClassList, searchDir, pkgRoot):
     pkgDecl = re.compile(r"^package\s+([a-zA-Z_][\w\.]*)\s*;$")
@@ -467,17 +510,19 @@
                                 break
                 if hasTest:
                     assert pkg is not None
-                    testClassList.append(pkg + '.' + name[:-len('.java')])
+                    if pkg.startswith(pkgRoot):
+                        testClassList.append(pkg + '.' + name[:-len('.java')])
 
 def unittest(args):
     """run the Graal Compiler Unit Tests in the GraalVM
     
     If filters are supplied, only tests whose fully qualified name
     include a filter as a substring are run. Negative filters are
-    those with a '-' prefix."""
+    those with a '-' prefix. VM args should have a @ prefix."""
     
-    pos = [a for a in args if a[0] != '-']
+    pos = [a for a in args if a[0] != '-' and a[0] != '@' ]
     neg = [a[1:] for a in args if a[0] == '-']
+    vmArgs = [a[1:] for a in args if a[0] == '@']
 
     def containsAny(c, substrings):
         for s in substrings:
@@ -496,9 +541,63 @@
         if len(neg) != 0:
             classes = [c for c in classes if not containsAny(c, neg)]
             
-        # (ds) The boot class path must be used for some reason I don't quite understand
-        vm(['-XX:-BootstrapGraal', '-esa', '-Xbootclasspath/a:' + mx.classpath(proj), 'org.junit.runner.JUnitCore'] + classes)
+        vm(['-XX:-BootstrapGraal', '-esa'] + vmArgs + ['-cp', mx.classpath(proj), 'org.junit.runner.JUnitCore'] + classes)
+    
+def jtt(args):
+    """run the Java Tester Tests in the GraalVM
+    
+    If filters are supplied, only tests whose fully qualified name
+    include a filter as a substring are run. Negative filters are
+    those with a '-' prefix. VM args should have a @ prefix."""
+    
+    pos = [a for a in args if a[0] != '-' and a[0] != '@' ]
+    neg = [a[1:] for a in args if a[0] == '-']
+    vmArgs = [a[1:] for a in args if a[0] == '@']
+
+    def containsAny(c, substrings):
+        for s in substrings:
+            if s in c:
+                return True
+        return False
+    
+    for proj in _jtttests.iterkeys():
+        p = mx.project(proj)
+        classes = []
+        for pkg in _jtttests[proj]:
+            _add_test_classes(classes, join(p.dir, 'src'), pkg)
     
+        if len(pos) != 0:
+            classes = [c for c in classes if containsAny(c, pos)]
+        if len(neg) != 0:
+            classes = [c for c in classes if not containsAny(c, neg)]
+            
+        vm(['-XX:-BootstrapGraal', '-XX:CompileOnly=::test', '-Xcomp', '-esa'] + vmArgs + ['-cp', mx.classpath(proj), 'org.junit.runner.JUnitCore'] + classes)
+    
+def buildvms(args):
+    """build one or more VMs in various configurations"""
+    
+    parser = ArgumentParser(prog='mx buildvms');
+    parser.add_argument('--vms', help='a comma separated list of VMs to build (default: server,client,graal)', default='server,client,graal')
+    parser.add_argument('--builds', help='a comma separated list of build types (default: product,fastdebug,debug)', default='product,fastdebug,debug')
+
+    args = parser.parse_args(args)
+    vms = args.vms.split(',')
+    builds = args.builds.split(',')
+    
+    allStart = time.time()
+    for v in vms:
+        for vmbuild in builds:
+            logFile = join(v + '-' + vmbuild + '.log')
+            log = open(join(_graal_home, logFile), 'wb')
+            start = time.time()
+            mx.log('BEGIN: ' + v + '-' + vmbuild + '\t(see: ' + logFile + ')')
+            # Run as subprocess so that output can be directed to a file
+            subprocess.check_call([sys.executable, '-u', join('mxtool', 'mx.py'), '--vm', v, 'build', vmbuild], cwd=_graal_home, stdout=log, stderr=subprocess.STDOUT)
+            duration = datetime.timedelta(seconds=time.time() - start)
+            mx.log('END:   ' + v + '-' + vmbuild + '\t[' + str(duration) + ']')
+    allDuration = datetime.timedelta(seconds=time.time() - allStart)
+    mx.log('TOTAL TIME:   ' + '[' + str(allDuration) + ']')
+
 def gate(args):
     """run the tests used to validate a push
 
@@ -524,12 +623,18 @@
             mx.abort(codeOrMessage)
             return self
              
+    parser = ArgumentParser(prog='mx gate');
+    parser.add_argument('-n', '--omit-native-build', action='store_false', dest='buildNative', help='omit cleaning and building native code')
+    parser.add_argument('-g', '--only-build-graalvm', action='store_false', dest='buildNonGraal', help='only build the Graal VM')
+
+    args = parser.parse_args(args)
+
     tasks = []             
     total = Task('Gate')
     try:
         
         t = Task('Clean')
-        clean([])
+        clean([] if args.buildNative else ['--no-native'])
         tasks.append(t.stop())
         
         t = Task('Checkstyle')
@@ -551,13 +656,20 @@
         mx.run(['ant', '-f', join(_graal_home, 'visualizer', 'build.xml'), '-q', 'clean', 'build'])
         tasks.append(t.stop())
 
+        # Prevent Graal modifications from breaking the standard builds
+        if args.buildNative and args.buildNonGraal:
+            t = Task('BuildHotSpotVarieties')
+            buildvms(['--vms', 'client,server', '--builds', 'fastdebug,product'])
+            tasks.append(t.stop())
+        
         for vmbuild in ['fastdebug', 'product']:
             global _vmbuild
             _vmbuild = vmbuild
             
-            t = Task('BuildHotSpot:' + vmbuild)
-            build(['--no-java', vmbuild])
-            tasks.append(t.stop())
+            if args.buildNative:
+                t = Task('BuildHotSpotGraal:' + vmbuild)
+                buildvms(['--vms', 'graal', '--builds', vmbuild])
+                tasks.append(t.stop())
             
             t = Task('BootstrapWithSystemAssertions:' + vmbuild)
             vm(['-esa', '-version'])
@@ -567,6 +679,10 @@
             unittest([])
             tasks.append(t.stop())
             
+            # t = Task('JavaTesterTests:' + vmbuild)
+            # jtt([])
+            # tasks.append(t.stop())
+            
             for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild):
                 t = Task(str(test) + ':' + vmbuild)
                 if not test.test('graal'):
@@ -575,7 +691,7 @@
     except KeyboardInterrupt:
         total.abort(1)
     
-    except Exception as e:
+    except BaseException as e:
         import traceback
         traceback.print_exc()
         total.abort(str(e))
@@ -605,15 +721,7 @@
             del args[index]
         else:
             mx.abort('-resultfile must be followed by a file name')
-    vm = 'graal'
-    if '-vm' in args:
-        index = args.index('-vm')
-        if index + 1 < len(args):
-            vm = args[index + 1]
-            del args[index]
-            del args[index]
-        else:
-            mx.abort('-vm must be followed by a vm name (graal, server, client..)')
+    vm = _vm
     if len(args) is 0:
         args += ['all']
 
@@ -690,7 +798,7 @@
     sanitycheck.getSPECjvm2008(benchArgs, skipValid, wt, it).bench('graal', opts=vmArgs)
     
 def hsdis(args):
-    """Installs the hsdis library
+    """install the hsdis library
 
     This is needed to support HotSpot's assembly dumping features.
     By default it installs the Intel syntax version, use the 'att' argument to install AT&T syntax."""
@@ -699,13 +807,14 @@
         flavor = 'att'
     build = _vmbuild if _vmSourcesAvailable else 'product'
     lib = mx.lib_suffix('hsdis-amd64')
-    path = join(_jdk(build), 'jre', 'lib', 'amd64', lib)
+    path = join(_vmLibDirInJdk(_jdk(build)), lib)
     mx.download(path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavor + "/" + lib])
     
 def mx_init():
     _vmbuild = 'product'
     commands = {
         'build': [build, '[-options]'],
+        'buildvms': [buildvms, '[-options]'],
         'clean': [clean, ''],
         'copyrightcheck': [copyrightcheck, ''],
         'hsdis': [hsdis, '[att]'],
@@ -713,15 +822,16 @@
         'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'],
         'specjvm2008': [specjvm2008, '[VM options|@specjvm2008 options]'],
         'example': [example, '[-v] example names...'],
-        'gate' : [gate, ''],
+        'gate' : [gate, '[-options]'],
         'gv' : [gv, ''],
-        'bench' : [bench, '[-vm vm] [-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
+        'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
         'unittest' : [unittest, '[filters...]'],
+        'jtt' : [jtt, '[filters...]'],
         'vm': [vm, '[-options] class [args...]']
     }
 
     if (_vmSourcesAvailable):
-        mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to run (default: graal)')
+        mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to build/run (default: graal)')
         mx.add_argument('--product', action='store_const', dest='vmbuild', const='product', help='select the product build of the VM')
         mx.add_argument('--debug', action='store_const', dest='vmbuild', const='debug', help='select the debug build of the VM')
         mx.add_argument('--fastdebug', action='store_const', dest='vmbuild', const='fastdebug', help='select the fast debug build of the VM')
@@ -743,8 +853,9 @@
         mx.abort('Requires Java version 1.7 or greater, got version ' + version)
     
     if (_vmSourcesAvailable):
-        global _vm
-        _vm = opts.vm
+        if hasattr(opts, 'vm') and opts.vm is not None:
+            global _vm
+            _vm = opts.vm
         if hasattr(opts, 'vmbuild') and opts.vmbuild is not None:
             global _vmbuild
             _vmbuild = opts.vmbuild
--- a/mx/eclipse-settings/org.eclipse.jdt.core.prefs	Mon Feb 20 17:58:46 2012 +0100
+++ b/mx/eclipse-settings/org.eclipse.jdt.core.prefs	Mon Feb 20 18:01:22 2012 +0100
@@ -247,7 +247,7 @@
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
@@ -323,7 +323,7 @@
 org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
--- a/mx/projects	Mon Feb 20 17:58:46 2012 +0100
+++ b/mx/projects	Mon Feb 20 18:01:22 2012 +0100
@@ -114,6 +114,12 @@
 project@com.oracle.max.graal.tests@dependencies=com.oracle.max.graal.printer
 project@com.oracle.max.graal.tests@checkstyle=com.oracle.max.graal.graph
 
+# graal.jtt
+project@com.oracle.max.graal.jtt@subDir=graal
+project@com.oracle.max.graal.jtt@sourceDirs=src
+project@com.oracle.max.graal.jtt@dependencies=JUNIT
+project@com.oracle.max.graal.jtt@checkstyle=com.oracle.max.graal.graph
+
 # max.asm
 project@com.oracle.max.asm@subDir=graal
 project@com.oracle.max.asm@sourceDirs=src
--- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -593,7 +593,7 @@
 
 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) {
   OopMapSet* oop_maps = new OopMapSet();
-  if (UseGraal) {
+#ifdef GRAAL
     // graal passes the argument in r10
     OopMap* oop_map = save_live_registers(sasm, 1);
 
@@ -611,7 +611,7 @@
     int call_offset = __ call_RT(noreg, noreg, target, has_argument ? 1 : 0);
 
     oop_maps->add_gc_map(call_offset, oop_map);
-  } else {
+#else
     // preserve all registers
     int num_rt_args = has_argument ? 2 : 1;
     OopMap* oop_map = save_live_registers(sasm, num_rt_args);
@@ -635,7 +635,7 @@
     int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1);
 
     oop_maps->add_gc_map(call_offset, oop_map);
-  }
+#endif
 
   __ stop("should not reach here");
 
@@ -1372,8 +1372,13 @@
         // will be place in C abi locations
 
 #ifdef _LP64
-        __ verify_oop((UseGraal) ? j_rarg0 : c_rarg0);
-        __ mov(rax, (UseGraal) ? j_rarg0 : c_rarg0);
+#ifdef GRAAL
+        __ verify_oop(j_rarg0);
+        __ mov(rax, j_rarg0);
+#else
+        __ verify_oop(c_rarg0);
+        __ mov(rax, c_rarg0);
+#endif
 #else
         // The object is passed on the stack and we haven't pushed a
         // frame yet so it's one work away from top of stack.
@@ -1506,10 +1511,10 @@
 
         Label success;
         Label miss;
-        if (UseGraal) {
+#ifdef GRAAL
           // TODO this should really be within the XirSnippets
           __ check_klass_subtype_fast_path(rsi, rax, rcx, &success, &miss, NULL);
-        };
+#endif
 
         __ check_klass_subtype_slow_path(rsi, rax, rcx, rdi, NULL, &miss);
 
--- a/src/cpu/x86/vm/c1_globals_x86.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/cpu/x86/vm/c1_globals_x86.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -56,8 +56,8 @@
 define_pd_global(bool, NeverActAsServerClassMachine, true );
 define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
 define_pd_global(bool, CICompileOSR,                 true );
+define_pd_global(intx, TypeProfileWidth,             8    );    // changed for GRAAL
 #endif // !TIERED
-define_pd_global(intx, TypeProfileWidth,             8    );    // changed for GRAAL
 define_pd_global(bool, RoundFPResults,               true );
 
 define_pd_global(bool, LIRFillDelaySlots,            false);
--- a/src/cpu/x86/vm/interp_masm_x86_64.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -1126,8 +1126,12 @@
                                         Register receiver, Register mdp,
                                         Register reg2, int start_row,
                                         Label& done, bool is_virtual_call) {
+#ifdef GRAAL
   // change for GRAAL (use counter to indicate polymorphic case instead of failed typechecks)
-  bool use_counter_for_polymorphic_case = is_virtual_call || UseGraal;
+  bool use_counter_for_polymorphic_case = true;
+#else
+  bool use_counter_for_polymorphic_case = is_virtual_call;
+#endif
 
   if (TypeProfileWidth == 0) {
     if (use_counter_for_polymorphic_case) {
@@ -1300,8 +1304,9 @@
 
 
 void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) {
-  // changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks)
-  if (ProfileInterpreter && TypeProfileCasts && !UseGraal) {
+// changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks)
+#ifndef GRAAL
+  if (ProfileInterpreter && TypeProfileCasts) {
     Label profile_continue;
 
     // If no method data exists, go to profile_continue.
@@ -1316,6 +1321,7 @@
 
     bind (profile_continue);
   }
+#endif
 }
 
 
--- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalEdgeColorFilter.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalEdgeColorFilter.java	Mon Feb 20 18:01:22 2012 +0100
@@ -35,7 +35,7 @@
 
 /**
  * Filter that colors usage and successor edges differently.
- * 
+ *
  * @author Peter Hofer
  */
 public class GraalEdgeColorFilter extends AbstractFilter {
@@ -77,7 +77,9 @@
                 for (Connection c : is.getConnections()) {
                     if (c.getLabel() == null || !c.getLabel().endsWith("#NDF")) {
                         c.setColor(color);
-                        c.setStyle(style);
+                        if (c.getStyle() != ConnectionStyle.DASHED) {
+                            c.setStyle(style);
+                        }
                     } else if ("EndNode".equals(c.getOutputSlot().getFigure().getProperties().get("class"))
                             || "EndNode".equals(c.getOutputSlot().getProperties().get("class"))) {
                         c.setColor(successorColor);
--- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/color.filter	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/color.filter	Mon Feb 20 18:01:22 2012 +0100
@@ -1,11 +1,11 @@
 colorize("name", ".*", white);
-colorize("name", "StartNode|EndNode|LoopBegin|LoopEnd|Return", orange);
-colorize("name", "Phi:.*", magenta);
+colorize("name", "Begin|EndNode|LoopBegin|LoopEnd|Return", orange);
+colorize("name", "Phi.*", magenta);
 colorize("name", "FrameState@.*", new java.awt.Color(0.5, 0.8, 1.0));
-colorize("name", "If", pink);
+colorize("name", "If|Merge", pink);
 colorize("name", "const.*", new java.awt.Color(0.7, 0.7, 0.7));
 colorize("name", "Local", new java.awt.Color(0.85, 0.85, 0.85));
-colorize("name", "\\+|-|\\*|/", cyan);
+colorize("name", "\\+|-|\\*|/|&|\\||<<|>>|>>>", cyan);
 colorize("name", "Comp .*", yellow);
 
 colorize("notInOwnBlock", "true", red);
\ No newline at end of file
--- a/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java	Mon Feb 20 18:01:22 2012 +0100
@@ -32,7 +32,7 @@
 import java.util.List;
 
 /**
- * 
+ *
  * @author Thomas Wuerthinger
  */
 public class Connection implements Source.Provider, Link {
@@ -112,7 +112,7 @@
         outputSlot.getFigure().removeSuccessor(inputSlot.getFigure());
         outputSlot.connections.remove(this);
     }
-    
+
     public String getToolTipText() {
         StringBuilder builder = new StringBuilder();
         if (label != null) {
@@ -120,9 +120,9 @@
         } else {
             builder.append("From ");
         }
-        builder.append(getOutputSlot().getFigure());
+        builder.append(getOutputSlot().getFigure().getSource().getSourceNodes().get(0).getId());
         builder.append(" to ");
-        builder.append(getInputSlot().getFigure());
+        builder.append(getInputSlot().getFigure().getSource().getSourceNodes().get(0).getId());
         return builder.toString();
     }
 
--- a/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java	Mon Feb 20 18:01:22 2012 +0100
@@ -128,9 +128,9 @@
             int to = e.getTo();
             Figure fromFigure = figureHash.get(from);
             Figure toFigure = figureHash.get(to);
-            assert fromFigure != null && toFigure != null;
             
             if(fromFigure == null || toFigure == null) continue;
+            assert fromFigure != null && toFigure != null;
 
             int fromIndex = e.getFromIndex();
             while (fromFigure.getOutputSlots().size() <= fromIndex) {
--- a/src/share/tools/ProjectCreator/BuildConfig.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/tools/ProjectCreator/BuildConfig.java	Mon Feb 20 18:01:22 2012 +0100
@@ -68,18 +68,17 @@
         if (value != null) {
             outDir = value;
         }
-        if (outDir.endsWith("debug")) {
-            outDir = outDir.substring(0, outDir.lastIndexOf("debug") - 1);
-        } else if(outDir.endsWith("fastdebug")) {
-            outDir = outDir.substring(0, outDir.lastIndexOf("fastdebug") - 1);
+        
+        int lastDirectorySeparator = Math.max(outDir.lastIndexOf("/"), outDir.lastIndexOf("\\"));
+        if (lastDirectorySeparator >= 0) {
+            outDir = outDir.substring(0, lastDirectorySeparator);
         }
         
-        if (!build.equals("product")) {
-            outDir += Util.sep + build;
-        }
-        outDir += Util.sep + "jre" + Util.sep + "bin";
-        if (flavour.equals("compiler1")) {
+        outDir += Util.sep + build + Util.sep + "jre" + Util.sep + "bin";
+        if (flavour.equals("graal")) {
             outDir += Util.sep + "graal";
+        } else if (flavour.equals("compiler1")) {
+            outDir += Util.sep + "client";
         } else {
             outDir += Util.sep + "server";
         }
@@ -126,7 +125,6 @@
         tree.addSubdirToIgnore("Codemgr_wsdata");
         tree.addSubdirToIgnore("deleted_files");
         tree.addSubdirToIgnore("SCCS");
-        tree.setVerbose(true);
         if (startAt != null) {
             tree.readDirectory(sourceBase + File.separator + startAt);
         } else {
@@ -576,6 +574,28 @@
    }
 }
 
+class GraalDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    GraalDebugConfig() {
+        initNames("graal", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class GraalFastDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    GraalFastDebugConfig() {
+        initNames("graal", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
 class C1DebugConfig extends GenericDebugNonKernelConfig {
     String getOptFlag() {
         return getCI().getNoOptFlag();
@@ -655,6 +675,13 @@
     }
 }
 
+class GraalProductConfig extends ProductConfig {
+    GraalProductConfig() {
+        initNames("graal", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
 class C1ProductConfig extends ProductConfig {
     C1ProductConfig() {
         initNames("compiler1", "product", "jvm.dll");
--- a/src/share/tools/ProjectCreator/WinGammaPlatform.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/tools/ProjectCreator/WinGammaPlatform.java	Mon Feb 20 18:01:22 2012 +0100
@@ -586,6 +586,10 @@
     Vector createAllConfigs(String platform) {
         Vector allConfigs = new Vector();
 
+        allConfigs.add(new GraalDebugConfig());
+        allConfigs.add(new GraalFastDebugConfig());
+        allConfigs.add(new GraalProductConfig());
+
         allConfigs.add(new C1DebugConfig());
         allConfigs.add(new C1FastDebugConfig());
         allConfigs.add(new C1ProductConfig());
--- a/src/share/vm/c1/c1_IR.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/c1/c1_IR.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -237,7 +237,8 @@
     // reexecute allowed only for the topmost frame
     bool reexecute = topmost ? should_reexecute() : false;
     bool return_oop = false; // This flag will be ignored since it used only for C2 with escape analysis.
-    recorder->describe_scope(pc_offset, (methodOop)scope()->method()->get_oop(), bci(), reexecute, false, is_method_handle_invoke, return_oop, locvals, expvals, monvals);
+    methodHandle null_mh;
+    recorder->describe_scope(pc_offset, null_mh, scope()->method(), bci(), reexecute, false, is_method_handle_invoke, return_oop, locvals, expvals, monvals);
   }
 };
 
--- a/src/share/vm/c1/c1_LIRAssembler.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/c1/c1_LIRAssembler.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -405,7 +405,8 @@
     if (s == NULL)  break;
     IRScope* scope = s->scope();
     //Always pass false for reexecute since these ScopeDescs are never used for deopt
-    debug_info->describe_scope(pc_offset, (methodOop)scope->method()->get_oop(), s->bci(), false/*reexecute*/, false/*rethrow_exception*/);
+    methodHandle null_mh;
+    debug_info->describe_scope(pc_offset, null_mh, scope->method(), s->bci(), false/*reexecute*/);
   }
 
   debug_info->end_non_safepoint(pc_offset);
--- a/src/share/vm/c1/c1_Runtime1.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/c1/c1_Runtime1.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -462,9 +462,11 @@
   thread->set_is_method_handle_return(false);
 
   Handle exception(thread, ex);
-  if (UseGraal && exception.is_null()) {
+#ifdef GRAAL
+  if (exception.is_null()) {
     exception = Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL);
   }
+#endif
   nm = CodeCache::find_nmethod(pc);
   assert(nm != NULL, "this is not an nmethod");
   // Adjust the pc as needed/
--- a/src/share/vm/c1/c1_globals.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/c1/c1_globals.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -56,8 +56,6 @@
 //
 #define C1_FLAGS(develop, develop_pd, product, product_pd, notproduct)      \
                                                                             \
-  product(bool, UseGraal, true,                                             \
-          "Use graal instead of C1")                                        \
   product(bool, DebugGraal, true,                                           \
           "Enable JVMTI for the compiler thread")                           \
   product(bool, BootstrapGraal, true,                                       \
--- a/src/share/vm/ci/ciMethod.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/ci/ciMethod.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -97,12 +97,11 @@
   ciEnv *env = CURRENT_ENV;
   if (env->jvmti_can_hotswap_or_post_breakpoint() && can_be_compiled()) {
     // 6328518 check hotswap conditions under the right lock.
-    // TODO(tw): Check if we need that.
-    //MutexLocker locker(Compile_lock);
-    //if (Dependencies::check_evol_method(h_m()) != NULL) {
-    //  _is_c1_compilable = false;
-    //  _is_c2_compilable = false;
-    //}
+    MutexLocker locker(Compile_lock);
+    if (Dependencies::check_evol_method(h_m()) != NULL) {
+      _is_c1_compilable = false;
+      _is_c2_compilable = false;
+    }
   } else {
     CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
   }
--- a/src/share/vm/classfile/classLoader.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/classfile/classLoader.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -184,7 +184,6 @@
 
 ClassPathEntry::ClassPathEntry() {
   set_next(NULL);
-  _compiler_thread_only = false;
 }
 
 
@@ -443,17 +442,23 @@
 void ClassLoader::setup_bootstrap_search_path() {
   assert(_first_entry == NULL, "should not setup bootstrap class search path twice");
   char* sys_class_path = os::strdup(Arguments::get_sysclasspath());
+#ifdef GRAAL
   char* compiler_class_path = os::strdup(Arguments::get_compilerclasspath());
+#endif
   if (TraceClassLoading && Verbose) {
     tty->print_cr("[Bootstrap loader class path=%s]", sys_class_path);
+#ifdef GRAAL
     tty->print_cr("[Compiler loader class path=%s]", compiler_class_path);
+#endif
   }
 
-  setup_bootstrap_search_path(sys_class_path, false);
-  setup_bootstrap_search_path(compiler_class_path, true);
+  setup_bootstrap_search_path(sys_class_path);
+#ifdef GRAAL
+  setup_bootstrap_search_path(compiler_class_path);
+#endif
 }
 
-void ClassLoader::setup_bootstrap_search_path(char* sys_class_path, bool compiler_cp) {
+void ClassLoader::setup_bootstrap_search_path(char* sys_class_path) {
   int len = (int)strlen(sys_class_path);
   int end = 0;
 
@@ -465,7 +470,7 @@
     char* path = NEW_C_HEAP_ARRAY(char, end-start+1);
     strncpy(path, &sys_class_path[start], end-start);
     path[end-start] = '\0';
-    update_class_path_entry_list(path, false, compiler_cp);
+    update_class_path_entry_list(path, false);
     FREE_C_HEAP_ARRAY(char, path);
     while (sys_class_path[end] == os::path_separator()[0]) {
       end++;
@@ -561,7 +566,7 @@
   ClassPathEntry* e = _first_entry;
   while (e != NULL) {
     // assume zip entries have been canonicalized
-	if (e->compiler_thread_only() == entry->compiler_thread_only() && strcmp(entry->name(), e->name()) == 0) {
+	if (strcmp(entry->name(), e->name()) == 0) {
       return true;
     }
     e = e->next();
@@ -581,14 +586,12 @@
 }
 
 void ClassLoader::update_class_path_entry_list(const char *path,
-                                               bool check_for_duplicates,
-											   bool compiler_cp) {
+                                               bool check_for_duplicates) {
   struct stat st;
   if (os::stat((char *)path, &st) == 0) {
     // File or directory found
     ClassPathEntry* new_entry = NULL;
     create_class_path_entry((char *)path, st, &new_entry, LazyBootClassLoader);
-	//new_entry->set_compiler_thread_only(compiler_cp);
     // The kernel VM adds dynamically to the end of the classloader path and
     // doesn't reorder the bootclasspath which would break java.lang.Package
     // (see PackageInfo).
@@ -905,9 +908,7 @@
                                PerfClassTraceTime::CLASS_LOAD);
     ClassPathEntry* e = _first_entry; 
     while (e != NULL) {
-      if (THREAD->is_Compiler_thread() || !Universe::_fully_initialized || !e->compiler_thread_only()) {
-        stream = e->open_stream(name);
-      }
+      stream = e->open_stream(name);
       if (stream != NULL) {
         break;
       }
--- a/src/share/vm/classfile/classLoader.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/classfile/classLoader.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -49,7 +49,6 @@
 class ClassPathEntry: public CHeapObj {
  private:
   ClassPathEntry* _next;
-  bool _compiler_thread_only;
  public:
   // Next entry in class path
   ClassPathEntry* next()              { return _next; }
@@ -60,8 +59,6 @@
   virtual bool is_jar_file() = 0;
   virtual const char* name() = 0;
   virtual bool is_lazy();
-  bool compiler_thread_only() const { return _compiler_thread_only; }
-  void set_compiler_thread_only(bool b) { _compiler_thread_only = b; }
   // Constructor
   ClassPathEntry();
   // Attempt to locate file_name through this class path entry.
@@ -209,7 +206,7 @@
   // Initialization
   static void setup_meta_index();
   static void setup_bootstrap_search_path();
-  static void setup_bootstrap_search_path(char* sys_class_path, bool compiler_cp);
+  static void setup_bootstrap_search_path(char* sys_class_path);
   static void load_zip_library();
   static void create_class_path_entry(char *path, struct stat st, ClassPathEntry **new_entry, bool lazy);
 
@@ -219,8 +216,7 @@
  public:
   // Used by the kernel jvm.
   static void update_class_path_entry_list(const char *path,
-                                           bool check_for_duplicates,
-										   bool compiler_cp);
+                                           bool check_for_duplicates);
   static void print_bootclasspath();
 
   // Timing
--- a/src/share/vm/code/compiledIC.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/code/compiledIC.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -529,7 +529,10 @@
   NativeJump*        jump          = nativeJump_at(method_holder->next_instruction_address());
 
   assert(method_holder->data()    == 0           || method_holder->data()    == (intptr_t)callee(), "a) MT-unsafe modification of inline cache");
-  assert(UseGraal || jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, "b) MT-unsafe modification of inline cache");
+// XXX GRAAL : ??
+#ifndef GRAAL
+  assert(jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, "b) MT-unsafe modification of inline cache");
+#endif
 
   // Update stub
   method_holder->set_data((intptr_t)callee());
--- a/src/share/vm/code/debugInfoRec.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/code/debugInfoRec.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -280,7 +280,8 @@
 // must call add_safepoint before: it sets PcDesc and this routine uses
 // the last PcDesc set
 void DebugInformationRecorder::describe_scope(int         pc_offset,
-                                              methodHandle   method,
+                                              methodHandle methodH,
+                                              ciMethod*   method,
                                               int         bci,
                                               bool        reexecute,
                                               bool        rethrow_exception,
@@ -307,13 +308,24 @@
   stream()->write_int(sender_stream_offset);
 
   // serialize scope
-  jobject method_enc = JNIHandles::make_local(Thread::current(), method());
+  jobject method_enc;
+  if (method != NULL) {
+    method_enc = method->constant_encoding();
+  } else if (methodH.not_null()) {
+    method_enc = JNIHandles::make_local(Thread::current(), methodH());
+  } else {
+    method_enc = NULL;
+  }
   stream()->write_int(oop_recorder()->find_index(method_enc));
   stream()->write_bci(bci);
   assert(method == NULL ||
          (method->is_native() && bci == 0) ||
          (!method->is_native() && 0 <= bci && bci < method->code_size()) ||
          bci == -1, "illegal bci");
+  assert(methodH.is_null() ||
+         (methodH->is_native() && bci == 0) ||
+         (!methodH->is_native() && 0 <= bci && bci < methodH->code_size()) ||
+         bci == -1, "illegal bci");
 
   // serialize the locals/expressions/monitors
   stream()->write_int((intptr_t) locals);
--- a/src/share/vm/code/debugInfoRec.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/code/debugInfoRec.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -98,7 +98,8 @@
   // by add_non_safepoint, and the locals, expressions, and monitors
   // must all be null.
   void describe_scope(int         pc_offset,
-                      methodHandle   method,
+                      methodHandle methodH,
+                      ciMethod*   method,
                       int         bci,
                       bool        reexecute,
                       bool        rethrow_exception = false,
--- a/src/share/vm/code/nmethod.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/code/nmethod.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -119,7 +119,6 @@
 //   PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation.
 // (In the latter two cases, they like other stats are printed to the log only.)
 
-#ifndef PRODUCT
 // These variables are put into one block to reduce relocations
 // and make it simpler to print from the debugger.
 static
@@ -209,7 +208,6 @@
                   pc_desc_tests, pc_desc_searches, pc_desc_adds);
   }
 } nmethod_stats;
-#endif //PRODUCT
 
 
 //---------------------------------------------------------------------------------
@@ -512,7 +510,7 @@
               code_buffer, frame_size,
               basic_lock_owner_sp_offset, basic_lock_sp_offset,
               oop_maps);
-    NOT_PRODUCT(if (nm != NULL)  nmethod_stats.note_native_nmethod(nm));
+    if (nm != NULL)  nmethod_stats.note_native_nmethod(nm);
     if (PrintAssembly && nm != NULL)
       Disassembler::decode(nm);
   }
@@ -545,7 +543,7 @@
 
     nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size);
 
-    NOT_PRODUCT(if (nm != NULL)  nmethod_stats.note_nmethod(nm));
+    if (nm != NULL)  nmethod_stats.note_nmethod(nm);
     if (PrintAssembly && nm != NULL)
       Disassembler::decode(nm);
   }
@@ -612,7 +610,7 @@
         instanceKlass::cast(klass)->add_dependent_nmethod(nm);
       }
     }
-    NOT_PRODUCT(if (nm != NULL)  nmethod_stats.note_nmethod(nm));
+    if (nm != NULL)  nmethod_stats.note_nmethod(nm);
     if (PrintAssembly && nm != NULL)
       Disassembler::decode(nm);
   }
@@ -839,7 +837,7 @@
     // Exception handler and deopt handler are in the stub section
     assert(offsets->value(CodeOffsets::Exceptions) != -1, "must be set");
     assert(offsets->value(CodeOffsets::Deopt     ) != -1, "must be set");
-    if (UseGraal) {
+#ifdef GRAAL
       // graal produces no (!) stub section
       _exception_offset        = code_offset()          + offsets->value(CodeOffsets::Exceptions);
       _deoptimize_offset       = code_offset()          + offsets->value(CodeOffsets::Deopt);
@@ -848,7 +846,7 @@
       } else {
         _deoptimize_mh_offset  = -1;
       }
-    } else {
+#else
       _exception_offset        = _stub_offset          + offsets->value(CodeOffsets::Exceptions);
       _deoptimize_offset       = _stub_offset          + offsets->value(CodeOffsets::Deopt);
       if (offsets->value(CodeOffsets::DeoptMH) != -1) {
@@ -856,7 +854,7 @@
       } else {
         _deoptimize_mh_offset  = -1;
       }
-    }
+#endif
     if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
       _unwind_handler_offset = code_offset()         + offsets->value(CodeOffsets::UnwindHandler);
     } else {
@@ -2355,7 +2353,9 @@
         // information in a table.
         break;
     }
-    assert(UseGraal || stub == NULL || stub_contains(stub), "static call stub outside stub section");
+#ifndef GRAAL
+    assert(stub == NULL || stub_contains(stub), "static call stub outside stub section");
+#endif
   }
 }
 
@@ -2832,6 +2832,8 @@
   ImplicitExceptionTable(this).print(code_begin());
 }
 
+#endif // PRODUCT
+
 void nmethod::print_statistics() {
   ttyLocker ttyl;
   if (xtty != NULL)  xtty->head("statistics type='nmethod'");
@@ -2842,5 +2844,3 @@
   Dependencies::print_statistics();
   if (xtty != NULL)  xtty->tail("statistics");
 }
-
-#endif // PRODUCT
--- a/src/share/vm/code/nmethod.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/code/nmethod.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -592,7 +592,7 @@
 
   // (tw) When using graal, the address might be off by 5 (because this is the size of the call instruction.
   // (tw) TODO: Replace this by a more general mechanism.
-  bool is_deopt_entry   (address pc) { return pc == deopt_handler_begin() || (UseGraal && pc == deopt_handler_begin() + 5); }
+  bool is_deopt_entry   (address pc) { return pc == deopt_handler_begin() IS_GRAAL( || pc == deopt_handler_begin() + 5); }
   bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); }
   // Accessor/mutator for the original pc of a frame before a frame was deopted.
   address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }
@@ -643,7 +643,7 @@
 
   // Prints a comment for one native instruction (reloc info, pc desc)
   void print_code_comment_on(outputStream* st, int column, address begin, address end);
-  static void print_statistics()                  PRODUCT_RETURN;
+  static void print_statistics();
 
   // Compiler task identification.  Note that all OSR methods
   // are numbered in an independent sequence if CICountOSR is true,
--- a/src/share/vm/compiler/compileBroker.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -44,7 +44,9 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/sweeper.hpp"
 #include "utilities/dtrace.hpp"
+#ifdef GRAAL
 #include "graal/graalCompiler.hpp"
+#endif
 #ifdef COMPILER1
 #include "c1/c1_Compiler.hpp"
 #endif
@@ -680,13 +682,15 @@
   // Set the interface to the current compiler(s).
   int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple);
   int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization);
+#ifdef GRAAL
+  _compilers[0] = new GraalCompiler();
+#else
 #ifdef COMPILER1
-  if (UseGraal) {
-	  _compilers[0] = new GraalCompiler();
-  } else if (c1_count > 0) {
-	  _compilers[0] = new Compiler();
+  if (c1_count > 0) {
+    _compilers[0] = new Compiler();
   }
 #endif // COMPILER1
+#endif
 
 #ifdef COMPILER2
   if (c2_count > 0) {
@@ -936,6 +940,7 @@
 // ------------------------------------------------------------------
 // CompileBroker::is_idle
 bool CompileBroker::is_idle() {
+#ifndef GRAAL
   if (_c2_method_queue != NULL && !_c2_method_queue->is_empty()) {
     return false;
   } else if (_c1_method_queue != NULL && !_c1_method_queue->is_empty()) {
@@ -947,10 +952,10 @@
         return false;
       }
     }
-
-    // No pending or active compilations.
-    return true;
   }
+#endif
+  // No pending or active compilations.
+  return true;
 }
 
 
@@ -1043,8 +1048,9 @@
     MutexLocker locker(queue->lock(), THREAD);
 
     if (JavaThread::current()->is_compiling() && !BackgroundCompilation) {
-
+#ifdef GRAAL
       TRACE_graal_1("Recursive compile %s!", method->name_and_sig_as_C_string());
+#endif
       method->set_not_compilable();
       return;
     }
@@ -1113,11 +1119,13 @@
     // and in that case it's best to protect both the testing (here) of
     // these bits, and their updating (here and elsewhere) under a
     // common lock.
-    /*task = create_compile_task(queue,
+#ifndef GRAAL
+    task = create_compile_task(queue,
                                compile_id, method,
                                osr_bci, comp_level,
                                hot_method, hot_count, comment,
-                               blocking);*/
+                               blocking);
+#endif
   }
 
 #ifdef GRAAL
@@ -1128,10 +1136,11 @@
     // Recursive compile request => ignore.
   }
 #endif
-
-  /*if (blocking) {
+#ifndef GRAAL
+  if (blocking) {
     wait_for_completion(task);
-  }*/
+  }
+#endif
 }
 
 
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -536,9 +536,9 @@
       throw_exception = true;
     }
 
-    _debug_recorder->describe_scope(pc_offset, method, bci, reexecute, throw_exception, false, false, locals_token, expressions_token, monitors_token);
+    _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, throw_exception, false, false, locals_token, expressions_token, monitors_token);
   } else {
-    _debug_recorder->describe_scope(pc_offset, method, bci, reexecute, false, false, false, NULL, NULL, NULL);
+    _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, false, false, false, NULL, NULL, NULL);
   }
 }
 
--- a/src/share/vm/graal/graalCompiler.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/graal/graalCompiler.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -202,6 +202,8 @@
 }
 
 Handle GraalCompiler::createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS) {
+  ObjectLocker ol(klass, THREAD);
+
   if (klass->graal_mirror() != NULL) {
     return klass->graal_mirror();
   }
@@ -291,7 +293,6 @@
   HotSpotMethodData::set_hotspotMirror(obj, method_data());
   HotSpotMethodData::set_normalDataSize(obj, method_data()->data_size());
   HotSpotMethodData::set_extraDataSize(obj, method_data()->extra_data_size());
-  HotSpotMethodData::set_mature(obj, method_data()->is_mature());
 
   method_data->set_graal_mirror(obj());
   return obj;
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -200,13 +200,6 @@
   }
 }
 
-JNIEXPORT jboolean JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_HotSpotMethodData_1isMature(JNIEnv *, jobject, jobject hotspot_method_data) {
-  TRACE_graal_3("CompilerToVM::HotSpotMethodData_isMature");
-  VM_ENTRY_MARK;
-  methodDataHandle method_data = getMethodDataFromHotSpotMethodData(hotspot_method_data);
-  return method_data->is_mature();
-}
-
 // ------------------------------------------------------------------
 // Adjust a CounterData count to be commensurate with
 // interpreter_invocation_count.  If the MDO exists for
@@ -549,6 +542,8 @@
 // public boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
 JNIEXPORT jboolean JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_RiType_2isSubtypeOf(JNIEnv *, jobject, jobject klass, jobject jother) {
   TRACE_graal_3("CompilerToVM::RiType_isSubtypeOf");
+  VM_ENTRY_MARK;
+  
   oop other = JNIHandles::resolve(jother);
   assert(other->is_a(HotSpotTypeResolved::klass()), "resolved hotspot type expected");
   assert(JNIHandles::resolve(klass) != NULL, "");
@@ -564,6 +559,18 @@
   }
 }
 
+// public RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
+JNIEXPORT jobject JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_RiType_2leastCommonAncestor(JNIEnv *, jobject, jobject this_type, jobject other_type) {
+  TRACE_graal_3("CompilerToVM::RiType_leastCommonAncestor");
+  VM_ENTRY_MARK;
+
+  Klass* this_klass  = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(this_type))->klass_part();
+  Klass* other_klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(other_type))->klass_part();
+  Klass* lca         = this_klass->LCA(other_klass);
+
+  return JNIHandles::make_local(GraalCompiler::get_RiType(lca, THREAD)());
+}
+
 // public RiType RiType_componentType(HotSpotResolvedType klass);
 JNIEXPORT jobject JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_RiType_1componentType(JNIEnv *, jobject, jobject klass) {
   TRACE_graal_3("CompilerToVM::RiType_componentType");
@@ -944,39 +951,39 @@
 #define CLASS           "Ljava/lang/Class;"
 
 JNINativeMethod CompilerToVM_methods[] = {
-  {CC"RiMethod_code",                     CC"("RESOLVED_METHOD")[B",                  FN_PTR(RiMethod_1code)},
-  {CC"RiMethod_signature",                CC"("RESOLVED_METHOD")"STRING,              FN_PTR(RiMethod_1signature)},
-  {CC"RiMethod_exceptionHandlers",        CC"("RESOLVED_METHOD")"EXCEPTION_HANDLERS,  FN_PTR(RiMethod_1exceptionHandlers)},
-  {CC"RiMethod_hasBalancedMonitors",      CC"("RESOLVED_METHOD")Z",                   FN_PTR(RiMethod_1hasBalancedMonitors)},
-  {CC"RiMethod_uniqueConcreteMethod",     CC"("RESOLVED_METHOD")"METHOD,              FN_PTR(RiMethod_1uniqueConcreteMethod)},
-  {CC"getRiMethod",                       CC"("REFLECT_METHOD")"METHOD,               FN_PTR(getRiMethod)},
-  {CC"RiMethod_methodData",               CC"("RESOLVED_METHOD")"METHOD_DATA,         FN_PTR(RiMethod_1methodData)},
-  {CC"HotSpotMethodData_isMature",        CC"("METHOD_DATA")Z",                       FN_PTR(HotSpotMethodData_1isMature)},
-  {CC"RiMethod_invocationCount",          CC"("RESOLVED_METHOD")I",                   FN_PTR(RiMethod_1invocationCount)},
-  {CC"RiMethod_hasCompiledCode",          CC"("RESOLVED_METHOD")Z",                   FN_PTR(RiMethod_1hasCompiledCode)},
-  {CC"RiMethod_getCompiledCodeSize",      CC"("RESOLVED_METHOD")I",                   FN_PTR(RiMethod_1getCompiledCodeSize)},
-  {CC"RiSignature_lookupType",            CC"("STRING RESOLVED_TYPE"Z)"TYPE,          FN_PTR(RiSignature_1lookupType)},
-  {CC"RiConstantPool_lookupConstant",     CC"("RESOLVED_TYPE"I)"OBJECT,               FN_PTR(RiConstantPool_1lookupConstant)},
-  {CC"RiConstantPool_lookupMethod",       CC"("RESOLVED_TYPE"IB)"METHOD,              FN_PTR(RiConstantPool_1lookupMethod)},
-  {CC"RiConstantPool_lookupType",         CC"("RESOLVED_TYPE"I)"TYPE,                 FN_PTR(RiConstantPool_1lookupType)},
-  {CC"RiConstantPool_loadReferencedType", CC"("RESOLVED_TYPE"IB)V",                   FN_PTR(RiConstantPool_1loadReferencedType)},
-  {CC"RiConstantPool_lookupField",        CC"("RESOLVED_TYPE"IB)"FIELD,               FN_PTR(RiConstantPool_1lookupField)},
-  {CC"RiType_resolveMethodImpl",          CC"("RESOLVED_TYPE STRING STRING")"METHOD,  FN_PTR(RiType_3resolveMethodImpl)},
-  {CC"RiType_isSubtypeOf",                CC"("RESOLVED_TYPE TYPE")Z",                FN_PTR(RiType_2isSubtypeOf)},
-  {CC"RiType_componentType",              CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(RiType_1componentType)},
-  {CC"RiType_uniqueConcreteSubtype",      CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(RiType_1uniqueConcreteSubtype)},
-  {CC"RiType_superType",                  CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(RiType_1superType)},
-  {CC"RiType_arrayOf",                    CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(RiType_1arrayOf)},
-  {CC"RiType_fields",                     CC"("RESOLVED_TYPE")["RESOLVED_FIELD,       FN_PTR(RiType_1fields)},
-  {CC"RiType_isInitialized",              CC"("RESOLVED_TYPE")Z",                     FN_PTR(RiType_1isInitialized)},
-  {CC"getPrimitiveArrayType",             CC"("CI_KIND")"TYPE,                        FN_PTR(getPrimitiveArrayType)},
-  {CC"getMaxCallTargetOffset",            CC"("CI_RUNTIME_CALL")J",                   FN_PTR(getMaxCallTargetOffset)},
-  {CC"getType",                           CC"("CLASS")"TYPE,                          FN_PTR(getType)},
-  {CC"getConfiguration",                  CC"()"CONFIG,                               FN_PTR(getConfiguration)},
-  {CC"installMethod",                     CC"("TARGET_METHOD"Z)"HS_COMP_METHOD,       FN_PTR(installMethod)},
-  {CC"installStub",                       CC"("TARGET_METHOD")"PROXY,                 FN_PTR(installStub)},
-  {CC"disassembleNative",                 CC"([BJ)"STRING,                            FN_PTR(disassembleNative)},
-  {CC"disassembleJava",                   CC"("RESOLVED_METHOD")"STRING,              FN_PTR(disassembleJava)},
+  {CC"RiMethod_code",                     CC"("RESOLVED_METHOD")[B",                            FN_PTR(RiMethod_1code)},
+  {CC"RiMethod_signature",                CC"("RESOLVED_METHOD")"STRING,                        FN_PTR(RiMethod_1signature)},
+  {CC"RiMethod_exceptionHandlers",        CC"("RESOLVED_METHOD")"EXCEPTION_HANDLERS,            FN_PTR(RiMethod_1exceptionHandlers)},
+  {CC"RiMethod_hasBalancedMonitors",      CC"("RESOLVED_METHOD")Z",                             FN_PTR(RiMethod_1hasBalancedMonitors)},
+  {CC"RiMethod_uniqueConcreteMethod",     CC"("RESOLVED_METHOD")"METHOD,                        FN_PTR(RiMethod_1uniqueConcreteMethod)},
+  {CC"getRiMethod",                       CC"("REFLECT_METHOD")"METHOD,                         FN_PTR(getRiMethod)},
+  {CC"RiMethod_methodData",               CC"("RESOLVED_METHOD")"METHOD_DATA,                   FN_PTR(RiMethod_1methodData)},
+  {CC"RiMethod_invocationCount",          CC"("RESOLVED_METHOD")I",                             FN_PTR(RiMethod_1invocationCount)},
+  {CC"RiMethod_hasCompiledCode",          CC"("RESOLVED_METHOD")Z",                             FN_PTR(RiMethod_1hasCompiledCode)},
+  {CC"RiMethod_getCompiledCodeSize",      CC"("RESOLVED_METHOD")I",                             FN_PTR(RiMethod_1getCompiledCodeSize)},
+  {CC"RiSignature_lookupType",            CC"("STRING RESOLVED_TYPE"Z)"TYPE,                    FN_PTR(RiSignature_1lookupType)},
+  {CC"RiConstantPool_lookupConstant",     CC"("RESOLVED_TYPE"I)"OBJECT,                         FN_PTR(RiConstantPool_1lookupConstant)},
+  {CC"RiConstantPool_lookupMethod",       CC"("RESOLVED_TYPE"IB)"METHOD,                        FN_PTR(RiConstantPool_1lookupMethod)},
+  {CC"RiConstantPool_lookupType",         CC"("RESOLVED_TYPE"I)"TYPE,                           FN_PTR(RiConstantPool_1lookupType)},
+  {CC"RiConstantPool_loadReferencedType", CC"("RESOLVED_TYPE"IB)V",                             FN_PTR(RiConstantPool_1loadReferencedType)},
+  {CC"RiConstantPool_lookupField",        CC"("RESOLVED_TYPE"IB)"FIELD,                         FN_PTR(RiConstantPool_1lookupField)},
+  {CC"RiType_resolveMethodImpl",          CC"("RESOLVED_TYPE STRING STRING")"METHOD,            FN_PTR(RiType_3resolveMethodImpl)},
+  {CC"RiType_isSubtypeOf",                CC"("RESOLVED_TYPE TYPE")Z",                          FN_PTR(RiType_2isSubtypeOf)},
+  {CC"RiType_leastCommonAncestor",        CC"("RESOLVED_TYPE RESOLVED_TYPE")"TYPE,              FN_PTR(RiType_2leastCommonAncestor)},
+  {CC"RiType_componentType",              CC"("RESOLVED_TYPE")"TYPE,                            FN_PTR(RiType_1componentType)},
+  {CC"RiType_uniqueConcreteSubtype",      CC"("RESOLVED_TYPE")"TYPE,                            FN_PTR(RiType_1uniqueConcreteSubtype)},
+  {CC"RiType_superType",                  CC"("RESOLVED_TYPE")"TYPE,                            FN_PTR(RiType_1superType)},
+  {CC"RiType_arrayOf",                    CC"("RESOLVED_TYPE")"TYPE,                            FN_PTR(RiType_1arrayOf)},
+  {CC"RiType_fields",                     CC"("RESOLVED_TYPE")["RESOLVED_FIELD,                 FN_PTR(RiType_1fields)},
+  {CC"RiType_isInitialized",              CC"("RESOLVED_TYPE")Z",                               FN_PTR(RiType_1isInitialized)},
+  {CC"getPrimitiveArrayType",             CC"("CI_KIND")"TYPE,                                  FN_PTR(getPrimitiveArrayType)},
+  {CC"getMaxCallTargetOffset",            CC"("CI_RUNTIME_CALL")J",                             FN_PTR(getMaxCallTargetOffset)},
+  {CC"getType",                           CC"("CLASS")"TYPE,                                    FN_PTR(getType)},
+  {CC"getConfiguration",                  CC"()"CONFIG,                                         FN_PTR(getConfiguration)},
+  {CC"installMethod",                     CC"("TARGET_METHOD"Z)"HS_COMP_METHOD,                 FN_PTR(installMethod)},
+  {CC"installStub",                       CC"("TARGET_METHOD")"PROXY,                           FN_PTR(installStub)},
+  {CC"disassembleNative",                 CC"([BJ)"STRING,                                      FN_PTR(disassembleNative)},
+  {CC"disassembleJava",                   CC"("RESOLVED_METHOD")"STRING,                        FN_PTR(disassembleJava)},
 };
 
 int CompilerToVM_methods_count() {
--- a/src/share/vm/graal/graalEnv.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/graal/graalEnv.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -246,7 +246,7 @@
                                         int index) {
   EXCEPTION_CONTEXT;
 
-  assert(klass->is_linked(), "must be linked before using its constan-pool");
+  assert(klass->is_linked(), "must be linked before using its constant-pool");
 
   constantPoolHandle cpool(thread, klass->constants());
 
--- a/src/share/vm/graal/graalJavaAccess.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -75,7 +75,6 @@
     oop_field(HotSpotMethodData, hotspotMirror, "Ljava/lang/Object;")                   \
     int_field(HotSpotMethodData, normalDataSize)                                        \
     int_field(HotSpotMethodData, extraDataSize)                                         \
-    boolean_field(HotSpotMethodData, mature)                                            \
   end_class                                                                             \
   start_class(HotSpotType)                                                              \
     oop_field(HotSpotType, name, "Ljava/lang/String;")                                  \
--- a/src/share/vm/interpreter/rewriter.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/interpreter/rewriter.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -118,7 +118,11 @@
   while (!bcs.is_last_bytecode()) {
     Bytecodes::Code opcode = bcs.raw_next();
     switch (opcode) {
-      case Bytecodes::_return: if (!UseGraal) { *bcs.bcp() = Bytecodes::_return_register_finalizer; } break;
+      case Bytecodes::_return:
+#ifndef GRAAL
+          *bcs.bcp() = Bytecodes::_return_register_finalizer;
+#endif
+        break;
 
       case Bytecodes::_istore:
       case Bytecodes::_lstore:
@@ -273,14 +277,14 @@
       switch (c) {
         case Bytecodes::_lookupswitch   : {
 #ifndef CC_INTERP
-          if (!UseGraal) {
+#ifndef GRAAL
             Bytecode_lookupswitch bc(method, bcp);
             (*bcp) = (
               bc.number_of_pairs() < BinarySwitchThreshold
               ? Bytecodes::_fast_linearswitch
               : Bytecodes::_fast_binaryswitch
             );
-          }
+#endif
 #endif
           break;
         }
--- a/src/share/vm/oops/methodDataOop.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/oops/methodDataOop.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -555,6 +555,14 @@
   return DataLayout::compute_size_in_bytes(cell_count);
 }
 
+#ifdef GRAAL
+int methodDataOopDesc::compute_extra_data_count(int data_size, int empty_bc_count) {
+  if (!ProfileTraps) return 0;
+
+  // Assume that up to 30% of the possibly trapping BCIs with no MDP will need to allocate one.
+  return MIN2(empty_bc_count, MAX2(4, (empty_bc_count * 30) / 100));
+}
+#else
 int methodDataOopDesc::compute_extra_data_count(int data_size, int empty_bc_count) {
   if (ProfileTraps) {
     // Assume that up to 3% of BCIs with no MDP will need to allocate one.
@@ -571,6 +579,7 @@
     return 0;
   }
 }
+#endif
 
 // Compute the size of the methodDataOop necessary to store
 // profiling information about a given method.  Size is in bytes.
@@ -582,7 +591,8 @@
   while ((c = stream.next()) >= 0) {
     int size_in_bytes = compute_data_size(&stream);
     data_size += size_in_bytes;
-    if (size_in_bytes == 0)  empty_bc_count += 1;
+
+    if (is_empty_data(size_in_bytes, c)) empty_bc_count++;
   }
   int object_size = in_bytes(data_offset()) + data_size;
 
@@ -590,9 +600,11 @@
   int extra_data_count = compute_extra_data_count(data_size, empty_bc_count);
   object_size += extra_data_count * DataLayout::compute_size_in_bytes(0);
 
+#ifndef GRAAL
   // Add a cell to record information about modified arguments.
   int arg_size = method->size_of_parameters();
   object_size += DataLayout::compute_size_in_bytes(arg_size+1);
+#endif
   return object_size;
 }
 
@@ -781,7 +793,8 @@
   while ((c = stream.next()) >= 0) {
     int size_in_bytes = initialize_data(&stream, data_size);
     data_size += size_in_bytes;
-    if (size_in_bytes == 0)  empty_bc_count += 1;
+
+    if (is_empty_data(size_in_bytes, c)) empty_bc_count++;
   }
   _data_size = data_size;
   int object_size = in_bytes(data_offset()) + data_size;
@@ -789,7 +802,9 @@
   // Add some extra DataLayout cells (at least one) to track stray traps.
   int extra_data_count = compute_extra_data_count(data_size, empty_bc_count);
   int extra_size = extra_data_count * DataLayout::compute_size_in_bytes(0);
+  object_size += extra_size;
 
+#ifndef GRAAL
   // Add a cell to record information about modified arguments.
   // Set up _args_modified array after traps cells so that
   // the code for traps cells works.
@@ -798,7 +813,8 @@
   int arg_size = method->size_of_parameters();
   dp->initialize(DataLayout::arg_info_data_tag, 0, arg_size+1);
 
-  object_size += extra_size + DataLayout::compute_size_in_bytes(arg_size+1);
+  object_size += DataLayout::compute_size_in_bytes(arg_size+1);
+#endif
 
   // Set an initial hint. Don't use set_hint_di() because
   // first_di() may be out of bounds if data_size is 0.
@@ -811,6 +827,14 @@
   set_object_is_parsable(object_size);
 }
 
+bool methodDataOopDesc::is_empty_data(int size_in_bytes, Bytecodes::Code code) {
+#ifdef GRAAL
+  return size_in_bytes == 0 && Bytecodes::can_trap(code);
+#else
+  return size_in_bytes == 0;
+#endif
+}
+
 // Get a measure of how much mileage the method has on it.
 int methodDataOopDesc::mileage_of(methodOop method) {
   int mileage = 0;
--- a/src/share/vm/oops/methodDataOop.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/oops/methodDataOop.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -1386,6 +1386,7 @@
 
   bool is_mature() const;  // consult mileage and ProfileMaturityPercentage
   static int mileage_of(methodOop m);
+  static bool is_empty_data(int size, Bytecodes::Code code);
 
   // Support for interprocedural escape analysis, from Thomas Kotzmann.
   enum EscapeFlag {
--- a/src/share/vm/opto/output.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/opto/output.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -944,7 +944,9 @@
     assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI");
     assert(!jvms->should_reexecute() || depth == max_depth, "reexecute allowed only for the youngest");
     // Now we can describe the scope.
-    debug_info()->describe_scope(safepoint_pc_offset, (methodOop)scope_method->get_oop(), jvms->bci(), jvms->should_reexecute(), is_method_handle_invoke, return_oop, locvals, expvals, monvals);
+    methodHandle null_mh;
+    bool rethrow_exception = false;
+    debug_info()->describe_scope(safepoint_pc_offset, null_mh, scope_method, jvms->bci(), jvms->should_reexecute(), rethrow_exception, is_method_handle_invoke, return_oop, locvals, expvals, monvals);
   } // End jvms loop
 
   // Mark the end of the scope set.
@@ -1027,7 +1029,8 @@
     JVMState* jvms = youngest_jvms->of_depth(depth);
     ciMethod* method = jvms->has_method() ? jvms->method() : NULL;
     assert(!jvms->should_reexecute() || depth==max_depth, "reexecute allowed only for the youngest");
-    debug_info->describe_scope(pc_offset, (methodOop)method->get_oop(), jvms->bci(), jvms->should_reexecute());
+    methodHandle null_mh;
+    debug_info->describe_scope(pc_offset, null_mh, method, jvms->bci(), jvms->should_reexecute());
   }
 
   // Mark the end of the scope set.
--- a/src/share/vm/prims/jni.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/prims/jni.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -29,7 +29,9 @@
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "interpreter/linkResolver.hpp"
+#ifdef GRAAL
 #include "graal/graalCompiler.hpp"
+#endif
 #ifndef SERIALGC
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #endif // SERIALGC
@@ -5125,11 +5127,9 @@
     *(JNIEnv**)penv = thread->jni_environment();
 
 #ifdef GRAAL
-    if (UseGraal) {
       GraalCompiler* compiler = GraalCompiler::instance();
       ciObjectFactory::initialize(); 
       compiler->initialize();
-    }
 #endif
 
     // Tracks the time application was running before GC
--- a/src/share/vm/runtime/arguments.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -61,8 +61,10 @@
 int     Arguments::_num_jvm_flags               = 0;
 char**  Arguments::_jvm_args_array              = NULL;
 int     Arguments::_num_jvm_args                = 0;
+#ifdef GRAAL
 char**  Arguments::_graal_args_array              = NULL;
 int     Arguments::_num_graal_args                = 0;
+#endif
 char*  Arguments::_java_command                 = NULL;
 SystemProperty* Arguments::_system_properties   = NULL;
 const char*  Arguments::_gc_log_filename        = NULL;
@@ -100,7 +102,9 @@
 SystemProperty *Arguments::_java_home = NULL;
 SystemProperty *Arguments::_java_class_path = NULL;
 SystemProperty *Arguments::_sun_boot_class_path = NULL;
+#ifdef GRAAL
 SystemProperty *Arguments::_compiler_class_path = NULL;
+#endif
 
 char* Arguments::_meta_index_path = NULL;
 char* Arguments::_meta_index_dir = NULL;
@@ -164,7 +168,9 @@
   _java_library_path = new SystemProperty("java.library.path", NULL,  true);
   _java_home =  new SystemProperty("java.home", NULL,  true);
   _sun_boot_class_path = new SystemProperty("sun.boot.class.path", NULL,  true);
+#ifdef GRAAL
   _compiler_class_path = new SystemProperty("compiler.class.path", NULL,  true);
+#endif
 
   _java_class_path = new SystemProperty("java.class.path", "",  true);
 
@@ -176,7 +182,9 @@
   PropertyList_add(&_system_properties, _java_home);
   PropertyList_add(&_system_properties, _java_class_path);
   PropertyList_add(&_system_properties, _sun_boot_class_path);
+#ifdef GRAAL
   PropertyList_add(&_system_properties, _compiler_class_path);
+#endif
 
   // Set OS specific system properties values
   os::init_system_properties_values();
@@ -756,10 +764,11 @@
 void Arguments::build_jvm_flags(const char* arg) {
   add_string(&_jvm_flags_array, &_num_jvm_flags, arg);
 }
-
+#ifdef GRAAL
 void Arguments::add_graal_arg(const char* arg) {
   add_string(&_graal_args_array, &_num_graal_args, arg);
 }
+#endif
 
 // utility function to return a string that concatenates all
 // strings in a given char** array
@@ -1931,6 +1940,19 @@
 
   status = status && verify_object_alignment();
 
+#ifdef GRAAL
+  if (UseCompressedOops) {
+    jio_fprintf(defaultStream::error_stream(),
+                    "CompressedOops are not supported in Graal at the moment\n");
+        status = false;
+  }
+  if (UseG1GC) {
+    jio_fprintf(defaultStream::error_stream(),
+                        "G1 is not supported in Graal at the moment\n");
+            status = false;
+  }
+#endif
+
   return status;
 }
 
@@ -2010,7 +2032,7 @@
 }
 
 // Parse JavaVMInitArgs structure
-
+#ifdef GRAAL
 static void prepend_to_graal_classpath(SysClassPath &cp, const char* graal_dir, const char* project) {
   const int BUFFER_SIZE = 1024;
   char path[BUFFER_SIZE];
@@ -2056,6 +2078,7 @@
   }
   return false;
 }
+#endif
 
 jint Arguments::parse_vm_init_args(const JavaVMInitArgs* args) {
   // For components of the system classpath.
@@ -2083,7 +2106,7 @@
     return result;
   }
 
-  if (UseGraal) {
+#ifdef GRAAL
     if (PrintVMOptions) {
       tty->print_cr("Running Graal VM... ");
     }
@@ -2103,7 +2126,7 @@
     errno = 0;
     DIR* graal_dir_handle = os::opendir(graal_dir);
     while ((dentry = os::readdir(graal_dir_handle, (struct dirent *)tdbuf)) != NULL) {
-      if (strcmp(dentry->d_name, ".") != 0 && strcmp(dentry->d_name, "..")) {
+      if (strcmp(dentry->d_name, ".") != 0 && strcmp(dentry->d_name, "..") != 0 && strcmp(dentry->d_name, "com.oracle.max.graal.tests") != 0 && strcmp(dentry->d_name, "com.oracle.max.graal.jtt") != 0) {
         prepend_to_graal_classpath(scp_compiler, graal_dir, dentry->d_name);
         if (PrintVMOptions) {
           tty->print_cr("Adding project directory %s to bootclasspath", dentry->d_name);
@@ -2115,7 +2138,7 @@
     scp_compiler.expand_endorsed();
 
     Arguments::set_compilerclasspath(scp_compiler.combined_path());
-  }
+#endif
 
   if (AggressiveOpts) {
     // Insert alt-rt.jar between user-specified bootclasspath
@@ -2777,7 +2800,9 @@
           return JNI_EINVAL;
         }
       }
-    } else if (match_option(option, "-G:", &tail)) { // -G:XXX
+    }
+#ifdef GRAAL
+    else if (match_option(option, "-G:", &tail)) { // -G:XXX
       // Option for the graal compiler.
       if (PrintVMOptions) {
         tty->print_cr("graal option %s", tail);
@@ -2785,7 +2810,9 @@
       Arguments::add_graal_arg(tail);
 
     // Unknown option
-    } else if (is_bad_option(option, args->ignoreUnrecognized)) {
+    }
+#endif
+    else if (is_bad_option(option, args->ignoreUnrecognized)) {
       return JNI_ERR;
     }
   }
--- a/src/share/vm/runtime/arguments.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/arguments.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -245,7 +245,9 @@
   static SystemProperty *_java_home;
   static SystemProperty *_java_class_path;
   static SystemProperty *_sun_boot_class_path;
+#ifdef GRAAL
   static SystemProperty *_compiler_class_path;
+#endif
 
   // Meta-index for knowing what packages are in the boot class path
   static char* _meta_index_path;
@@ -370,7 +372,9 @@
   // methods to build strings from individual args
   static void build_jvm_args(const char* arg);
   static void build_jvm_flags(const char* arg);
+#ifdef GRAAL
   static void add_graal_arg(const char* arg);
+#endif
   static void add_string(char*** bldarray, int* count, const char* arg);
   static const char* build_resource_string(char** args, int count);
 
@@ -426,7 +430,9 @@
   // return a char* array containing all options
   static char** jvm_flags_array()          { return _jvm_flags_array; }
   static char** jvm_args_array()           { return _jvm_args_array; }
+#ifdef GRAAL
   static char** graal_args_array()           { return _graal_args_array; }
+#endif
   static int num_jvm_flags()               { return _num_jvm_flags; }
   static int num_graal_args()               { return _num_graal_args; }
   static int num_jvm_args()                { return _num_jvm_args; }
@@ -526,7 +532,9 @@
   static void set_ext_dirs(char *value) { _java_ext_dirs->set_value(value); }
   static void set_endorsed_dirs(char *value) { _java_endorsed_dirs->set_value(value); }
   static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); }
+#ifdef GRAAL
   static void set_compilerclasspath(char *value) { _compiler_class_path->set_value(value); }
+#endif
   static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); }
   static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) {
     _meta_index_path = meta_index_path;
@@ -537,7 +545,9 @@
   static char *get_dll_dir() { return _sun_boot_library_path->value(); }
   static char *get_endorsed_dir() { return _java_endorsed_dirs->value(); }
   static char *get_sysclasspath() { return _sun_boot_class_path->value(); }
+#ifdef GRAAL
   static char *get_compilerclasspath() { return _compiler_class_path->value(); }
+#endif
   static char* get_meta_index_path() { return _meta_index_path; }
   static char* get_meta_index_dir()  { return _meta_index_dir;  }
 
--- a/src/share/vm/runtime/globals.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/globals.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -922,6 +922,9 @@
   diagnostic(ccstr, PrintAssemblyOptions, NULL,                             \
           "Options string passed to disassembler.so")                       \
                                                                             \
+  product(bool, PrintNMethodStatistics, false,                              \
+          "Print a summary statistic for the generated nmethods")           \
+                                                                            \
   diagnostic(bool, PrintNMethods, false,                                    \
           "Print assembly code for nmethods when generated")                \
                                                                             \
--- a/src/share/vm/runtime/java.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/java.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -30,7 +30,9 @@
 #include "compiler/compileBroker.hpp"
 #include "compiler/compilerOracle.hpp"
 #include "interpreter/bytecodeHistogram.hpp"
+#ifdef GRAAL
 #include "graal/graalCompiler.hpp"
+#endif
 #include "memory/genCollectedHeap.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/universe.hpp"
@@ -250,9 +252,12 @@
     Runtime1::print_statistics();
     Deoptimization::print_statistics();
     SharedRuntime::print_statistics();
+  }
+#endif /* COMPILER1 */
+
+  if(PrintNMethodStatistics) {
     nmethod::print_statistics();
   }
-#endif /* COMPILER1 */
 
 #ifdef COMPILER2
   if ((PrintOptoStatistics || LogVMOutput || LogCompilation) && UseCompiler) {
@@ -364,6 +369,9 @@
   if (CITime) {
     CompileBroker::print_times();
   }
+  if(PrintNMethodStatistics) {
+    nmethod::print_statistics();
+  }
 #ifdef COMPILER2
   if (PrintPreciseBiasedLockingStatistics) {
     OptoRuntime::print_named_counters();
@@ -426,9 +434,7 @@
   static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN;
 
 #ifdef GRAAL
-  if (UseGraal) {
-    GraalCompiler::instance()->exit();
-  }
+  GraalCompiler::instance()->exit();
 #endif
 
   // Note: don't use a Mutex to guard the entire before_exit(), as
--- a/src/share/vm/runtime/reflectionUtils.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/reflectionUtils.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -79,12 +79,10 @@
     _filtered_fields->append(new FilteredField(SystemDictionary::reflect_UnsafeStaticFieldAccessorImpl_klass(), offset));
   }
 #ifdef GRAAL
-  if (UseGraal) {
-    compute_offset(offset, SystemDictionary::HotSpotMethodResolved_klass(), "javaMirror", "Ljava/lang/Object;", false);
-    _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodResolved_klass(), offset));
-    compute_offset(offset, SystemDictionary::HotSpotMethodData_klass(), "hotspotMirror", "Ljava/lang/Object;", false);
-    _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodData_klass(), offset));
-  }
+  compute_offset(offset, SystemDictionary::HotSpotMethodResolved_klass(), "javaMirror", "Ljava/lang/Object;", false);
+  _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodResolved_klass(), offset));
+  compute_offset(offset, SystemDictionary::HotSpotMethodData_klass(), "hotspotMirror", "Ljava/lang/Object;", false);
+  _filtered_fields->append(new FilteredField(SystemDictionary::HotSpotMethodData_klass(), offset));
 #endif
 }
 
--- a/src/share/vm/runtime/sharedRuntime.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -714,15 +714,15 @@
 
 #ifdef COMPILER1
   if (t == NULL && nm->is_compiled_by_c1()) {
-    if (UseGraal) {
-      nm->make_not_entrant();
-      JavaThread::current()->set_exception_pc(ret_pc);
-      JavaThread::current()->set_exception_oop(exception());
-      return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
-    } else {
-      assert(nm->unwind_handler_begin() != NULL, "");
-      return nm->unwind_handler_begin();
-    }
+#ifdef GRAAL
+    nm->make_not_entrant();
+    JavaThread::current()->set_exception_pc(ret_pc);
+    JavaThread::current()->set_exception_oop(exception());
+    return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
+#else
+    assert(nm->unwind_handler_begin() != NULL, "");
+    return nm->unwind_handler_begin();
+#endif
   }
 #endif
 
@@ -877,11 +877,11 @@
 #ifndef PRODUCT
           _implicit_null_throws++;
 #endif
-          if (UseGraal) {
-            target_pc = deoptimization_continuation(thread, pc, nm);
-          } else {
-            target_pc = nm->continuation_for_implicit_exception(pc);
-          }
+#ifdef GRAAL
+          target_pc = deoptimization_continuation(thread, pc, nm);
+#else
+          target_pc = nm->continuation_for_implicit_exception(pc);
+#endif
           // If there's an unexpected fault, target_pc might be NULL,
           // in which case we want to fall through into the normal
           // error handling code.
@@ -897,14 +897,14 @@
 #ifndef PRODUCT
         _implicit_div0_throws++;
 #endif
-        if (UseGraal) {
-          if (TraceSignals) {
-            tty->print_cr("graal implicit div0");
-          }
-          target_pc = deoptimization_continuation(thread, pc, nm);
-        } else {
-          target_pc = nm->continuation_for_implicit_exception(pc);
+#ifdef GRAAL
+        if (TraceSignals) {
+          tty->print_cr("graal implicit div0");
         }
+        target_pc = deoptimization_continuation(thread, pc, nm);
+#else
+        target_pc = nm->continuation_for_implicit_exception(pc);
+#endif
         // If there's an unexpected fault, target_pc might be NULL,
         // in which case we want to fall through into the normal
         // error handling code.
--- a/src/share/vm/runtime/thread.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/thread.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -29,7 +29,9 @@
 #include "classfile/vmSymbols.hpp"
 #include "code/scopeDesc.hpp"
 #include "compiler/compileBroker.hpp"
+#ifdef GRAAL
 #include "graal/graalCompiler.hpp"
+#endif
 #include "interpreter/interpreter.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "interpreter/oopMapCache.hpp"
@@ -3017,7 +3019,10 @@
 
 static void compiler_thread_entry(JavaThread* thread, TRAPS) {
   assert(thread->is_Compiler_thread(), "must be compiler thread");
-  //CompileBroker::compiler_thread_loop();
+// XXX (gd) currently we still start c1 compiler threads even with Graal, they just die immediately, more compileBroker cleanup is needed to eliminate that
+#ifndef GRAAL
+  CompileBroker::compiler_thread_loop();
+#endif
 }
 
 // Create a CompilerThread
--- a/src/share/vm/runtime/thread.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/thread.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -1748,7 +1748,13 @@
   bool is_Compiler_thread() const                { return true; }
   // Hide this compiler thread from external view.
   // (tw) For Graal, the compiler thread should be visible.
-  bool is_hidden_from_external_view() const      { return !UseGraal || !DebugGraal; }
+  bool is_hidden_from_external_view() const      {
+#ifdef GRAAL
+    return !DebugGraal;
+#else
+    return true;
+#endif
+  }
 
   CompileQueue* queue()                          { return _queue; }
   CompilerCounters* counters()                   { return _counters; }
--- a/src/share/vm/runtime/vm_version.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/runtime/vm_version.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -119,8 +119,12 @@
   #define VMTYPE "Zero"
 #endif // SHARK
 #else // ZERO
-   #define VMTYPE COMPILER1_PRESENT("Graal")   \
+#ifdef GRAAL
+   #define VMTYPE "Graal"
+#else // GRAAL
+   #define VMTYPE COMPILER1_PRESENT("Client")   \
                   COMPILER2_PRESENT("Server")
+#endif // GRAAL
 #endif // ZERO
 #endif // TIERED
 #endif // KERNEL
--- a/src/share/vm/shark/sharkCacheDecache.cpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/shark/sharkCacheDecache.cpp	Mon Feb 20 18:01:22 2012 +0100
@@ -151,8 +151,10 @@
 
 void SharkDecacher::end_frame() {
   // Record the scope
+  methodHandle null_mh;
   debug_info()->describe_scope(
     pc_offset(),
+    null_mh,
     target(),
     bci(),
     true,
--- a/src/share/vm/utilities/macros.hpp	Mon Feb 20 17:58:46 2012 +0100
+++ b/src/share/vm/utilities/macros.hpp	Mon Feb 20 18:01:22 2012 +0100
@@ -74,6 +74,12 @@
 #define NOT_COMPILER2(code) code
 #endif // COMPILER2
 
+#ifdef GRAAL
+#define IS_GRAAL(code) code
+#else
+#define IS_GRAAL(code)
+#endif
+
 #ifdef TIERED
 #define TIERED_ONLY(code) code
 #define NOT_TIERED(code)
--- a/visualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalEdgeColorFilter.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalEdgeColorFilter.java	Mon Feb 20 18:01:22 2012 +0100
@@ -35,7 +35,7 @@
 
 /**
  * Filter that colors usage and successor edges differently.
- * 
+ *
  * @author Peter Hofer
  */
 public class GraalEdgeColorFilter extends AbstractFilter {
@@ -77,7 +77,9 @@
                 for (Connection c : is.getConnections()) {
                     if (c.getLabel() == null || !c.getLabel().endsWith("#NDF")) {
                         c.setColor(color);
-                        c.setStyle(style);
+                        if (c.getStyle() != ConnectionStyle.DASHED) {
+                            c.setStyle(style);
+                        }
                     } else if ("EndNode".equals(c.getOutputSlot().getFigure().getProperties().get("class"))
                             || "EndNode".equals(c.getOutputSlot().getProperties().get("class"))) {
                         c.setColor(successorColor);
--- a/visualizer/Graal/src/com/sun/hotspot/igv/graal/filters/color.filter	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/Graal/src/com/sun/hotspot/igv/graal/filters/color.filter	Mon Feb 20 18:01:22 2012 +0100
@@ -1,11 +1,11 @@
 colorize("name", ".*", white);
-colorize("name", "StartNode|EndNode|LoopBegin|LoopEnd|Return", orange);
-colorize("name", "Phi:.*", magenta);
+colorize("name", "Begin|EndNode|LoopBegin|LoopEnd|Return", orange);
+colorize("name", "Phi.*", magenta);
 colorize("name", "FrameState@.*", new java.awt.Color(0.5, 0.8, 1.0));
-colorize("name", "If", pink);
+colorize("name", "If|Merge", pink);
 colorize("name", "const.*", new java.awt.Color(0.7, 0.7, 0.7));
 colorize("name", "Local", new java.awt.Color(0.85, 0.85, 0.85));
-colorize("name", "\\+|-|\\*|/", cyan);
+colorize("name", "\\+|-|\\*|/|&|\\||<<|>>|>>>", cyan);
 colorize("name", "Comp .*", yellow);
 
 colorize("notInOwnBlock", "true", red);
\ No newline at end of file
--- a/visualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java	Mon Feb 20 18:01:22 2012 +0100
@@ -32,7 +32,7 @@
 import java.util.List;
 
 /**
- * 
+ *
  * @author Thomas Wuerthinger
  */
 public class Connection implements Source.Provider, Link {
@@ -112,7 +112,7 @@
         outputSlot.getFigure().removeSuccessor(inputSlot.getFigure());
         outputSlot.connections.remove(this);
     }
-    
+
     public String getToolTipText() {
         StringBuilder builder = new StringBuilder();
         if (label != null) {
@@ -120,9 +120,9 @@
         } else {
             builder.append("From ");
         }
-        builder.append(getOutputSlot().getFigure());
+        builder.append(getOutputSlot().getFigure().getSource().getSourceNodes().get(0).getId());
         builder.append(" to ");
-        builder.append(getInputSlot().getFigure());
+        builder.append(getInputSlot().getFigure().getSource().getSourceNodes().get(0).getId());
         return builder.toString();
     }
 
--- a/visualizer/SnapshotsView/src/com/oracle/graal/visualizer/snapshots/SnapshotTopComponent.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/SnapshotsView/src/com/oracle/graal/visualizer/snapshots/SnapshotTopComponent.java	Mon Feb 20 18:01:22 2012 +0100
@@ -57,7 +57,7 @@
             update();
         }
     };
-    
+
     private final ChangedListener<RangeSliderModel> rangeSliderChangedListener = new ChangedListener<RangeSliderModel>(){
 
         @Override
@@ -75,7 +75,9 @@
         result.addLookupListener(lookupListener);
         this.rangeSlider = new RangeSlider(null);
         this.setLayout(new BorderLayout());
-        this.add(new JScrollPane(rangeSlider), BorderLayout.CENTER);
+        final JScrollPane scrollPane = new JScrollPane(rangeSlider);
+        scrollPane.getVerticalScrollBar().setUnitIncrement(RangeSlider.ITEM_HEIGHT);
+        this.add(scrollPane, BorderLayout.CENTER);
         update();
     }
 
--- a/visualizer/Util/src/com/sun/hotspot/igv/util/RangeSlider.java	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/Util/src/com/sun/hotspot/igv/util/RangeSlider.java	Mon Feb 20 18:01:22 2012 +0100
@@ -88,6 +88,7 @@
     };
 
     private void update() {
+        this.revalidate();
         this.repaint();
     }
 
--- a/visualizer/build.xml	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/build.xml	Mon Feb 20 18:01:22 2012 +0100
@@ -3,12 +3,12 @@
 <!-- for some information on what you could do (e.g. targets to override). -->
 <!-- If you delete this file and reopen the project it will be recreated. -->
 <project name="Graal Visualizer" basedir=".">
-    <description>Builds the module suite IdealGraphVisualizer.</description>
+    <description>Builds the module suite Graal Visualizer.</description>
     <import file="nbproject/build-impl.xml"/>
     
     <target name="build-launchers" depends="suite.build-launchers">
         <!-- Drop memory presets (-Xms, -Xmx) from default_options of packaged builds and let the executing VM choose reasonable defaults -->
-        <replaceregexp file="${build.launcher.dir}/etc/${app.name}.conf" byline="true" match="^default_options=.*" replace='default_options="--branding idealgraphvisualizer"' />
+        <replaceregexp file="${build.launcher.dir}/etc/${app.name}.conf" byline="true" match="^default_options=.*" replace='default_options="--branding graalvisualizer"' />
     </target>
     
     <!-- Local (environment-specific) extensions/modifications to the build -->
--- a/visualizer/nbproject/build-impl.xml	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/nbproject/build-impl.xml	Mon Feb 20 18:01:22 2012 +0100
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT  ***
-***         EDIT ../build.xml INSTEAD         ***
--->
-<project name="Graal Visualizer-impl" basedir=".." xmlns:sproject="http://www.netbeans.org/ns/nb-module-suite-project/1">
-    <fail message="Please build using Ant 1.7.1 or higher.">
-        <condition>
-            <not>
-                <antversion atleast="1.7.1"/>
-            </not>
-        </condition>
-    </fail>
-    <property file="nbproject/private/platform-private.properties"/>
-    <property file="nbproject/platform.properties"/>
-    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
-        <attribute name="name"/>
-        <attribute name="value"/>
-        <sequential>
-            <property name="@{name}" value="${@{value}}"/>
-        </sequential>
-    </macrodef>
-    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
-        <attribute name="property"/>
-        <attribute name="value"/>
-        <sequential>
-            <property name="@{property}" value="@{value}"/>
-        </sequential>
-    </macrodef>
-    <property file="${user.properties.file}"/>
-    <sproject:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir"/>
-    <sproject:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
-    <sproject:evalprops property="cluster.path.evaluated" value="${cluster.path}"/>
-    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
-        <condition>
-            <not>
-                <contains string="${cluster.path.evaluated}" substring="platform"/>
-            </not>
-        </condition>
-    </fail>
-    <ant antfile="nbproject/platform.xml"/>
-    <fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly. ${line.separator}You may instead download the harness and platform: -Dbootstrap.url=.../tasks.jar -Dautoupdate.catalog.url=.../updates.xml">
-        <condition>
-            <not>
-                <available file="${harness.dir}/suite.xml"/>
-            </not>
-        </condition>
-    </fail>
-    <import file="${harness.dir}/suite.xml"/>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+-->
+<project name="Graal Visualizer-impl" basedir=".." xmlns:sproject="http://www.netbeans.org/ns/nb-module-suite-project/1">
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <property file="nbproject/private/platform-private.properties"/>
+    <property file="nbproject/platform.properties"/>
+    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
+        <attribute name="name"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{name}" value="${@{value}}"/>
+        </sequential>
+    </macrodef>
+    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
+        <attribute name="property"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{property}" value="@{value}"/>
+        </sequential>
+    </macrodef>
+    <property file="${user.properties.file}"/>
+    <sproject:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir"/>
+    <sproject:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
+    <sproject:evalprops property="cluster.path.evaluated" value="${cluster.path}"/>
+    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
+        <condition>
+            <not>
+                <contains string="${cluster.path.evaluated}" substring="platform"/>
+            </not>
+        </condition>
+    </fail>
+    <ant antfile="nbproject/platform.xml"/>
+    <fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly. ${line.separator}You may instead download the harness and platform: -Dbootstrap.url=.../tasks.jar -Dautoupdate.catalog.url=.../updates.xml">
+        <condition>
+            <not>
+                <available file="${harness.dir}/suite.xml"/>
+            </not>
+        </condition>
+    </fail>
+    <import file="${harness.dir}/suite.xml"/>
+</project>
--- a/visualizer/nbproject/genfiles.properties	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/nbproject/genfiles.properties	Mon Feb 20 18:01:22 2012 +0100
@@ -1,11 +1,11 @@
-build.xml.data.CRC32=3c2c6126
-build.xml.script.CRC32=48934e60
-build.xml.stylesheet.CRC32=eaf9f76a@1.45.1
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=3077accc
-nbproject/build-impl.xml.script.CRC32=17b494f7
-nbproject/build-impl.xml.stylesheet.CRC32=0f381476@2.47.1
-nbproject/platform.xml.data.CRC32=3077accc
-nbproject/platform.xml.script.CRC32=db9e1f43
-nbproject/platform.xml.stylesheet.CRC32=df8ac4dd@2.47.1
+build.xml.data.CRC32=3c2c6126
+build.xml.script.CRC32=48934e60
+build.xml.stylesheet.CRC32=eaf9f76a@1.45.1
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=3077accc
+nbproject/build-impl.xml.script.CRC32=17b494f7
+nbproject/build-impl.xml.stylesheet.CRC32=0f381476@2.47.1
+nbproject/platform.xml.data.CRC32=3077accc
+nbproject/platform.xml.script.CRC32=db9e1f43
+nbproject/platform.xml.stylesheet.CRC32=df8ac4dd@2.47.1
--- a/visualizer/nbproject/project.properties	Mon Feb 20 17:58:46 2012 +0100
+++ b/visualizer/nbproject/project.properties	Mon Feb 20 18:01:22 2012 +0100
@@ -1,5 +1,5 @@
 app.icon=branding/core/core.jar/org/netbeans/core/startup/frame48.gif
-app.name=idealgraphvisualizer
+app.name=graalvisualizer
 app.title=Graal Visualizer
 branding.token=${app.name}
 modules=\