/** * Add an edge to the subroutine's CFG. * * @param sourceBlock * the source basic block * @param destBlock * the destination basic block * @param edgeType * the type of edge */ public void addEdge(BasicBlock sourceBlock, BasicBlock destBlock, @Edge.Type int edgeType) { if (VERIFY_INTEGRITY) { if (destBlock.isExceptionHandler() && edgeType != HANDLED_EXCEPTION_EDGE) { throw new IllegalStateException("In method " + SignatureConverter.convertMethodSignature(methodGen) + ": exception handler " + destBlock.getFirstInstruction() + " reachable by non exception edge type " + edgeType); } } cfgSub.createEdge(sourceBlock, destBlock, edgeType); }
@Override public void transfer(BasicBlock basicBlock, @CheckForNull InstructionHandle end, BlockType start, BlockType result) throws DataflowAnalysisException { result.copyFrom(start); if (start.isValid()) { if (basicBlock.isExceptionHandler()) { CodeExceptionGen exceptionGen = basicBlock.getExceptionGen(); ObjectType catchType = exceptionGen.getCatchType(); if (catchType == null) { // Probably a finally block, or a synchronized block // exception-compensation catch block. result.pushFinally(); } else { // Catch type was explicitly specified: // this is probably a programmer-written catch block result.pushCatch(); } } } }
Location location = i.next(); if (location.getBasicBlock().isExceptionHandler()) { continue;
@Override public void meetInto(ValueNumberFrame fact, Edge edge, ValueNumberFrame result) throws DataflowAnalysisException { if (edge.getTarget().isExceptionHandler() && fact.isValid()) { // Special case: when merging predecessor facts for entry to // an exception handler, we clear the stack and push a // single entry for the exception object. That way, the locals // can still be merged. // Get the value number for the exception BasicBlock handlerBlock = edge.getTarget(); ValueNumber exceptionValueNumber = getExceptionValueNumber(handlerBlock); // Set up the stack frame ValueNumberFrame tmpFact = createFact(); tmpFact.copyFrom(fact); tmpFact.clearStack(); tmpFact.pushValue(exceptionValueNumber); fact = tmpFact; } mergeInto(fact, result); }
if (destBlock.isExceptionHandler()) {
if (location.getBasicBlock().isExceptionHandler()) { propertySet.addProperty(DeadLocalStoreProperty.EXCEPTION_HANDLER);
if (basicBlock.isExceptionHandler()) { tmpFact = modifyFrame(fact, null);
if (subBlock.isExceptionHandler()) { resultBlock.setExceptionGen(null, subBlock.getExceptionGen());
if (dest.isExceptionHandler()) {
/** * Add an edge to the subroutine's CFG. * * @param sourceBlock * the source basic block * @param destBlock * the destination basic block * @param edgeType * the type of edge */ public void addEdge(BasicBlock sourceBlock, BasicBlock destBlock, @Edge.Type int edgeType) { if (VERIFY_INTEGRITY) { if (destBlock.isExceptionHandler() && edgeType != HANDLED_EXCEPTION_EDGE) { throw new IllegalStateException("In method " + SignatureConverter.convertMethodSignature(methodGen) + ": exception handler " + destBlock.getFirstInstruction() + " reachable by non exception edge type " + edgeType); } } cfgSub.createEdge(sourceBlock, destBlock, edgeType); }
@Override public void transfer(BasicBlock basicBlock, @CheckForNull InstructionHandle end, BlockType start, BlockType result) throws DataflowAnalysisException { result.copyFrom(start); if (start.isValid()) { if (basicBlock.isExceptionHandler()) { CodeExceptionGen exceptionGen = basicBlock.getExceptionGen(); ObjectType catchType = exceptionGen.getCatchType(); if (catchType == null) { // Probably a finally block, or a synchronized block // exception-compensation catch block. result.pushFinally(); } else { // Catch type was explicitly specified: // this is probably a programmer-written catch block result.pushCatch(); } } } }
Location location = i.next(); if (location.getBasicBlock().isExceptionHandler()) { continue;
@Override public void meetInto(ValueNumberFrame fact, Edge edge, ValueNumberFrame result) throws DataflowAnalysisException { if (edge.getTarget().isExceptionHandler() && fact.isValid()) { // Special case: when merging predecessor facts for entry to // an exception handler, we clear the stack and push a // single entry for the exception object. That way, the locals // can still be merged. // Get the value number for the exception BasicBlock handlerBlock = edge.getTarget(); ValueNumber exceptionValueNumber = getExceptionValueNumber(handlerBlock); // Set up the stack frame ValueNumberFrame tmpFact = createFact(); tmpFact.copyFrom(fact); tmpFact.clearStack(); tmpFact.pushValue(exceptionValueNumber); fact = tmpFact; } mergeInto(fact, result); }
if (destBlock.isExceptionHandler()) {
if (location.getBasicBlock().isExceptionHandler()) { propertySet.addProperty(DeadLocalStoreProperty.EXCEPTION_HANDLER);
if (basicBlock.isExceptionHandler()) { tmpFact = modifyFrame(fact, null);
if (subBlock.isExceptionHandler()) { resultBlock.setExceptionGen(null, subBlock.getExceptionGen());