private DecodedInstruction decodeRawInsn(ShortArrayCodeInput in) throws EOFException { int opcodeUnit = in.read(); int opcode = Opcodes.extractOpcodeFromUnit(opcodeUnit); OpcodeInfo.Info opcodeInfo; try { opcodeInfo = OpcodeInfo.get(opcode); } catch (IllegalArgumentException e) { LOG.warn("Ignore decode error: '{}', replace with NOP instruction", e.getMessage()); opcodeInfo = OpcodeInfo.NOP; } return opcodeInfo.getFormat().decode(opcodeUnit, in); }
InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int e = nibble2(opcodeUnit); int registerCount = nibble3(opcodeUnit); int index = in.read(); int abcd = in.read(); int a = nibble0(abcd); int b = nibble1(abcd); int c = nibble2(abcd); int d = nibble3(abcd); IndexType indexType = OpcodeInfo.getIndexType(opcode);
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that decodes any of the three-unit register-range formats. */ private static DecodedInstruction decodeRegisterRange( InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int registerCount = byte1(opcodeUnit); int index = in.read(); int a = in.read(); IndexType indexType = OpcodeInfo.getIndexType(opcode); return new RegisterRangeDecodedInstruction( format, opcode, index, indexType, 0, 0L, a, registerCount); }
/** * Encodes this instance to the given output. */ public final void encode(CodeOutput out) { format.encode(this, out); }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int e = nibble2(opcodeUnit); int registerCount = nibble3(opcodeUnit); int index = in.read(); int abcd = in.read(); int a = nibble0(abcd); int b = nibble1(abcd); int c = nibble2(abcd); int d = nibble3(abcd); IndexType indexType = OpcodeInfo.getIndexType(opcode);
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that decodes any of the three-unit register-range formats. */ private static DecodedInstruction decodeRegisterRange( InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int registerCount = byte1(opcodeUnit); int index = in.read(); int a = in.read(); IndexType indexType = OpcodeInfo.getIndexType(opcode); return new RegisterRangeDecodedInstruction( format, opcode, index, indexType, 0, 0L, a, registerCount); }
/** * Encodes this instance to the given output. */ public final void encode(CodeOutput out) { format.encode(this, out); }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int e = nibble2(opcodeUnit); int registerCount = nibble3(opcodeUnit); int index = in.read(); int abcd = in.read(); int a = nibble0(abcd); int b = nibble1(abcd); int c = nibble2(abcd); int d = nibble3(abcd); IndexType indexType = OpcodeInfo.getIndexType(opcode);
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that decodes any of the three-unit register-range formats. */ private static DecodedInstruction decodeRegisterRange( InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int registerCount = byte1(opcodeUnit); int index = in.read(); int a = in.read(); IndexType indexType = OpcodeInfo.getIndexType(opcode); return new RegisterRangeDecodedInstruction( format, opcode, index, indexType, 0, 0L, a, registerCount); }
/** * Decodes an instruction from the given input source. */ public static DecodedInstruction decode(CodeInput in) throws EOFException { int opcodeUnit = in.read(); int opcode = Opcodes.extractOpcodeFromUnit(opcodeUnit); InstructionCodec format = OpcodeInfo.getFormat(opcode); return format.decode(opcodeUnit, in); }
/** * Encodes this instance to the given output. */ public final void encode(CodeOutput out) { format.encode(this, out); }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int e = nibble2(opcodeUnit); int registerCount = nibble3(opcodeUnit); int index = in.read(); int abcd = in.read(); int a = nibble0(abcd); int b = nibble1(abcd); int c = nibble2(abcd); int d = nibble3(abcd); IndexType indexType = OpcodeInfo.getIndexType(opcode);
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that decodes any of the three-unit register-range formats. */ private static DecodedInstruction decodeRegisterRange( InstructionCodec format, int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int registerCount = byte1(opcodeUnit); int index = in.read(); int a = in.read(); IndexType indexType = OpcodeInfo.getIndexType(opcode); return new RegisterRangeDecodedInstruction( format, opcode, index, indexType, 0, 0L, a, registerCount); }