throws InstructionListParserException {
bytecodes = _bytecodes;
if (bytecodes == null) {
throw new InstructionListParserException("bytecodes are null");
}
InstructionList il = new InstructionList();
int maxCode = bytecodes.length;
int currentPc = 0;
int nextPc = -1;
int startPc = -1;
boolean bWide = false;
while (currentPc < maxCode) {
int curOpcode = Instruction.signedToUnsigned(bytecodes[currentPc]);
startPc = currentPc + 1;
if (curOpcode == Opcodes.OPCODE_TABLESWITCH) {
startPc = currentPc + 4 - (currentPc % 4);
nextPc = parseTableSwitchInstruction(startPc);
} else if (curOpcode == Opcodes.OPCODE_LOOKUPSWITCH) {
startPc = currentPc + 4 - (currentPc % 4);
nextPc = parseLookupSwitchInstruction(startPc);
} else {
nextPc = currentPc
+ JVMInstructionSet.getOpcodeLength(curOpcode, bWide);
}
Instruction ins = new Instruction(currentPc, curOpcode, getArgArray(
startPc, nextPc), nextPc, bWide);
il.add(ins);
bWide = (curOpcode == Opcodes.OPCODE_WIDE);
currentPc = nextPc;
}
return il;