@Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("[basicBlock="); buf.append(getBasicBlock().getLabel()); if (next != null) { buf.append(", next=" + next); } else if (getBasicBlock().isExceptionThrower()) { buf.append(", check for" + getBasicBlock().getExceptionThrower()); } else { buf.append(", end"); } buf.append(']'); return buf.toString(); } }
/** * Try to produce a new state that will finish matching the current * element and start matching the next element. Returns null if the * current element is not complete. */ public State advanceToNextElement() { if (!canFork || matchCount < patternElement.minOccur()) { // Current element is not complete, or we already // forked at this point return null; } // Create state to advance to matching next pattern element // at current basic block and instruction. State advance = new State(this, basicBlock, instructionIterator.duplicate(), patternElement.getNext(), 0, currentMatch, bindingSet, true); // Now that this state has forked from this element // at this instruction, it must not do so again. this.canFork = false; return advance; }
@Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("[basicBlock="); buf.append(getBasicBlock().getLabel()); if (next != null) { buf.append(", next=" + next); } else if (getBasicBlock().isExceptionThrower()) { buf.append(", check for" + getBasicBlock().getExceptionThrower()); } else { buf.append(", end"); } buf.append(']'); return buf.toString(); } }
public InstructionIterator duplicate() { return new InstructionIterator(next, last); }
/** * Match current pattern element with next instruction in basic block. * Returns MatchResult if match succeeds, null otherwise. */ public MatchResult matchNextInBasicBlock() throws DataflowAnalysisException { if (!moreInstructionsInBasicBlock()) { throw new IllegalStateException("At end of BB!"); } // Move to location of next instruction to be matched Location location = new Location(instructionIterator.next(), basicBlock); return matchLocation(location); }
/** * Determine if there are more instructions in the same basic block. */ public boolean moreInstructionsInBasicBlock() { return instructionIterator.hasNext(); }
/** * Get an Iterator over the instructions in the basic block. */ public InstructionIterator instructionIterator() { return new InstructionIterator(firstInstruction, lastInstruction); }
@Override public int hashCode() { int code = getBasicBlock().hashCode() * 227; if (next != null) { code += next.getPosition() + 1; } return code; }
@Override public InstructionHandle next() { if (!hasNext()) { throw new NoSuchElementException(); } InstructionHandle result = next; next = (result == last) ? null : next.getNext(); return result; }
/** * Try to produce a new state that will finish matching the current * element and start matching the next element. Returns null if the * current element is not complete. */ public State advanceToNextElement() { if (!canFork || matchCount < patternElement.minOccur()) { // Current element is not complete, or we already // forked at this point return null; } // Create state to advance to matching next pattern element // at current basic block and instruction. State advance = new State(this, basicBlock, instructionIterator.duplicate(), patternElement.getNext(), 0, currentMatch, bindingSet, true); // Now that this state has forked from this element // at this instruction, it must not do so again. this.canFork = false; return advance; }
/** * Match current pattern element with next instruction in basic block. * Returns MatchResult if match succeeds, null otherwise. */ public MatchResult matchNextInBasicBlock() throws DataflowAnalysisException { if (!moreInstructionsInBasicBlock()) { throw new IllegalStateException("At end of BB!"); } // Move to location of next instruction to be matched Location location = new Location(instructionIterator.next(), basicBlock); return matchLocation(location); }
public InstructionIterator duplicate() { return new InstructionIterator(next, last); }
/** * Determine if there are more instructions in the same basic block. */ public boolean moreInstructionsInBasicBlock() { return instructionIterator.hasNext(); }
@Override public InstructionHandle next() { if (!hasNext()) { throw new NoSuchElementException(); } InstructionHandle result = next; next = (result == last) ? null : next.getNext(); return result; }