@Override public int getSize() { return delegate.getSize(); }
@Override public int getSize() { return delegate.getSize(); }
@Override public int getSize() { return delegate.getSize(); }
public Set<TypeReference> computeExceptions(BitVectorVariable bitVector) { Set<TypeReference> result = new HashSet<>(); for (int i = 0; i < values.getSize(); i++) { if (bitVector.get(i)) { result.add(values.getMappedObject(i)); } } return result; } }
public Set<TypeReference> computeExceptions(BitVectorVariable bitVector) { Set<TypeReference> result = new HashSet<>(); for (int i = 0; i < values.getSize(); i++) { if (bitVector.get(i)) { result.add(values.getMappedObject(i)); } } return result; } }
public Set<TypeReference> computeExceptions(BitVector bitVector) { assert bitVector.length() == values.getSize(); Set<TypeReference> result = new HashSet<>(); for (int i = 0; i < bitVector.length(); i++) { if (bitVector.get(i)) { result.add(values.getMappedObject(i)); } } return result; }
public Set<TypeReference> computeExceptions(BitVector bitVector) { assert bitVector.length() == values.getSize(); Set<TypeReference> result = new HashSet<>(); for (int i = 0; i < bitVector.length(); i++) { if (bitVector.get(i)) { result.add(values.getMappedObject(i)); } } return result; }
public BitVector computeBitVector(Set<TypeReference> exceptions) { BitVector result = new BitVector(values.getSize()); for (TypeReference exception : exceptions) { int pos = values.getMappedIndex(exception); if (pos != -1) { result.set(pos); } else { throw new IllegalArgumentException("Got exception I don't know about," + "make sure only to use exceptions given to the constructor "); } } return result; }
public BitVector computeBitVector(Set<TypeReference> exceptions) { BitVector result = new BitVector(values.getSize()); for (TypeReference exception : exceptions) { int pos = values.getMappedIndex(exception); if (pos != -1) { result.set(pos); } else { throw new IllegalArgumentException("Got exception I don't know about," + "make sure only to use exceptions given to the constructor "); } } return result; }
@Override public UnaryOperator<BitVectorVariable> getEdgeTransferFunction(CGNode dst, CGNode src) { /* * Note, that dst and src are swapped. For the data-flow-analysis we use * called -> caller, but for the call graph we need caller -> called. */ Iterator<CallSiteReference> callsites = cg.getPossibleSites(src, dst); BitVector filtered = new BitVector(transformer.getValues().getSize()); if (callsites.hasNext()) { CallSiteReference callsite = callsites.next(); Set<TypeReference> caught = new LinkedHashSet<>(intraResult.getAnalysis(src).getCaughtExceptions(callsite)); while (callsites.hasNext()) { callsite = callsites.next(); caught.retainAll(intraResult.getAnalysis(src).getCaughtExceptions(callsite)); } filtered = transformer.computeBitVector(caught); return new BitVectorMinusVector(filtered); } else { // This case should not happen, as we should only get src, dst pairs, // which represent an edge in the call graph. For each edge in the call // graph should be at least one call site. throw new RuntimeException("Internal Error: Got call graph edge without call site."); } } }
public Exception2BitvectorTransformer(Set<TypeReference> exceptions) { createValues(exceptions); for (TypeReference exception : exceptions) { BitVector bv = new BitVector(values.getSize()); bv.set(values.getMappedIndex(exception)); } }
public Exception2BitvectorTransformer(Set<TypeReference> exceptions) { createValues(exceptions); for (TypeReference exception : exceptions) { BitVector bv = new BitVector(values.getSize()); bv.set(values.getMappedIndex(exception)); } }
@Override public Object getNode(int number) { if (number > pointerKeys.getMaximumIndex()) { return P.getInstanceKeyMapping().getMappedObject(number - pointerKeys.getSize()); } else { return pointerKeys.getMappedObject(number); } }
@Override public UnaryOperator<BitVectorVariable> getEdgeTransferFunction(CGNode dst, CGNode src) { /* * Note, that dst and src are swapped. For the data-flow-analysis we use * called -> caller, but for the call graph we need caller -> called. */ Iterator<CallSiteReference> callsites = cg.getPossibleSites(src, dst); BitVector filtered = new BitVector(transformer.getValues().getSize()); if (callsites.hasNext()) { CallSiteReference callsite = callsites.next(); Set<TypeReference> caught = new LinkedHashSet<>(intraResult.getAnalysis(src).getCaughtExceptions(callsite)); while (callsites.hasNext()) { callsite = callsites.next(); caught.retainAll(intraResult.getAnalysis(src).getCaughtExceptions(callsite)); } filtered = transformer.computeBitVector(caught); return new BitVectorMinusVector(filtered); } else { // This case should not happen, as we should only get src, dst pairs, // which represent an edge in the call graph. For each edge in the call // graph should be at least one call site. throw new RuntimeException("Internal Error: Got call graph edge without call site."); } } }
@Override public Object getNode(int number) { if (number > pointerKeys.getMaximumIndex()) { return P.getInstanceKeyMapping().getMappedObject(number - pointerKeys.getSize()); } else { return pointerKeys.getMappedObject(number); } }