|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectserp.bytecode.Attributes
serp.bytecode.Attribute
serp.bytecode.LocalTable
public abstract class LocalTable
Code blocks compiled from source have local tables mapping locals used in opcodes to their names and descriptions.
Method Summary | |
---|---|
Local |
addLocal()
Add a local to this table. |
Local |
addLocal(Local local)
Import a local from another method/class. |
Local |
addLocal(String name,
String type)
Add a local to this table. |
void |
clear()
Clear all locals from this table. |
Code |
getCode()
Returns the Code block that owns the Instruction(s) this InstructionPtr points to. |
Local |
getLocal(int local)
Return the local with the given locals index, or null if none. |
Local |
getLocal(String name)
Return the local with the given name, or null if none. |
Local[] |
getLocals()
Return all the locals of this method. |
Local[] |
getLocals(String name)
Return all locals with the given name, or empty array if none. |
protected abstract Local |
newLocal()
Create a new element of this table. |
protected abstract Local[] |
newLocalArray(int size)
Create a new array. |
boolean |
removeLocal(int local)
Removes the local with the given locals index from the table. |
boolean |
removeLocal(Local local)
Removes a local from this method. |
boolean |
removeLocal(String name)
Removes the local with the given name from this method. |
void |
replaceTarget(Instruction oldTarget,
Instruction newTarget)
Replace the given old, likely invalid, target with a new target. |
void |
setLocals(Local[] locals)
Set the locals of this table. |
void |
updateTargets()
Use the byte indexes read from the class file to calculate and set references to the target instruction(s) for this ptr. |
Methods inherited from class serp.bytecode.Attribute |
---|
getClassLoader, getName, getNameIndex, getOwner, getPool, getProject, isValid |
Methods inherited from class serp.bytecode.Attributes |
---|
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface serp.bytecode.visitor.VisitAcceptor |
---|
acceptVisit |
Method Detail |
---|
public Local[] getLocals()
public Local getLocal(int local)
public Local getLocal(String name)
public Local[] getLocals(String name)
public void setLocals(Local[] locals)
public Local addLocal(Local local)
public Local addLocal()
protected abstract Local newLocal()
protected abstract Local[] newLocalArray(int size)
public Local addLocal(String name, String type)
public void clear()
public boolean removeLocal(int local)
public boolean removeLocal(String name)
public boolean removeLocal(Local local)
public void updateTargets()
InstructionPtr
updateTargets
in interface InstructionPtr
public void replaceTarget(Instruction oldTarget, Instruction newTarget)
InstructionPtr
replaceTarget
in interface InstructionPtr
public Code getCode()
InstructionPtr
getCode
in interface InstructionPtr
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |