Class CodeAttribute

  • All Implemented Interfaces:
    VMConstants

    public class CodeAttribute
    extends ClassAttribute
    Subtype of ClassAttribute which describes the "Code" attribute associated with a method.
    • Constructor Detail

      • CodeAttribute

        public CodeAttribute​(ConstUtf8 attrName,
                             int maxStack,
                             int maxLocals,
                             Insn code,
                             ExceptionTable excTable,
                             AttributeVector codeAttrs)
        Constructs a CodeAttribute object for construction from scratch
      • CodeAttribute

        public CodeAttribute​(ConstUtf8 attrName,
                             int maxStack,
                             int maxLocals,
                             Insn code,
                             byte[] codeBytes,
                             ExceptionTable excTable,
                             AttributeVector codeAttrs,
                             com.sun.jdo.api.persistence.enhancer.classfile.CodeEnv codeEnv)
        Constructs a CodeAttribute object
      • CodeAttribute

        public CodeAttribute​(ConstUtf8 attrName,
                             byte[] dataBytes,
                             com.sun.jdo.api.persistence.enhancer.classfile.CodeEnv codeEnv)
        Constructs a CodeAttribute object for later disassembly
    • Method Detail

      • stackUsed

        public int stackUsed()
        Return the maximum number of stack entries used by this method
      • setStackUsed

        public void setStackUsed​(int used)
        Set the maximum number of stack entries used by this method
      • localsUsed

        public int localsUsed()
        Return the maximum number of local variables used by this method
      • setLocalsUsed

        public void setLocalsUsed​(int used)
        Set the maximum number of local variables used by this method
      • byteCodes

        public byte[] byteCodes()
        Return the java VM byte code sequence for this method - null for native and abstract methods
      • theCode

        public Insn theCode()
        Return the instruction sequence for this method - initially derived from the byte code array, but may later be modified
      • setTheCode

        public void setTheCode​(Insn insn)
        Install the instruction sequence for this method - the byte code array is later updated.
      • exceptionHandlers

        public ExceptionTable exceptionHandlers()
        Return the exception ranges and handlers which apply to the code in this method.
      • attributes

        public AttributeVector attributes()
        Return the attributes which apply to this code