Class GeneratedMethodInfo


  • public class GeneratedMethodInfo
    extends java.lang.Object
    Information about the current method whose bytecode is being generated
    • Constructor Detail

      • GeneratedMethodInfo

        public GeneratedMethodInfo()
    • Method Detail

      • pushContextVariableInfo

        public void pushContextVariableInfo​(int position,
                                            boolean isArgument)
      • pushOutputterInfo

        public void pushOutputterInfo​(int position)
      • popContextVariableInfo

        public void popContextVariableInfo()
      • popOutputterInfo

        public void popOutputterInfo()
      • getContextVariablePosition

        public int getContextVariablePosition()
      • getOutputterPosition

        public int getOutputterPosition()
      • isOutputterInitialized

        public boolean isOutputterInitialized()
      • isContextVariableAnArgument

        public boolean isContextVariableAnArgument()
      • getCurrentGenerator

        public Generator getCurrentGenerator()
      • newLabel

        public LabelInfo newLabel​(java.lang.String name)
        Allocate a new label within the method
        Parameters:
        name - a diagnostic name for the label, used if errors are reported
        Returns:
        the constructed label information
      • placeLabel

        public void placeLabel​(LabelInfo labelInfo)
        Place a label at the current position in the bytecode
        Parameters:
        labelInfo - the label to be placed (marked)
        Throws:
        java.lang.AssertionError - if the label has already been marked
      • placeNewLabel

        public LabelInfo placeNewLabel​(java.lang.String name)
        Place a new label at the current position in the bytecode
        Parameters:
        name - the name of the label
        Returns:
        the Label that has been placed
        Throws:
        java.lang.AssertionError - if the label has already been marked
      • checkLabels

        public void checkLabels()
        Check (on completion of the method) that all labels that have been used have also been marked
        Throws:
        java.lang.AssertionError - if this is not the case
      • getXslIterateLoopLabelStack

        public java.util.Stack<LabelInfo> getXslIterateLoopLabelStack()
        Get the stack of labels representing entry points to xsl:iterate instructions within this method
        Returns:
        the stack of labels
      • getXslIterateBreakLabelStack

        public java.util.Stack<LabelInfo> getXslIterateBreakLabelStack()
        Get the stack of labels representing entry points to xsl:iterate instructions within this method
        Returns:
        the stack of labels
      • allocateLocal

        public int allocateLocal​(java.lang.Class theClass)
        Allocate a local bytecode variable. Reuse an existing slot if available
        Parameters:
        theClass - the class of value to be held in the local variable
        Returns:
        the slot number on the stack to be used for the variable
      • releaseLocal

        public void releaseLocal​(int slotNumber)
        Return a local variable to the pool for reuse
        Parameters:
        slotNumber - the slot number to be released for reuse
      • setTailCallLabel

        public void setTailCallLabel​(LabelInfo label)
        Supply the label to act as the target of a jump for a self-recursive tail call. Before jumping to this label, the code implementing the function call must adjust the stack frame to make sure that it contains the parameters for the new call.
        Parameters:
        label - the target label for a tail call loop (or null if there is to be no tail call)
      • getTailCallLabel

        public LabelInfo getTailCallLabel()
        Get the label to act as the target of a jump for a self-recursive tail call. Before jumping to this label, the code implementing the function call must adjust the stack frame to make sure that it contains the parameters for the new call.
        Returns:
        the designated label (which will be null if not in the body of a tail-recursive function)