Class StackMapTable


  • public class StackMapTable
    extends AttributeInfo
    stack_map attribute.

    This is an entry in the attributes table of a Code attribute. It was introduced by J2SE 6 for the verification by typechecking.

    Since:
    3.4
    See Also:
    StackMap
    • Constructor Detail

      • StackMapTable

        StackMapTable​(ConstPool cp,
                      byte[] newInfo)
        Constructs a stack_map attribute.
      • StackMapTable

        StackMapTable​(ConstPool cp,
                      int name_id,
                      java.io.DataInputStream in)
               throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • write

        void write​(java.io.DataOutputStream out)
            throws java.io.IOException
        Overrides:
        write in class AttributeInfo
        Throws:
        java.io.IOException
      • insertLocal

        public void insertLocal​(int index,
                                int tag,
                                int classInfo)
                         throws BadBytecode
        Updates this stack map table when a new local variable is inserted for a new parameter.
        Parameters:
        index - the index of the added local variable.
        tag - the type tag of that local variable.
        classInfo - the index of the CONSTANT_Class_info structure in a constant pool table. This should be zero unless the tag is ITEM_Object.
        Throws:
        BadBytecode
        See Also:
        CtBehavior.addParameter(javassist.CtClass), typeTagOf(char), ConstPool
      • typeTagOf

        public static int typeTagOf​(char descriptor)
        Returns the tag of the type specified by the descriptor. This method returns INTEGER unless the descriptor is either D (double), F (float), J (long), L (class type), or [ (array).
        Parameters:
        descriptor - the type descriptor.
        See Also:
        Descriptor
      • println

        public void println​(java.io.PrintWriter w)
        Prints the stack table map.
      • println

        public void println​(java.io.PrintStream ps)
        Prints the stack table map.
        Parameters:
        ps - a print stream such as System.out.
      • shiftPc

        void shiftPc​(int where,
                     int gapSize,
                     boolean exclusive)
              throws BadBytecode
        Throws:
        BadBytecode
      • removeNew

        public void removeNew​(int where)
                       throws CannotCompileException
        Undocumented method. Do not use; internal-use only.

        This method is for javassist.convert.TransformNew. It is called to update the stack map table when the NEW opcode (and the following DUP) is removed.

        Parameters:
        where - the position of the removed NEW opcode.
        Throws:
        CannotCompileException