@Override public int hashCode() { return getNode().hashCode() * 8647 + getSite().hashCode(); }
@Override public int hashCode() { return getNode().hashCode() * 8647 + getSite().hashCode(); }
@Override public boolean equals(Object obj) { // instanceof is OK because this class is final if (obj instanceof NormalAllocationInNode) { AllocationSiteInNode other = (AllocationSiteInNode) obj; return getNode().equals(other.getNode()) && getSite().equals(other.getSite()); } else { return false; } }
@Override public boolean equals(Object obj) { // instanceof is OK because this class is final if (obj instanceof NormalAllocationInNode) { AllocationSiteInNode other = (AllocationSiteInNode) obj; return getNode().equals(other.getNode()) && getSite().equals(other.getSite()); } else { return false; } }
/** * convert a pointer key to one in the memory access map's heap model * * TODO move this somewhere more appropriate * * @throws UnsupportedOperationException if it doesn't know how to handle a {@link PointerKey} */ public static PointerKey convertPointerKeyToHeapModel(PointerKey pk, HeapModel h) { if (pk == null) { throw new IllegalArgumentException("null pk"); } if (pk instanceof LocalPointerKey) { LocalPointerKey lpk = (LocalPointerKey) pk; return h.getPointerKeyForLocal(lpk.getNode(), lpk.getValueNumber()); } else if (pk instanceof ArrayContentsKey) { ArrayContentsKey ack = (ArrayContentsKey) pk; InstanceKey ik = ack.getInstanceKey(); if (ik instanceof NormalAllocationInNode) { NormalAllocationInNode nain = (NormalAllocationInNode) ik; ik = h.getInstanceKeyForAllocation(nain.getNode(), nain.getSite()); } else { assert false : "need to handle " + ik.getClass(); } return h.getPointerKeyForArrayContents(ik); } else if (pk instanceof ReturnValueKey) { ReturnValueKey rvk = (ReturnValueKey) pk; return h.getPointerKeyForReturnValue(rvk.getNode()); } throw new UnsupportedOperationException("need to handle " + pk.getClass()); }
/** * convert a pointer key to one in the memory access map's heap model * * TODO move this somewhere more appropriate * * @throws UnsupportedOperationException if it doesn't know how to handle a {@link PointerKey} */ public static PointerKey convertPointerKeyToHeapModel(PointerKey pk, HeapModel h) { if (pk == null) { throw new IllegalArgumentException("null pk"); } if (pk instanceof LocalPointerKey) { LocalPointerKey lpk = (LocalPointerKey) pk; return h.getPointerKeyForLocal(lpk.getNode(), lpk.getValueNumber()); } else if (pk instanceof ArrayContentsKey) { ArrayContentsKey ack = (ArrayContentsKey) pk; InstanceKey ik = ack.getInstanceKey(); if (ik instanceof NormalAllocationInNode) { NormalAllocationInNode nain = (NormalAllocationInNode) ik; ik = h.getInstanceKeyForAllocation(nain.getNode(), nain.getSite()); } else { assert false : "need to handle " + ik.getClass(); } return h.getPointerKeyForArrayContents(ik); } else if (pk instanceof ReturnValueKey) { ReturnValueKey rvk = (ReturnValueKey) pk; return h.getPointerKeyForReturnValue(rvk.getNode()); } throw new UnsupportedOperationException("need to handle " + pk.getClass()); }
if(((NormalAllocationInNode)receivers[0]).getSite().getDeclaredType().getClassLoader().equals(ClassLoaderReference.Application))
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){