|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.services.bytecode.CodeChunk
This class represents a chunk of code in a CodeAttribute. Typically, a CodeAttribute represents the code in a method. If there is a try/catch block, each catch block will get its own code chunk. This allows the catch blocks to all be put at the end of the generated code for a method, which eliminates the need to generate a jump around each catch block, which would be a forward reference.
Field Summary | |
(package private) static short[] |
ARRAY_ACCESS
|
(package private) static short[] |
ARRAY_STORE
|
(package private) static short[][][] |
CAST_CONVERSION_INFO
|
private int |
codeOffset
|
private ClassFormatOutput |
cout
|
(package private) static short[] |
LOAD_VARIABLE
|
(package private) static short[] |
LOAD_VARIABLE_FAST
|
(package private) static short[] |
RETURN_OPCODE
|
(package private) static short[] |
STORE_VARIABLE
|
(package private) static short[] |
STORE_VARIABLE_FAST
|
Constructor Summary | |
(package private) |
CodeChunk(boolean main)
|
Method Summary | |
(package private) void |
addChunk(CodeChunk other)
Add an arbitrary array of bytes |
(package private) void |
addInstr(short opcode)
Add an instruction that has no opcodes. |
(package private) void |
addInstrCPE(short opcode,
int cpeNum)
This takes an instruction that has a narrow and a wide form for CPE access, and generates accordingly the right one. |
(package private) void |
addInstrU1(short opcode,
int operand)
|
(package private) void |
addInstrU2(short opcode,
int operand)
|
(package private) void |
addInstrU2U1U1(short opcode,
int operand1,
short operand2,
short operand3)
For adding an instruction with 3 operands, a U2 and two U1's. |
(package private) void |
addInstrWide(short opcode,
int varNum)
This takes an instruction that can be wrapped in a wide for large variable #s and does so. |
(package private) void |
complete(ClassHolder ch,
ClassMember method,
int maxStack,
int maxLocals)
wrap up the entry and stuff it in the class, now that it holds all of the instructions and the exception table. |
(package private) void |
fixLengths(int maxStack,
int maxLocals,
int codeLength)
now that we have codeBytes, fix the lengths fields in it to reflect what was stored. |
(package private) ClassFormatOutput |
getCout()
Get the ClassFormatOutput |
int |
getRelativePC()
Get the current PC |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final short[] LOAD_VARIABLE
static final short[] LOAD_VARIABLE_FAST
static final short[] STORE_VARIABLE
static final short[] STORE_VARIABLE_FAST
static final short[] ARRAY_ACCESS
static final short[] ARRAY_STORE
static final short[] RETURN_OPCODE
static final short[][][] CAST_CONVERSION_INFO
private int codeOffset
private final ClassFormatOutput cout
Constructor Detail |
CodeChunk(boolean main)
Method Detail |
void addInstr(short opcode)
void addInstrU2(short opcode, int operand)
void addInstrU1(short opcode, int operand)
void addInstrCPE(short opcode, int cpeNum)
void addInstrWide(short opcode, int varNum)
void addInstrU2U1U1(short opcode, int operand1, short operand2, short operand3)
void addChunk(CodeChunk other)
ClassFormatOutput getCout()
public int getRelativePC()
void fixLengths(int maxStack, int maxLocals, int codeLength)
void complete(ClassHolder ch, ClassMember method, int maxStack, int maxLocals)
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |