Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/graph/BlockMap.java @ 2840:75e0d39833a0
new CompilerGraph, create only one Return and one Unwind per CompilerGraph
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 31 May 2011 16:53:19 +0200 |
parents | 706047ee5f2e |
children |
comparison
equal
deleted
inserted
replaced
2837:7b5831f0e913 | 2840:75e0d39833a0 |
---|---|
399 | 399 |
400 private HashMap<RiExceptionHandler, ExceptionBlock> exceptionDispatch = new HashMap<RiExceptionHandler, ExceptionBlock>(); | 400 private HashMap<RiExceptionHandler, ExceptionBlock> exceptionDispatch = new HashMap<RiExceptionHandler, ExceptionBlock>(); |
401 | 401 |
402 private ExceptionBlock unwindBlock; | 402 private ExceptionBlock unwindBlock; |
403 | 403 |
404 private ExceptionBlock makeUnwind() { | |
405 if (unwindBlock == null) { | |
406 unwindBlock = new ExceptionBlock(); | |
407 unwindBlock.startBci = -1; | |
408 unwindBlock.endBci = -1; | |
409 } | |
410 return unwindBlock; | |
411 } | |
412 | |
413 private Block makeExceptionDispatch(List<RiExceptionHandler> handlers, int index) { | 404 private Block makeExceptionDispatch(List<RiExceptionHandler> handlers, int index) { |
414 RiExceptionHandler handler = handlers.get(index); | 405 RiExceptionHandler handler = handlers.get(index); |
415 if (handler.isCatchAll()) { | 406 if (handler.isCatchAll()) { |
416 return blockMap[handler.handlerBCI()]; | 407 return blockMap[handler.handlerBCI()]; |
417 } | 408 } |
420 block = new ExceptionBlock(); | 411 block = new ExceptionBlock(); |
421 block.startBci = -1; | 412 block.startBci = -1; |
422 block.endBci = -1; | 413 block.endBci = -1; |
423 block.handler = handler; | 414 block.handler = handler; |
424 block.successors.add(blockMap[handler.handlerBCI()]); | 415 block.successors.add(blockMap[handler.handlerBCI()]); |
425 Block next; | |
426 if (index < handlers.size() - 1) { | 416 if (index < handlers.size() - 1) { |
427 next = makeExceptionDispatch(handlers, index + 1); | 417 block.next = makeExceptionDispatch(handlers, index + 1); |
428 } else { | 418 block.successors.add(block.next); |
429 next = makeUnwind(); | 419 } |
430 } | |
431 block.successors.add(next); | |
432 block.next = next; | |
433 exceptionDispatch.put(handler, block); | 420 exceptionDispatch.put(handler, block); |
434 } | 421 } |
435 return block; | 422 return block; |
436 } | 423 } |
437 | 424 |