changeset 2833:1cd59ca9ac86

Removed Throw HIR instruction. Removed special handling for exceptions in register allocator.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Tue, 31 May 2011 13:30:23 +0200
parents 775c31be565c
children c1c8a0291771 a75ef246fab3
files graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java graal/GraalCompiler/src/com/sun/c1x/alloc/RegisterVerifier.java graal/GraalCompiler/src/com/sun/c1x/asm/TargetMethodAssembler.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/ComputeLinearScanOrder.java graal/GraalCompiler/src/com/sun/c1x/ir/NullCheck.java graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java graal/GraalCompiler/src/com/sun/c1x/ir/ValueVisitor.java graal/GraalCompiler/src/com/sun/c1x/lir/LIRAssembler.java graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java graal/GraalCompiler/src/com/sun/c1x/lir/LIRDebugInfo.java graal/GraalCompiler/src/com/sun/c1x/lir/LIRInstruction.java graal/GraalCompiler/src/com/sun/c1x/lir/LIRList.java graal/GraalCompiler/src/com/sun/c1x/lir/LIROpcode.java graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRAssembler.java
diffstat 19 files changed, 50 insertions(+), 278 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java	Tue May 31 13:30:23 2011 +0200
@@ -34,7 +34,6 @@
     private final List<Block> successors = new ArrayList<Block>();
     private final List<Block> predecessors = new ArrayList<Block>();
     private List<Node> instructions = new ArrayList<Node>();
-    private boolean exceptionEntry;
     private Block dominator;
     private final List<Block> dominators = new ArrayList<Block>();
 
@@ -93,14 +92,6 @@
         return blockID;
     }
 
-    public void setExceptionEntry(boolean b) {
-        exceptionEntry = b;
-    }
-
-    public boolean isExceptionEntry() {
-        return exceptionEntry;
-    }
-
     /**
      * Iterate over this block, its exception handlers, and its successors, in that order.
      *
--- a/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java	Tue May 31 13:30:23 2011 +0200
@@ -86,7 +86,7 @@
     }
 
     public static boolean isBlockEnd(Node n) {
-        return trueSuccessorCount(n) > 1 || n instanceof Anchor || n instanceof Return || n instanceof Throw;
+        return trueSuccessorCount(n) > 1 || n instanceof Anchor || n instanceof Return || n instanceof Unwind;
     }
 
     private void identifyBlocks() {
@@ -128,7 +128,6 @@
                     // We have a single predecessor => check its successor count.
                     if (isBlockEnd(singlePred)) {
                         Block b = assignBlock(n);
-                        b.setExceptionEntry(singlePred instanceof Throw);
                         blockBeginNodes.add(n);
                     } else {
                         assignBlock(n, nodeToBlock.get(singlePred));
@@ -395,9 +394,6 @@
         for (Block b : blocks) {
            TTY.println();
            TTY.print(b.toString());
-           if (b.isExceptionEntry()) {
-               TTY.print(" (ex)");
-           }
 
            TTY.print(" succs=");
            for (Block succ : b.getSuccessors()) {
--- a/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java	Tue May 31 13:30:23 2011 +0200
@@ -746,8 +746,6 @@
 
         // Perform a backward dataflow analysis to compute liveOut and liveIn for each block.
         // The loop is executed until a fixpoint is reached (no changes in an iteration)
-        // Exception handlers must be processed because not all live values are
-        // present in the state array, e.g. because of global value numbering
         do {
             changeOccurred = false;
 
@@ -1974,13 +1972,6 @@
             }
 
             if (op.info != null) {
-                // exception handling
-//                if (compilation.hasExceptionHandlers()) {
-//                    if (op.exceptionEdge() != null && op.exceptionEdge().lir() != null) {
-//                        assignLocations(op.exceptionEdge().lir().instructionsList(), iw);
-//                    }
-//                }
-
                 // compute reference map and debug information
                 computeDebugInfo(iw, op);
             }
--- a/graal/GraalCompiler/src/com/sun/c1x/alloc/RegisterVerifier.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/alloc/RegisterVerifier.java	Tue May 31 13:30:23 2011 +0200
@@ -101,7 +101,7 @@
         } while (!workList.isEmpty());
     }
 
-    void processBlock(LIRBlock block) {
+    private void processBlock(LIRBlock block) {
         if (C1XOptions.TraceLinearScanLevel >= 2) {
             TTY.println();
             TTY.println("processBlock B%d", block.blockID());
@@ -133,21 +133,7 @@
         }
     }
 
-    void processXhandler(LIRBlock xhandler, Interval[] inputState) {
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
-            TTY.println("processXhandler B%d", xhandler.blockID());
-        }
-
-        // must copy state because it is modified
-        inputState = copy(inputState);
-
-        if (xhandler.lir() != null) {
-            processOperations(xhandler.lir(), inputState);
-        }
-        processSuccessor(xhandler, inputState);
-    }
-
-    void processSuccessor(LIRBlock block, Interval[] inputState) {
+    private void processSuccessor(LIRBlock block, Interval[] inputState) {
         Interval[] savedState = stateForBlock(block);
 
         if (savedState != null) {
@@ -258,11 +244,6 @@
                 }
             }
 
-            // process xhandler before output and temp operands
-            if (op.exceptionEdge() != null) {
-                processXhandler(op.exceptionEdge(), inputState);
-            }
-
             // set temp operands (some operations use temp operands also as output operands, so can't set them null)
             n = op.operandCount(LIRInstruction.OperandMode.Temp);
             for (int j = 0; j < n; j++) {
--- a/graal/GraalCompiler/src/com/sun/c1x/asm/TargetMethodAssembler.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/asm/TargetMethodAssembler.java	Tue May 31 13:30:23 2011 +0200
@@ -140,11 +140,11 @@
 
     public void recordExceptionHandlers(int pcOffset, LIRDebugInfo info) {
         if (info != null) {
-            if (info.exceptionEdge != null) {
+            if (info.exceptionEdge() != null) {
                 if (exceptionInfoList == null) {
                     exceptionInfoList = new ArrayList<ExceptionInfo>(4);
                 }
-                exceptionInfoList.add(new ExceptionInfo(pcOffset, info.exceptionEdge, info.state.bci));
+                exceptionInfoList.add(new ExceptionInfo(pcOffset, info.exceptionEdge(), info.state.bci));
             }
         }
     }
@@ -155,7 +155,7 @@
             assert lastSafepointPos < pcOffset;
             lastSafepointPos = pcOffset;
             targetMethod.recordSafepoint(pcOffset, info.debugInfo());
-            recordExceptionHandlers(pcOffset, info);
+            assert info.exceptionEdge() == null;
         }
     }
 
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Tue May 31 13:30:23 2011 +0200
@@ -216,7 +216,7 @@
         public final LIRDebugInfo info;
 
         public DeoptimizationStub(FrameState state) {
-            info = new LIRDebugInfo(state, null);
+            info = new LIRDebugInfo(state);
         }
     }
 
@@ -477,6 +477,9 @@
         RiMethod target = x.target();
         LIRDebugInfo info = stateFor(x, stateBeforeInvokeWithArguments(x));
         LIRDebugInfo info2 = stateFor(x, stateBeforeInvokeReturn(x));
+        if (x.exceptionEdge() != null) {
+            info2.setExceptionEdge(getLIRBlock(x.exceptionEdge()));
+        }
 
         XirSnippet snippet = null;
 
@@ -880,20 +883,6 @@
     }
 
     @Override
-    public void visitThrow(Throw x) {
-        setNoResult(x);
-        CiValue exceptionOpr = load(x.exception());
-        LIRDebugInfo info = stateFor(x, x.stateBefore());
-
-        // move exception oop into fixed register
-        CiCallingConvention callingConvention = compilation.frameMap().getCallingConvention(new CiKind[]{CiKind.Object}, RuntimeCall);
-        CiValue argumentOperand = callingConvention.locations[0];
-        lir.move(exceptionOpr, argumentOperand);
-
-        lir.throwException(CiValue.IllegalValue, argumentOperand, info);
-    }
-
-    @Override
     public void visitDeoptimize(Deoptimize deoptimize) {
         DeoptimizationStub stub = new DeoptimizationStub(lastState);
         addDeoptimizationStub(stub);
@@ -1488,16 +1477,7 @@
         if (compilation.placeholderState != null) {
             state = compilation.placeholderState;
         }
-
-        assert state != null;
-        LIRBlock exceptionEdge = null;
-        if (x instanceof ExceptionEdgeInstruction) {
-            Instruction begin = ((ExceptionEdgeInstruction) x).exceptionEdge();
-            if (begin != null) {
-                exceptionEdge = getLIRBlock(begin);
-            }
-        }
-        return new LIRDebugInfo(state, exceptionEdge);
+        return new LIRDebugInfo(state);
     }
 
     List<CiValue> visitInvokeArguments(CiCallingConvention cc, Invoke x, List<CiValue> pointerSlots) {
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Tue May 31 13:30:23 2011 +0200
@@ -337,11 +337,7 @@
         return handler.catchTypeCPI() == 0;
     }
 
-    private void handleException(Instruction x, int bci) {
-        if (!hasHandler()) {
-            return;
-        }
-
+    private Instruction handleException(Value exceptionObject, int bci) {
         assert bci == Instruction.SYNCHRONIZATION_ENTRY_BCI || bci == bci() : "invalid bci";
 
         RiExceptionHandler firstHandler = null;
@@ -388,19 +384,23 @@
 
             StateSplit entry = new Placeholder(graph);
             entry.setStateBefore(entryState);
-            ExceptionObject exception = new ExceptionObject(graph);
-            entry.setNext(exception);
-            FrameState stateWithException = entryState.duplicateModified(bci, CiKind.Void, exception);
+
+            Instruction currentNext = entry;
+            Value currentExceptionObject = exceptionObject;
+            if (currentExceptionObject == null) {
+                ExceptionObject exception = new ExceptionObject(graph);
+                entry.setNext(exception);
+                currentNext = exception;
+                currentExceptionObject = exception;
+            }
+            FrameState stateWithException = entryState.duplicateModified(bci, CiKind.Void, currentExceptionObject);
 
             Instruction successor = createTarget(dispatchBlock, stateWithException);
             Anchor end = new Anchor(successor, graph);
-            exception.setNext(end);
-            if (x instanceof Invoke) {
-                ((Invoke) x).setExceptionEdge(entry);
-            } else {
-                ((Throw) x).setExceptionEdge(entry);
-            }
+            currentNext.setNext(end);
+            return entry;
         }
+        return null;
     }
 
     private void genLoadConstant(int cpi) {
@@ -608,11 +608,13 @@
     }
 
     private void genThrow(int bci) {
-        FrameState stateBefore = frameState.create(bci);
-        Throw t = new Throw(frameState.apop(), graph);
-        t.setStateBefore(stateBefore);
-        appendWithBCI(t);
-        handleException(t, bci);
+        Value exception = frameState.apop();
+        append(new NullCheck(exception, graph));
+        Instruction entry = handleException(exception, bci);
+        if (entry == null) {
+            entry = new Unwind(exception, graph);
+        }
+        append(entry);
     }
 
     private void genCheckCast() {
@@ -831,7 +833,7 @@
         CiKind resultType = returnKind(target);
         Invoke invoke = new Invoke(bci(), opcode, resultType.stackKind(), args, target, target.signature().returnType(compilation.method.holder()), graph);
         Value result = appendWithBCI(invoke);
-        handleException(invoke, bci());
+        invoke.setExceptionEdge(handleException(null, bci()));
         frameState.pushReturn(resultType, result);
     }
 
@@ -1009,7 +1011,7 @@
     }
 
     private Value appendWithBCI(Instruction x) {
-        assert x.next() == null && x.predecessors().size() == 0 : "instruction should not have been appended yet";
+        assert x.predecessors().size() == 0 : "instruction should not have been appended yet";
         assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")";
         lastInstr.setNext(x);
 
@@ -1493,12 +1495,4 @@
     private Block removeFromWorkList() {
         return workList.poll();
     }
-
-    /**
-     * Checks whether this graph has any handlers.
-     * @return {@code true} if there are any exception handlers
-     */
-    private boolean hasHandler() {
-        return Modifier.isSynchronized(compilation.method.accessFlags()) || (compilation.method.exceptionHandlers() != null && compilation.method.exceptionHandlers().length > 0);
-    }
 }
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Tue May 31 13:30:23 2011 +0200
@@ -88,7 +88,6 @@
         Map<Block, LIRBlock> map = new HashMap<Block, LIRBlock>();
         for (Block b : blocks) {
             LIRBlock block = new LIRBlock(b.blockID());
-            block.setExceptionEntry(b.isExceptionEntry());
             map.put(b, block);
             block.setInstructions(b.getInstructions());
             block.setLinearScanNumber(b.blockID());
@@ -100,11 +99,7 @@
 
         for (Block b : blocks) {
             for (Block succ : b.getSuccessors()) {
-//                if (succ.isExceptionEntry()) {
-//                    map.get(b).getExceptionHandlerSuccessors().add(map.get(succ));
-//                } else {
-                    map.get(b).blockSuccessors().add(map.get(succ));
-//                }
+                map.get(b).blockSuccessors().add(map.get(succ));
             }
 
             for (Block pred : b.getPredecessors()) {
@@ -112,16 +107,10 @@
             }
         }
 
-
-     // TODO(tw): Schedule nodes within a block.
-
-
         CriticalEdgeFinder finder = new CriticalEdgeFinder(lirBlocks, compilation.graph);
         finder.splitCriticalEdges();
 
-
         orderedBlocks = lirBlocks;
-
         valueToBlock = new HashMap<Node, LIRBlock>();
         for (LIRBlock b : orderedBlocks) {
             for (Node i : b.getInstructions()) {
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java	Tue May 31 13:30:23 2011 +0200
@@ -162,16 +162,6 @@
             cur.setBackwardBranchTarget(true);
             parent.setLinearScanLoopEnd();
 
-            // When a loop header is also the start of an exception handler, then the backward branch is
-            // an exception edge. Because such edges are usually critical edges which cannot be split, the
-            // loop must be excluded here from processing.
-            if (cur.isExceptionEntry()) {
-                // Make sure that dominators are correct in this weird situation
-                iterativeDominators = true;
-                return;
-            }
-//            assert parent.numberOfSux() == 1 && parent.suxAt(0) == cur : "loop end blocks must have one successor (critical edges are split)";
-
             loopEndBlocks.add(parent);
             return;
         }
@@ -374,10 +364,10 @@
 //        curBit--;
 
         // exceptions handlers are added as late as possible
-        if (!cur.isExceptionEntry()) {
-            weight |= 1 << curBit;
-        }
-        curBit--;
+//        if (!cur.isExceptionEntry()) {
+//            weight |= 1 << curBit;
+//        }
+//        curBit--;
 
         // guarantee that weight is > 0
         weight |= 1;
@@ -502,7 +492,6 @@
             for (LIRBlock cur : linearScanOrder) {
                 TTY.print(String.format("%4d: B%02d    loop: %2d  depth: %2d", cur.linearScanNumber(), cur.blockID(), cur.loopIndex(), cur.loopDepth()));
 
-                TTY.print(cur.isExceptionEntry() ? " ex" : "   ");
                 TTY.print(cur.isLinearScanLoopHeader() ? " lh" : "   ");
                 TTY.print(cur.isLinearScanLoopEnd() ? " le" : "   ");
 
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/NullCheck.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/NullCheck.java	Tue May 31 13:30:23 2011 +0200
@@ -31,7 +31,7 @@
 /**
  * The {@code NullCheck} class represents an explicit null check instruction.
  */
-public final class NullCheck extends Value {
+public final class NullCheck extends Instruction {
 
     private static final int INPUT_COUNT = 1;
     private static final int INPUT_OBJECT = 0;
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java	Tue May 31 11:50:19 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +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.oracle.graal.graph.*;
-import com.sun.c1x.debug.*;
-import com.sun.c1x.value.*;
-import com.sun.cri.ci.*;
-
-/**
- * The {@code Throw} instruction represents a throw of an exception.
- */
-public final class Throw extends Instruction implements ExceptionEdgeInstruction {
-
-    private static final int INPUT_COUNT = 2;
-    private static final int INPUT_EXCEPTION = 0;
-    private static final int INPUT_STATE_BEFORE = 1;
-
-    private static final int SUCCESSOR_COUNT = 1;
-    private static final int SUCCESSOR_EXCEPTION_EDGE = 0;
-
-    @Override
-    protected int inputCount() {
-        return super.inputCount() + INPUT_COUNT;
-    }
-
-    @Override
-    protected int successorCount() {
-        return super.successorCount() + SUCCESSOR_COUNT;
-    }
-
-    /**
-     * The instruction which produces the exception to throw.
-     */
-     public Value exception() {
-        return (Value) inputs().get(super.inputCount() + INPUT_EXCEPTION);
-    }
-
-    public Value setException(Value n) {
-        return (Value) inputs().set(super.inputCount() + INPUT_EXCEPTION, n);
-    }
-
-    /**
-     * The state for this instruction.
-     */
-    public FrameState stateBefore() {
-        return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE);
-    }
-
-    public FrameState setStateBefore(FrameState n) {
-        return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n);
-    }
-
-    /**
-     * The entry to the exception dispatch chain for this throw.
-     * TODO ls: this needs more cleanup - throw should either unwind or jump to the exception dispatch chain
-     */
-    @Override
-    public Instruction exceptionEdge() {
-        return (Instruction) successors().get(super.successorCount() + SUCCESSOR_EXCEPTION_EDGE);
-    }
-
-    public Instruction setExceptionEdge(Instruction n) {
-        return (Instruction) successors().set(super.successorCount() + SUCCESSOR_EXCEPTION_EDGE, n);
-    }
-
-    /**
-     * Creates a new Throw instruction.
-     * @param exception the instruction that generates the exception to throw
-     * @param stateAfter the state before the exception is thrown but after the exception object has been popped
-     * @param graph
-     */
-    public Throw(Value exception, Graph graph) {
-        super(CiKind.Illegal, INPUT_COUNT, SUCCESSOR_COUNT, graph);
-        setException(exception);
-    }
-
-    @Override
-    public void accept(ValueVisitor v) {
-        v.visitThrow(this);
-    }
-
-    @Override
-    public void print(LogStream out) {
-        out.print("throw ").print(exception());
-    }
-
-    @Override
-    public Node copy(Graph into) {
-        Throw x = new Throw(null, into);
-        x.setNonNull(isNonNull());
-        return x;
-    }
-}
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/ValueVisitor.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ValueVisitor.java	Tue May 31 13:30:23 2011 +0200
@@ -66,7 +66,6 @@
     public abstract void visitStoreField(StoreField i);
     public abstract void visitStoreIndexed(StoreIndexed i);
     public abstract void visitTableSwitch(TableSwitch i);
-    public abstract void visitThrow(Throw i);
     public abstract void visitDeoptimize(Deoptimize deoptimize);
     public abstract void visitExceptionDispatch(ExceptionDispatch exceptionDispatch);
     public abstract void visitUnwind(Unwind unwind);
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRAssembler.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRAssembler.java	Tue May 31 13:30:23 2011 +0200
@@ -311,10 +311,6 @@
                 emitLogicOp(op.code, op.operand1(), op.operand2(), op.result());
                 break;
 
-            case Throw:
-                emitThrow(op.operand1(), op.operand2(), op.info);
-                break;
-
             default:
                 throw Util.shouldNotReachHere();
         }
@@ -407,8 +403,6 @@
 
     protected abstract void emitVolatileMove(CiValue inOpr, CiValue result, CiKind kind, LIRDebugInfo info);
 
-    protected abstract void emitThrow(CiValue inOpr1, CiValue inOpr2, LIRDebugInfo info);
-
     protected abstract void emitLogicOp(LIROpcode code, CiValue inOpr1, CiValue inOpr2, CiValue dst);
 
     protected abstract void emitIntrinsicOp(LIROpcode code, CiValue inOpr1, CiValue inOpr2, CiValue dst, LIROp2 op);
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java	Tue May 31 13:30:23 2011 +0200
@@ -185,18 +185,8 @@
     private int linearScanNumber = -1;
     private boolean linearScanLoopEnd;
     private boolean linearScanLoopHeader;
-    private boolean exceptionEntry;
     private boolean backwardBranchTarget;
 
-
-    public void setExceptionEntry(boolean b) {
-        this.exceptionEntry = b;
-    }
-
-    public boolean isExceptionEntry() {
-        return exceptionEntry;
-    }
-
     public void setBackwardBranchTarget(boolean b) {
         this.backwardBranchTarget = b;
     }
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRDebugInfo.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRDebugInfo.java	Tue May 31 13:30:23 2011 +0200
@@ -37,12 +37,19 @@
     }
 
     public final FrameState state;
-    public final LIRBlock exceptionEdge;
+    private LIRBlock exceptionEdge;
     public CiDebugInfo debugInfo;
 
-    public LIRDebugInfo(FrameState state, LIRBlock exceptionEdge) {
+    public LIRDebugInfo(FrameState state) {
         assert state != null;
         this.state = state;
+    }
+
+    public LIRBlock exceptionEdge() {
+        return exceptionEdge;
+    }
+
+    public void setExceptionEdge(LIRBlock exceptionEdge) {
         this.exceptionEdge = exceptionEdge;
     }
 
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRInstruction.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRInstruction.java	Tue May 31 13:30:23 2011 +0200
@@ -482,7 +482,7 @@
     }
 
     public final LIRBlock exceptionEdge() {
-        return (info == null) ? null : info.exceptionEdge;
+        return (info == null) ? null : info.exceptionEdge();
     }
 
     @Override
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRList.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRList.java	Tue May 31 13:30:23 2011 +0200
@@ -172,10 +172,6 @@
         append(new LIROp1(LIROpcode.NullCheck, opr, info));
     }
 
-    public void throwException(CiValue exceptionPC, CiValue exceptionOop, LIRDebugInfo info) {
-        append(new LIROp2(LIROpcode.Throw, exceptionPC, exceptionOop, CiValue.IllegalValue, info, CiKind.Illegal, true));
-    }
-
     public void compareTo(CiValue left, CiValue right, CiValue dst) {
         append(new LIROp2(LIROpcode.CompareTo, left, right, dst));
     }
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIROpcode.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIROpcode.java	Tue May 31 13:30:23 2011 +0200
@@ -77,7 +77,6 @@
         Shl,
         Shr,
         Ushr,
-        Throw,
         CompareTo,
     EndOp2,
     BeginOp3,
--- a/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRAssembler.java	Tue May 31 11:50:19 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRAssembler.java	Tue May 31 13:30:23 2011 +0200
@@ -1397,16 +1397,6 @@
         indirectCall(reg, null, null);
     }
 
-    @Override
-    protected void emitThrow(CiValue exceptionPC, CiValue exceptionOop, LIRDebugInfo info) {
-       // exception object is not added to oop map by LinearScan
-       // (LinearScan assumes that no oops are in fixed registers)
-       // info.addRegisterOop(exceptionOop);
-        directCall(CiRuntimeCall.HandleException, info);
-        // enough room for two byte trap
-        shouldNotReachHere();
-    }
-
     private void emitXIRShiftOp(LIROpcode code, CiValue left, CiValue count, CiValue dest) {
         if (count.isConstant()) {
             emitShiftOp(code, left, ((CiConstant) count).asInt(), dest);