/** * Remove all NOPs from the instruction list (if possible) and update every * object refering to them, i.e., branch instructions, local variables and * exception handlers. */ public void removeNOPs() { if(il != null) { InstructionHandle next; /* Check branch instructions. */ for(InstructionHandle ih = il.getStart(); ih != null; ih = next) { next = ih.next; if((next != null) && (ih.getInstruction() instanceof NOP)) { try { il.delete(ih); } catch(TargetLostException e) { InstructionHandle[] targets = e.getTargets(); for(int i=0; i < targets.length; i++) { InstructionTargeter[] targeters = targets[i].getTargeters(); for(int j=0; j < targeters.length; j++) targeters[j].updateTarget(targets[i], next); } } } } } }
/** * Remove all NOPs from the instruction list (if possible) and update every * object refering to them, i.e., branch instructions, local variables and * exception handlers. */ public void removeNOPs() { if(il != null) { InstructionHandle next; /* Check branch instructions. */ for(InstructionHandle ih = il.getStart(); ih != null; ih = next) { next = ih.next; if((next != null) && (ih.getInstruction() instanceof NOP)) { try { il.delete(ih); } catch(TargetLostException e) { InstructionHandle[] targets = e.getTargets(); for(int i=0; i < targets.length; i++) { InstructionTargeter[] targeters = targets[i].getTargeters(); for(int j=0; j < targeters.length; j++) targeters[j].updateTarget(targets[i], next); } } } } } }