@Override public int getMappedIndex(Object o) { if (delegate.getMappedIndex(o) == -1) { return -1; } return offset + delegate.getMappedIndex(o); }
@Override public int getMappedIndex(Object o) { if (delegate.getMappedIndex(o) == -1) { return -1; } return offset + delegate.getMappedIndex(o); }
@Override public int getMappedIndex(Object o) { if (delegate.getMappedIndex(o) == -1) { return -1; } return offset + delegate.getMappedIndex(o); }
/** * @return true iff this set contains object */ public boolean contains(T object) { if (this == EMPTY || S == null || object == null) { return false; } int index = mapping.getMappedIndex(object); return (index == -1) ? false : S.contains(index); }
/** * Does this set contain a certain object? */ public boolean contains(T o) { int n = map.getMappedIndex(o); if (n == -1) { return false; } return vector.get(n); }
/** * Does this set contain a certain object? */ public boolean contains(T o) { int n = map.getMappedIndex(o); if (n == -1) { return false; } return vector.get(n); }
/** * Add an object to this bit set. */ public void add(T o) { int n = map.getMappedIndex(o); vector.set(n); }
/** * @return true iff this set contains object */ public boolean contains(T object) { if (this == EMPTY || S == null || object == null) { return false; } int index = mapping.getMappedIndex(object); return (index == -1) ? false : S.contains(index); }
@Override public int getNumber(Object N) { if (N instanceof PointerKey) { return pointerKeys.getMappedIndex(N); } else { if (!(N instanceof InstanceKey)) { Assertions.UNREACHABLE(N.getClass().toString()); } int inumber = P.getInstanceKeyMapping().getMappedIndex(N); return (inumber == -1) ? -1 : inumber + pointerKeys.getMaximumIndex() + 1; } }
@Override public UnaryOperator<BitVectorVariable> getNodeTransferFunction(T n) { int index = domain.getMappedIndex(n); if (index > -1) { return new BitVectorUnionConstant(index); } else { return BitVectorIdentity.instance(); } }
@Override public UnaryOperator<BitVectorVariable> getNodeTransferFunction(T n) { int index = domain.getMappedIndex(n); if (index > -1) { return new BitVectorUnionConstant(index); } else { return BitVectorIdentity.instance(); } }
@Override public UnaryOperator<BitVectorVariable> getNodeTransferFunction(T n) { int index = domain.getMappedIndex(n); if (index > -1) { return new BitVectorUnionConstant(index); } else { return BitVectorIdentity.instance(); } }
private BitVector getGen(T node) { Collection<L> g = gen.get(node); if (g == null) { return new BitVector(); } else { BitVector result = new BitVector(); for (L p : g) { result.set(domain.getMappedIndex(p)); } return result; } }
private BitVector getGen(T node) { Collection<L> g = gen.get(node); if (g == null) { return new BitVector(); } else { BitVector result = new BitVector(); for (L p : g) { result.set(domain.getMappedIndex(p)); } return result; } }
@Override protected List<PointerKey> getPointerKeysUnderInstanceKey(InstanceKey ik) { List<PointerKey> ret = new ArrayList<>(super.getPointerKeysUnderInstanceKey(ik)); int ikIndex = pa.getInstanceKeyMapping().getMappedIndex(ik); ret.addAll(nonNullList(instanceKeyIdToObjectPropertyCatalogKey.getMappedObject(ikIndex))); return ret; }
@Override protected List<PointerKey> getPointerKeysUnderInstanceKey(InstanceKey ik) { List<PointerKey> ret = new ArrayList<>(super.getPointerKeysUnderInstanceKey(ik)); int ikIndex = pa.getInstanceKeyMapping().getMappedIndex(ik); ret.addAll(nonNullList(instanceKeyIdToObjectPropertyCatalogKey.getMappedObject(ikIndex))); return ret; }
public Exception2BitvectorTransformer(Set<TypeReference> exceptions) { createValues(exceptions); for (TypeReference exception : exceptions) { BitVector bv = new BitVector(values.getSize()); bv.set(values.getMappedIndex(exception)); } }
private void handleString(final InstanceKey ik, final OrdinalSetMapping<InstanceKey> mapping, final Map<InstanceKeySite, Set<InstanceKey>> unresolvedDependencies) { if (isOfType(ik, "Ljava/lang/String")) { if (ik instanceof ConstantKey) { final String value = (String) ((ConstantKey<?>) ik).getValue(); final InstanceKeySite node = new ConstantString(mapping.getMappedIndex(ik), value); addNode(node); nodeMap.put(ik, node); } else if (ik instanceof NormalAllocationInNode) { final NormalAllocationInNode nain = (NormalAllocationInNode) ik; handleStringBuilderToString(nain, mapping, unresolvedDependencies); } } }
private void addPredsOfIKeyAndStateToTrackedPointsTo(InstanceKeyAndState ikAndState) throws UnimplementedError { for (Object o : Iterator2Iterable.make(g.getPredNodes(ikAndState.getInstanceKey(), NewLabel.v()))) { PointerKey ikPred = (PointerKey) o; PointerKeyAndState ikPredAndState = new PointerKeyAndState(ikPred, ikAndState.getState()); int mappedIndex = ikAndStates.getMappedIndex(ikAndState); assert mappedIndex != -1; if (findOrCreate(pkToTrackedSet, ikPredAndState).add(mappedIndex)) { addToTrackedPToWorklist(ikPredAndState); } } }
private void addPredsOfIKeyAndStateToTrackedPointsTo(InstanceKeyAndState ikAndState) throws UnimplementedError { for (Object o : Iterator2Iterable.make(g.getPredNodes(ikAndState.getInstanceKey(), NewLabel.v()))) { PointerKey ikPred = (PointerKey) o; PointerKeyAndState ikPredAndState = new PointerKeyAndState(ikPred, ikAndState.getState()); int mappedIndex = ikAndStates.getMappedIndex(ikAndState); assert mappedIndex != -1; if (findOrCreate(pkToTrackedSet, ikPredAndState).add(mappedIndex)) { addToTrackedPToWorklist(ikPredAndState); } } }