/** * Determine whether or not the given instruction is a control flow merge. * * @param handle * the instruction * @return true if the instruction is a control merge, false otherwise */ private static boolean isMerge(InstructionHandle handle) { if (handle.hasTargeters()) { // Check all targeters of this handle to see if any // of them are branches. If so, the instruction is a merge. InstructionTargeter[] targeterList = handle.getTargeters(); for (InstructionTargeter targeter : targeterList) { if (targeter instanceof BranchInstruction) { return true; } } } return false; }
InstructionHandle[] match = (InstructionHandle[]) iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters()) { il.delete(match[0], match[1]); (org.apache.bcel.generic.ISTORE) match[3].getInstruction(); if (!match[1].hasTargeters() && !match[2].hasTargeters() && !match[3].hasTargeters() && iload1.getIndex() == iload2.getIndex() && iload2.getIndex() == istore.getIndex()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters() && !match[2].hasTargeters()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[1].hasTargeters()) { org.apache.bcel.generic.ALOAD aload1 = (org.apache.bcel.generic.ALOAD) match[0].getInstruction();
if (ih.hasTargeters()) { if (inst instanceof OutlineableChunkEnd) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { InstructionTargeter[] targeters = ih.getTargeters();
/** * @return null, if there are no targeters */ public InstructionTargeter[] getTargeters() { if (!hasTargeters()) { return new InstructionTargeter[0]; } final InstructionTargeter[] t = new InstructionTargeter[targeters.size()]; targeters.toArray(t); return t; }
/** * @return null, if there are no targeters */ public InstructionTargeter[] getTargeters() { if(!hasTargeters()) return null; InstructionTargeter[] t = new InstructionTargeter[targeters.size()]; targeters.toArray(t); return t; }
/** * Determine whether or not the given instruction is a control flow merge. * * @param handle * the instruction * @return true if the instruction is a control merge, false otherwise */ private static boolean isMerge(InstructionHandle handle) { if (handle.hasTargeters()) { // Check all targeters of this handle to see if any // of them are branches. If so, the instruction is a merge. InstructionTargeter[] targeterList = handle.getTargeters(); for (InstructionTargeter targeter : targeterList) { if (targeter instanceof BranchInstruction) { return true; } } } return false; }
length--; if(ih.hasTargeters()) { // Still got targeters? target_vec.add(ih); buf.append(ih.toString(true) + " ");
InstructionHandle[] match = (InstructionHandle[]) iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters()) { il.delete(match[0], match[1]); (org.apache.bcel.generic.ISTORE) match[3].getInstruction(); if (!match[1].hasTargeters() && !match[2].hasTargeters() && !match[3].hasTargeters() && iload1.getIndex() == iload2.getIndex() && iload2.getIndex() == istore.getIndex()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters() && !match[2].hasTargeters()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[1].hasTargeters()) { org.apache.bcel.generic.ALOAD aload1 = (org.apache.bcel.generic.ALOAD) match[0].getInstruction();
InstructionHandle[] match = (InstructionHandle[]) iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters()) { il.delete(match[0], match[1]); (org.apache.bcel.generic.ISTORE) match[3].getInstruction(); if (!match[1].hasTargeters() && !match[2].hasTargeters() && !match[3].hasTargeters() && iload1.getIndex() == iload2.getIndex() && iload2.getIndex() == istore.getIndex()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters() && !match[2].hasTargeters()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[1].hasTargeters()) { org.apache.bcel.generic.ALOAD aload1 = (org.apache.bcel.generic.ALOAD) match[0].getInstruction();
InstructionHandle[] match = (InstructionHandle[]) iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters()) { il.delete(match[0], match[1]); (org.apache.bcel.generic.ISTORE) match[3].getInstruction(); if (!match[1].hasTargeters() && !match[2].hasTargeters() && !match[3].hasTargeters() && iload1.getIndex() == iload2.getIndex() && iload2.getIndex() == istore.getIndex()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[0].hasTargeters() && !match[1].hasTargeters() && !match[2].hasTargeters()) InstructionHandle[] match = (InstructionHandle[])iter.next(); try { if (!match[1].hasTargeters()) { org.apache.bcel.generic.ALOAD aload1 = (org.apache.bcel.generic.ALOAD) match[0].getInstruction();
public void start() { if(!_mg.isAbstract() && !_mg.isNative()) { for(InstructionHandle ih = _mg.getInstructionList().getStart(); ih != null; ih = ih.getNext()) { Instruction i = ih.getInstruction(); if(i instanceof BranchInstruction) { branch_map.put(i, ih); // memorize container } if(ih.hasTargeters()) { if(i instanceof BranchInstruction) { _out.println(" InstructionHandle ih_" + ih.getPosition() + ";"); } else { _out.print(" InstructionHandle ih_" + ih.getPosition() + " = "); } } else { _out.print(" "); } if(!visitInstruction(i)) i.accept(this); } updateBranchTargets(); updateExceptionHandlers(); } }
next = ih.getNext(); length--; if (ih.hasTargeters()) { // Still got targeters? target_vec.add(ih); buf.append(ih.toString(true)).append(" ");
public void start() { if (!_mg.isAbstract() && !_mg.isNative()) { for (InstructionHandle ih = _mg.getInstructionList().getStart(); ih != null; ih = ih .getNext()) { final Instruction i = ih.getInstruction(); if (i instanceof BranchInstruction) { branch_map.put(i, ih); // memorize container } if (ih.hasTargeters()) { if (i instanceof BranchInstruction) { _out.println(" InstructionHandle ih_" + ih.getPosition() + ";"); } else { _out.print(" InstructionHandle ih_" + ih.getPosition() + " = "); } } else { _out.print(" "); } if (!visitInstruction(i)) { i.accept(this); } } updateBranchTargets(); updateExceptionHandlers(); } }
if (ih.hasTargeters()) { if (inst instanceof OutlineableChunkEnd) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { InstructionTargeter[] targeters = ih.getTargeters();
if (ih.hasTargeters()) { if (inst instanceof OutlineableChunkEnd) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { InstructionTargeter[] targeters = ih.getTargeters();
if (ih.hasTargeters()) { if (inst instanceof OutlineableChunkEnd) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { targetMap.put(ih, lastCopyHandle); if (ih.hasTargeters()) { InstructionTargeter[] targeters = ih.getTargeters();
if (oldIfHandle.hasTargeters()) { InstructionTargeter[] targeters = oldIfHandle.getTargeters();
if (oldIfHandle.hasTargeters()) { InstructionTargeter[] targeters = oldIfHandle.getTargeters();