* @see InstructionHandle
* @see Instruction
* @see InstructionList
- * @version $Id: BranchHandle.java,v 1.2 2004/11/19 16:45:19 aclement Exp $
+ * @version $Id: BranchHandle.java,v 1.3 2007/05/22 09:11:40 aclement Exp $
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
*/
public final class BranchHandle extends InstructionHandle {
/** Factory methods.
*/
- private static BranchHandle bh_list = null; // List of reusable handles
static final BranchHandle getBranchHandle(BranchInstruction i) {
- if(bh_list == null)
return new BranchHandle(i);
- else {
- BranchHandle bh = bh_list;
- bh_list = (BranchHandle)bh.next;
-
- bh.setInstruction(i);
-
- return bh;
- }
- }
-
- /** Handle adds itself to the list of resuable handles.
- */
- protected void addHandle() {
- next = bh_list;
- bh_list = this;
}
/* Override InstructionHandle methods: delegate to branch instruction.
* can traverse the list via an Enumeration returned by
* InstructionList.elements().
*
- * @version $Id: InstructionHandle.java,v 1.2 2004/11/19 16:45:19 aclement Exp $
+ * @version $Id: InstructionHandle.java,v 1.3 2007/05/22 09:11:40 aclement Exp $
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
* @see Instruction
* @see BranchHandle
setInstruction(i);
}
- private static InstructionHandle ih_list = null; // List of reusable handles
/** Factory method.
*/
static final InstructionHandle getInstructionHandle(Instruction i) {
- if(ih_list == null)
return new InstructionHandle(i);
- else {
- InstructionHandle ih = ih_list;
- ih_list = ih.next;
-
- ih.setInstruction(i);
-
- return ih;
- }
}
/**
*/
void setPosition(int pos) { i_position = pos; }
- /** Overridden in BranchHandle
- */
- protected void addHandle() {
- next = ih_list;
- ih_list = this;
- }
/**
* Delete contents, i.e., remove user access and make handle reusable.
i_position = -1;
attributes = null;
removeAllTargeters();
- addHandle();
}
/** Remove all targeters, if any.