Some Notes:
org.codehaus.groovy.classgen.AsmClassGenerator
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| private static class | |
| protected static class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private Label | breakLabel
current label for break |
| private String | |
| private boolean | clear
state flag |
| private Label | continueLabel
current label for continue |
| private final WriterController | |
| private Map | currentBlockNamedLabels
map containing named labels of current block |
| private int | currentVariableIndex
index of the last variable on stack |
| private LinkedList | finallyBlocks
list containing finally blocks such a block is created by synchronized or finally and must be called for break/continue/return |
| private boolean | implicitThis
stores if implicit or explicit this is used. |
| private final Deque | implicitThisStack
handle different states for the implicit "this" |
| private boolean | |
| private boolean | lhs
stores if on left-hand-side during compilation |
| private final Deque | lhsStack
handle different states for being on the left hand side |
| private int | localVariableOffset
first variable index usable after all parameters of a method |
| private final Map | namedLoopBreakLabel
goals for a "break foo" call in a loop where foo is a label. |
| private final Map | namedLoopContinueLabel
goals for a "continue foo" call in a loop where foo is a label. |
| private int | nextVariableIndex
index for the next variable on stack |
| private VariableScope | scope
current scope |
| private Map | stackVariables
available variables on stack |
| private final Deque | stateStack
helper to handle different stack based variables |
| private Map | superBlockNamedLabels
map containing named labels of parenting blocks |
| private final Deque | temporaryVariables
currently temporary variables in use |
| private Label | |
| private Label | |
| private final Deque | |
| private final Deque | |
| private final Deque | usedVariables
overall used variables for a method/constructor |
| private final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| public void | |
| public void | |
| public void | |
| public boolean | Returns: true if a variable is already definedthe name of the variable of interest name)
|
| public Label | |
| private void | |
| private void | |
| public int | Returns: the index used for this temporary variabledefines type and name var, final boolean defines if the toplevel argument of the stack should be stored store)creates a temporary variable. |
| public int | Returns: the index used for this temporary variabledefines type and name name, final boolean defines if the top-level argument of the stack should be stored store)creates a temporary variable. |
| public int | Returns: the index used for this temporary variabledefines the name name, final ClassNode defines the node node, final boolean defines if the top-level argument of the stack should be stored store)creates a temporary variable. |
| private BytecodeVariable | |
| public BytecodeVariable | defineVariable(final Variable v, final boolean
if true the last element of the
stack will be used to initialize
the new variable. If false null
will be used. initFromStack)Defines a new Variable using an AST variable. |
| public BytecodeVariable | |
| public Label | |
| public Label | |
| public Label | |
| public Label | getNamedBreakLabel(final String name)
Used for |
| public Label | getNamedContinueLabel(final String name)
Used for |
| public VariableScope | |
| public BytecodeVariable | |
| public BytecodeVariable | Returns: the normal variable or null if not found (andmustExist not true)name of the variable variableName, final boolean throw exception if variable does not exist mustExist)Returns a normal variable. |
| public boolean | |
| public void | init(final VariableScope scope, final Parameter[] parameters)
initializes this class for a MethodNode. |
| private void | |
| public boolean | |
| public boolean | |
| public boolean | |
| private void | |
| private void | makeNextVariableID(final ClassNode type, final boolean useReferenceDirectly)
Calculates the index of the next free register stores it and sets the current variable index to the old value |
| public void | |
| public void | |
| public void | |
| public void | |
| private void | |
| public void | |
| public void | |
| public void | pushBooleanExpression()
because a boolean Expression may not be evaluated completely it is important to keep the registers clean |
| public void | |
| private static void | |
| public void | |
| public void | |
| public void | pushLoop(final VariableScope scope, final String labelName)
Should be called when descending into a loop that defines also a scope. |
| public void | pushLoop(final VariableScope el, final List<String> labelNames)
Should be called when descending into a loop that defines also a scope. |
| public void | |
| public void | |
| public void | |
| public Label | pushSwitch()
Creates a new break label and a element for the state stack so pop has to be called later |
| public void | pushVariableScope(final VariableScope scope)
Causes the state-stack to add an element and sets the given scope as new current variable scope. |
| public void | |
| private void | |
| private void | |
| public void |
| breakLabel | back to summary |
|---|---|
| private Label breakLabel current label for break | |
| className | back to summary |
|---|---|
| private String className | |
| clear | back to summary |
|---|---|
| private boolean clear state flag | |
| continueLabel | back to summary |
|---|---|
| private Label continueLabel current label for continue | |
| controller | back to summary |
|---|---|
| private final WriterController controller | |
| currentBlockNamedLabels | back to summary |
|---|---|
| private Map<String, Label> currentBlockNamedLabels map containing named labels of current block | |
| currentVariableIndex | back to summary |
|---|---|
| private int currentVariableIndex index of the last variable on stack | |
| finallyBlocks | back to summary |
|---|---|
| private LinkedList<CompileStack. list containing finally blocks such a block is created by synchronized or finally and must be called for break/continue/return | |
| implicitThis | back to summary |
|---|---|
| private boolean implicitThis stores if implicit or explicit this is used. | |
| implicitThisStack | back to summary |
|---|---|
| private final Deque<Boolean> implicitThisStack handle different states for the implicit "this" | |
| inSpecialConstructorCall | back to summary |
|---|---|
| private boolean inSpecialConstructorCall | |
| lhs | back to summary |
|---|---|
| private boolean lhs stores if on left-hand-side during compilation | |
| lhsStack | back to summary |
|---|---|
| private final Deque<Boolean> lhsStack handle different states for being on the left hand side | |
| localVariableOffset | back to summary |
|---|---|
| private int localVariableOffset first variable index usable after all parameters of a method | |
| namedLoopBreakLabel | back to summary |
|---|---|
| private final Map<String, Label> namedLoopBreakLabel goals for a "break foo" call in a loop where foo is a label. | |
| namedLoopContinueLabel | back to summary |
|---|---|
| private final Map<String, Label> namedLoopContinueLabel goals for a "continue foo" call in a loop where foo is a label. | |
| nextVariableIndex | back to summary |
|---|---|
| private int nextVariableIndex index for the next variable on stack | |
| scope | back to summary |
|---|---|
| private VariableScope scope current scope | |
| stackVariables | back to summary |
|---|---|
| private Map<String, BytecodeVariable> stackVariables available variables on stack | |
| stateStack | back to summary |
|---|---|
| private final Deque<CompileStack. helper to handle different stack based variables | |
| superBlockNamedLabels | back to summary |
|---|---|
| private Map<String, Label> superBlockNamedLabels map containing named labels of parenting blocks | |
| temporaryVariables | back to summary |
|---|---|
| private final Deque<BytecodeVariable> temporaryVariables currently temporary variables in use | |
| thisEndLabel | back to summary |
|---|---|
| private Label thisEndLabel | |
| thisStartLabel | back to summary |
|---|---|
| private Label thisStartLabel | |
| typedExceptions | back to summary |
|---|---|
| private final Deque<CompileStack. | |
| untypedExceptions | back to summary |
|---|---|
| private final Deque<CompileStack. | |
| usedVariables | back to summary |
|---|---|
| private final Deque<BytecodeVariable> usedVariables overall used variables for a method/constructor | |
| visitedBlocks | back to summary |
|---|---|
| private final List<CompileStack. | |
| CompileStack | back to summary |
|---|---|
| public CompileStack(final WriterController controller) | |
| addExceptionBlock | back to summary |
|---|---|
| public void addExceptionBlock(final Label start, final Label end, final Label goal, final String sig) | |
| applyBlockRecorder | back to summary |
|---|---|
| private void applyBlockRecorder(final Collection<CompileStack. | |
| applyBlockRecorder | back to summary |
|---|---|
| public void applyBlockRecorder() | |
| applyFinallyBlocks | back to summary |
|---|---|
| public void applyFinallyBlocks(final Label label, final boolean isBreakLabel) | |
| clear | back to summary |
|---|---|
| public void clear() Clears the state of the class. This method should be called after a MethodNode is visited. Note that a call to init will fail if clear is not called before | |
| containsVariable | back to summary |
|---|---|
public boolean containsVariable(final String name)
| |
| createLocalLabel | back to summary |
|---|---|
| public Label createLocalLabel(final String name) creates a new named label | |
| createReference | back to summary |
|---|---|
| private void createReference(final BytecodeVariable reference) | |
| defineMethodVariables | back to summary |
|---|---|
| private void defineMethodVariables(final Parameter[] params, final boolean isInStaticContext) | |
| defineTemporaryVariable | back to summary |
|---|---|
| public int defineTemporaryVariable(final Variable var, final boolean store) creates a temporary variable.
| |
| defineTemporaryVariable | back to summary |
|---|---|
| public int defineTemporaryVariable(final String name, final boolean store) creates a temporary variable.
| |
| defineTemporaryVariable | back to summary |
|---|---|
| public int defineTemporaryVariable(final String name, final ClassNode node, final boolean store) creates a temporary variable. | |
| defineVar | back to summary |
|---|---|
| private BytecodeVariable defineVar(final String name, final ClassNode type, final boolean holder, final boolean useReferenceDirectly) | |
| defineVariable | back to summary |
|---|---|
| public BytecodeVariable defineVariable(final Variable v, final boolean initFromStack) Defines a new Variable using an AST variable.
| |
| defineVariable | back to summary |
|---|---|
| public BytecodeVariable defineVariable(final Variable v, final ClassNode variableType, final boolean initFromStack) | |
| getBreakLabel | back to summary |
|---|---|
| public Label getBreakLabel() | |
| getContinueLabel | back to summary |
|---|---|
| public Label getContinueLabel() | |
| getLabel | back to summary |
|---|---|
| public Label getLabel(final String name) Returns the label for the given name | |
| getNamedBreakLabel | back to summary |
|---|---|
| public Label getNamedBreakLabel(final String name) Used for | |
| getNamedContinueLabel | back to summary |
|---|---|
| public Label getNamedContinueLabel(final String name) Used for | |
| getScope | back to summary |
|---|---|
| public VariableScope getScope() | |
| getVariable | back to summary |
|---|---|
| public BytecodeVariable getVariable(final String variableName) | |
| getVariable | back to summary |
|---|---|
| public BytecodeVariable getVariable(final String variableName, final boolean mustExist) Returns a normal variable.
If
| |
| hasBlockRecorder | back to summary |
|---|---|
| public boolean hasBlockRecorder() | |
| init | back to summary |
|---|---|
| public void init(final VariableScope scope, final Parameter[] parameters) initializes this class for a MethodNode. This method will automatically define variables for the method parameters and will create references if needed. The created variables can be accessed by calling getVariable(). | |
| initLoopLabels | back to summary |
|---|---|
| private void initLoopLabels(final String labelName) | |
| isImplicitThis | back to summary |
|---|---|
| public boolean isImplicitThis() | |
| isInSpecialConstructorCall | back to summary |
|---|---|
| public boolean isInSpecialConstructorCall() | |
| isLHS | back to summary |
|---|---|
| public boolean isLHS() | |
| makeLocalVariablesOffset | back to summary |
|---|---|
| private void makeLocalVariablesOffset(final Parameter[] paras, final boolean isInStaticContext) | |
| makeNextVariableID | back to summary |
|---|---|
| private void makeNextVariableID(final ClassNode type, final boolean useReferenceDirectly) Calculates the index of the next free register stores it and sets the current variable index to the old value | |
| pop | back to summary |
|---|---|
| public void pop() | |
| popBlockRecorderVisit | back to summary |
|---|---|
| public void popBlockRecorderVisit(final CompileStack. | |
| popImplicitThis | back to summary |
|---|---|
| public void popImplicitThis() | |
| popLHS | back to summary |
|---|---|
| public void popLHS() | |
| popState | back to summary |
|---|---|
| private void popState() | |
| pushBlockRecorder | back to summary |
|---|---|
| public void pushBlockRecorder(final CompileStack. | |
| pushBlockRecorderVisit | back to summary |
|---|---|
| public void pushBlockRecorderVisit(final CompileStack. | |
| pushBooleanExpression | back to summary |
|---|---|
| public void pushBooleanExpression() because a boolean Expression may not be evaluated completely it is important to keep the registers clean | |
| pushImplicitThis | back to summary |
|---|---|
| public void pushImplicitThis(final boolean implicitThis) | |
| pushInitValue | back to summary |
|---|---|
| private static void pushInitValue(final ClassNode type, final MethodVisitor mv) | |
| pushInSpecialConstructorCall | back to summary |
|---|---|
| public void pushInSpecialConstructorCall() | |
| pushLHS | back to summary |
|---|---|
| public void pushLHS(final boolean lhs) | |
| pushLoop | back to summary |
|---|---|
| public void pushLoop(final VariableScope scope, final String labelName) Should be called when descending into a loop that defines also a scope. Calls pushVariableScope and prepares labels for a loop structure. Creates a element for the state stack so pop has to be called later, TODO: @Deprecate | |
| pushLoop | back to summary |
|---|---|
| public void pushLoop(final VariableScope el, final List<String> labelNames) Should be called when descending into a loop that defines also a scope. Calls pushVariableScope and prepares labels for a loop structure. Creates a element for the state stack so pop has to be called later | |
| pushLoop | back to summary |
|---|---|
| public void pushLoop(final String labelName) Should be called when descending into a loop that does not define a scope. Creates a element for the state stack so pop has to be called later, TODO: @Deprecate | |
| pushLoop | back to summary |
|---|---|
| public void pushLoop(final List<String> labelNames) Should be called when descending into a loop that does not define a scope. Creates a element for the state stack so pop has to be called later | |
| pushState | back to summary |
|---|---|
| public void pushState() | |
| pushSwitch | back to summary |
|---|---|
| public Label pushSwitch() Creates a new break label and a element for the state stack so pop has to be called later | |
| pushVariableScope | back to summary |
|---|---|
| public void pushVariableScope(final VariableScope scope) Causes the state-stack to add an element and sets the given scope as new current variable scope. Creates a element for the state stack so pop has to be called later | |
| removeVar | back to summary |
|---|---|
| public void removeVar(final int tempIndex) | |
| resetVariableIndex | back to summary |
|---|---|
| private void resetVariableIndex(final boolean isStatic) | |
| setEndLabels | back to summary |
|---|---|
| private void setEndLabels() | |
| writeExceptionTable | back to summary |
|---|---|
| public void writeExceptionTable(final CompileStack. | |
| Modifier and Type | Field and Description |
|---|---|
| public Runnable | |
| private boolean | |
| public final LinkedList |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| excludedStatement | back to summary |
|---|---|
| public Runnable excludedStatement | |
| isEmpty | back to summary |
|---|---|
| private boolean isEmpty | |
| ranges | back to summary |
|---|---|
| public final LinkedList<CompileStack. | |
| BlockRecorder | back to summary |
|---|---|
| public BlockRecorder() | |
| BlockRecorder | back to summary |
|---|---|
| public BlockRecorder(final Runnable excludedStatement) | |
| closeRange | back to summary |
|---|---|
| public void closeRange(final Label end) | |
| startRange | back to summary |
|---|---|
| public void startRange(final Label start) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Label | |
| pack-priv Label | |
| pack-priv String | |
| pack-priv Label |
| Access | Constructor and Description |
|---|---|
| private |
| end | back to summary |
|---|---|
| pack-priv Label end | |
| goal | back to summary |
|---|---|
| pack-priv Label goal | |
| sig | back to summary |
|---|---|
| pack-priv String sig | |
| start | back to summary |
|---|---|
| pack-priv Label start | |
| ExceptionTableEntry | back to summary |
|---|---|
| private ExceptionTableEntry() | |
| Access | Constructor and Description |
|---|---|
| protected |
| LabelRange | back to summary |
|---|---|
| protected LabelRange() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Label | |
| pack-priv final Label | |
| pack-priv final Map | |
| pack-priv final LinkedList | |
| pack-priv final boolean | |
| pack-priv final VariableScope | |
| pack-priv final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| breakLabel | back to summary |
|---|---|
| pack-priv final Label breakLabel | |
| continueLabel | back to summary |
|---|---|
| pack-priv final Label continueLabel | |
| currentBlockNamedLabels | back to summary |
|---|---|
| pack-priv final Map<String, Label> currentBlockNamedLabels | |
| finallyBlocks | back to summary |
|---|---|
| pack-priv final LinkedList<CompileStack. | |
| inSpecialConstructorCall | back to summary |
|---|---|
| pack-priv final boolean inSpecialConstructorCall | |
| scope | back to summary |
|---|---|
| pack-priv final VariableScope scope | |
| stackVariables | back to summary |
|---|---|
| pack-priv final Map<String, BytecodeVariable> stackVariables | |
| StateStackElement | back to summary |
|---|---|
| pack-priv StateStackElement() | |