LocalVariablesInfopublic class LocalVariablesInfo extends Object A utility class holding the information about
the names and the types of the local variables in
a given method. |
Fields Summary |
---|
private LocalVariableInfo[] | localVariableInfosThe information about the local variables is stored here. | private IntList | instruction_offsetsThe ints in the list represent code offsets where either instructions must start
or the offset is the length of the code array. This will be verified in Pass 3a. |
Constructors Summary |
---|
LocalVariablesInfo(int max_locals)The constructor.
localVariableInfos = new LocalVariableInfo[max_locals];
for (int i=0; i<max_locals; i++){
localVariableInfos[i] = new LocalVariableInfo();
}
|
Methods Summary |
---|
public void | add(int slot, java.lang.String name, int startpc, int length, com.sun.org.apache.bcel.internal.generic.Type t)Adds information about the local variable in slot 'slot'. Automatically
adds information for slot+1 if 't' is Type.LONG or Type.DOUBLE.
// The add operation on LocalVariableInfo may throw the '...Inconsistent...' exception, we don't throw it explicitely here.
if (slot < 0 || slot >= localVariableInfos.length){
throw new AssertionViolatedException("Slot number for local variable information out of range.");
}
localVariableInfos[slot].add(name, startpc, length, t);
if (t == Type.LONG) localVariableInfos[slot+1].add(name, startpc, length, LONG_Upper.theInstance());
if (t == Type.DOUBLE) localVariableInfos[slot+1].add(name, startpc, length, DOUBLE_Upper.theInstance());
| public LocalVariableInfo | getLocalVariableInfo(int slot)Returns the LocalVariableInfo for the given slot.
if (slot < 0 || slot >= localVariableInfos.length){
throw new AssertionViolatedException("Slot number for local variable information out of range.");
}
return localVariableInfos[slot];
|
|