/** * Replace current instruction contained in this handle. * Old instruction is disposed using Instruction.dispose(). */ public void setInstruction(Instruction i) { // Overridden in BranchHandle if(i == null) throw new ClassGenException("Assigning null to handle"); if((this.getClass() != BranchHandle.class) && (i instanceof BranchInstruction)) throw new ClassGenException("Assigning branch instruction " + i + " to plain handle"); if(instruction != null) instruction.dispose(); instruction = i; }
/** * Delete contents, i.e., remove user access and make handle reusable. */ void dispose() { next = prev = null; instruction.dispose(); instruction = null; i_position = -1; attributes = null; removeAllTargeters(); addHandle(); }
/** * Delete contents, i.e., remove user access and make handle reusable. */ void dispose() { next = prev = null; instruction.dispose(); instruction = null; i_position = -1; attributes = null; removeAllTargeters(); addHandle(); }
/** * Replace current instruction contained in this handle. * Old instruction is disposed using Instruction.dispose(). */ public void setInstruction( final Instruction i ) { // Overridden in BranchHandle TODO could be package-protected? if (i == null) { throw new ClassGenException("Assigning null to handle"); } if ((this.getClass() != BranchHandle.class) && (i instanceof BranchInstruction)) { throw new ClassGenException("Assigning branch instruction " + i + " to plain handle"); } if (instruction != null) { instruction.dispose(); } instruction = i; }
ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets
final List<InstructionHandle> target_vec = new ArrayList<>(); for (InstructionHandle ih = first; ih != null; ih = ih.getNext()) { ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets