public PointerKey getPointerKeyForExceptionalReturnValue() { return getBuilder().getPointerKeyForExceptionalReturnValue(node); }
public PointerKey getPointerKeyForExceptionalReturnValue() { return getBuilder().getPointerKeyForExceptionalReturnValue(node); }
/** * precondition: hasUniqueCatchBlock(call,node,cg) * * @return the unique pointer key which catches the exceptions thrown by a call * @throws IllegalArgumentException if ir == null * @throws IllegalArgumentException if call == null */ public PointerKey getUniqueCatchKey(SSAAbstractInvokeInstruction call, IRView ir, CGNode node) throws IllegalArgumentException, IllegalArgumentException { if (call == null) { throw new IllegalArgumentException("call == null"); } if (ir == null) { throw new IllegalArgumentException("ir == null"); } ISSABasicBlock[] bb = ir.getBasicBlocksForCall(call.getCallSite()); assert bb.length == 1; SSACFG.BasicBlock cb = (BasicBlock) ir.getControlFlowGraph().getExceptionalSuccessors(bb[0]).iterator().next(); if (cb.isExitBlock()) { return getPointerKeyForExceptionalReturnValue(node); } else { SSACFG.ExceptionHandlerBasicBlock ehbb = (ExceptionHandlerBasicBlock) cb; SSAGetCaughtExceptionInstruction ci = ehbb.getCatchInstruction(); return getPointerKeyForLocal(node, ci.getDef()); } }
/** * precondition: hasUniqueCatchBlock(call,node,cg) * * @return the unique pointer key which catches the exceptions thrown by a call * @throws IllegalArgumentException if ir == null * @throws IllegalArgumentException if call == null */ public PointerKey getUniqueCatchKey(SSAAbstractInvokeInstruction call, IRView ir, CGNode node) throws IllegalArgumentException, IllegalArgumentException { if (call == null) { throw new IllegalArgumentException("call == null"); } if (ir == null) { throw new IllegalArgumentException("ir == null"); } ISSABasicBlock[] bb = ir.getBasicBlocksForCall(call.getCallSite()); assert bb.length == 1; SSACFG.BasicBlock cb = (BasicBlock) ir.getControlFlowGraph().getExceptionalSuccessors(bb[0]).iterator().next(); if (cb.isExitBlock()) { return getPointerKeyForExceptionalReturnValue(node); } else { SSACFG.ExceptionHandlerBasicBlock ehbb = (ExceptionHandlerBasicBlock) cb; SSAGetCaughtExceptionInstruction ci = ehbb.getCatchInstruction(); return getPointerKeyForLocal(node, ci.getDef()); } }
/** * Add constraints to represent the flow of exceptions to the exceptional return value for this node */ protected void addNodePassthruExceptionConstraints(CGNode node, IRView ir, DefUse du) { // add constraints relating to thrown exceptions that reach the exit block. List<ProgramCounter> peis = getIncomingPEIs(ir, ir.getExitBlock()); PointerKey exception = getPointerKeyForExceptionalReturnValue(node); TypeReference throwableType = node.getMethod().getDeclaringClass().getClassLoader().getLanguage().getThrowableType(); IClass c = node.getClassHierarchy().lookupClass(throwableType); addExceptionDefConstraints(ir, du, node, peis, exception, Collections.singleton(c)); }
/** * Add constraints to represent the flow of exceptions to the exceptional return value for this node */ protected void addNodePassthruExceptionConstraints(CGNode node, IRView ir, DefUse du) { // add constraints relating to thrown exceptions that reach the exit block. List<ProgramCounter> peis = getIncomingPEIs(ir, ir.getExitBlock()); PointerKey exception = getPointerKeyForExceptionalReturnValue(node); TypeReference throwableType = node.getMethod().getDeclaringClass().getClassLoader().getLanguage().getThrowableType(); IClass c = node.getClassHierarchy().lookupClass(throwableType); addExceptionDefConstraints(ir, du, node, peis, exception, Collections.singleton(c)); }
AbstractRootMethod fakeWorldClinitMethod = (AbstractRootMethod) callGraph.getFakeWorldClinitNode().getMethod(); SSAAbstractInvokeInstruction s = fakeWorldClinitMethod.addInvocation(new int[0], site); PointerKey uniqueCatch = getBuilder().getPointerKeyForExceptionalReturnValue(callGraph.getFakeRootNode()); getBuilder().processResolvedCall(callGraph.getFakeWorldClinitNode(), s, target, null, uniqueCatch);
AbstractRootMethod fakeWorldClinitMethod = (AbstractRootMethod) callGraph.getFakeWorldClinitNode().getMethod(); SSAAbstractInvokeInstruction s = fakeWorldClinitMethod.addInvocation(new int[0], site); PointerKey uniqueCatch = getBuilder().getPointerKeyForExceptionalReturnValue(callGraph.getFakeRootNode()); getBuilder().processResolvedCall(callGraph.getFakeWorldClinitNode(), s, target, null, uniqueCatch);
PointerKey er = getPointerKeyForExceptionalReturnValue(target); if (SHORT_CIRCUIT_SINGLE_USES && uniqueCatchKey != null) {
PointerKey er = getPointerKeyForExceptionalReturnValue(target); if (SHORT_CIRCUIT_SINGLE_USES && uniqueCatchKey != null) {