@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int literal = byte1(opcodeUnit); // should be zero int a = in.read(); int b = in.read(); return new TwoRegisterDecodedInstruction( this, opcode, 0, null, 0, literal, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int baseAddress = in.baseAddressForCursor() - 1; // already read opcode int size = in.read(); int firstKey = in.readInt(); int[] targets = new int[size]; for (int i = 0; i < size; i++) { targets[i] = baseAddress + in.readInt(); } return new PackedSwitchPayloadDecodedInstruction( this, opcodeUnit, firstKey, targets); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = byte1(opcodeUnit); int bc = in.read(); int b = byte0(bc); int literal = (byte) byte1(bc); // sign-extend return new TwoRegisterDecodedInstruction( this, opcode, 0, null, 0, literal, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int index = in.readInt(); int registerCount = in.read(); int a = in.read(); IndexType indexType = OpcodeInfo.getIndexType(opcodeUnit); return new RegisterRangeDecodedInstruction( this, opcodeUnit, index, indexType, 0, 0L, a, registerCount); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = nibble2(opcodeUnit); int b = nibble3(opcodeUnit); int literal = (short) in.read(); // sign-extend return new TwoRegisterDecodedInstruction( this, opcode, 0, null, 0, literal, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = byte1(opcodeUnit); int b = in.read(); return new TwoRegisterDecodedInstruction( this, opcode, 0, null, 0, 0L, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = byte1(opcodeUnit); int b = in.read(); return new TwoRegisterDecodedInstruction( this, opcode, 0, null, 0, 0L, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = byte1(opcodeUnit); int bc = in.read(); int b = byte0(bc); int c = byte1(bc); return new ThreeRegisterDecodedInstruction( this, opcode, 0, null, 0, 0L, a, b, c); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = nibble2(opcodeUnit); int b = nibble3(opcodeUnit); int index = in.read(); return new TwoRegisterDecodedInstruction( this, opcode, index, IndexType.FIELD_OFFSET, 0, 0L, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = nibble2(opcodeUnit); int b = nibble3(opcodeUnit); int literal = (short) in.read(); // sign-extend return new TwoRegisterDecodedInstruction( this, opcode, 0, null, 0, literal, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = nibble2(opcodeUnit); int b = nibble3(opcodeUnit); int index = in.read(); return new TwoRegisterDecodedInstruction( this, opcode, index, IndexType.FIELD_OFFSET, 0, 0L, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int baseAddress = in.cursor() - 1; int opcode = byte0(opcodeUnit); int a = byte1(opcodeUnit); int target = (short) in.read(); // sign-extend return new OneRegisterDecodedInstruction( this, opcode, 0, null, baseAddress + target, 0L, a); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = nibble2(opcodeUnit); int b = nibble3(opcodeUnit); int index = in.read(); IndexType indexType = OpcodeInfo.getIndexType(opcode); return new TwoRegisterDecodedInstruction( this, opcode, index, indexType, 0, 0L, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int baseAddress = in.cursor() - 1; int opcode = byte0(opcodeUnit); int literal = byte1(opcodeUnit); // should be zero int target = (short) in.read(); // sign-extend return new ZeroRegisterDecodedInstruction( this, opcode, 0, null, baseAddress + target, literal); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); int a = byte1(opcodeUnit); int index = in.read(); IndexType indexType = OpcodeInfo.getIndexType(opcode); return new OneRegisterDecodedInstruction( this, opcode, index, indexType, 0, 0L, a); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int baseAddress = in.cursor() - 1; int opcode = byte0(opcodeUnit); int a = nibble2(opcodeUnit); int b = nibble3(opcodeUnit); int target = (short) in.read(); // sign-extend return new TwoRegisterDecodedInstruction( this, opcode, 0, null, baseAddress + target, 0L, a, b); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int baseAddress = in.cursor() - 1; int opcode = byte0(opcodeUnit); int literal = byte1(opcodeUnit); // should be zero int target = (short) in.read(); // sign-extend return new ZeroRegisterDecodedInstruction( this, opcode, 0, null, baseAddress + target, literal); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int baseAddress = in.cursor() - 1; int opcode = byte0(opcodeUnit); int literal = byte1(opcodeUnit); // should be zero int target = (short) in.read(); // sign-extend return new ZeroRegisterDecodedInstruction( this, opcode, 0, null, baseAddress + target, literal); }
/** * 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); }
/** * 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); }