@Override public void action(AbstractFieldPointerKey fieldKey) { if (!representsNullType(fieldKey.getInstanceKey())) { for (InstanceKey rhsFixedValue : rhsFixedValues) { system.findOrCreateIndexForInstanceKey(rhsFixedValue); system.newConstraint(fieldKey, rhsFixedValue); } } } }
/** * Handle assign of a particular exception instance into an exception variable * * @param exceptionVar points-to set for a variable representing a caught exception * @param catchClasses set of TypeReferences that the exceptionVar may catch * @param e a particular exception instance */ protected void assignInstanceToCatch(PointerKey exceptionVar, Set<IClass> catchClasses, InstanceKey e) { if (catches(catchClasses, e.getConcreteType(), cha)) { system.newConstraint(exceptionVar, e); } }
@Override public void action(AbstractFieldPointerKey fieldKey) { if (!representsNullType(fieldKey.getInstanceKey())) { system.newConstraint(fieldKey, assignOperator, rhs); } } }
@Override public boolean addFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { int idx = system.findOrCreateIndexForInstanceKey(concreteType); if (R.contains(idx)) { return L.add(idx); } return false; }
public void newSideEffect(AbstractOperator<PointsToSetVariable> op, PointerKey arg0, PointerKey arg1) { if (DEBUG) { System.err.println("add constraint D: " + op + ' ' + arg0); } assert !pointsToMap.isUnified(arg0); assert !pointsToMap.isUnified(arg1); PointsToSetVariable v1 = findOrCreatePointsToSet(arg0); PointsToSetVariable v2 = findOrCreatePointsToSet(arg1); newStatement(null, op, v1, v2, true, true); }
private int compareFieldKey(InstanceFieldKey key1, Object key2) { if (key2 instanceof InstanceFieldKey) { int r1 = compareInstanceKeys(key1.getInstanceKey(), ((InstanceFieldKey)key2).getInstanceKey()); if (r1 != 0) return r1; else { return compareFields(key1.getField(), ((InstanceFieldKey)key2).getField()); } } else return -1; }
@Override protected PropagationSystem makeSystem(AnalysisOptions options) { PropagationSystem result = super.makeSystem(options); result.setVerboseInterval(VERBOSE_INTERVAL); result.setPeriodicMaintainInterval(PERIODIC_MAINTAIN_INTERVAL); return result; }
@Override public boolean equals(Object o) { if (o instanceof AssignEquation) { AssignEquation other = (AssignEquation) o; return getLHS().equals(other.getLHS()) && getRightHandSide().equals(other.getRightHandSide()); } else { return false; } } }
@SuppressWarnings("unused") private static boolean isRootType(FilteredPointerKey.TypeFilter filter) { if (filter instanceof FilteredPointerKey.SingleClassFilter) { return isRootType(((FilteredPointerKey.SingleClassFilter) filter).getConcreteType()); } else { return false; } }
@Override public boolean addFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { IntSet f = system.getInstanceKeysForClass(concreteType); return (f == null) ? false : L.addAllInIntersection(R, f); }
@Override public boolean addFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { IntSet f = bits(system); return (f == null) ? false : L.addAllInIntersection(R, f); }
/** * Update side effect after unification * * @param s set of PointsToSetVariables that have been unified * @param rep number of the representative variable for the unified set. */ private void updateSideEffectsForUnification(HashSet<PointsToSetVariable> s, int rep) { PointsToSetVariable pRef = pointsToMap.getPointsToSet(rep); for (PointsToSetVariable p : s) { updateSideEffects(p, pRef); } }
/** * Handle assign of a particular exception instance into an exception variable * * @param exceptionVar points-to set for a variable representing a caught exception * @param catchClasses set of TypeReferences that the exceptionVar may catch * @param e a particular exception instance */ protected void assignInstanceToCatch(PointerKey exceptionVar, Set<IClass> catchClasses, InstanceKey e) { if (catches(catchClasses, e.getConcreteType(), cha)) { system.newConstraint(exceptionVar, e); } }
@Override public void action(AbstractFieldPointerKey fieldKey) { if (!representsNullType(fieldKey.getInstanceKey())) { for (InstanceKey rhsFixedValue : rhsFixedValues) { system.findOrCreateIndexForInstanceKey(rhsFixedValue); system.newConstraint(fieldKey, rhsFixedValue); } } } }
@Override public void action(AbstractFieldPointerKey fieldKey) { if (!representsNullType(fieldKey.getInstanceKey())) { system.newConstraint(fieldKey, assignOperator, rhs); } } }
private int compareFieldKey(InstanceFieldKey key1, Object key2) { if (key2 instanceof InstanceFieldKey) { int r1 = compareInstanceKeys(key1.getInstanceKey(), ((InstanceFieldKey)key2).getInstanceKey()); if (r1 != 0) return r1; else { return compareFields(key1.getField(), ((InstanceFieldKey)key2).getField()); } } else return -1; }
@Override protected PropagationSystem makeSystem(AnalysisOptions options) { PropagationSystem result = super.makeSystem(options); result.setVerboseInterval(VERBOSE_INTERVAL); result.setPeriodicMaintainInterval(PERIODIC_MAINTAIN_INTERVAL); return result; }
@SuppressWarnings("unused") private static boolean isRootType(FilteredPointerKey.TypeFilter filter) { if (filter instanceof FilteredPointerKey.SingleClassFilter) { return isRootType(((FilteredPointerKey.SingleClassFilter) filter).getConcreteType()); } else { return false; } }
@Override public boolean addFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { IntSet f = system.getInstanceKeysForClass(concreteType); return (f == null) ? false : L.addAllInIntersection(R, f); }
@Override public boolean addFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { IntSet f = bits(system); return (f == null) ? false : L.addAllInIntersection(R, f); }