Mercurial > hg > graal-compiler
comparison 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 |
comparison
equal
deleted
inserted
replaced
2677:0ea5f12e873a | 2707:7ed72769d51a |
---|---|
392 } | 392 } |
393 } | 393 } |
394 | 394 |
395 @Override | 395 @Override |
396 public void visitExceptionObject(ExceptionObject x) { | 396 public void visitExceptionObject(ExceptionObject x) { |
397 assert currentBlock.isExceptionEntry() : "ExceptionObject only allowed in exception handler block"; | |
398 assert currentBlock.next() == x : "ExceptionObject must be first instruction of block"; | 397 assert currentBlock.next() == x : "ExceptionObject must be first instruction of block"; |
399 | 398 |
400 // no moves are created for phi functions at the begin of exception | 399 // no moves are created for phi functions at the begin of exception |
401 // handlers, so assign operands manually here | 400 // handlers, so assign operands manually here |
402 currentBlock.stateBefore().forEachLivePhi(currentBlock, new PhiProcedure() { | 401 currentBlock.stateBefore().forEachLivePhi(currentBlock, new PhiProcedure() { |
1444 if (compilation.placeholderState != null) { | 1443 if (compilation.placeholderState != null) { |
1445 state = compilation.placeholderState; | 1444 state = compilation.placeholderState; |
1446 } | 1445 } |
1447 | 1446 |
1448 assert state != null; | 1447 assert state != null; |
1449 return new LIRDebugInfo(state, x.exceptionHandlers()); | 1448 return new LIRDebugInfo(state, x.exceptionEdge()); |
1450 } | 1449 } |
1451 | 1450 |
1452 List<CiValue> visitInvokeArguments(CiCallingConvention cc, Invoke x, List<CiValue> pointerSlots) { | 1451 List<CiValue> visitInvokeArguments(CiCallingConvention cc, Invoke x, List<CiValue> pointerSlots) { |
1453 // for each argument, load it into the correct location | 1452 // for each argument, load it into the correct location |
1454 List<CiValue> argList = new ArrayList<CiValue>(x.argumentCount()); | 1453 List<CiValue> argList = new ArrayList<CiValue>(x.argumentCount()); |
1609 | 1608 |
1610 @Override | 1609 @Override |
1611 public void visitFrameState(FrameState i) { | 1610 public void visitFrameState(FrameState i) { |
1612 // nothing to do for now | 1611 // nothing to do for now |
1613 } | 1612 } |
1613 | |
1614 @Override | |
1615 public void visitUnwind(Unwind x) { | |
1616 // TODO ls: this needs some thorough testing... | |
1617 CiValue operand = resultOperandFor(x.kind); | |
1618 CiValue result = force(x.exception(), operand); | |
1619 ArrayList<CiValue> args = new ArrayList<CiValue>(1); | |
1620 args.add(result); | |
1621 lir.callRuntime(CiRuntimeCall.UnwindException, CiValue.IllegalValue, args, null); | |
1622 setNoResult(x); | |
1623 } | |
1614 } | 1624 } |