/** * Return whether or not the basic block contains the given instruction. * * @param handle * the instruction * @return true if the block contains the instruction, false otherwise */ public boolean containsInstruction(InstructionHandle handle) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next() == handle) { return true; } } return false; }
protected Iterator<InstructionHandle> instructionIterator(BasicBlock bb) { if (isForwards) { return bb.instructionIterator(); } else { return bb.instructionReverseIterator(); } }
/** * Return whether or not the basic block contains the instruction with the * given bytecode offset. * * @param offset * the bytecode offset * @return true if the block contains an instruction with the given offset, * false if it does not */ public boolean containsInstructionWithOffset(int offset) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next().getPosition() == offset) { return true; } } return false; }
private void findNext() { while (next == null) { // Make sure we have an instruction iterator if (instructionIter == null) { if (!blockIter.hasNext()) { return; // At end } curBlock = blockIter.next(); instructionIter = curBlock.instructionIterator(); } if (instructionIter.hasNext()) { next = new Location(instructionIter.next(), curBlock); } else { instructionIter = null; // Go to next block } } } }
public void checkIntegrity() { // Ensure that basic blocks have only consecutive instructions for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) { BasicBlock basicBlock = i.next(); InstructionHandle prev = null; for (Iterator<InstructionHandle> j = basicBlock.instructionIterator(); j.hasNext();) { InstructionHandle handle = j.next(); if (prev != null && prev.getNext() != handle) { throw new IllegalStateException("Non-consecutive instructions in block " + basicBlock.getLabel() + ": prev=" + prev + ", handle=" + handle); } prev = handle; } } }
@Override public void transfer(BasicBlock basicBlock, @CheckForNull InstructionHandle end, Fact start, Fact result) throws DataflowAnalysisException { copy(start, result); if (isFactValid(result)) { Iterator<InstructionHandle> i = isForwards() ? basicBlock.instructionIterator() : basicBlock .instructionReverseIterator(); while (i.hasNext()) { InstructionHandle handle = i.next(); if (handle == end) { break; } if (DEBUG && end == null) { System.out.print("Transfer " + handle); } // Transfer the dataflow value transferInstruction(handle, basicBlock, result); if (DEBUG && end == null) { System.out.println(" ==> " + result.toString()); } } } }
BasicBlock.InstructionIterator i = basicBlock.instructionIterator(); while (i.hasNext()) { attemptMatch(basicBlock, i.duplicate());
Iterator<InstructionHandle> i = source.instructionIterator(); int count = 0; while (i.hasNext()) {
for (Iterator<InstructionHandle> j = block.instructionIterator(); j.hasNext();) { InstructionHandle next = j.next(); if (includeInstructions) {
while (i.hasNext()) { BasicBlock block = i.next(); Iterator<InstructionHandle> j = block.instructionIterator(); while (j.hasNext()) { InstructionHandle handle = j.next();
Iterator<InstructionHandle> i = startBlock.instructionIterator(); i = basicBlock.instructionIterator();
/** * Return a new State for continuing the overall pattern match in a * successor basic block. * * @param edge * the Edge leading to the successor basic block * @param matchResult * a MatchResult representing the match of the last * instruction in the predecessor block; null if none */ public State advanceToSuccessor(Edge edge, MatchResult matchResult) { // If we have just matched an instruction, then we allow the // matching PatternElement to choose which edges are acceptable. // This allows PatternElements to select particular control edges; // for example, only continue the pattern on the true branch // of an "if" comparison. if (matchResult != null && !matchResult.getPatternElement().acceptBranch(edge, getLastMatchedInstruction())) { return null; } return new State(this, edge.getTarget(), edge.getTarget().instructionIterator(), patternElement, matchCount, currentMatch, bindingSet, canFork); }
boolean sawNEW = false, sawINVOKE = false; for (BasicBlock block : cfg.getBlocks(extent)) { for (Iterator<InstructionHandle> j = block.instructionIterator(); j.hasNext();) { InstructionHandle handle = j.next(); if (handle.equals(store.getMatchedInstructionInstructionHandle())) { for (Iterator<InstructionHandle> j = block.instructionIterator(); j.hasNext();) { InstructionHandle handle = j.next();
Iterator<org.apache.bcel.generic.InstructionHandle> ii = block.instructionIterator(); while (ii.hasNext()) { org.apache.bcel.generic.InstructionHandle handle = ii.next();
BasicBlock.InstructionIterator insIter = subBlock.instructionIterator(); while (insIter.hasNext()) { InstructionHandle handle = insIter.next();
/** * Return whether or not the basic block contains the given instruction. * * @param handle * the instruction * @return true if the block contains the instruction, false otherwise */ public boolean containsInstruction(InstructionHandle handle) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next() == handle) { return true; } } return false; }
protected Iterator<InstructionHandle> instructionIterator(BasicBlock bb) { if (isForwards) { return bb.instructionIterator(); } else { return bb.instructionReverseIterator(); } }
/** * Return whether or not the basic block contains the instruction with the * given bytecode offset. * * @param offset * the bytecode offset * @return true if the block contains an instruction with the given offset, * false if it does not */ public boolean containsInstructionWithOffset(int offset) { Iterator<InstructionHandle> i = instructionIterator(); while (i.hasNext()) { if (i.next().getPosition() == offset) { return true; } } return false; }
private void findNext() { while (next == null) { // Make sure we have an instruction iterator if (instructionIter == null) { if (!blockIter.hasNext()) { return; // At end } curBlock = blockIter.next(); instructionIter = curBlock.instructionIterator(); } if (instructionIter.hasNext()) { next = new Location(instructionIter.next(), curBlock); } else { instructionIter = null; // Go to next block } } } }
public void checkIntegrity() { // Ensure that basic blocks have only consecutive instructions for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) { BasicBlock basicBlock = i.next(); InstructionHandle prev = null; for (Iterator<InstructionHandle> j = basicBlock.instructionIterator(); j.hasNext();) { InstructionHandle handle = j.next(); if (prev != null && prev.getNext() != handle) { throw new IllegalStateException("Non-consecutive instructions in block " + basicBlock.getLabel() + ": prev=" + prev + ", handle=" + handle); } prev = handle; } } }