3.3.1 Code Attribute
The structure of a method's Code attribute is as follows:
- attribute name (Code) and length
- max_stacks - maximum depth of the operand stack
- max_locals - number of local variables in the local variable
array allocated upon invocation of this method, including the local
variables used to pass parameters to the method when it is invoked
- the code - an array of opcodes (i.e., the instruction list)
- exception table - an array of exception handlers, each of which
is represented by a quadruple: start_pc, end_pc, handler_pc and
catch_type. The first two items describe the boundaries of the try catch
block. The first three item are indexes in the code array, the fourth
item is an index in the constant pool containing the exception class.
- attributes - an array of attributes
There is no requirement on a Java Virtual Machine to recognize any
attributes in the attributes item above. A virtual machine may
recognize for debugging and specification purposes the following code
attributes: LineNumberTable, LocalVariableTable.
BML related code attributes are described in Code Attributes.