public class LocalVariableGen extends java.lang.Object implements InstructionTargeter, NamedAndTyped, java.lang.Cloneable
LocalVariable
,
MethodGen
Modifier and Type | Field and Description |
---|---|
private InstructionHandle |
end |
private int |
index |
private boolean |
live_to_end |
private java.lang.String |
name |
private int |
orig_index |
private InstructionHandle |
start |
private Type |
type |
Constructor and Description |
---|
LocalVariableGen(int index,
java.lang.String name,
Type type,
InstructionHandle start,
InstructionHandle end)
Generate a local variable that with index `index'.
|
LocalVariableGen(int index,
java.lang.String name,
Type type,
InstructionHandle start,
InstructionHandle end,
int orig_index)
Generate a local variable that with index `index'.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
containsTarget(InstructionHandle ih)
Checks whether this targeter targets the specified instruction handle.
|
(package private) void |
dispose()
Clear the references from and to this variable when it's removed.
|
boolean |
equals(java.lang.Object o)
We consider to local variables to be equal, if the use the same index and
are valid in the same range.
|
InstructionHandle |
getEnd() |
int |
getIndex() |
boolean |
getLiveToEnd() |
LocalVariable |
getLocalVariable(ConstantPoolGen cp)
Get LocalVariable object.
|
java.lang.String |
getName() |
int |
getOrigIndex() |
InstructionHandle |
getStart() |
Type |
getType() |
int |
hashCode() |
void |
setEnd(InstructionHandle end) |
void |
setIndex(int index) |
void |
setLiveToEnd(boolean live_to_end) |
void |
setName(java.lang.String name) |
void |
setStart(InstructionHandle start) |
void |
setType(Type type) |
java.lang.String |
toString() |
void |
updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
Replaces the target of this targeter from this old handle to the new handle.
|
private int index
private java.lang.String name
private Type type
private InstructionHandle start
private InstructionHandle end
private int orig_index
private boolean live_to_end
public LocalVariableGen(int index, java.lang.String name, Type type, InstructionHandle start, InstructionHandle end)
index
- index of local variablename
- its nametype
- its typestart
- from where the instruction is valid (null means from the start)end
- until where the instruction is valid (null means to the end)public LocalVariableGen(int index, java.lang.String name, Type type, InstructionHandle start, InstructionHandle end, int orig_index)
index
- index of local variablename
- its nametype
- its typestart
- from where the instruction is valid (null means from the start)end
- until where the instruction is valid (null means to the end)orig_index
- index of local variable prior to any changes to indexpublic LocalVariable getLocalVariable(ConstantPoolGen cp)
cp
- constant poolpublic void setIndex(int index)
public int getIndex()
public int getOrigIndex()
public void setLiveToEnd(boolean live_to_end)
public boolean getLiveToEnd()
public void setName(java.lang.String name)
setName
in interface NamedAndTyped
public java.lang.String getName()
getName
in interface NamedAndTyped
public void setType(Type type)
setType
in interface NamedAndTyped
public Type getType()
getType
in interface NamedAndTyped
public InstructionHandle getStart()
public InstructionHandle getEnd()
public void setStart(InstructionHandle start)
public void setEnd(InstructionHandle end)
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
InstructionTargeter
updateTarget
in interface InstructionTargeter
old_ih
- old target, either start or endnew_ih
- new targetvoid dispose()
public boolean containsTarget(InstructionHandle ih)
InstructionTargeter
containsTarget
in interface InstructionTargeter
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object