/** * Read needed data (e.g. index) from file. */ @Override protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException { super.setLength(3); b = bytes.readShort(); }
/** * Read needed data (e.g. index) from file. */ @Override protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException { type = bytes.readByte(); super.setLength(2); }
/** * Read needed data (e.g. index) from file. */ @Override protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException { super.setLength(2); b = bytes.readByte(); }
/** * Read needed data (e.g. index) from file. Conversion to a InstructionHandle * is done in InstructionList(byte[]). * * @param bytes input stream * @param wide wide prefix? * @see InstructionList */ @Override protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException { super.setLength(3); index = bytes.readShort(); }
/** * Read needed data (e.g. index) from file. */ @Override protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException { this.wide = wide; if (wide) { index = bytes.readUnsignedShort(); super.setLength(4); } else { index = bytes.readUnsignedByte(); super.setLength(2); } }
/** * Read needed data (e.g. index) from file. * <pre> * (ILOAD <= tag <= ALOAD_3) || (ISTORE <= tag <= ASTORE_3) * </pre> */ @Override protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException { if (wide) { n = bytes.readUnsignedShort(); super.setLength(4); } else { final short _opcode = super.getOpcode(); if (((_opcode >= Const.ILOAD) && (_opcode <= Const.ALOAD)) || ((_opcode >= Const.ISTORE) && (_opcode <= Const.ASTORE))) { n = bytes.readUnsignedByte(); super.setLength(2); } else if (_opcode <= Const.ALOAD_3) { // compact load instruction such as ILOAD_2 n = (_opcode - Const.ILOAD_0) % 4; super.setLength(1); } else { // Assert ISTORE_0 <= tag <= ASTORE_3 n = (_opcode - Const.ISTORE_0) % 4; super.setLength(1); } } }
/** * Read needed data (i.e., index) from file. * @param bytes input stream * @param wide wide prefix? */ @Override protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException { setIndex(bytes.readUnsignedShort()); super.setLength(3); }
/** * Set the local variable index. * also updates opcode and length * TODO Why? * @see #setIndexOnly(int) */ @Override public void setIndex( final int n ) { // TODO could be package-protected? if ((n < 0) || (n > Const.MAX_SHORT)) { throw new ClassGenException("Illegal value: " + n); } this.n = n; // Cannot be < 0 as this is checked above if (n <= 3) { // Use more compact instruction xLOAD_n super.setOpcode((short) (c_tag + n)); super.setLength(1); } else { super.setOpcode(canon_tag); if (wide()) { super.setLength(4); } else { super.setLength(2); } } }