public abstract class LocalVariableInstruction extends TypedInstruction
load
and store
instructions.
The local variable table size is fixed by the maxLocals
property of the code block. Long and double types take up 2 local variable
indexes.
Parameter values to methods are loaded into the local variable table prior to the execution of the first instruction. The 0 index of the table is set to the instance of the class the method is being invoked on.
Modifier and Type | Method and Description |
---|---|
boolean |
equalsInstruction(Instruction other)
Two local variable instructions are equal if the local index they
reference is equal or if either index is 0/unset.
|
int |
getLocal()
Return the index of the local variable that this instruction operates on.
|
LocalVariable |
getLocalVariable()
Return the local variable object this instruction
operates on, or null if none.
|
int |
getParam()
Return the parameter that this instruction operates on, or -1 if none.
|
String |
getTypeName()
Return the type name for this instruction.
|
LocalVariableInstruction |
setLocal(int index)
Set the index of the local variable that this instruction operates on.
|
LocalVariableInstruction |
setLocalVariable(LocalVariable local)
Set the local variable object this instruction
operates on.
|
LocalVariableInstruction |
setParam(int param)
Set the method parameter that this instruction operates on.
|
TypedInstruction |
setType(String type)
Set the type of this instruction.
|
getType, getTypeBC, setType, setType
acceptVisit, getByteIndex, getClassLoader, getCode, getLineNumber, getLogicalStackChange, getName, getOpcode, getPool, getProject, getStackChange, isValid
public String getTypeName()
TypedInstruction
getTypeName
in class TypedInstruction
public TypedInstruction setType(String type)
TypedInstruction
setType
in class TypedInstruction
public int getLocal()
public LocalVariableInstruction setLocal(int index)
public int getParam()
public LocalVariableInstruction setParam(int param)
public LocalVariable getLocalVariable()
LocalVariableTable.getLocalVariable(int)
public LocalVariableInstruction setLocalVariable(LocalVariable local)
public boolean equalsInstruction(Instruction other)
equalsInstruction
in class Instruction
Copyright © 2002–2019. All rights reserved.