@Override public PointerKey getPointerKeyForExceptionalReturnValue(CGNode node) { return h.getPointerKeyForExceptionalReturnValue(node); }
@Override public PointerKey getPointerKeyForExceptionalReturnValue(CGNode node) { return h.getPointerKeyForExceptionalReturnValue(node); }
@Override public PointerKey getPointerKeyForExceptionalReturnValue(CGNode node) { return delegate.getPointerKeyForExceptionalReturnValue(node); }
@Override public PointerKey getPointerKeyForExceptionalReturnValue(CGNode node) { return delegate.getPointerKeyForExceptionalReturnValue(node); }
/** * Add constraints to represent the flow of exceptions to the exceptional return value for this node */ protected void addNodePassthruExceptionConstraints(CGNode node, IR ir) { // add constraints relating to thrown exceptions that reach the exit block. List<ProgramCounter> peis = SSAPropagationCallGraphBuilder.getIncomingPEIs(ir, ir.getExitBlock()); PointerKey exception = heapModel.getPointerKeyForExceptionalReturnValue(node); IClass c = node.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable); addExceptionDefConstraints(ir, 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, IR ir) { // add constraints relating to thrown exceptions that reach the exit // block. List<ProgramCounter> peis = SSAPropagationCallGraphBuilder.getIncomingPEIs(ir, ir.getExitBlock()); PointerKey exception = heapModel.getPointerKeyForExceptionalReturnValue(node); IClass c = node.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable); addExceptionDefConstraints(ir, 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, IR ir) { // add constraints relating to thrown exceptions that reach the exit block. List<ProgramCounter> peis = SSAPropagationCallGraphBuilder.getIncomingPEIs(ir, ir.getExitBlock()); PointerKey exception = heapModel.getPointerKeyForExceptionalReturnValue(node); IClass c = node.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable); addExceptionDefConstraints(ir, 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, IR ir) { // add constraints relating to thrown exceptions that reach the exit // block. List<ProgramCounter> peis = SSAPropagationCallGraphBuilder.getIncomingPEIs(ir, ir.getExitBlock()); PointerKey exception = heapModel.getPointerKeyForExceptionalReturnValue(node); IClass c = node.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable); addExceptionDefConstraints(ir, node, peis, exception, Collections.singleton(c)); }
/** * add nodes for parameters and return values */ @Override protected void addNodesForParameters(CGNode node, IR ir) { for (int parameter : Iterator2Iterable.make(new PointerParamValueNumIterator(node))) { PointerKey paramPk = heapModel.getPointerKeyForLocal(node, parameter); addNode(paramPk); params.put(paramPk, node); } PointerKey returnKey = heapModel.getPointerKeyForReturnValue(node); addNode(returnKey); returns.put(returnKey, node); PointerKey exceptionReturnKey = heapModel.getPointerKeyForExceptionalReturnValue(node); addNode(exceptionReturnKey); returns.put(exceptionReturnKey, node); }
/** * add nodes for parameters and return values */ @Override protected void addNodesForParameters(CGNode node, IR ir) { for (int parameter : Iterator2Iterable.make(new PointerParamValueNumIterator(node))) { PointerKey paramPk = heapModel.getPointerKeyForLocal(node, parameter); addNode(paramPk); params.put(paramPk, node); } PointerKey returnKey = heapModel.getPointerKeyForReturnValue(node); addNode(returnKey); returns.put(returnKey, node); PointerKey exceptionReturnKey = heapModel.getPointerKeyForExceptionalReturnValue(node); addNode(exceptionReturnKey); returns.put(exceptionReturnKey, node); }
@Override protected void addNodesForParameters(CGNode node, IR ir) { SymbolTable symbolTable = ir.getSymbolTable(); int numParams = symbolTable.getNumberOfParameters(); for (int i = 0; i < numParams; i++) { int parameter = symbolTable.getParameter(i); PointerKey paramPk = heapModel.getPointerKeyForLocal(node, parameter); addNode(paramPk); params.put(paramPk, node); } PointerKey returnKey = heapModel.getPointerKeyForReturnValue(node); addNode(returnKey); returns.put(returnKey, node); PointerKey exceptionReturnKey = heapModel.getPointerKeyForExceptionalReturnValue(node); addNode(exceptionReturnKey); returns.put(exceptionReturnKey, node); }
@Override protected void addNodesForParameters(CGNode node, IR ir) { SymbolTable symbolTable = ir.getSymbolTable(); int numParams = symbolTable.getNumberOfParameters(); for (int i = 0; i < numParams; i++) { int parameter = symbolTable.getParameter(i); PointerKey paramPk = heapModel.getPointerKeyForLocal(node, parameter); addNode(paramPk); params.put(paramPk, node); } PointerKey returnKey = heapModel.getPointerKeyForReturnValue(node); addNode(returnKey); returns.put(returnKey, node); PointerKey exceptionReturnKey = heapModel.getPointerKeyForExceptionalReturnValue(node); addNode(exceptionReturnKey); returns.put(exceptionReturnKey, node); }
public Iterator<PointerKeyAndCallSite> getReturnSuccs(LocalPointerKey pk) { SSAAbstractInvokeInstruction callInstr = callDefs.get(pk); if (callInstr == null) return EmptyIterator.instance(); ArrayList<PointerKeyAndCallSite> returnSuccs = new ArrayList<>(); boolean isExceptional = pk.getValueNumber() == callInstr.getException(); CallSiteReference callSiteRef = callInstr.getCallSite(); // get call targets Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callSiteRef); // construct graph for each target for (CGNode callee : possibleCallees) { addSubgraphForNode(callee); PointerKey retVal = isExceptional ? heapModel.getPointerKeyForExceptionalReturnValue(callee) : heapModel .getPointerKeyForReturnValue(callee); assert containsNode(retVal); returnSuccs.add(new PointerKeyAndCallSite(retVal, callSiteRef)); } return returnSuccs.iterator(); }
public Iterator<PointerKeyAndCallSite> getReturnSuccs(LocalPointerKey pk) { SSAAbstractInvokeInstruction callInstr = callDefs.get(pk); if (callInstr == null) return EmptyIterator.instance(); ArrayList<PointerKeyAndCallSite> returnSuccs = new ArrayList<>(); boolean isExceptional = pk.getValueNumber() == callInstr.getException(); CallSiteReference callSiteRef = callInstr.getCallSite(); // get call targets Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callSiteRef); // construct graph for each target for (CGNode callee : possibleCallees) { addSubgraphForNode(callee); PointerKey retVal = isExceptional ? heapModel.getPointerKeyForExceptionalReturnValue(callee) : heapModel .getPointerKeyForReturnValue(callee); assert containsNode(retVal); returnSuccs.add(new PointerKeyAndCallSite(retVal, callSiteRef)); } return returnSuccs.iterator(); }
public Iterator<PointerKeyAndCallSite> getReturnPreds(LocalPointerKey pk) { CGNode cgNode = returns.get(pk); if (cgNode == null) { return EmptyIterator.instance(); } boolean isExceptional = pk == heapModel.getPointerKeyForExceptionalReturnValue(cgNode); ArrayList<PointerKeyAndCallSite> returnPreds = new ArrayList<>(); // iterate over callers for (CGNode caller : cg) { // TODO we don't need to add the graph if null is passed // as the argument addSubgraphForNode(caller); IR ir = caller.getIR(); for (CallSiteReference call : Iterator2Iterable.make(ir.iterateCallSites())) { if (cg.getPossibleTargets(caller, call).contains(cgNode)) { SSAAbstractInvokeInstruction[] callInstrs = ir.getCalls(call); for (SSAAbstractInvokeInstruction callInstr : callInstrs) { PointerKey returnPk = heapModel.getPointerKeyForLocal(caller, isExceptional ? callInstr.getException() : callInstr .getDef()); assert containsNode(returnPk); assert containsNode(pk); returnPreds.add(new PointerKeyAndCallSite(returnPk, call)); } } } } return returnPreds.iterator(); }
public Iterator<PointerKeyAndCallSite> getReturnPreds(LocalPointerKey pk) { CGNode cgNode = returns.get(pk); if (cgNode == null) { return EmptyIterator.instance(); } boolean isExceptional = pk == heapModel.getPointerKeyForExceptionalReturnValue(cgNode); ArrayList<PointerKeyAndCallSite> returnPreds = new ArrayList<>(); // iterate over callers for (CGNode caller : cg) { // TODO we don't need to add the graph if null is passed // as the argument addSubgraphForNode(caller); IR ir = caller.getIR(); for (CallSiteReference call : Iterator2Iterable.make(ir.iterateCallSites())) { if (cg.getPossibleTargets(caller, call).contains(cgNode)) { SSAAbstractInvokeInstruction[] callInstrs = ir.getCalls(call); for (SSAAbstractInvokeInstruction callInstr : callInstrs) { PointerKey returnPk = heapModel.getPointerKeyForLocal(caller, isExceptional ? callInstr.getException() : callInstr .getDef()); assert containsNode(returnPk); assert containsNode(pk); returnPreds.add(new PointerKeyAndCallSite(returnPk, call)); } } } } return returnPreds.iterator(); }
/** * add nodes for parameters and return values */ private void addNodesForParameters(CGNode node) { // TODO Auto-generated method stub IR ir = node.getIR(); TypeInference ti = TypeInference.make(ir, false); SymbolTable symbolTable = ir.getSymbolTable(); for (int i = 0; i < symbolTable.getNumberOfParameters(); i++) { int parameter = symbolTable.getParameter(i); TypeAbstraction t = ti.getType(parameter); if (t != null) { PointerKey paramPk = heapModel.getPointerKeyForLocal(node, parameter); addNode(paramPk); params.put(paramPk, node); } } addNode(heapModel.getPointerKeyForReturnValue(node)); addNode(heapModel.getPointerKeyForExceptionalReturnValue(node)); }
/** * add nodes for parameters and return values */ private void addNodesForParameters(CGNode node) { // TODO Auto-generated method stub IR ir = node.getIR(); TypeInference ti = TypeInference.make(ir, false); SymbolTable symbolTable = ir.getSymbolTable(); for (int i = 0; i < symbolTable.getNumberOfParameters(); i++) { int parameter = symbolTable.getParameter(i); TypeAbstraction t = ti.getType(parameter); if (t != null) { PointerKey paramPk = heapModel.getPointerKeyForLocal(node, parameter); addNode(paramPk); params.put(paramPk, node); } } addNode(heapModel.getPointerKeyForReturnValue(node)); addNode(heapModel.getPointerKeyForExceptionalReturnValue(node)); }
/** * @param pk value being def'fed by a call instruction (either normal or exceptional) */ private void addReturnEdges(LocalPointerKey pk, SSAInvokeInstruction callInstr) { boolean isExceptional = pk.getValueNumber() == callInstr.getException(); // get call targets Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callInstr.getCallSite()); // construct graph for each target for (CGNode callee : possibleCallees) { addSubgraphForNode(callee); PointerKey retVal = isExceptional ? heapModel.getPointerKeyForExceptionalReturnValue(callee) : heapModel .getPointerKeyForReturnValue(callee); assert containsNode(retVal); addEdge(pk, retVal); } }
/** * @param pk value being def'fed by a call instruction (either normal or exceptional) */ private void addReturnEdges(LocalPointerKey pk, SSAInvokeInstruction callInstr) { boolean isExceptional = pk.getValueNumber() == callInstr.getException(); // get call targets Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callInstr.getCallSite()); // construct graph for each target for (CGNode callee : possibleCallees) { addSubgraphForNode(callee); PointerKey retVal = isExceptional ? heapModel.getPointerKeyForExceptionalReturnValue(callee) : heapModel .getPointerKeyForReturnValue(callee); assert containsNode(retVal); addEdge(pk, retVal); } }