All Packages Class Hierarchy This Package Previous Next Index
Class gnu.bytecode.Variable
java.lang.Object
|
+----gnu.bytecode.Location
|
+----gnu.bytecode.Variable
- public class Variable
- extends Location
- implements Enumeration
-
offset
- The local variable slot number used by this variable.
-
Variable()
-
-
allocateLocal(CodeAttr)
- Allocate slots for a local variable (or parameter).
-
freeLocal(CodeAttr)
-
-
hasMoreElements()
-
-
isArtificial()
-
-
isAssigned()
- Returns true iff assigned to a local variable slot.
-
isParameter()
-
-
isSimple()
- Returns true for a "simple" variable.
-
nextElement()
-
-
nextVar()
-
-
reserveLocal(int, CodeAttr)
- Assign a local variable to a given local variable slot.
-
setArtificial(boolean)
-
-
setParameter(boolean)
-
-
setSimple(boolean)
-
offset
public int offset
- The local variable slot number used by this variable.
Not used (by the codegen layer) if !isSimple().
Variable
public Variable()
nextVar
public final Variable nextVar()
hasMoreElements
public final boolean hasMoreElements()
nextElement
public Object nextElement()
isAssigned
public final boolean isAssigned()
- Returns true iff assigned to a local variable slot.
Only relevant if isSimple ().
isSimple
public final boolean isSimple()
- Returns true for a "simple" variable.
A "simple" Variable can be stack-allocated using standard local
variable slots. It is allocated by the codegen package.
A non-simple variable may need heap allocation, or more more
complex access; it is basically ignored by the codegen package,
and must be managed by higher layers.
setSimple
public final void setSimple(boolean simple)
isParameter
public final boolean isParameter()
setParameter
public final void setParameter(boolean parameter)
isArtificial
public final boolean isArtificial()
setArtificial
public final void setArtificial(boolean artificial)
reserveLocal
public boolean reserveLocal(int varIndex,
CodeAttr code)
- Assign a local variable to a given local variable slot.
- Parameters:
- local - the index of the local variables.
- Returns:
- true iff we succeeded (i.e. the slot was unused)
allocateLocal
public void allocateLocal(CodeAttr code)
- Allocate slots for a local variable (or parameter).
- Returns:
- the index of the (first) slot.
freeLocal
public void freeLocal(CodeAttr code)
All Packages Class Hierarchy This Package Previous Next Index