Class StackMap


public class StackMap extends AttributeInfo
Another stack_map attribute defined in CLDC 1.1 for J2ME.

This is an entry in the attributes table of a Code attribute. It was introduced by J2ME CLDC 1.1 (JSR 139) for pre-verification.

According to the CLDC specification, the sizes of some fields are not 16bit but 32bit if the code size is more than 64K or the number of the local variables is more than 64K. However, for the J2ME CLDC technology, they are always 16bit. The implementation of the StackMap class assumes they are 16bit.

Since:
3.12
See Also:
  • Field Details

  • Method Details

    • numOfEntries

      public int numOfEntries()
      Returns number_of_entries.
    • copy

      public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames)
      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.
    • 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. It is available by StackMapTable.typeTagOf(char).
      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:
    • 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 when the NEW opcode (and the following DUP) is removed.

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

      public void print(PrintWriter out)
      Prints this stack map.