All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----harpoon.ClassFile.Raw.Attribute.Attribute | +----harpoon.ClassFile.Raw.Attribute.AttributeCode
Code
attribute is a variable-length attribute used
in the attributes
table of method_info
structures. A Code
attribute contains the Java Virtual
Machine instructions and auxilliary information for a single Java
method, instance initialization method, or class or interface
initialization method. There must be exactly one Code
attribute in each method_info
structure.
attributes
table must be a
variable-length attribute structure.
code
array gives the actual bytes of Java
Virtual Machine code that implement the method.
exception_table
array describes
one exception handler in the code
array.
max_locals
item gives the number
of local variables used by this method, including the parameters
passes to the method on invocation.
max_stack
item gives the maximum
number of words on the operand stack at any point during
execution of this method.
attribute_length
item indicates
the length of the attribute, excluding the initial six bytes.
Constant
in the constant_pool
.
public int max_stack
max_stack
item gives the maximum
number of words on the operand stack at any point during
execution of this method.
public int max_locals
max_locals
item gives the number
of local variables used by this method, including the parameters
passes to the method on invocation. The index of the first
local variable is 0.
public byte code[]
code
array gives the actual bytes of Java
Virtual Machine code that implement the method.
public ExceptionTable exception_table[]
exception_table
array describes
one exception handler in the code
array.
public Attribute attributes[]
attributes
table must be a
variable-length attribute structure. A Code
attribute can have any number of optional attributes associated
with it. Currently, the LinueNumberTable
and
LocalVariableTable
attributes, both of which
contain debugging information, are defined and used with the
Code
attribute.
public AttributeCode(ClassFile parent, int attribute_name_index, int max_stack, int max_locals, byte code[], ExceptionTable exception_table[], Attribute attributes[])
public long code_length()
public int exception_table_length()
public int attributes_count()
public long attribute_length()
attribute_length
item indicates
the length of the attribute, excluding the initial six bytes.
public void write(ClassDataOutputStream out) throws IOException
public String localName(int pc, int index)
public Constant constant(int index)
Constant
in the constant_pool
.
Provided for use of methods that parse the code array.
public void print(PrintWriter pw, int indent)
All Packages Class Hierarchy This Package Previous Next Index