/** * @return an {@link Iterator} of all instructions (Normal, Phi, and Catch) */ public Iterator<SSAInstruction> iterateAllInstructions() { return new CompoundIterator<>(iterateNormalInstructions(), new CompoundIterator<>( iterateCatchInstructions(), new CompoundIterator<>(iteratePhis(), iteratePis()))); }
/** * @return an {@link Iterator} of all instructions (Normal, Phi, and Catch) */ public Iterator<SSAInstruction> iterateAllInstructions() { return new CompoundIterator<>(iterateNormalInstructions(), new CompoundIterator<>( iterateCatchInstructions(), new CompoundIterator<>(iteratePhis(), iteratePis()))); }
@Override public Iterator<T> iterator() { return new CompoundIterator<>(original.iterator(), additionalNodes.iterator()); }
@Override public Iterator<T> iterator() { return new CompoundIterator<>(original.iterator(), additionalNodes.iterator()); }
@Override public Iterator<T> iterator() { return new CompoundIterator<>(original.iterator(), additionalNodes.iterator()); }
@Override public Iterator<Object> iterator() { return new CompoundIterator<>(pointerKeys.iterator(), P.getInstanceKeyMapping().iterator()); }
@Override public Iterator<Object> iterator() { return new CompoundIterator<>(pointerKeys.iterator(), P.getInstanceKeyMapping().iterator()); }
@Override public Iterator<T> getSuccNodes(T N) { int number = getNumber(N); if (normalToExit.get(number) && exceptionalToExit.get(number)) { return new CompoundIterator<>(iterateNormalSuccessorsWithoutExit(number), iterateExceptionalSuccessors(number)); } else { return new CompoundIterator<>(iterateNormalSuccessors(number), iterateExceptionalSuccessors(number)); } }
@Override public Iterator<T> getSuccNodes(T N) { int number = getNumber(N); if (normalToExit.get(number) && exceptionalToExit.get(number)) { return new CompoundIterator<>(iterateNormalSuccessorsWithoutExit(number), iterateExceptionalSuccessors(number)); } else { return new CompoundIterator<>(iterateNormalSuccessors(number), iterateExceptionalSuccessors(number)); } }
@Override public Iterator<T> getSuccNodes(T n) { Iterator<T> orig = (original.containsNode(n)? original.getSuccNodes(n): EmptyIterator.<T>instance()); return new CompoundIterator<>(orig, nodes(n, outEdges)); }
public void repOk() { for (MemoryAccess m : Iterator2Iterable.make(new CompoundIterator<>(arrayReads.iterator(), arrayWrites.iterator()))) { CGNode node = m.getNode(); IR ir = node.getIR(); assert ir != null : "null IR for " + node + " but we have a memory access"; SSAInstruction[] instructions = ir.getInstructions(); int instructionIndex = m.getInstructionIndex(); assert instructionIndex >= 0 && instructionIndex < instructions.length : "instruction index " + instructionIndex + " out of range for " + node + ", which has " + instructions.length + " instructions"; SSAInstruction s = instructions[m.getInstructionIndex()]; if (s == null) { // this is possible due to dead bytecodes continue; } assert s instanceof SSAArrayReferenceInstruction || s instanceof SSANewInstruction : "bad type " + s.getClass() + " for array access instruction"; } } }
public void repOk() { for (MemoryAccess m : Iterator2Iterable.make(new CompoundIterator<>(arrayReads.iterator(), arrayWrites.iterator()))) { CGNode node = m.getNode(); IR ir = node.getIR(); assert ir != null : "null IR for " + node + " but we have a memory access"; SSAInstruction[] instructions = ir.getInstructions(); int instructionIndex = m.getInstructionIndex(); assert instructionIndex >= 0 && instructionIndex < instructions.length : "instruction index " + instructionIndex + " out of range for " + node + ", which has " + instructions.length + " instructions"; SSAInstruction s = instructions[m.getInstructionIndex()]; if (s == null) { // this is possible due to dead bytecodes continue; } assert s instanceof SSAArrayReferenceInstruction || s instanceof SSANewInstruction : "bad type " + s.getClass() + " for array access instruction"; } } }
@Override public Iterator<T> getSuccNodes(T n) { Iterator<T> orig = (original.containsNode(n)? original.getSuccNodes(n): EmptyIterator.<T>instance()); return new CompoundIterator<>(orig, nodes(n, outEdges)); }
@Override public Iterator<T> getPredNodes(T n) { Iterator<T> orig = (original.containsNode(n)? original.getPredNodes(n): EmptyIterator.<T>instance()); return new CompoundIterator<>(orig, nodes(n, inEdges)); }
@Override public Iterator<T> getPredNodes(T n) { Iterator<T> orig = (original.containsNode(n)? original.getPredNodes(n): EmptyIterator.<T>instance()); return new CompoundIterator<>(orig, nodes(n, inEdges)); }
@Override public Iterator<T> getPredNodes(T n) { Iterator<T> orig = (original.containsNode(n)? original.getPredNodes(n): EmptyIterator.<T>instance()); return new CompoundIterator<>(orig, nodes(n, inEdges)); }
@Override public Iterator<AbstractStatement> getStatements() { Iterator<AbstractStatement> it = IteratorUtil.filter(delegateGraph.iterator(), AbstractStatement.class); return new CompoundIterator<>(it, new GlobalImplicitIterator()); }
@Override public Iterator<T> getSuccNodes(T n) { Iterator<T> orig = (original.containsNode(n)? original.getSuccNodes(n): EmptyIterator.<T>instance()); return new CompoundIterator<>(orig, nodes(n, outEdges)); }
@Override public Iterator<AbstractStatement> getStatements() { Iterator<AbstractStatement> it = IteratorUtil.filter(delegateGraph.iterator(), AbstractStatement.class); return new CompoundIterator<>(it, new GlobalImplicitIterator()); }
@Override @SuppressWarnings("unchecked") public Iterator<AbstractStatement> getStatementsThatDef(PointsToSetVariable v) { if (v == null) { throw new IllegalArgumentException("v is null"); } int number = v.getGraphNodeId(); if (number == -1) { return EmptyIterator.instance(); } Iterator<INodeWithNumber> result = delegateGraph.getPredNodes(v); for (int i = 0; i < implicitUnaryMap.size(); i++) { UnaryOperator op = implicitUnaryMap.getKey(i); IBinaryNaturalRelation R = implicitUnaryMap.getValue(i); IntSet s = R.getRelated(number); if (s != null) { result = new CompoundIterator<>(new ImplicitDefIterator(op, s, v), result); } } List<AbstractStatement> list = new ArrayList<>(); while (result.hasNext()) { list.add((AbstractStatement) result.next()); } return list.iterator(); }