public int getOpcode(final int opcode) {
    if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
      switch (sort) {
        case BOOLEAN:
        case BYTE:
          return opcode + (Opcodes.BALOAD - Opcodes.IALOAD);
        case CHAR:
          return opcode + (Opcodes.CALOAD - Opcodes.IALOAD);
        case SHORT:
          return opcode + (Opcodes.SALOAD - Opcodes.IALOAD);
        case INT:
          return opcode;
        case FLOAT:
          return opcode + (Opcodes.FALOAD - Opcodes.IALOAD);
        case LONG:
          return opcode + (Opcodes.LALOAD - Opcodes.IALOAD);
        case DOUBLE:
          return opcode + (Opcodes.DALOAD - Opcodes.IALOAD);
        case ARRAY:
        case OBJECT:
        case INTERNAL:
          return opcode + (Opcodes.AALOAD - Opcodes.IALOAD);
        case METHOD:
        case VOID:
          throw new UnsupportedOperationException();
        default:
          throw new AssertionError();
      }
    } else {
      switch (sort) {
        case VOID:
          if (opcode != Opcodes.IRETURN) {
            throw new UnsupportedOperationException();
          }
          return Opcodes.RETURN;
        case BOOLEAN:
        case BYTE:
        case CHAR:
        case SHORT:
        case INT:
          return opcode;
        case FLOAT:
          return opcode + (Opcodes.FRETURN - Opcodes.IRETURN);
        case LONG:
          return opcode + (Opcodes.LRETURN - Opcodes.IRETURN);
        case DOUBLE:
          return opcode + (Opcodes.DRETURN - Opcodes.IRETURN);
        case ARRAY:
        case OBJECT:
        case INTERNAL:
          if (opcode != Opcodes.ILOAD && opcode != Opcodes.ISTORE && opcode != Opcodes.IRETURN) {
            throw new UnsupportedOperationException();
          }
          return opcode + (Opcodes.ARETURN - Opcodes.IRETURN);
        case METHOD:
          throw new UnsupportedOperationException();
        default:
          throw new AssertionError();
      }
    }
  }
public int getOpcode(final int opcode) {
    if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
      switch (sort) {
        case BOOLEAN:
        case BYTE:
          return opcode + (Opcodes.BALOAD - Opcodes.IALOAD);
        case CHAR:
          return opcode + (Opcodes.CALOAD - Opcodes.IALOAD);
        case SHORT:
          return opcode + (Opcodes.SALOAD - Opcodes.IALOAD);
        case INT:
          return opcode;
        case FLOAT:
          return opcode + (Opcodes.FALOAD - Opcodes.IALOAD);
        case LONG:
          return opcode + (Opcodes.LALOAD - Opcodes.IALOAD);
        case DOUBLE:
          return opcode + (Opcodes.DALOAD - Opcodes.IALOAD);
        case ARRAY:
        case OBJECT:
        case INTERNAL:
          return opcode + (Opcodes.AALOAD - Opcodes.IALOAD);
        case METHOD:
        case VOID:
          throw new UnsupportedOperationException();
        default:
          throw new AssertionError();
      }
    } else {
      switch (sort) {
        case VOID:
          if (opcode != Opcodes.IRETURN) {
            throw new UnsupportedOperationException();
          }
          return Opcodes.RETURN;
        case BOOLEAN:
        case BYTE:
        case CHAR:
        case SHORT:
        case INT:
          return opcode;
        case FLOAT:
          return opcode + (Opcodes.FRETURN - Opcodes.IRETURN);
        case LONG:
          return opcode + (Opcodes.LRETURN - Opcodes.IRETURN);
        case DOUBLE:
          return opcode + (Opcodes.DRETURN - Opcodes.IRETURN);
        case ARRAY:
        case OBJECT:
        case INTERNAL:
          if (opcode != Opcodes.ILOAD && opcode != Opcodes.ISTORE && opcode != Opcodes.IRETURN) {
            throw new UnsupportedOperationException();
          }
          return opcode + (Opcodes.ARETURN - Opcodes.IRETURN);
        case METHOD:
          throw new UnsupportedOperationException();
        default:
          throw new AssertionError();
      }
    }
  }
public int getOpcode ( final int opcode ) { if ( opcode == Opcodes . IALOAD || opcode == Opcodes . IASTORE ) { switch ( sort ) { case BOOLEAN : case BYTE : return opcode + ( Opcodes . BALOAD - Opcodes . IALOAD ) ; case CHAR : return opcode + ( Opcodes . CALOAD - Opcodes . IALOAD ) ; case SHORT : return opcode + ( Opcodes . SALOAD - Opcodes . IALOAD ) ; case INT : return opcode ; case FLOAT : return opcode + ( Opcodes . FALOAD - Opcodes . IALOAD ) ; case LONG : return opcode + ( Opcodes . LALOAD - Opcodes . IALOAD ) ; case DOUBLE : return opcode + ( Opcodes . DALOAD - Opcodes . IALOAD ) ; case ARRAY : case OBJECT : case INTERNAL : return opcode + ( Opcodes . AALOAD - Opcodes . IALOAD ) ; case METHOD : case VOID : throw new UnsupportedOperationException ( ) ; default : throw new AssertionError ( ) ; } } else { switch ( sort ) { case VOID : if ( opcode != Opcodes . IRETURN ) { throw new UnsupportedOperationException ( ) ; } return Opcodes . RETURN ; case BOOLEAN : case BYTE : case CHAR : case SHORT : case INT : return opcode ; case FLOAT : return opcode + ( Opcodes . FRETURN - Opcodes . IRETURN ) ; case LONG : return opcode + ( Opcodes . LRETURN - Opcodes . IRETURN ) ; case DOUBLE : return opcode + ( Opcodes . DRETURN - Opcodes . IRETURN ) ; case ARRAY : case OBJECT : case INTERNAL : if ( opcode != Opcodes . ILOAD && opcode != Opcodes . ISTORE && opcode != Opcodes . IRETURN ) { throw new UnsupportedOperationException ( ) ; } return opcode + ( Opcodes . ARETURN - Opcodes . IRETURN ) ; case METHOD : throw new UnsupportedOperationException ( ) ; default : throw new AssertionError ( ) ; } } }
Returns a JVM instruction opcode adapted to this {@link Type}. This method must not be used for
method types.

@param opcode a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD,
IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and
IRETURN.
@return an opcode that is similar to the given opcode, but adapted to this {@link Type}. For
example, if this type is {@code float} and {@code opcode} is IRETURN, this method returns
FRETURN.
Returns a JVM instruction opcode adapted to this { @link Type } . This method must not be used for method types .