diff graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2707:7ed72769d51a

exception handling related changes: * changed blockPredecessors to list of Instructions, instead of Blocks * removed explicit predecessor management in BlockBegin, now using predecessors from Graph structure * replaced generated LIR exception entries with exception dispatch chains in IR * added Unwind and ExceptionDispatch instructions * removed ExceptionEntry flag in BlockBegin and all code depending on it * removed exceptionHandler list from Instruction, replaced by exception Edge on Invoke and Throw * replaced list of ExceptionHandlers with single exception edge in debug info misc: * changed GraphvizPrinter layout (smaller ports on large nodes) * removed defunct run config
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 18 May 2011 18:09:20 +0200
parents 0ea5f12e873a
children 0efd77a02ea9 a0dd2b907806
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Fri May 13 17:09:20 2011 -0700
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Wed May 18 18:09:20 2011 +0200
@@ -394,7 +394,6 @@
 
     @Override
     public void visitExceptionObject(ExceptionObject x) {
-        assert currentBlock.isExceptionEntry() : "ExceptionObject only allowed in exception handler block";
         assert currentBlock.next() == x : "ExceptionObject must be first instruction of block";
 
         // no moves are created for phi functions at the begin of exception
@@ -1446,7 +1445,7 @@
         }
 
         assert state != null;
-        return new LIRDebugInfo(state, x.exceptionHandlers());
+        return new LIRDebugInfo(state, x.exceptionEdge());
     }
 
     List<CiValue> visitInvokeArguments(CiCallingConvention cc, Invoke x, List<CiValue> pointerSlots) {
@@ -1611,4 +1610,15 @@
     public void visitFrameState(FrameState i) {
         // nothing to do for now
     }
+
+    @Override
+    public void visitUnwind(Unwind x) {
+        // TODO ls: this needs some thorough testing...
+        CiValue operand = resultOperandFor(x.kind);
+        CiValue result = force(x.exception(), operand);
+        ArrayList<CiValue> args = new ArrayList<CiValue>(1);
+        args.add(result);
+        lir.callRuntime(CiRuntimeCall.UnwindException, CiValue.IllegalValue, args, null);
+        setNoResult(x);
+    }
 }