changeset 2515:4fdef1464592

Removed extended bytecodes and related HIR instructions.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 15:36:29 +0200
parents 34b5eea9b001
children a384fac3fd34
files graal/GraalCompiler/src/com/sun/c1x/C1XCompilation.java graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java graal/GraalCompiler/src/com/sun/c1x/graph/IR.java graal/GraalCompiler/src/com/sun/c1x/ir/BreakpointTrap.java graal/GraalCompiler/src/com/sun/c1x/ir/CompareAndSwap.java graal/GraalCompiler/src/com/sun/c1x/ir/DefaultValueVisitor.java graal/GraalCompiler/src/com/sun/c1x/ir/IncrementRegister.java graal/GraalCompiler/src/com/sun/c1x/ir/Info.java graal/GraalCompiler/src/com/sun/c1x/ir/Infopoint.java graal/GraalCompiler/src/com/sun/c1x/ir/LoadPointer.java graal/GraalCompiler/src/com/sun/c1x/ir/LoadRegister.java graal/GraalCompiler/src/com/sun/c1x/ir/MemoryBarrier.java graal/GraalCompiler/src/com/sun/c1x/ir/NativeCall.java graal/GraalCompiler/src/com/sun/c1x/ir/Pause.java graal/GraalCompiler/src/com/sun/c1x/ir/PointerOp.java graal/GraalCompiler/src/com/sun/c1x/ir/SignificantBitOp.java graal/GraalCompiler/src/com/sun/c1x/ir/StackAllocate.java graal/GraalCompiler/src/com/sun/c1x/ir/StackHandle.java graal/GraalCompiler/src/com/sun/c1x/ir/StorePointer.java graal/GraalCompiler/src/com/sun/c1x/ir/StoreRegister.java graal/GraalCompiler/src/com/sun/c1x/ir/UnsafeCast.java graal/GraalCompiler/src/com/sun/c1x/ir/UnsignedCompareOp.java graal/GraalCompiler/src/com/sun/c1x/ir/ValueVisitor.java graal/GraalCompiler/src/com/sun/c1x/opt/NullCheckEliminator.java graal/GraalCompiler/src/com/sun/c1x/opt/UnsafeCastEliminator.java graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java graal/GraalCompiler/src/com/sun/c1x/value/MutableFrameState.java
diffstat 29 files changed, 13 insertions(+), 2369 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/C1XCompilation.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/C1XCompilation.java	Wed Apr 27 15:36:29 2011 +0200
@@ -34,7 +34,6 @@
 import com.sun.c1x.lir.*;
 import com.sun.c1x.observer.*;
 import com.sun.c1x.value.*;
-import com.sun.cri.bytecode.*;
 import com.sun.cri.ci.*;
 import com.sun.cri.ri.*;
 
@@ -117,14 +116,6 @@
     }
 
     /**
-     * Records that this compilation encountered an instruction (e.g. {@link Bytecodes#UNSAFE_CAST})
-     * that breaks the type safety invariant of the input bytecode.
-     */
-    public void setNotTypesafe() {
-        typesafe = false;
-    }
-
-    /**
      * Checks whether this compilation is for an on-stack replacement.
      *
      * @return {@code true} if this compilation is for an on-stack replacement
@@ -236,14 +227,6 @@
         return hasExceptionHandlers;
     }
 
-    /**
-     * Determines if this compilation has encountered any instructions (e.g. {@link Bytecodes#UNSAFE_CAST})
-     * that break the type safety invariant of the input bytecode.
-     */
-    public boolean isTypesafe() {
-        return typesafe;
-    }
-
     public CiResult compile() {
         CiTargetMethod targetMethod;
         try {
--- a/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java	Wed Apr 27 15:36:29 2011 +0200
@@ -2093,7 +2093,7 @@
                 assert !hasCall(opId) || operand.isStackSlot() || !isCallerSave(operand) : "cannot have caller-save register operands at calls";
                 return operand;
             } else if (operand.isRegister()) {
-                assert value instanceof LoadRegister;
+                assert false : "must not reach here";
                 return operand;
             } else {
                 assert value instanceof Constant;
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Wed Apr 27 15:36:29 2011 +0200
@@ -39,7 +39,6 @@
 import com.sun.c1x.graph.*;
 import com.sun.c1x.ir.*;
 import com.sun.c1x.ir.Value.Flag;
-import com.sun.c1x.lir.FrameMap.StackBlock;
 import com.sun.c1x.lir.*;
 import com.sun.c1x.opt.*;
 import com.sun.c1x.util.*;
@@ -48,7 +47,6 @@
 import com.sun.cri.bytecode.*;
 import com.sun.cri.bytecode.Bytecodes.MemoryBarriers;
 import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiAddress.Scale;
 import com.sun.cri.ri.*;
 import com.sun.cri.xir.CiXirAssembler.XirConstant;
 import com.sun.cri.xir.CiXirAssembler.XirInstruction;
@@ -618,22 +616,6 @@
     }
 
     @Override
-    public void visitNativeCall(NativeCall x) {
-        LIRDebugInfo info = stateFor(x, x.stateBefore());
-        CiValue resultOperand = resultOperandFor(x.kind);
-        CiValue callAddress = load(x.address());
-        CiKind[] signature = Util.signatureToKinds(x.signature, null);
-        CiCallingConvention cc = compilation.frameMap().getCallingConvention(signature, NativeCall);
-        List<CiValue> argList = visitInvokeArguments(cc, x.arguments, null);
-        argList.add(callAddress);
-        lir.callNative(x.nativeMethod.jniSymbol(), resultOperand, argList, info, null);
-        if (resultOperand.isLegal()) {
-            CiValue result = createResultVariable(x);
-            lir.move(resultOperand, result);
-        }
-    }
-
-    @Override
     public void visitTemplateCall(TemplateCall x) {
         CiValue resultOperand = resultOperandFor(x.kind);
         List<CiValue> argList;
@@ -656,142 +638,11 @@
     }
 
     @Override
-    public void visitLoadRegister(LoadRegister x) {
-        x.setOperand(x.register.asValue(x.kind));
-    }
-
-    @Override
-    public void visitPause(Pause i) {
-        lir.pause();
-    }
-
-    @Override
-    public void visitBreakpointTrap(BreakpointTrap i) {
-        lir.breakpoint();
-    }
-
-    protected CiAddress getAddressForPointerOp(PointerOp x, CiKind kind, CiValue pointer) {
-        CiAddress addr;
-        Value offset = x.offset();
-        Value index = x.index();
-        if (x.displacement() == null) {
-            // address is [pointer + offset]
-            if (offset.isConstant() && offset.kind.isInt()) {
-                int displacement = x.offset().asConstant().asInt();
-                addr = new CiAddress(kind, pointer, displacement);
-            } else {
-                addr = new CiAddress(kind, pointer, load(offset));
-            }
-        } else {
-            // address is [pointer + disp + (index * scale)]
-            assert (x.opcode & 0xff) == PGET || (x.opcode & 0xff) == PSET;
-            if (!x.displacement().isConstant()) {
-                CiVariable tmp = newVariable(CiKind.Word);
-                arithmeticOpLong(Bytecodes.LADD, tmp, pointer, load(x.displacement()), null);
-                int kindSize = compilation.target.sizeInBytes(kind);
-                Scale scale = Scale.fromInt(kindSize);
-                if (index.isConstant()) {
-                    addr = new CiAddress(kind, tmp, index.asConstant().asInt() * kindSize);
-                } else {
-                    addr = new CiAddress(kind, tmp, load(index), scale, 0);
-                }
-            } else {
-                int displacement = x.displacement().asConstant().asInt();
-                int kindSize = compilation.target.sizeInBytes(kind);
-                Scale scale = Scale.fromInt(kindSize);
-                if (index.isConstant()) {
-                    displacement += index.asConstant().asInt() * kindSize;
-                    addr = new CiAddress(kind, pointer, displacement);
-                } else {
-                    addr = new CiAddress(kind, pointer, load(index), scale, displacement);
-                }
-            }
-        }
-        return addr;
-    }
-
-    @Override
-    public void visitAllocateStackHandle(StackHandle x) {
-        CiValue value = load(x.value());
-        CiValue src = forceToSpill(value, x.value().kind, true);
-        CiValue dst = createResultVariable(x);
-
-        CiConstant constant = x.value().isConstant() ? x.value().asConstant() : null;
-        if (constant == null) {
-            CiConstant zero = CiConstant.defaultValue(x.value().kind);
-            lir.cmp(Condition.EQ, src, zero);
-        }
-        lir.lea(src, dst);
-        if (constant != null) {
-            if (constant.isDefaultValue()) {
-                lir.move(value, dst);
-            }
-        } else {
-            lir.cmove(Condition.EQ, CiConstant.ZERO, dst, dst);
-        }
-    }
-
-    @Override
-    public void visitLoadPointer(LoadPointer x) {
-        LIRDebugInfo info = maybeStateFor(x);
-        CiValue pointer = load(x.pointer());
-        CiValue dst = createResultVariable(x);
-        CiAddress src = getAddressForPointerOp(x, x.dataKind, pointer);
-        lir.load(src, dst, info);
-    }
-
-    @Override
-    public void visitStorePointer(StorePointer x) {
-        LIRDebugInfo info = maybeStateFor(x);
-        LIRItem value = new LIRItem(x.value(), this);
-        CiValue pointer = load(x.pointer());
-        value.loadItem(x.dataKind);
-        CiAddress dst = getAddressForPointerOp(x, x.dataKind, pointer);
-        lir.store(value.result(), dst, info);
-    }
-
-    @Override
-    public void visitInfopoint(Infopoint x) {
-        LIRDebugInfo info = stateFor(x);
-        if (x.opcode == SAFEPOINT) {
-            emitXir(xir.genSafepoint(site(x)), x, info, null, false);
-            return;
-        }
-        assert x.opcode == HERE || x.opcode == INFO;
-        CiValue result = x.kind.isVoid() ? CiValue.IllegalValue : createResultVariable(x);
-        LIROpcode opcode = x.opcode == HERE ? LIROpcode.Here : LIROpcode.Info;
-        lir.infopoint(opcode, result, info);
-    }
-
-    @Override
-    public void visitStackAllocate(StackAllocate x) {
-        CiValue result = createResultVariable(x);
-        assert x.size().isConstant() : "ALLOCA bytecode 'size' operand is not a constant: " + x.size();
-        StackBlock stackBlock = compilation.frameMap().reserveStackBlock(x.size().asConstant().asInt());
-        lir.alloca(stackBlock, result);
-    }
-
-    @Override
     public void visitMonitorAddress(MonitorAddress x) {
         CiValue result = createResultVariable(x);
         lir.monitorAddress(x.monitor(), result);
     }
 
-    @Override
-    public void visitMemoryBarrier(MemoryBarrier x) {
-        if (x.barriers != 0) {
-            lir.membar(x.barriers);
-        }
-    }
-
-    @Override
-    public void visitUnsafeCast(UnsafeCast i) {
-        assert !i.redundant : "redundant UnsafeCasts must be eliminated by the front end";
-        CiValue src = load(i.value());
-        CiValue dst = createResultVariable(i);
-        lir.move(src, dst);
-    }
-
     /**
      * For note on volatile fields, see {@link #visitStoreField(StoreField)}.
      */
@@ -1091,27 +942,6 @@
     }
 
     @Override
-    public void visitIncrementRegister(IncrementRegister x) {
-        CiValue reg = x.register.asValue(CiKind.Word);
-        if (x.delta().isConstant()) {
-            int delta = x.delta().asConstant().asInt();
-            if (delta < 0) {
-                lir.sub(reg, CiConstant.forInt(-delta), reg);
-            } else {
-                lir.add(reg, CiConstant.forInt(delta), reg);
-            }
-        } else {
-            lir.add(reg, makeOperand(x.delta()), reg);
-        }
-    }
-
-    @Override
-    public void visitStoreRegister(StoreRegister x) {
-        CiValue reg = x.register.asValue(x.kind);
-        lir.move(makeOperand(x.value()), reg);
-    }
-
-    @Override
     public void visitStoreField(StoreField x) {
         RiField field = x.field();
         boolean needsPatching = x.needsPatching();
@@ -1711,7 +1541,7 @@
             TTY.println("Operand for " + instr + " = " + instr.operand());
         }
 
-        assert (instr.operand().isLegal()) || !isUsedForValue(instr) || instr.isConstant() || instr instanceof UnsafeCast : "operand was not set for live instruction";
+        assert (instr.operand().isLegal()) || !isUsedForValue(instr) || instr.isConstant() : "operand was not set for live instruction";
     }
 
     private boolean isUsedForValue(Instruction instr) {
@@ -1921,7 +1751,7 @@
             if (value instanceof Phi && !value.isIllegal()) {
                 // phi's are special
                 operandForPhi((Phi) value);
-            } else if (value.operand().isIllegal() && !(value instanceof UnsafeCast)) {
+            } else if (value.operand().isIllegal()) {
                 // instruction doesn't have an operand yet
                 CiValue operand = makeOperand(value);
                 assert operand.isLegal() : "must be evaluated now";
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Wed Apr 27 15:36:29 2011 +0200
@@ -32,12 +32,10 @@
 import com.sun.c1x.debug.*;
 import com.sun.c1x.graph.ScopeData.ReturnBlock;
 import com.sun.c1x.ir.*;
-import com.sun.c1x.ir.Value.Flag;
 import com.sun.c1x.opt.*;
 import com.sun.c1x.util.*;
 import com.sun.c1x.value.*;
 import com.sun.cri.bytecode.*;
-import com.sun.cri.bytecode.Bytecodes.JniOp;
 import com.sun.cri.ci.*;
 import com.sun.cri.ri.*;
 import com.sun.cri.ri.RiType.Representation;
@@ -191,13 +189,9 @@
                 iterateAllBlocks();
             }
         } else {
-            RiType accessor = openAccessorScope(rootMethod);
-
             // 6B.1 do the normal parsing
             scopeData.addToWorkList(stdEntry);
             iterateAllBlocks();
-
-            closeAccessorScope(accessor);
         }
 
         if (syncHandler != null && syncHandler.stateBefore() != null) {
@@ -214,24 +208,6 @@
         }
     }
 
-    private void closeAccessorScope(RiType accessor) {
-        if (accessor != null) {
-            boundAccessor.set(null);
-        }
-    }
-
-    private RiType openAccessorScope(RiMethod rootMethod) {
-        RiType accessor = rootMethod.accessor();
-        if (accessor != null) {
-            assert boundAccessor.get() == null;
-            boundAccessor.set(accessor);
-
-            // What looks like an object receiver in the bytecode may not be a word value
-            compilation.setNotTypesafe();
-        }
-        return accessor;
-    }
-
     private void finishStartBlock(BlockBegin startBlock, BlockBegin stdEntry, BlockBegin osrEntry) {
         assert curBlock == startBlock;
         Base base = new Base(stdEntry, osrEntry);
@@ -682,12 +658,6 @@
         }
     }
 
-    void genUnsignedCompareOp(CiKind kind, int opcode, int op) {
-        Value y = pop(kind);
-        Value x = pop(kind);
-        ipush(append(new UnsignedCompareOp(opcode, op, x, y)));
-    }
-
     void genConvert(int opcode, CiKind from, CiKind to) {
         CiKind tt = to.stackKind();
         push(tt, append(new Convert(opcode, pop(from.stackKind()), tt)));
@@ -741,25 +711,6 @@
         appendWithoutOptimization(t, bci);
     }
 
-    void genUnsafeCast(RiMethod method) {
-        compilation.setNotTypesafe();
-        RiSignature signature = method.signature();
-        int argCount = signature.argumentCount(false);
-        RiType accessingClass = scope().method.holder();
-        RiType fromType;
-        RiType toType = signature.returnType(accessingClass);
-        if (argCount == 1) {
-            fromType = signature.argumentTypeAt(0, accessingClass);
-        } else {
-            assert argCount == 0 : "method with @UNSAFE_CAST must have exactly 1 argument";
-            fromType = method.holder();
-        }
-        CiKind from = fromType.kind();
-        CiKind to = toType.kind();
-        boolean redundant = compilation.archKindsEqual(to, from);
-        curState.push(to, append(new UnsafeCast(toType, curState.pop(from), redundant)));
-    }
-
     void genCheckCast() {
         int cpi = stream().readCPI();
         RiType type = constantPool().lookupType(cpi, CHECKCAST);
@@ -906,33 +857,7 @@
         push(kind.stackKind(), optimized);
     }
 
-    /**
-     * Temporary work-around to support the @ACCESSOR Maxine annotation.
-     */
-    private RiMethod handleInvokeAccessorOrBuiltin(RiMethod target) {
-        target = bindAccessorMethod(target);
-        if (target.intrinsic() != 0) {
-            int intrinsic = target.intrinsic();
-            int opcode = intrinsic & 0xff;
-            switch (opcode) {
-                case PREAD          : genLoadPointer(intrinsic); break;
-                case PGET           : genLoadPointer(intrinsic); break;
-                case PWRITE         : genStorePointer(intrinsic); break;
-                case PSET           : genStorePointer(intrinsic); break;
-                case PCMPSWP        : genCompareAndSwap(intrinsic); break;
-                default:
-                    throw new CiBailout("unknown bytecode " + opcode + " (" + nameOf(opcode) + ")");
-            }
-            return null;
-        }
-        return target;
-    }
-
     void genInvokeStatic(RiMethod target, int cpi, RiConstantPool constantPool) {
-        target = handleInvokeAccessorOrBuiltin(target);
-        if (target == null) {
-            return;
-        }
         RiType holder = target.holder();
         boolean isInitialized = !C1XOptions.TestPatching && target.isResolved() && holder.isInitialized();
         if (!isInitialized && C1XOptions.ResolveClassBeforeStaticInvoke) {
@@ -951,10 +876,6 @@
     }
 
     void genInvokeInterface(RiMethod target, int cpi, RiConstantPool constantPool) {
-        target = handleInvokeAccessorOrBuiltin(target);
-        if (target == null) {
-            return;
-        }
         Value[] args = curState.popArguments(target.signature().argumentSlots(true));
         if (!tryRemoveCall(target, args, false)) {
             genInvokeIndirect(INVOKEINTERFACE, target, args, cpi, constantPool);
@@ -962,10 +883,6 @@
     }
 
     void genInvokeVirtual(RiMethod target, int cpi, RiConstantPool constantPool) {
-        target = handleInvokeAccessorOrBuiltin(target);
-        if (target == null) {
-            return;
-        }
         Value[] args = curState.popArguments(target.signature().argumentSlots(true));
         if (!tryRemoveCall(target, args, false)) {
             genInvokeIndirect(INVOKEVIRTUAL, target, args, cpi, constantPool);
@@ -973,10 +890,6 @@
     }
 
     void genInvokeSpecial(RiMethod target, RiType knownHolder, int cpi, RiConstantPool constantPool) {
-        target = handleInvokeAccessorOrBuiltin(target);
-        if (target == null) {
-            return;
-        }
         Value[] args = curState.popArguments(target.signature().argumentSlots(true));
         if (!tryRemoveCall(target, args, false)) {
             invokeDirect(target, args, knownHolder, cpi, constantPool);
@@ -1015,26 +928,6 @@
         return target;
     }
 
-    /**
-     * Temporary work-around to support the @ACCESSOR Maxine annotation.
-     */
-    private boolean inlineWithBoundAccessor(RiMethod target, Value[] args, boolean forcedInline) {
-        RiType accessor = target.accessor();
-        if (accessor != null) {
-            assert boundAccessor.get() == null;
-            boundAccessor.set(accessor);
-            try {
-                // What looks like an object receiver in the bytecode may not be a word value
-                compilation.setNotTypesafe();
-                inline(target, args, forcedInline);
-            } finally {
-                boundAccessor.set(null);
-            }
-            return true;
-        }
-        return false;
-    }
-
     private void genInvokeIndirect(int opcode, RiMethod target, Value[] args, int cpi, RiConstantPool constantPool) {
         Value receiver = args[0];
         // attempt to devirtualize the call
@@ -1785,9 +1678,8 @@
                     log.println("|");
                 }
             }
-            if (!inlineWithBoundAccessor(target, args, forcedInline)) {
-                inline(target, args, forcedInline);
-            }
+
+            inline(target, args, forcedInline);
 
             if (C1XOptions.TraceBytecodeParserLevel > 0) {
                 if (C1XOptions.TraceBytecodeParserLevel < TRACELEVEL_STATE) {
@@ -2443,69 +2335,6 @@
             case IFNONNULL      : genIfNull(Condition.NE); break;
             case GOTO_W         : genGoto(s.currentBCI(), s.readFarBranchDest()); break;
             case JSR_W          : genJsr(s.readFarBranchDest()); break;
-            default:
-                processExtendedBytecode(bci, s, opcode);
-        }
-        // Checkstyle: resume
-    }
-
-    private void processExtendedBytecode(int bci, BytecodeStream s, int opcode) {
-        // Checkstyle: stop
-        switch (opcode) {
-            case UNSAFE_CAST    : genUnsafeCast(constantPool().lookupMethod(s.readCPI(), (byte)Bytecodes.UNSAFE_CAST)); break;
-            case WLOAD          : loadLocal(s.readLocalIndex(), CiKind.Word); break;
-            case WLOAD_0        : loadLocal(0, CiKind.Word); break;
-            case WLOAD_1        : loadLocal(1, CiKind.Word); break;
-            case WLOAD_2        : loadLocal(2, CiKind.Word); break;
-            case WLOAD_3        : loadLocal(3, CiKind.Word); break;
-
-            case WSTORE         : storeLocal(CiKind.Word, s.readLocalIndex()); break;
-            case WSTORE_0       : // fall through
-            case WSTORE_1       : // fall through
-            case WSTORE_2       : // fall through
-            case WSTORE_3       : storeLocal(CiKind.Word, opcode - WSTORE_0); break;
-
-            case WCONST_0       : wpush(appendConstant(CiConstant.ZERO)); break;
-            case WDIV           : // fall through
-            case WREM           : genArithmeticOp(CiKind.Word, opcode, curState.immutableCopy(bci())); break;
-            case WDIVI          : genArithmeticOp(CiKind.Word, opcode, CiKind.Word, CiKind.Int, curState.immutableCopy(bci())); break;
-            case WREMI          : genArithmeticOp(CiKind.Int, opcode, CiKind.Word, CiKind.Int, curState.immutableCopy(bci())); break;
-
-            case READREG        : genLoadRegister(s.readCPI()); break;
-            case WRITEREG       : genStoreRegister(s.readCPI()); break;
-            case INCREG         : genIncRegister(s.readCPI()); break;
-
-            case PREAD          : genLoadPointer(PREAD      | (s.readCPI() << 8)); break;
-            case PGET           : genLoadPointer(PGET       | (s.readCPI() << 8)); break;
-            case PWRITE         : genStorePointer(PWRITE    | (s.readCPI() << 8)); break;
-            case PSET           : genStorePointer(PSET      | (s.readCPI() << 8)); break;
-            case PCMPSWP        : genCompareAndSwap(PCMPSWP | (s.readCPI() << 8)); break;
-            case MEMBAR         : genMemoryBarrier(s.readCPI()); break;
-
-            case WRETURN        : genReturn(wpop()); break;
-            case INFOPOINT      : genInfopoint(INFOPOINT | (s.readUByte(bci() + 1) << 16), s.readUByte(bci() + 2) != 0); break;
-            case JNICALL        : genNativeCall(s.readCPI()); break;
-            case JNIOP          : genJniOp(s.readCPI()); break;
-            case ALLOCA         : genStackAllocate(); break;
-
-            case MOV_I2F        : genConvert(opcode, CiKind.Int, CiKind.Float ); break;
-            case MOV_F2I        : genConvert(opcode, CiKind.Float, CiKind.Int ); break;
-            case MOV_L2D        : genConvert(opcode, CiKind.Long, CiKind.Double ); break;
-            case MOV_D2L        : genConvert(opcode, CiKind.Double, CiKind.Long ); break;
-
-            case UCMP           : genUnsignedCompareOp(CiKind.Int, opcode, s.readCPI()); break;
-            case UWCMP          : genUnsignedCompareOp(CiKind.Word, opcode, s.readCPI()); break;
-
-            case STACKHANDLE    : genStackHandle(s.readCPI() == 0); break;
-            case BREAKPOINT_TRAP: genBreakpointTrap(); break;
-            case PAUSE          : genPause(); break;
-            case LSB            : // fall through
-            case MSB            : genSignificantBit(opcode);break;
-
-            case TEMPLATE_CALL  : genTemplateCall(constantPool().lookupMethod(s.readCPI(), (byte)Bytecodes.TEMPLATE_CALL)); break;
-            case ICMP           : genCompareOp(CiKind.Int, opcode, CiKind.Void); break;
-            case WCMP           : genCompareOp(CiKind.Word, opcode, CiKind.Void); break;
-
             case BREAKPOINT:
                 throw new CiBailout("concurrent setting of breakpoint");
             default:
@@ -2531,315 +2360,6 @@
         }
     }
 
-    private void genPause() {
-        append(new Pause());
-    }
-
-    private void genBreakpointTrap() {
-        append(new BreakpointTrap());
-    }
-
-    private void genStackHandle(boolean isCategory1) {
-        Value value = curState.xpop();
-        wpush(append(new StackHandle(value)));
-    }
-
-    private void genStackAllocate() {
-        Value size = pop(CiKind.Int);
-        wpush(append(new StackAllocate(size)));
-    }
-
-    private void genSignificantBit(int opcode) {
-        Value value = pop(CiKind.Word);
-        push(CiKind.Int, append(new SignificantBitOp(value, opcode)));
-    }
-
-    private void appendSnippetCall(RiSnippetCall snippetCall) {
-        Value[] args = new Value[snippetCall.arguments.length];
-        RiMethod snippet = snippetCall.snippet;
-        RiSignature signature = snippet.signature();
-        assert signature.argumentCount(!isStatic(snippet.accessFlags())) == args.length;
-        for (int i = args.length - 1; i >= 0; --i) {
-            CiKind argKind = signature.argumentKindAt(i);
-            if (snippetCall.arguments[i] == null) {
-                args[i] = pop(argKind);
-            } else {
-                args[i] = append(new Constant(snippetCall.arguments[i]));
-            }
-        }
-
-        if (!tryRemoveCall(snippet, args, true)) {
-            if (!tryInline(snippet, args)) {
-                appendInvoke(snippetCall.opcode, snippet, args, true, (char) 0, constantPool());
-            }
-        }
-    }
-
-    private void genJniOp(int operand) {
-        RiSnippets snippets = compilation.runtime.getSnippets();
-        switch (operand) {
-            case JniOp.LINK: {
-                RiMethod nativeMethod = scope().method;
-                RiSnippetCall linkSnippet = snippets.link(nativeMethod);
-                if (linkSnippet.result != null) {
-                    wpush(appendConstant(linkSnippet.result));
-                } else {
-                    appendSnippetCall(linkSnippet);
-                }
-                break;
-            }
-            case JniOp.J2N: {
-                RiMethod nativeMethod = scope().method;
-                appendSnippetCall(snippets.enterNative(nativeMethod));
-                break;
-            }
-            case JniOp.N2J: {
-                RiMethod nativeMethod = scope().method;
-                appendSnippetCall(snippets.enterVM(nativeMethod));
-                break;
-            }
-        }
-    }
-
-    private void genNativeCall(int cpi) {
-        Value nativeFunctionAddress = wpop();
-        RiSignature sig = constantPool().lookupSignature(cpi);
-        Value[] args = curState.popArguments(sig.argumentSlots(false));
-
-        RiMethod nativeMethod = scope().method;
-        CiKind returnKind = sig.returnKind();
-        pushReturn(returnKind, append(new NativeCall(nativeMethod, sig, nativeFunctionAddress, args, null)));
-
-        // Sign extend or zero the upper bits of a return value smaller than an int to
-        // preserve the invariant that all such values are represented by an int
-        // in the VM. We cannot rely on the native C compiler doing this for us.
-        switch (sig.returnKind()) {
-            case Boolean:
-            case Byte: {
-                genConvert(I2B, CiKind.Int, CiKind.Byte);
-                break;
-            }
-            case Short: {
-                genConvert(I2S, CiKind.Int, CiKind.Short);
-                break;
-            }
-            case Char: {
-                genConvert(I2C, CiKind.Int, CiKind.Char);
-                break;
-            }
-        }
-    }
-
-    void genTemplateCall(RiMethod method) {
-        RiSignature sig = method.signature();
-        Value[] args = curState.popArguments(sig.argumentSlots(false));
-        assert args.length <= 2;
-        CiKind returnKind = sig.returnKind();
-        Value address = null;
-        Value receiver = null;
-        if (args.length == 1) {
-            address = args[0];
-            assert address.kind.isWord();
-        } else if (args.length == 2) {
-            address = args[0];
-            assert address.kind.isWord();
-            receiver = args[1];
-            assert receiver.kind.isObject();
-        }
-        pushReturn(returnKind, append(new TemplateCall(returnKind, address, receiver)));
-    }
-
-    private void genInfopoint(int opcode, boolean inclFrame) {
-        // TODO: create slimmer frame state if inclFrame is false
-        FrameState state = curState.immutableCopy(bci());
-        assert opcode != SAFEPOINT || !scopeData.noSafepoints() : "cannot place explicit safepoint in uninterruptible code scope";
-        Value result = append(new Infopoint(opcode, state));
-        if (!result.kind.isVoid()) {
-            push(result.kind, result);
-        }
-    }
-
-    private void genLoadRegister(int registerId) {
-        CiRegister register = compilation.registerConfig.getRegisterForRole(registerId);
-        if (register == null) {
-            throw new CiBailout("Unsupported READREG operand " + registerId);
-        }
-        LoadRegister load = new LoadRegister(CiKind.Word, register);
-        RiRegisterAttributes regAttr = compilation.registerConfig.getAttributesMap()[register.number];
-        if (regAttr.isNonZero) {
-            load.setFlag(Flag.NonNull);
-        }
-        wpush(append(load));
-    }
-
-    private void genStoreRegister(int registerId) {
-        CiRegister register = compilation.registerConfig.getRegisterForRole(registerId);
-        if (register == null) {
-            throw new CiBailout("Unsupported WRITEREG operand " + registerId);
-        }
-        Value value = pop(CiKind.Word);
-        append(new StoreRegister(CiKind.Word, register, value));
-    }
-
-    private void genIncRegister(int registerId) {
-        CiRegister register = compilation.registerConfig.getRegisterForRole(registerId);
-        if (register == null) {
-            throw new CiBailout("Unsupported INCREG operand " + registerId);
-        }
-        Value value = pop(CiKind.Int);
-        append(new IncrementRegister(register, value));
-    }
-
-    /**
-     * Gets the data kind corresponding to a given pointer operation opcode.
-     * The data kind may be more specific than a {@linkplain CiKind#stackKind()}.
-     *
-     * @return the kind of value at the address accessed by the pointer operation denoted by {@code opcode}
-     */
-    private static CiKind dataKindForPointerOp(int opcode) {
-        switch (opcode) {
-            case PGET_BYTE          :
-            case PSET_BYTE          :
-            case PREAD_BYTE         :
-            case PREAD_BYTE_I       :
-            case PWRITE_BYTE        :
-            case PWRITE_BYTE_I      : return CiKind.Byte;
-            case PGET_CHAR          :
-            case PREAD_CHAR         :
-            case PREAD_CHAR_I       : return CiKind.Char;
-            case PGET_SHORT         :
-            case PSET_SHORT         :
-            case PREAD_SHORT        :
-            case PREAD_SHORT_I      :
-            case PWRITE_SHORT       :
-            case PWRITE_SHORT_I     : return CiKind.Short;
-            case PGET_INT           :
-            case PSET_INT           :
-            case PREAD_INT          :
-            case PREAD_INT_I        :
-            case PWRITE_INT         :
-            case PWRITE_INT_I       : return CiKind.Int;
-            case PGET_FLOAT         :
-            case PSET_FLOAT         :
-            case PREAD_FLOAT        :
-            case PREAD_FLOAT_I      :
-            case PWRITE_FLOAT       :
-            case PWRITE_FLOAT_I     : return CiKind.Float;
-            case PGET_LONG          :
-            case PSET_LONG          :
-            case PREAD_LONG         :
-            case PREAD_LONG_I       :
-            case PWRITE_LONG        :
-            case PWRITE_LONG_I      : return CiKind.Long;
-            case PGET_DOUBLE        :
-            case PSET_DOUBLE        :
-            case PREAD_DOUBLE       :
-            case PREAD_DOUBLE_I     :
-            case PWRITE_DOUBLE      :
-            case PWRITE_DOUBLE_I    : return CiKind.Double;
-            case PGET_WORD          :
-            case PSET_WORD          :
-            case PREAD_WORD         :
-            case PREAD_WORD_I       :
-            case PWRITE_WORD        :
-            case PWRITE_WORD_I      : return CiKind.Word;
-            case PGET_REFERENCE     :
-            case PSET_REFERENCE     :
-            case PREAD_REFERENCE    :
-            case PREAD_REFERENCE_I  :
-            case PWRITE_REFERENCE   :
-            case PWRITE_REFERENCE_I : return CiKind.Object;
-            default:
-                throw new CiBailout("Unsupported pointer operation opcode " + opcode + "(" + nameOf(opcode) + ")");
-        }
-    }
-
-    /**
-     * Pops the value producing the scaled-index or the byte offset for a pointer operation.
-     * If compiling for a 64-bit platform and the value is an {@link CiKind#Int} parameter,
-     * then a conversion is inserted to sign extend the int to a word.
-     *
-     * This is required as the value is used as a 64-bit value and so the high 32 bits
-     * need to be correct.
-     *
-     * @param isInt specifies if the value is an {@code int}
-     */
-    private Value popOffsetOrIndexForPointerOp(boolean isInt) {
-        if (isInt) {
-            Value offsetOrIndex = ipop();
-            if (compilation.target.arch.is64bit() && offsetOrIndex instanceof Local) {
-                return append(new Convert(I2L, offsetOrIndex, CiKind.Word));
-            }
-            return offsetOrIndex;
-        }
-        return wpop();
-    }
-
-    private void genLoadPointer(int opcode) {
-        FrameState stateBefore = curState.immutableCopy(bci());
-        CiKind dataKind = dataKindForPointerOp(opcode);
-        Value offsetOrIndex;
-        Value displacement;
-        if ((opcode & 0xff) == PREAD) {
-            offsetOrIndex = popOffsetOrIndexForPointerOp(opcode >= PREAD_BYTE_I && opcode <= PREAD_REFERENCE_I);
-            displacement = null;
-        } else {
-            offsetOrIndex = popOffsetOrIndexForPointerOp(true);
-            displacement = ipop();
-        }
-        Value pointer = wpop();
-        push(dataKind.stackKind(), append(new LoadPointer(dataKind, opcode, pointer, displacement, offsetOrIndex, stateBefore, false)));
-    }
-
-    private void genStorePointer(int opcode) {
-        FrameState stateBefore = curState.immutableCopy(bci());
-        CiKind dataKind = dataKindForPointerOp(opcode);
-        Value value = pop(dataKind.stackKind());
-        Value offsetOrIndex;
-        Value displacement;
-        if ((opcode & 0xff) == PWRITE) {
-            offsetOrIndex = popOffsetOrIndexForPointerOp(opcode >= PWRITE_BYTE_I && opcode <= PWRITE_REFERENCE_I);
-            displacement = null;
-        } else {
-            offsetOrIndex = popOffsetOrIndexForPointerOp(true);
-            displacement = ipop();
-        }
-        Value pointer = wpop();
-        append(new StorePointer(opcode, dataKind, pointer, displacement, offsetOrIndex, value, stateBefore, false));
-    }
-
-    private static CiKind kindForCompareAndSwap(int opcode) {
-        switch (opcode) {
-            case PCMPSWP_INT        :
-            case PCMPSWP_INT_I      : return CiKind.Int;
-            case PCMPSWP_WORD       :
-            case PCMPSWP_WORD_I     : return CiKind.Word;
-            case PCMPSWP_REFERENCE  :
-            case PCMPSWP_REFERENCE_I: return CiKind.Object;
-            default:
-                throw new CiBailout("Unsupported compare-and-swap opcode " + opcode + "(" + nameOf(opcode) + ")");
-        }
-    }
-
-    private void genCompareAndSwap(int opcode) {
-        FrameState stateBefore = curState.immutableCopy(bci());
-        CiKind kind = kindForCompareAndSwap(opcode);
-        Value newValue = pop(kind);
-        Value expectedValue = pop(kind);
-        Value offset;
-        offset = popOffsetOrIndexForPointerOp(opcode >= PCMPSWP_INT_I && opcode <= PCMPSWP_REFERENCE_I);
-        Value pointer = wpop();
-        push(kind, append(new CompareAndSwap(opcode, pointer, offset, expectedValue, newValue, stateBefore, false)));
-    }
-
-
-    private void genMemoryBarrier(int barriers) {
-        int explicitMemoryBarriers = barriers & ~compilation.target.arch.implicitMemoryBarriers;
-        if (explicitMemoryBarriers != 0) {
-            append(new MemoryBarrier(explicitMemoryBarriers));
-        }
-    }
-
     private void genArrayLength() {
         FrameState stateBefore = curState.immutableCopy(bci());
         ipush(append(new ArrayLength(apop(), stateBefore)));
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Wed Apr 27 15:36:29 2011 +0200
@@ -111,11 +111,6 @@
     }
 
     private void optimize1() {
-        if (!compilation.isTypesafe()) {
-            new UnsafeCastEliminator(this);
-            verifyAndPrint("After unsafe cast elimination");
-        }
-
         // do basic optimizations
         if (C1XOptions.PhiSimplify) {
             new PhiSimplifier(this);
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BreakpointTrap.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.ci.*;
-
-/**
- * Instruction the emits a machine code instruction causing a breakpoint trap.
- *
- * @author Doug Simon
- */
-public final class BreakpointTrap extends Instruction {
-
-    /**
-     * Creates a {@link BreakpointTrap} instance.
-     */
-    public BreakpointTrap() {
-        super(CiKind.Void);
-        setFlag(Flag.LiveSideEffect);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitBreakpointTrap(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("breakpoint_trap");
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/CompareAndSwap.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.c1x.value.*;
-import com.sun.cri.bytecode.*;
-
-/**
- * Atomic update of a value in memory. Implements the {@link Bytecodes#PCMPSWP} family of instructions.
- *
- * Compares a suspected value with the actual value in a memory location.
- * Iff they are same, a new value is placed into the location and the expected value is returned.
- * Otherwise, the actual value is returned.
- *
- * @author Doug Simon
- */
-public final class CompareAndSwap extends PointerOp {
-
-    /**
-     * The value to store.
-     */
-    Value expectedValue;
-
-    Value newValue;
-
-    /**
-     * Creates an instruction for a pointer store. If {@code displacement != null}, the effective of the address of the store is
-     * computed as the pointer plus a byte displacement plus a scaled index. Otherwise, the effective address is computed as the
-     * pointer plus a byte offset.
-     * @param pointer the value producing the pointer
-     * @param offset the value producing the byte offset
-     * @param expectedValue the value that must currently being in memory location for the swap to occur
-     * @param newValue the new value to store if the precondition is satisfied
-     * @param stateBefore the state before
-     * @param isVolatile {@code true} if the access is volatile
-     */
-    public CompareAndSwap(int opcode, Value pointer, Value offset, Value expectedValue, Value newValue, FrameState stateBefore, boolean isVolatile) {
-        super(expectedValue.kind, expectedValue.kind, opcode, pointer, null, offset, stateBefore, isVolatile);
-        assert offset != null;
-        this.expectedValue = expectedValue;
-        this.newValue = newValue;
-        setFlag(Flag.LiveStore);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitCompareAndSwap(this);
-    }
-
-    public Value expectedValue() {
-        return expectedValue;
-    }
-
-    public Value newValue() {
-        return newValue;
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        super.inputValuesDo(closure);
-        expectedValue = closure.apply(expectedValue);
-        newValue = closure.apply(newValue);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(Bytecodes.nameOf(opcode)).print("(").print(pointer());
-        out.print(" + ").print(offset());
-        out.print(", ").print(expectedValue()).print(", ").print(newValue()).print(')');
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/DefaultValueVisitor.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/DefaultValueVisitor.java	Wed Apr 27 15:36:29 2011 +0200
@@ -47,34 +47,25 @@
     @Override public void visitBase(Base i) { visit(i); }
     @Override public void visitBlockBegin(BlockBegin i) { visit(i); }
     @Override public void visitBoundsCheck(BoundsCheck i) { visit(i); }
-    @Override public void visitBreakpointTrap(BreakpointTrap i) {visit(i); }
     @Override public void visitCheckCast(CheckCast i) { visit(i); }
     @Override public void visitCompareOp(CompareOp i) { visit(i); }
-    @Override public void visitCompareAndSwap(CompareAndSwap i) { visit(i); }
     @Override public void visitConstant(Constant i) { visit(i); }
     @Override public void visitConvert(Convert i) { visit(i); }
     @Override public void visitExceptionObject(ExceptionObject i) { visit(i); }
     @Override public void visitGoto(Goto i) { visit(i); }
-    @Override public void visitIncrementRegister(IncrementRegister i) { visit(i); }
     @Override public void visitIf(If i) { visit(i); }
     @Override public void visitIfOp(IfOp i) { visit(i); }
-    @Override public void visitInfopoint(Infopoint i) { visit(i); }
     @Override public void visitInstanceOf(InstanceOf i) { visit(i); }
     @Override public void visitIntrinsic(Intrinsic i) { visit(i); }
     @Override public void visitInvoke(Invoke i) { visit(i); }
     @Override public void visitLoadField(LoadField i) { visit(i); }
     @Override public void visitLoadIndexed(LoadIndexed i) { visit(i); }
-    @Override public void visitLoadPointer(LoadPointer i) { visit(i); }
-    @Override public void visitLoadRegister(LoadRegister i) { visit(i); }
-    @Override public void visitAllocateStackHandle(StackHandle i) { visit(i); }
     @Override public void visitLocal(Local i) { visit(i); }
     @Override public void visitLogicOp(LogicOp i) { visit(i); }
     @Override public void visitLookupSwitch(LookupSwitch i) { visit(i); }
-    @Override public void visitMemoryBarrier(MemoryBarrier i) { visit(i); }
     @Override public void visitMonitorAddress(MonitorAddress i) { visit(i); }
     @Override public void visitMonitorEnter(MonitorEnter i) { visit(i); }
     @Override public void visitMonitorExit(MonitorExit i) { visit(i); }
-    @Override public void visitNativeCall(NativeCall i) { visit(i); }
     @Override public void visitNegateOp(NegateOp i) { visit(i); }
     @Override public void visitNewInstance(NewInstance i) { visit(i); }
     @Override public void visitNewMultiArray(NewMultiArray i) { visit(i); }
@@ -83,27 +74,20 @@
     @Override public void visitNewTypeArray(NewTypeArray i) { visit(i); }
     @Override public void visitNullCheck(NullCheck i) { visit(i); }
     @Override public void visitOsrEntry(OsrEntry i) { visit(i); }
-    @Override public void visitPause(Pause i) { visit(i); }
     @Override public void visitPhi(Phi i) { visit(i); }
     @Override public void visitResolveClass(ResolveClass i) { visit(i); }
     @Override public void visitReturn(Return i) { visit(i); }
     @Override public void visitShiftOp(ShiftOp i) { visit(i); }
-    @Override public void visitSignificantBit(SignificantBitOp i) { visit(i); }
-    @Override public void visitStackAllocate(StackAllocate i) { visit(i); }
     @Override public void visitStoreField(StoreField i) { visit(i); }
     @Override public void visitStoreIndexed(StoreIndexed i) { visit(i); }
-    @Override public void visitStorePointer(StorePointer i) { visit(i); }
-    @Override public void visitStoreRegister(StoreRegister i) { visit(i); }
     @Override public void visitTableSwitch(TableSwitch i) { visit(i); }
     @Override public void visitTemplateCall(TemplateCall i) { visit(i); }
     @Override public void visitTypeEqualityCheck(TypeEqualityCheck i) { visit(i); }
     @Override public void visitThrow(Throw i) { visit(i); }
-    @Override public void visitUnsafeCast(UnsafeCast i) { visit(i); }
     @Override public void visitUnsafeGetObject(UnsafeGetObject i) { visit(i); }
     @Override public void visitUnsafeGetRaw(UnsafeGetRaw i) { visit(i); }
     @Override public void visitUnsafePrefetchRead(UnsafePrefetchRead i) { visit(i); }
     @Override public void visitUnsafePrefetchWrite(UnsafePrefetchWrite i) { visit(i); }
     @Override public void visitUnsafePutObject(UnsafePutObject i) { visit(i); }
     @Override public void visitUnsafePutRaw(UnsafePutRaw i) { visit(i); }
-    @Override public void visitUnsignedCompareOp(UnsignedCompareOp i) { visit(i); }
 }
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/IncrementRegister.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.ci.*;
-
-/**
- * @author Doug Simon
- */
-public final class IncrementRegister extends Instruction {
-
-    public final CiRegister register;
-    private Value delta;
-
-    public IncrementRegister(CiRegister register, Value delta) {
-        super(CiKind.Void);
-        this.register = register;
-        this.delta = delta;
-        setFlag(Flag.LiveStore);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitIncrementRegister(this);
-    }
-
-    public Value delta() {
-        return delta;
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        delta = closure.apply(delta);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(register.toString()).print(" += ").print(delta);
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Info.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2009, 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.
- */
-package com.sun.c1x.ir;
-
-import java.util.*;
-
-import com.sun.c1x.value.*;
-import com.sun.cri.ci.*;
-
-/**
- * This class collects a number of debugging and exception-related information about
- * an HIR node. Instances of this class can be attached to HIR nodes and contain
- * the {@link com.sun.cri.ci.CiCodePos code position}, the {@link com.sun.c1x.value.FrameState frame state}
- * potential exceptions, and exception handlers.
- *
- * @author Ben L. Titzer
- */
-public class Info {
-
-    /**
-     * An enumeration of the possible exceptions or stops that an instruction may generate.
-     */
-    public enum StopType {
-        /**
-         * This instruction may throw {@link ArrayIndexOutOfBoundsException}.
-         */
-        java_lang_ArrayOutOfBoundsException,
-
-        /**
-         * This instruction may throw {@link NullPointerException}.
-         */
-        java_lang_NullPointerException,
-
-        /**
-         * This instruction may throw {@link ClassCastException}.
-         */
-        java_lang_ClassCastException,
-
-        /**
-         * This instruction may throw {@link ArrayStoreException}.
-         */
-        java_lang_ArrayStoreException,
-
-        /**
-         * This instruction may throw {@link ArithmeticException}.
-         */
-        java_lang_ArithmeticException,
-
-        /**
-         * This instruction may throw {@link NegativeArraySizeException}.
-         */
-        java_lang_NegativeArraySizeException,
-
-        /**
-         * This instruction may throw {@link OutOfMemoryError}.
-         */
-        java_lang_OutOfMemoryError,
-
-        /**
-         * This instruction may throw {@link IncompatibleClassChangeError}.
-         */
-        java_lang_IncompatibleClassChangeError,
-
-        /**
-         * This instruction may cause a safepoint.
-         */
-        Safepoint,
-
-        /**
-         * This instruction may throw any exception or cause a safepoint.
-         */
-        Unknown;
-
-        public final int mask = 1 << ordinal();
-
-    }
-
-    public final CiCodePos pos;
-    public final int id;
-    private int stopFlags;
-    private FrameState state;
-    private List<ExceptionHandler> exceptionHandlers;
-
-    public Info(CiCodePos pos, int id, FrameState javaFrameState) {
-        this.pos = pos;
-        this.id = id;
-        this.state = javaFrameState;
-    }
-
-    public FrameState frameState() {
-        return state;
-    }
-
-    public boolean mayStop() {
-        return stopFlags != 0;
-    }
-
-    public boolean mayCauseException() {
-        return (stopFlags & ~StopType.Safepoint.mask) != 0;
-    }
-
-    public void clearStop(StopType stopType) {
-        stopFlags &= ~stopType.mask;
-    }
-
-    public void setStop(StopType stopType) {
-        stopFlags |= stopType.mask;
-    }
-
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Infopoint.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import static com.sun.cri.bytecode.Bytecodes.*;
-
-import com.sun.c1x.debug.*;
-import com.sun.c1x.value.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.ci.*;
-
-/**
- * Records debug info at the current code location.
- *
- * @author Doug Simon
- */
-public final class Infopoint extends Instruction {
-
-    public final FrameState state;
-
-    /**
-     * {@link Bytecodes#HERE}, {@link Bytecodes#INFO} or {@link Bytecodes#SAFEPOINT}.
-     */
-    public final int opcode;
-
-    /**
-     * Creates a new Infopoint instance.
-     * @param state the debug info at this instruction
-     */
-    public Infopoint(int opcode, FrameState state) {
-        super(opcode == HERE ? CiKind.Long : CiKind.Void);
-        assert opcode == HERE || opcode == INFO || opcode == SAFEPOINT : Bytecodes.nameOf(opcode);
-        this.opcode = opcode;
-        this.state = state;
-        setFlag(Flag.LiveSideEffect); // ensure this instruction is not eliminated
-        if (opcode == SAFEPOINT) {
-            setFlag(Value.Flag.IsSafepoint);
-        }
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitInfopoint(this);
-    }
-
-    @Override
-    public FrameState stateBefore() {
-        return state;
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(Bytecodes.nameOf(opcode));
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/LoadPointer.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.c1x.value.*;
-import com.sun.cri.ci.*;
-
-/**
- * The {@code LoadPointer} instruction represents a read of a pointer.
- * This instruction is part of the HIR support for low-level operations, such as safepoints,
- * stack banging, etc, and does not correspond to a Java operation.
- *
- * @author Ben L. Titzer
- * @author Doug Simon
- */
-public final class LoadPointer extends PointerOp {
-
-    /**
-     * Creates an instruction for a pointer load.
-     *
-     * @param kind the kind of value loaded from the pointer
-     * @param opcode the opcode of the instruction
-     * @param pointer the value producing the pointer
-     * @param displacement the value producing the displacement. This may be {@code null}.
-     * @param offsetOrIndex the value producing the scaled-index or the byte offset depending on whether {@code displacement} is {@code null}
-     * @param stateBefore the state before
-     * @param isVolatile {@code true} if the access is volatile
-     * @see PointerOp#PointerOp(CiKind, int, Value, Value, Value, FrameState, boolean)
-     */
-    public LoadPointer(CiKind kind, int opcode, Value pointer, Value displacement, Value offsetOrIndex, FrameState stateBefore, boolean isVolatile) {
-        super(kind, kind, opcode, pointer, displacement, offsetOrIndex, stateBefore, isVolatile);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitLoadPointer(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("*(").print(pointer());
-        if (displacement() == null) {
-            out.print(" + ").print(offset());
-        } else {
-            out.print(" + ").print(displacement()).print(" + (").print(index()).print(" * sizeOf(" + dataKind + "))");
-        }
-        out.print(")");
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/LoadRegister.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.ci.*;
-
-/**
- * The {@code LoadRegister} instruction represents a read of a physical register.
- * This instruction is part of the HIR support for low-level operations, such as safepoints,
- * stack banging, etc, and does not correspond to a Java operation.
- *
- * @author Ben L. Titzer
- */
-public final class LoadRegister extends Instruction {
-
-    public final CiRegister register;
-
-    /**
-     * Creates a new LoadRegister instance.
-     * @param kind the kind of value loaded from the register
-     * @param register the register to load
-     */
-    public LoadRegister(CiKind kind, CiRegister register) {
-        super(kind);
-        this.register = register;
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitLoadRegister(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(register.toString());
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/MemoryBarrier.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.bytecode.Bytecodes.*;
-import com.sun.cri.ci.*;
-
-/**
- * Instruction implementing the semantics of {@link Bytecodes#MEMBAR}.
- *
- * @author Doug Simon
- */
-public final class MemoryBarrier extends Instruction {
-
-    /**
-     * A mask of the constants defined by {@link Bytecodes.MemoryBarriers}.
-     */
-    public final int barriers;
-
-    /**
-     * Creates a {@link MemoryBarrier} instance.
-     */
-    public MemoryBarrier(int barriers) {
-        super(CiKind.Void);
-        assert barriers != 0;
-        this.barriers = barriers;
-        setFlag(Flag.LiveSideEffect);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitMemoryBarrier(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(MemoryBarriers.barriersString(barriers));
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/NativeCall.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.c1x.value.*;
-import com.sun.cri.ri.*;
-
-/**
- * Represents a call to a native function from within a native method stub.
- *
- * @author Doug Simon
- */
-public final class NativeCall extends StateSplit {
-
-    /**
-     * The instruction that produces the native function address for this native call.
-     */
-    private Value address;
-
-    /**
-     * The native method for this native call.
-     */
-    public final RiMethod nativeMethod;
-
-    /**
-     * The signature of the call which is derived from {@link #nativeMethod} but is not
-     * the same as its {@linkplain RiMethod#signature() signature}.
-     */
-    public final RiSignature signature;
-
-    /**
-     * The list of instructions that produce the arguments for this native call.
-     */
-    public final Value[] arguments;
-
-    /**
-     * Constructs a new NativeCall instruction.
-     *
-     * @param nativeMethod TODO
-     * @param signature TODO
-     * @param address TODO
-     * @param args the list of instructions producing arguments to the invocation
-     * @param stateBefore the state before executing the invocation
-     */
-    public NativeCall(RiMethod nativeMethod, RiSignature signature, Value address, Value[] args, FrameState stateBefore) {
-        super(signature.returnKind().stackKind(), stateBefore);
-        this.address = address;
-        this.nativeMethod = nativeMethod;
-        this.arguments = args;
-        this.signature = signature;
-        assert nativeMethod.jniSymbol() != null;
-    }
-
-    /**
-     * The native function may call back into the VM which may call method that can trap.
-     */
-    @Override
-    public boolean canTrap() {
-        return true;
-    }
-
-    /**
-     * Gets the instruction that produces the native function address for this native call.
-     * @return the instruction
-     */
-    public Value address() {
-        return address;
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        for (int i = 0; i < arguments.length; i++) {
-            Value arg = arguments[i];
-            if (arg != null) {
-                arguments[i] = closure.apply(arg);
-                assert arguments[i] != null;
-            }
-        }
-        address = closure.apply(address);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitNativeCall(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(nativeMethod.jniSymbol()).print('(');
-        for (int i = 0; i < arguments.length; i++) {
-            if (i > 0) {
-                out.print(", ");
-            }
-            out.print(arguments[i]);
-        }
-        out.print(')');
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Pause.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.ci.*;
-
-/**
- * Instruction implementing the semantics of {@link Bytecodes#PAUSE}.
- *
- * @author Doug Simon
- */
-public final class Pause extends Instruction {
-
-    /**
-     * Creates a {@link Pause} instance.
-     */
-    public Pause() {
-        super(CiKind.Void);
-        setFlag(Flag.LiveSideEffect); // ensure this instruction is not eliminated
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitPause(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("pause");
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/PointerOp.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2010, 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.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.value.*;
-import com.sun.cri.ci.*;
-
-/**
- * The base class for pointer access operations.
- *
- * @author Doug Simon
- */
-public abstract class PointerOp extends StateSplit {
-
-    /**
-     * The kind of value at the address accessed by the pointer operation.
-     */
-    public final CiKind dataKind;
-
-    public final int opcode;
-    protected Value pointer;
-    protected Value displacement;
-    protected Value offsetOrIndex;
-    protected final boolean isVolatile;
-    final boolean isPrefetch;
-
-    /**
-     * Creates an instruction for a pointer operation. If {@code displacement != null}, the effective of the address of the operation is
-     * computed as the pointer plus a byte displacement plus a scaled index. Otherwise, the effective address is computed as the
-     * pointer plus a byte offset.
-     *
-     * @param kind the kind of value produced by this operation
-     * @param dataKind the kind of value at the address accessed by the pointer operation
-     * @param opcode the opcode of the instruction
-     * @param pointer the value producing the pointer
-     * @param displacement the value producing the displacement. This may be {@code null}.
-     * @param offsetOrIndex the value producing the scaled-index or the byte offset depending on whether {@code displacement} is {@code null}
-     * @param stateBefore the state before
-     * @param isVolatile {@code true} if the access is volatile
-     */
-    public PointerOp(CiKind kind, CiKind dataKind, int opcode, Value pointer, Value displacement, Value offsetOrIndex, FrameState stateBefore, boolean isVolatile) {
-        super(kind.stackKind(), stateBefore);
-        this.opcode = opcode;
-        this.pointer = pointer;
-        this.dataKind = dataKind;
-        this.displacement = displacement;
-        this.offsetOrIndex = offsetOrIndex;
-        this.isVolatile = isVolatile;
-        this.isPrefetch = false;
-        if (pointer.isNonNull()) {
-            eliminateNullCheck();
-        }
-    }
-
-    public Value pointer() {
-        return pointer;
-    }
-
-    public Value index() {
-        return offsetOrIndex;
-    }
-
-    public Value offset() {
-        return offsetOrIndex;
-    }
-
-    public Value displacement() {
-        return displacement;
-    }
-
-    @Override
-    public void runtimeCheckCleared() {
-        clearState();
-    }
-
-    /**
-     * Checks whether this field access may cause a trap or an exception, which
-     * is if it either requires a null check or needs patching.
-     * @return {@code true} if this field access can cause a trap
-     */
-    @Override
-    public boolean canTrap() {
-        return needsNullCheck();
-    }
-
-    /**
-     * Iterates over the input values to this instruction.
-     * @param closure the closure to apply to each value
-     */
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        pointer = closure.apply(pointer);
-        offsetOrIndex = closure.apply(offsetOrIndex);
-        if (displacement != null) {
-            displacement = closure.apply(displacement);
-        }
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/SignificantBitOp.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.c1x.util.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.ci.*;
-
-/**
- * Implements the {@link Bytecodes#LSB} and {@link Bytecodes#MSB} instructions.
- *
- * @author Laurent Daynes
- */
-public class SignificantBitOp extends Instruction {
-    Value value;
-
-    /**
-     * This will be {@link Bytecodes#LSB} or {@link Bytecodes#MSB}.
-     */
-    public final int op;
-
-    /**
-     * Create a a new SignificantBitOp instance.
-     *
-     * @param value the instruction producing the value that is input to this instruction
-     * @param opcodeop either {@link Bytecodes#LSB} or {@link Bytecodes#MSB}
-     */
-    public SignificantBitOp(Value value, int opcodeop) {
-        super(CiKind.Int);
-        assert opcodeop == Bytecodes.LSB || opcodeop == Bytecodes.MSB;
-        this.value = value;
-        this.op = opcodeop;
-    }
-
-    /**
-     * Gets the instruction producing input to this instruction.
-     * @return the instruction that produces this instruction's input
-     */
-    public Value value() {
-        return value;
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        value = closure.apply(value);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitSignificantBit(this);
-    }
-
-    @Override
-    public int valueNumber() {
-        return Util.hash1(op, value);
-    }
-
-    @Override
-    public boolean valueEqual(Instruction i) {
-        if (i instanceof SignificantBitOp) {
-            SignificantBitOp o = (SignificantBitOp) i;
-            // FIXME: this is a conservative estimate. If x is a single-bit value
-            // (i.e., a power of 2), then the values are equal regardless of the value of the most field.
-            return value == o.value && op == o.op;
-        }
-        return false;
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(Bytecodes.nameOf(op) + " [").print(this).print("] ");
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/StackAllocate.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.ci.*;
-
-/**
- * Instruction implementing the semantics of {@link Bytecodes#ALLOCA}.
- *
- * @author Doug Simon
- */
-public final class StackAllocate extends Instruction {
-
-    private Value size;
-
-    /**
-     * Creates a new StackAllocate instance.
-     */
-    public StackAllocate(Value size) {
-        super(CiKind.Word);
-        this.size = size;
-        setFlag(Flag.NonNull);
-        eliminateNullCheck();
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitStackAllocate(this);
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        size = closure.apply(size);
-    }
-
-    /**
-     * Gets the instruction that produced the size argument.
-     */
-    public Value size() {
-        return size;
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("alloca(").print(size).print(")");
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/StackHandle.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.ci.*;
-
-/**
- * Instruction implementing the semantics of {@link Bytecodes#STACKHANDLE}.
- *
- * @author Doug Simon
- */
-public final class StackHandle extends Instruction {
-
-    /**
-     * The value that will be used to initialize the stack slot by allocated by this instruction.
-     */
-    private Value value;
-
-    /**
-     * Creates a new LoadStackAddress instance.
-     */
-    public StackHandle(Value value) {
-        super(CiKind.Word);
-        setFlag(Flag.NonNull);
-        this.value = value;
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitAllocateStackHandle(this);
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        value = closure.apply(value);
-    }
-
-    /**
-     * Gets the instruction that produced the size argument.
-     */
-    public Value value() {
-        return value;
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("stackHandle(").print(value).print(")");
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/StorePointer.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.c1x.value.*;
-import com.sun.cri.ci.*;
-
-/**
- * The {@code StorePointer} instruction represents a write of a pointer.
- * This instruction is part of the HIR support for low-level operations, such as safepoints,
- * stack banging, etc, and does not correspond to a Java operation.
- *
- * @author Ben L. Titzer
- * @author Doug Simon
- */
-public final class StorePointer extends PointerOp {
-
-    Value value;
-
-    /**
-     * Creates an instruction for a pointer store. If {@code displacement != null}, the effective of the address of the store is
-     * computed as the pointer plus a byte displacement plus a scaled index. Otherwise, the effective address is computed as the
-     * pointer plus a byte offset.
-     * @param dataKind the kind of value at the address accessed by the pointer operation
-     * @param pointer the value producing the pointer
-     * @param displacement the value producing the displacement. This may be {@code null}.
-     * @param offsetOrIndex the value producing the scaled-index or the byte offset depending on whether {@code displacement} is {@code null}
-     * @param value the value to write to the pointer
-     * @param stateBefore the state before
-     * @param isVolatile {@code true} if the access is volatile
-     */
-    public StorePointer(int opcode, CiKind dataKind, Value pointer, Value displacement, Value offsetOrIndex, Value value, FrameState stateBefore, boolean isVolatile) {
-        super(CiKind.Void, dataKind, opcode, pointer, displacement, offsetOrIndex, stateBefore, isVolatile);
-        this.value = value;
-        setFlag(Flag.LiveStore);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitStorePointer(this);
-    }
-
-    public Value value() {
-        return value;
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        super.inputValuesDo(closure);
-        value = closure.apply(value);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("*(").print(pointer);
-        if (displacement() == null) {
-            out.print(" + ").print(offset());
-        } else {
-            out.print(" + ").print(displacement()).print(" + (").print(index()).print(" * sizeOf(" + dataKind.name() + "))");
-        }
-        out.print(") := ").print(value());
-    }
-
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/StoreRegister.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.ci.*;
-
-/**
- * The {@code StoreRegister} instruction represents a write of a physical register.
- * This instruction is part of the HIR support for low-level operations, such as safepoints,
- * stack banging, etc, and does not correspond to a Java operation.
- *
- * @author Ben L. Titzer
- */
-public final class StoreRegister extends Instruction {
-
-    public final CiRegister register;
-    Value value;
-
-    /**
-     * Creates a new StoreReigster instance.
-     * @param kind the kind of value stored to the register
-     * @param register the register to store
-     * @param value the value to write
-     */
-    public StoreRegister(CiKind kind, CiRegister register, Value value) {
-        super(kind);
-        this.register = register;
-        this.value = value;
-        setFlag(Flag.LiveStore);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitStoreRegister(this);
-    }
-
-    public Value value() {
-        return value;
-    }
-
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        value = closure.apply(value);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(register.toString()).print(" := ").print(value());
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/UnsafeCast.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-
-/**
- * The {@code UnsafeCast} instruction represents a {@link Bytecodes#UNSAFE_CAST}.
- *
- * @author Doug Simon
- */
-public final class UnsafeCast extends Instruction {
-
-    public final RiType toType;
-
-    /**
-     * The instruction that produced the value being unsafe cast.
-     */
-    private Value value;
-
-    /**
-     * Denotes if this is a redundant cast at the machine level. That is the source
-     * and the destination kind are implemented by the same machine kind.
-     */
-    public final boolean redundant;
-
-    /**
-     * Creates a new UnsafeCast instruction.
-     *
-     * @param toType the the being cast to
-     * @param value the value being cast
-     */
-    public UnsafeCast(RiType toType, Value value, boolean redundant) {
-        super(toType.kind().stackKind());
-        this.toType = toType;
-        this.value = value;
-        this.redundant = redundant;
-    }
-
-    /**
-     * Gets the first non-redundant value derived from this value. If this
-     * value is not {@linkplain #redundant}, then it is returned. Otherwise,
-     * the first value found by following {@link #value()} that is not an
-     * unsafe cast or is not redundant is returned.
-     */
-    public Value nonRedundantReplacement() {
-        if (!redundant) {
-            return this;
-        }
-        if (!(value instanceof UnsafeCast)) {
-            return value;
-        }
-        return ((UnsafeCast) value).nonRedundantReplacement();
-    }
-
-    /**
-     * Gets the instruction that produced the value being unsafe cast.
-     */
-    public Value value() {
-        return value;
-    }
-
-    @Override
-    public RiType declaredType() {
-        return toType;
-    }
-
-    @Override
-    public RiType exactType() {
-        return declaredType().exactType();
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitUnsafeCast(this);
-    }
-
-    /**
-     * Iterates over the input values to this instruction.
-     * @param closure the closure to apply
-     */
-    @Override
-    public void inputValuesDo(ValueClosure closure) {
-        value = closure.apply(value);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("unsafe_cast(").
-        print(value).
-        print(") ").
-        print(CiUtil.toJavaName(toType));
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/UnsignedCompareOp.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.ir;
-
-import com.sun.c1x.debug.*;
-import com.sun.cri.bytecode.*;
-import com.sun.cri.bytecode.Bytecodes.UnsignedComparisons;
-import com.sun.cri.ci.*;
-
-/**
- * Unsigned comparisons.
- *
- * @author Mick Jordan
- * @see UnsignedComparisons
- */
-public final class UnsignedCompareOp extends Op2 {
-
-    /**
-     * One of the constants defined in {@link UnsignedComparisons} denoting the type of this comparison.
-     */
-    public final int op;
-
-    /**
-     * Creates a new compare operation.
-     *
-     * @param opcode the bytecode opcode
-     * @param op the comparison type
-     * @param x the first input
-     * @param y the second input
-     */
-    public UnsignedCompareOp(int opcode, int op, Value x, Value y) {
-        super(CiKind.Int, opcode, x, y);
-        assert opcode == Bytecodes.UWCMP || opcode == Bytecodes.UCMP;
-        this.op = op;
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitUnsignedCompareOp(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print(x()).
-        print(' ').
-        print(Bytecodes.operator(opcode)).
-        print(' ').
-        print(y());
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/ValueVisitor.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ValueVisitor.java	Wed Apr 27 15:36:29 2011 +0200
@@ -37,10 +37,8 @@
     public abstract void visitBase(Base i);
     public abstract void visitBoundsCheck(BoundsCheck boundsCheck);
     public abstract void visitBlockBegin(BlockBegin i);
-    public abstract void visitBreakpointTrap(BreakpointTrap i);
     public abstract void visitCheckCast(CheckCast i);
     public abstract void visitCompareOp(CompareOp i);
-    public abstract void visitCompareAndSwap(CompareAndSwap i);
     public abstract void visitConstant(Constant i);
     public abstract void visitConvert(Convert i);
     public abstract void visitExceptionObject(ExceptionObject i);
@@ -52,19 +50,12 @@
     public abstract void visitInvoke(Invoke i);
     public abstract void visitLoadField(LoadField i);
     public abstract void visitLoadIndexed(LoadIndexed i);
-    public abstract void visitIncrementRegister(IncrementRegister i);
-    public abstract void visitInfopoint(Infopoint i);
-    public abstract void visitLoadPointer(LoadPointer i);
-    public abstract void visitAllocateStackHandle(StackHandle i);
-    public abstract void visitLoadRegister(LoadRegister i);
     public abstract void visitLocal(Local i);
     public abstract void visitLogicOp(LogicOp i);
     public abstract void visitLookupSwitch(LookupSwitch i);
-    public abstract void visitMemoryBarrier(MemoryBarrier memoryBarrier);
     public abstract void visitMonitorAddress(MonitorAddress monitorAddress);
     public abstract void visitMonitorEnter(MonitorEnter i);
     public abstract void visitMonitorExit(MonitorExit i);
-    public abstract void visitNativeCall(NativeCall i);
     public abstract void visitNegateOp(NegateOp i);
     public abstract void visitNewInstance(NewInstance i);
     public abstract void visitNewMultiArray(NewMultiArray i);
@@ -73,27 +64,20 @@
     public abstract void visitNewTypeArray(NewTypeArray i);
     public abstract void visitNullCheck(NullCheck i);
     public abstract void visitOsrEntry(OsrEntry i);
-    public abstract void visitPause(Pause i);
     public abstract void visitPhi(Phi i);
     public abstract void visitResolveClass(ResolveClass i);
     public abstract void visitReturn(Return i);
     public abstract void visitShiftOp(ShiftOp i);
-    public abstract void visitSignificantBit(SignificantBitOp i);
-    public abstract void visitStackAllocate(StackAllocate i);
     public abstract void visitStoreField(StoreField i);
     public abstract void visitStoreIndexed(StoreIndexed i);
-    public abstract void visitStorePointer(StorePointer i);
-    public abstract void visitStoreRegister(StoreRegister i);
     public abstract void visitTableSwitch(TableSwitch i);
     public abstract void visitTemplateCall(TemplateCall templateCall);
     public abstract void visitThrow(Throw i);
     public abstract void visitTypeEqualityCheck(TypeEqualityCheck typeEqualityCheck);
-    public abstract void visitUnsafeCast(UnsafeCast i);
     public abstract void visitUnsafeGetObject(UnsafeGetObject i);
     public abstract void visitUnsafeGetRaw(UnsafeGetRaw i);
     public abstract void visitUnsafePrefetchRead(UnsafePrefetchRead i);
     public abstract void visitUnsafePrefetchWrite(UnsafePrefetchWrite i);
     public abstract void visitUnsafePutObject(UnsafePutObject i);
     public abstract void visitUnsafePutRaw(UnsafePutRaw i);
-    public abstract void visitUnsignedCompareOp(UnsignedCompareOp i);
 }
--- a/graal/GraalCompiler/src/com/sun/c1x/opt/NullCheckEliminator.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/opt/NullCheckEliminator.java	Wed Apr 27 15:36:29 2011 +0200
@@ -374,22 +374,6 @@
     }
 
     @Override
-    public void visitLoadPointer(LoadPointer i) {
-        Value pointer = i.pointer();
-        if (pointer != null) {
-            processUse(i, pointer, true);
-        }
-    }
-
-    @Override
-    public void visitUnsafeCast(UnsafeCast i) {
-        if (processUse(i, i.value(), false)) {
-            // if the object is non null, the result of the cast is as well
-            i.setFlag(Value.Flag.NonNull);
-        }
-    }
-
-    @Override
     public void visitLoadField(LoadField i) {
         Value object = i.object();
         if (object != null) {
@@ -398,14 +382,6 @@
     }
 
     @Override
-    public void visitStorePointer(StorePointer i) {
-        Value pointer = i.pointer();
-        if (pointer != null) {
-            processUse(i, pointer, true);
-        }
-    }
-
-    @Override
     public void visitStoreField(StoreField i) {
         Value object = i.object();
         if (object != null) {
@@ -542,10 +518,6 @@
         int index = getValueInfo(value).globalIndex;
         bitmap.grow(index + 1);
         bitmap.set(index);
-        if (value instanceof UnsafeCast) {
-            // An unsafe cast is just an alias
-            setValue(((UnsafeCast) value).value(), bitmap);
-        }
     }
 
     private boolean checkValue(Value value, CiBitMap bitmap) {
--- a/graal/GraalCompiler/src/com/sun/c1x/opt/UnsafeCastEliminator.java	Wed Apr 27 15:12:29 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.c1x.opt;
-
-import com.sun.c1x.graph.*;
-import com.sun.c1x.ir.*;
-import com.sun.c1x.value.*;
-
-/**
- * A mechanism to remove {@linkplain UnsafeCast#redundant redundant} unsafe casts.
- *
- * @author Doug Simon
- */
-public class UnsafeCastEliminator implements ValueClosure, BlockClosure {
-
-    final IR ir;
-
-    /**
-     * Eliminates redundant unsafe casts from a given IR.
-     */
-    public UnsafeCastEliminator(IR ir) {
-        this.ir = ir;
-        ir.startBlock.iterateAnyOrder(this, false);
-    }
-
-    public void apply(BlockBegin block) {
-        if (block.isExceptionEntry()) {
-            for (FrameState ehState : block.exceptionHandlerStates()) {
-                ehState.valuesDo(this);
-            }
-        }
-
-        Instruction i = block;
-        while (i != null) {
-            FrameState stateBefore = i.stateBefore();
-            if (stateBefore != null) {
-                stateBefore.valuesDo(this);
-            }
-            i.inputValuesDo(this);
-            FrameState stateAfter = i.stateAfter();
-            if (stateAfter != null) {
-                stateAfter.valuesDo(this);
-            }
-            i = i.next();
-        }
-    }
-
-    public Value apply(Value i) {
-        if (i instanceof UnsafeCast) {
-            Value y = ((UnsafeCast) i).nonRedundantReplacement();
-            assert y != null;
-            return y;
-        }
-        return i;
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java	Wed Apr 27 15:36:29 2011 +0200
@@ -23,8 +23,6 @@
 
 package com.sun.c1x.target.amd64;
 
-import static com.sun.cri.bytecode.Bytecodes.UnsignedComparisons.*;
-
 import com.sun.c1x.*;
 import com.sun.c1x.alloc.OperandPool.VariableFlag;
 import com.sun.c1x.gen.*;
@@ -145,19 +143,6 @@
         setResult(x, reg);
     }
 
-    @Override
-    public void visitSignificantBit(SignificantBitOp x) {
-        LIRItem value = new LIRItem(x.value(), this);
-        value.setDestroysRegister();
-        value.loadItem();
-        CiValue reg = createResultVariable(x);
-        if (x.op == Bytecodes.LSB) {
-            lir.lsb(value.result(), reg);
-        } else {
-            lir.msb(value.result(), reg);
-        }
-    }
-
     public boolean livesLonger(Value x, Value y) {
         BlockBegin bx = x.block();
         BlockBegin by = y.block();
@@ -464,65 +449,6 @@
     }
 
     @Override
-    public void visitUnsignedCompareOp(UnsignedCompareOp x) {
-        LIRItem left = new LIRItem(x.x(), this);
-        LIRItem right = new LIRItem(x.y(), this);
-        left.loadItem();
-        right.loadItem();
-        Condition condition = null;
-        switch (x.op) {
-            case BELOW_THAN  : condition = Condition.BT; break;
-            case ABOVE_THAN  : condition = Condition.AT; break;
-            case BELOW_EQUAL : condition = Condition.BE; break;
-            case ABOVE_EQUAL : condition = Condition.AE; break;
-            default:
-                Util.unimplemented();
-        }
-        CiValue result = createResultVariable(x);
-        lir.cmp(condition, left.result(), right.result());
-        lir.cmove(condition, CiConstant.INT_1, CiConstant.INT_0, result);
-    }
-
-    @Override
-    public void visitCompareAndSwap(CompareAndSwap x) {
-
-        // (tw) TODO: Factor out common code with genCompareAndSwap.
-
-        CiKind dataKind = x.dataKind;
-        CiValue tempPointer = load(x.pointer());
-        CiAddress addr = getAddressForPointerOp(x, dataKind, tempPointer);
-
-        CiValue expectedValue = force(x.expectedValue(), AMD64.rax.asValue(dataKind));
-        CiValue newValue = load(x.newValue());
-        assert Util.archKindsEqual(newValue.kind, dataKind) : "invalid type";
-
-        if (dataKind.isObject()) { // Write-barrier needed for Object fields.
-            // Do the pre-write barrier : if any.
-            preGCWriteBarrier(addr, false, null);
-        }
-
-        CiValue pointer = newVariable(CiKind.Word);
-        lir.lea(addr, pointer);
-        CiValue result = createResultVariable(x);
-        CiValue resultReg = AMD64.rax.asValue(dataKind);
-        if (dataKind.isObject()) {
-            lir.casObj(pointer, expectedValue, newValue);
-        } else if (dataKind.isInt()) {
-            lir.casInt(pointer, expectedValue, newValue);
-        } else {
-            assert dataKind.isLong() || dataKind.isWord();
-            lir.casLong(pointer, expectedValue, newValue);
-        }
-
-        lir.move(resultReg, result);
-
-        if (dataKind.isObject()) { // Write-barrier needed for Object fields.
-            // Seems to be precise
-            postGCWriteBarrier(pointer, newValue);
-        }
-    }
-
-    @Override
     protected void genCompareAndSwap(Intrinsic x, CiKind kind) {
         assert x.numberOfArguments() == 5 : "wrong number of arguments: " + x.numberOfArguments();
         // Argument 0 is the receiver.
--- a/graal/GraalCompiler/src/com/sun/c1x/value/MutableFrameState.java	Wed Apr 27 15:12:29 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/value/MutableFrameState.java	Wed Apr 27 15:36:29 2011 +0200
@@ -24,7 +24,6 @@
 
 import java.util.*;
 
-import com.sun.c1x.*;
 import com.sun.c1x.ir.*;
 import com.sun.c1x.util.*;
 import com.sun.cri.ci.*;
@@ -267,42 +266,42 @@
     }
 
     private static Value assertKind(CiKind kind, Value x) {
-        assert x != null && (x.kind == kind || !isTypesafe()) : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.kind);
+        assert x != null && (x.kind == kind) : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.kind);
         return x;
     }
 
     private static Value assertLong(Value x) {
-        assert x != null && (x.kind == CiKind.Long || !isTypesafe());
+        assert x != null && (x.kind == CiKind.Long);
         return x;
     }
 
     private static Value assertJsr(Value x) {
-        assert x != null && (x.kind == CiKind.Jsr || !isTypesafe());
+        assert x != null && (x.kind == CiKind.Jsr);
         return x;
     }
 
     private static Value assertInt(Value x) {
-        assert x != null && (x.kind == CiKind.Int || !isTypesafe());
+        assert x != null && (x.kind == CiKind.Int);
         return x;
     }
 
     private static Value assertFloat(Value x) {
-        assert x != null && (x.kind == CiKind.Float || !isTypesafe());
+        assert x != null && (x.kind == CiKind.Float);
         return x;
     }
 
     private static Value assertObject(Value x) {
-        assert x != null && (x.kind == CiKind.Object || !isTypesafe());
+        assert x != null && (x.kind == CiKind.Object);
         return x;
     }
 
     private static Value assertWord(Value x) {
-        assert x != null && (x.kind == CiKind.Word || !isTypesafe());
+        assert x != null && (x.kind == CiKind.Word);
         return x;
     }
 
     private static Value assertDouble(Value x) {
-        assert x != null && (x.kind == CiKind.Double || !isTypesafe());
+        assert x != null && (x.kind == CiKind.Double);
         return x;
     }
 
@@ -352,13 +351,6 @@
         return copy(bci, true, true, true);
     }
 
-    /**
-     * Determines if the current compilation is typesafe.
-     */
-    private static boolean isTypesafe() {
-        return C1XCompilation.compilation().isTypesafe();
-    }
-
     private static void assertHigh(Value x) {
         assert x == null;
     }