@Override protected boolean skip(int i) { return (i >= 0) && (i <= limit) && (!values.contains(i)); } };
/** * @param gen * the intset of facts which are gen'ned by this flow function. gen * <em>must</em> contain 0. */ private VectorGenFlowFunction(IntSet gen) { this.gen = gen; assert gen.contains(0); }
@Override protected boolean skip(int i) { return (i >= 0) && (i <= limit) && (!values.contains(i)); } };
/** * @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); }
/** * @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); }
/** * @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 void foreachExcluding(IntSet X, IntSetAction action) { if (action == null) { throw new IllegalArgumentException("null action"); } for (int i = 0; i < size; i++) { if (!X.contains(elements[i])) { action.act(elements[i]); } } }
@Override public void foreachExcluding(IntSet X, IntSetAction action) { if (action == null) { throw new IllegalArgumentException("null action"); } for (int i = 0; i < size; i++) { if (!X.contains(elements[i])) { action.act(elements[i]); } } }
@Override public boolean hasEdge(T src, T dst) throws IllegalArgumentException { if (dst == null) { throw new IllegalArgumentException("dst == null"); } return getSuccNodeNumbers(src).contains(dst.getGraphNodeId()); }
@Override public boolean hasEdge(T src, T dst) throws IllegalArgumentException { if (dst == null) { throw new IllegalArgumentException("dst == null"); } return getSuccNodeNumbers(src).contains(dst.getGraphNodeId()); }
@Override public boolean hasEdge(T src, T dst) throws IllegalArgumentException { if (dst == null) { throw new IllegalArgumentException("dst == null"); } return getSuccNodeNumbers(src).contains(dst.getGraphNodeId()); }
@Override public List<T> getExceptionalSuccessors(T b) { final List<T> origSucc = orig.getExceptionalSuccessors(b); final IntSet allSuccs = this.getSuccNodeNumbers(b); final List<T> thisSuccs = new LinkedList<>(); for (final T block : origSucc) { if (allSuccs.contains(block.getNumber())) { thisSuccs.add(block); } } return thisSuccs; }
@Override public List<T> getExceptionalSuccessors(T b) { final List<T> origSucc = orig.getExceptionalSuccessors(b); final IntSet allSuccs = this.getSuccNodeNumbers(b); final List<T> thisSuccs = new LinkedList<>(); for (final T block : origSucc) { if (allSuccs.contains(block.getNumber())) { thisSuccs.add(block); } } return thisSuccs; }
private void slowForeachExcluding(IntSet X, IntSetAction action) { populationCount = (populationCount == UNDEFINED) ? bitVector.populationCount() : populationCount; for (int i = 0, count = 0; count < populationCount; i++) { if (contains(i)) { if (!X.contains(i)) { action.act(i); } count++; } } }
private void slowForeachExcluding(IntSet X, IntSetAction action) { populationCount = (populationCount == UNDEFINED) ? bitVector.populationCount() : populationCount; for (int i = 0, count = 0; count < populationCount; i++) { if (contains(i)) { if (!X.contains(i)) { action.act(i); } count++; } } }
private IntSet getRelevantParameters(final CGNode caller, final CallSiteReference site) throws UnimplementedError { IntSet params = contextSelector.getRelevantParameters(caller, site); if (!site.isStatic() && !params.contains(0)) { params = IntSetUtil.makeMutableCopy(params); ((MutableIntSet)params).add(0); } return params; }
@Override public boolean hasNoInterestingUses(CGNode node, int vn, DefUse du) { if (node.getMethod() instanceof AstMethod) { // uses in nested functions are interesting IntSet uses = ((AstIRFactory.AstIR) node.getIR()).lexicalInfo().getAllExposedUses(); if (uses.contains(vn)) { return false; } } return super.hasNoInterestingUses(node, vn, du); }
protected Iterator<CallSiteReference> getPossibleSites(final CGNode to) { final int n = getCallGraph().getNumber(to); return new FilterIterator<>(iterateCallSites(), o -> { IntSet s = getPossibleTargetNumbers(o); return s == null ? false : s.contains(n); }); }
private void handleLexicalDef(int def) { assert def != -1; if(instructionIndex != -1 && exposedVars.contains(def)) { VarVertex v = factory.makeVarVertex(func, def); for(String localName : ir.getLocalNames(instructionIndex, def)) flowgraph.addEdge(v, factory.makeLexicalAccessVertex(lexicalInfo.getScopingName(), localName)); } }
@Override public boolean hasNoInterestingUses(CGNode node, int vn, DefUse du) { if (node.getMethod() instanceof AstMethod) { // uses in nested functions are interesting IntSet uses = ((AstIRFactory.AstIR) node.getIR()).lexicalInfo().getAllExposedUses(); if (uses.contains(vn)) { return false; } } return super.hasNoInterestingUses(node, vn, du); }