@Override public String toString() { return "NEW " + declaredType + '@' + getProgramCounter(); } }
@Override public String toString() { return "NEW " + declaredType + '@' + getProgramCounter(); } }
/** * @param n a call graph node * @param allocPC a bytecode index corresponding to an allocation * @return the NewSiteReference for the allocation */ static NewSiteReference findAlloc(CGNode n, int allocPC) throws WalaException { if (n == null) { throw new IllegalArgumentException("null n"); } for (NewSiteReference site : Iterator2Iterable.make(n.iterateNewSites())) { if (site.getProgramCounter() == allocPC) { return site; } } throw new WalaException("Failed to find an allocation at pc " + allocPC + " in node " + n); }
/** * @param n a call graph node * @param allocPC a bytecode index corresponding to an allocation * @return the NewSiteReference for the allocation */ static NewSiteReference findAlloc(CGNode n, int allocPC) throws WalaException { if (n == null) { throw new IllegalArgumentException("null n"); } for (NewSiteReference site : Iterator2Iterable.make(n.iterateNewSites())) { if (site.getProgramCounter() == allocPC) { return site; } } throw new WalaException("Failed to find an allocation at pc " + allocPC + " in node " + n); }
@Override public String toString(SymbolTable symbolTable) { return getValueString(symbolTable, result) + " = new " + site.getDeclaredType() + '@' + site.getProgramCounter() + (params == null ? "" : array2String(params, symbolTable)); }
@Override public String toString(SymbolTable symbolTable) { return getValueString(symbolTable, result) + " = new " + site.getDeclaredType() + '@' + site.getProgramCounter() + (params == null ? "" : array2String(params, symbolTable)); }
@Override public void visitNew(SSANewInstruction instruction) { try { int defNum = instruction.getDef(); String localName = newLocalDef(defNum); TypeReference type = instruction.getConcreteType(); String className = type.getName().toUnicodeString(); Element elt = doc.createElement(XMLSummaryWriter.E_NEW); elt.setAttribute(XMLSummaryWriter.A_DEF, localName); elt.setAttribute(XMLSummaryWriter.A_CLASS, className); if (type.isArrayType()) { // array allocations need a size value Element sizeElt = doc.createElement(XMLSummaryWriter.E_CONSTANT); final String sizeName = "sizeOf$allocAt" + instruction.getNewSite().getProgramCounter(); sizeElt.setAttribute(XMLSummaryWriter.A_NAME, sizeName); sizeElt.setAttribute(XMLSummaryWriter.A_TYPE, "int"); sizeElt.setAttribute(XMLSummaryWriter.A_VALUE, "1"); summary.add(sizeElt); elt.setAttribute(XMLSummaryWriter.A_SIZE, sizeName); } summary.add(elt); } catch (Exception e) { throw new SSASerializationException(e); } }
private Set<Pair<String,Integer>> map(Set<Pair<CGNode, NewSiteReference>> sites) { Set<Pair<String,Integer>> result = HashSetFactory.make(); for(Pair<CGNode,NewSiteReference> s : sites) { result.add(Pair.make(s.fst.getMethod().toString(), s.snd.getProgramCounter())); } return result; }
NormalAllocationInNode normalIk1 = (NormalAllocationInNode) ik; IR ir2 = normalIk1.getNode().getIR(); int pc2 = normalIk1.getSite().getProgramCounter(); irViewer.setIRAndPc(ir2, pc2); NormalAllocationInNode normalIk2 = (NormalAllocationInNode) userObject; IR ir3 = normalIk2.getNode().getIR(); int pc3 = normalIk2.getSite().getProgramCounter(); irViewer.setIRAndPc(ir3, pc3); } else if (userObject instanceof CGNode){
NormalAllocationInNode normalIk1 = (NormalAllocationInNode) ik; IR ir2 = normalIk1.getNode().getIR(); int pc2 = normalIk1.getSite().getProgramCounter(); irViewer.setIRAndPc(ir2, pc2); NormalAllocationInNode normalIk2 = (NormalAllocationInNode) userObject; IR ir3 = normalIk2.getNode().getIR(); int pc3 = normalIk2.getSite().getProgramCounter(); irViewer.setIRAndPc(ir3, pc3); } else if (userObject instanceof CGNode){