Class StackMapTable

java.lang.Object
javassist.bytecode.AttributeInfo
javassist.bytecode.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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An exception that may be thrown by copy() in StackMapTable.
    static class 
    A code walker for a StackMapTable attribute.
    static class 
    A writer of stack map tables.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Double_variable_info.tag.
    static final int
    Float_variable_info.tag.
    static final int
    Integer_variable_info.tag.
    static final int
    Long_variable_info.tag.
    static final int
    Null_variable_info.tag.
    static final int
    Object_variable_info.tag.
    static final String
    The name of this attribute "StackMapTable".
    static final int
    UninitializedThis_variable_info.tag.
    static final int
    Top_variable_info.tag.
    static final int
    Uninitialized_variable_info.tag.
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(ConstPool newCp, Map<String,String> classnames)
    Makes a copy.
    void
    insertLocal(int index, int tag, int classInfo)
    Updates this stack map table when a new local variable is inserted for a new parameter.
    void
    Prints the stack table map.
    void
    Prints the stack table map.
    void
    removeNew(int where)
    Undocumented method.
    static int
    typeTagOf(char descriptor)
    Returns the tag of the type specified by the descriptor.

    Methods inherited from class javassist.bytecode.AttributeInfo

    get, getConstPool, getName, length, set

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • copy

      public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames) throws StackMapTable.RuntimeCopyException
      Makes a copy.
      Overrides:
      copy in class AttributeInfo
      Parameters:
      newCp - the constant pool table used by the new copy.
      classnames - pairs of replaced and substituted class names.
      Throws:
      StackMapTable.RuntimeCopyException - if a BadBytecode exception is thrown while copying, it is converted into RuntimeCopyException.
    • 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:
    • 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:
    • println

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

      public void println(PrintStream ps)
      Prints the stack table map.
      Parameters:
      ps - a print stream such as System.out.
    • 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