@Override public void foreach(IntSetAction action) { impl.foreach(action); }
@Override public void foreach(IntSetAction action) { impl.foreach(action); }
@Override public void foreach(IntSetAction action) { impl.foreach(action); }
/** * Invoke an action on each element of the Set */ @Override public void foreach(IntSetAction action) { final Set<Integer> bits = HashSetFactory.make(); primaryImpl.foreach(x -> { assert !bits.contains(Integer.valueOf(x)); bits.add(Integer.valueOf(x)); }); secondaryImpl.foreach(x -> { assert bits.contains(Integer.valueOf(x)); bits.remove(Integer.valueOf(x)); }); assert bits.isEmpty(); primaryImpl.foreach(action); }
@Override public void removeOutgoingEdges() { if (succs != null) { succs.foreach(new IntSetAction() { @Override public void act(int x) { currentGraph.getNode(x).preds.remove(nodeNumber); } }); succs.clear(); } }
/** * Invoke an action on each element of the Set */ @Override public void foreach(IntSetAction action) { final Set<Integer> bits = HashSetFactory.make(); primaryImpl.foreach(x -> { assert !bits.contains(Integer.valueOf(x)); bits.add(Integer.valueOf(x)); }); secondaryImpl.foreach(x -> { assert bits.contains(Integer.valueOf(x)); bits.remove(Integer.valueOf(x)); }); assert bits.isEmpty(); primaryImpl.foreach(action); }
/** * Invoke an action on each element of the Set */ @Override public void foreach(IntSetAction action) { final Set<Integer> bits = HashSetFactory.make(); primaryImpl.foreach(x -> { assert !bits.contains(Integer.valueOf(x)); bits.add(Integer.valueOf(x)); }); secondaryImpl.foreach(x -> { assert bits.contains(Integer.valueOf(x)); bits.remove(Integer.valueOf(x)); }); assert bits.isEmpty(); primaryImpl.foreach(action); }
@Override public void removeIncomingEdges() { if (preds != null) { preds.foreach(new IntSetAction() { @Override public void act(int x) { currentGraph.getNode(x).succs.remove(nodeNumber); } }); preds.clear(); } }
@Override public boolean addInverseFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { if (R.getValue() == null) { return false; } else { UpdateAction act = new UpdateAction(system, L, false); R.getValue().foreach(act); return act.result; } }
@Override public boolean addInverseFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { if (R.getValue() == null) { return false; } else { UpdateAction act = new UpdateAction(system, L, false); R.getValue().foreach(act); return act.result; } }
@Override public boolean addFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { if (R.getValue() == null) { return false; } else { UpdateAction act = new UpdateAction(system, L, true); R.getValue().foreach(act); return act.result; } }
@Override public boolean addFiltered(PropagationSystem system, PointsToSetVariable L, PointsToSetVariable R) { if (R.getValue() == null) { return false; } else { UpdateAction act = new UpdateAction(system, L, true); R.getValue().foreach(act); return act.result; } }
@Override public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) { IntSetVariable<?> tv = rhs; if (tv.getValue() != null) { tv.getValue().foreach(ptr -> { InstanceKey iKey = system.getInstanceKey(ptr); PointerKey enclosing = new EnclosingObjectReferenceKey(iKey, cls); system.newConstraint(lvalKey, assignOperator, enclosing); }); } return NOT_CHANGED; }
@Override public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) { IntSetVariable<?> tv = rhs; if (tv.getValue() != null) { tv.getValue().foreach(ptr -> { InstanceKey iKey = system.getInstanceKey(ptr); PointerKey enclosing = new EnclosingObjectReferenceKey(iKey, cls); system.newConstraint(lvalKey, assignOperator, enclosing); }); } return NOT_CHANGED; }
@Override public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) { final IntSetVariable<?> objects = rhs; if (objects.getValue() != null) { objects.getValue().foreach(optr -> { InstanceKey object = system.getInstanceKey(optr); PointerKey objCatalog = getPointerKeyForObjectCatalog(object); if (objCatalog != null) { system.newConstraint(lk, assignOperator, objCatalog); } }); } return NOT_CHANGED; }
@Override public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) { final IntSetVariable<?> objects = rhs; if (objects.getValue() != null) { objects.getValue().foreach(optr -> { InstanceKey object = system.getInstanceKey(optr); PointerKey objCatalog = getPointerKeyForObjectCatalog(object); if (objCatalog != null) { system.newConstraint(lk, assignOperator, objCatalog); } }); } return NOT_CHANGED; }
@Override public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) { final IntSetVariable<?> objects = rhs; if (objects.getValue() != null) { objects.getValue().foreach(optr -> { InstanceKey object = system.getInstanceKey(optr); if (!getBuilder().isUncataloguedField(object.getConcreteType(), hack)) { PointerKey cat = getPointerKeyForObjectCatalog(object); if (cat != null) { system.newConstraint(cat, fieldNameKeys[0]); } } }); } return NOT_CHANGED; }
@Override public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) { final IntSetVariable<?> objects = rhs; if (objects.getValue() != null) { objects.getValue().foreach(optr -> { InstanceKey object = system.getInstanceKey(optr); if (!getBuilder().isUncataloguedField(object.getConcreteType(), hack)) { PointerKey cat = getPointerKeyForObjectCatalog(object); if (cat != null) { system.newConstraint(cat, fieldNameKeys[0]); } } }); } return NOT_CHANGED; }
public static IntSet getArgumentsArrayVns(IR ir, final DefUse du) { int originalArgsVn = getArgumentsArrayVn(ir); final MutableIntSet result = IntSetUtil.make(); if (originalArgsVn == -1) { return result; } result.add(originalArgsVn); int size; do { size = result.size(); result.foreach(vn -> { for(SSAInstruction inst : Iterator2Iterable.make(du.getUses(vn))) { if (inst instanceof PrototypeLookup || inst instanceof SSAPhiInstruction) { result.add(inst.getDef()); } } }); } while (size != result.size()); return result; }
public static IntSet getArgumentsArrayVns(IR ir, final DefUse du) { int originalArgsVn = getArgumentsArrayVn(ir); final MutableIntSet result = IntSetUtil.make(); if (originalArgsVn == -1) { return result; } result.add(originalArgsVn); int size; do { size = result.size(); result.foreach(vn -> { for(SSAInstruction inst : Iterator2Iterable.make(du.getUses(vn))) { if (inst instanceof PrototypeLookup || inst instanceof SSAPhiInstruction) { result.add(inst.getDef()); } } }); } while (size != result.size()); return result; }