Code attribute (JVMS 4.7.3),
which contains the bytecode of this method.
This attribute only appears on methods, and does not permit multiple instances in a method. It has a data dependency on the constant pool.
This attribute was introduced in the Java Platform version 1.0.2, major version 45.
API Note
CodeAttribute models properties of a Code attribute read
from class files. General class file transformation should
process and traverse a CodeModel in the traversal of a MethodModel, to support transformation of Code attributes currently
being built.
Code Attribute
Attributes#code(), CodeModel
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | Returns: the bytes (bytecode) of the code arrayReturns the bytes (bytecode) of the code array. |
| public int | Returns: The length of the code array in bytesReturns The length of the code array in bytes. |
| public int | labelToBci(Label
a marker for a position within this label)CodeAttributeReturns the position of the |
| public int | Returns: the maximum size of the local variable tableReturns the maximum size of the local variable table. |
| public int | Returns: the maximum size of the operand stackReturns the maximum size of the operand stack. |
| codeArray | back to summary |
|---|---|
| public byte[] codeArray() Returns the bytes (bytecode) of the code array.
| |
| codeLength | back to summary |
|---|---|
| public int codeLength() Returns The length of the code array in bytes.
| |
| labelToBci | back to summary |
|---|---|
| public int labelToBci(Label label) Returns the position of the
| |
| maxLocals | back to summary |
|---|---|
| public int maxLocals() Returns the maximum size of the local variable table.
| |
| maxStack | back to summary |
|---|---|
| public int maxStack() Returns the maximum size of the operand stack.
| |