org.codehaus.groovy.classgen
Class CompileStack
This class is a helper for AsmClassGenerator. It manages
different aspects of the code of a code block like
handling labels, defining variables, and scopes.
After a MethodNode is visited clear should be called, for
initialization the method init should be used.
Some Notes:
- every push method will require a later pop call
- method parameters may define a category 2 variable, so
don't ignore the type stored in the variable object
- the index of the variable may not be as assumed when
the variable is a parameter of a method because the
parameter may be used in a closure, so don't ignore
the stored variable index
- the names of temporary variables can be ignored. The names
are only used for debugging and do not conflict with each
other or normal variables. For accessing the index of the
variable must be used.
- never mix temporary and normal variables by changes to this class.
While the name is very important for a normal variable, it is only a
helper construct for temporary variables. That means for example a
name for a temporary variable can be used multiple times without
conflict. So mixing them both may lead to the problem that a normal
or temporary variable is hidden or even removed. that must not happen!
- see:
- AsmClassGenerator
- author:
- Jochen Theodorou
CompileStack
CompileStack()
-