public class InstructionHandle extends Object
Instruction
,
BranchHandle
,
InstructionList
Modifier and Type | Field and Description |
---|---|
protected int |
i_position
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
Modifier | Constructor and Description |
---|---|
protected |
InstructionHandle(Instruction i) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor v)
Convenience method, simply calls accept() on the contained instruction.
|
void |
addAttribute(Object key,
Object attr)
Add an attribute to an instruction handle.
|
protected void |
addHandle()
Deprecated.
Does nothing as of 6.3.1.
|
void |
addTargeter(InstructionTargeter t)
Denote this handle is being referenced by t.
|
Object |
getAttribute(Object key)
Get attribute of an instruction handle.
|
Collection<Object> |
getAttributes() |
Instruction |
getInstruction() |
InstructionHandle |
getNext() |
int |
getPosition() |
InstructionHandle |
getPrev() |
InstructionTargeter[] |
getTargeters() |
boolean |
hasTargeters() |
void |
removeAllTargeters()
Remove all targeters, if any.
|
void |
removeAttribute(Object key)
Delete an attribute of an instruction handle.
|
void |
removeTargeter(InstructionTargeter t)
Denote this handle isn't referenced anymore by t.
|
void |
setInstruction(Instruction i)
Replace current instruction contained in this handle.
|
Instruction |
swapInstruction(Instruction i)
Temporarily swap the current instruction, without disturbing
anything.
|
String |
toString() |
String |
toString(boolean verbose) |
protected int |
updatePosition(int offset,
int max_offset)
Called by InstructionList.setPositions when setting the position for every
instruction.
|
@Deprecated protected int i_position
protected InstructionHandle(Instruction i)
@Deprecated protected void addHandle()
public final InstructionHandle getNext()
public final InstructionHandle getPrev()
public final Instruction getInstruction()
public void setInstruction(Instruction i)
public Instruction swapInstruction(Instruction i)
Warning: if this is used on a BranchHandle then some methods such as getPosition() will still refer to the original cached instruction, whereas other BH methods may affect the cache and the replacement instruction.
protected int updatePosition(int offset, int max_offset)
offset
- additional offset caused by preceding (variable length) instructionsmax_offset
- the maximum offset that may be caused by these instructionspublic int getPosition()
public void removeAllTargeters()
public void removeTargeter(InstructionTargeter t)
public void addTargeter(InstructionTargeter t)
public boolean hasTargeters()
public InstructionTargeter[] getTargeters()
public String toString(boolean verbose)
public String toString()
public void addAttribute(Object key, Object attr)
key
- the key object to store/retrieve the attributeattr
- the attribute to associate with this handlepublic void removeAttribute(Object key)
key
- the key object to retrieve the attributepublic Object getAttribute(Object key)
key
- the key object to store/retrieve the attributepublic Collection<Object> getAttributes()
public void accept(Visitor v)
v
- Visitor objectCopyright © 2004–2019 The Apache Software Foundation. All rights reserved.