Java Code Examples for jdk.internal.org.objectweb.asm.Opcodes#T_BOOLEAN

The following examples show how to use jdk.internal.org.objectweb.asm.Opcodes#T_BOOLEAN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CheckMethodAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    checkStartCode();
    checkEndCode();
    checkOpcode(opcode, 1);
    switch (opcode) {
    case Opcodes.BIPUSH:
        checkSignedByte(operand, "Invalid operand");
        break;
    case Opcodes.SIPUSH:
        checkSignedShort(operand, "Invalid operand");
        break;
    // case Constants.NEWARRAY:
    default:
        if (operand < Opcodes.T_BOOLEAN || operand > Opcodes.T_LONG) {
            throw new IllegalArgumentException(
                    "Invalid operand (must be an array type code T_...): "
                            + operand);
        }
    }
    super.visitIntInsn(opcode, operand);
    ++insnCount;
}
 
Example 2
Source File: CheckMethodAdapter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    checkStartCode();
    checkEndCode();
    checkOpcode(opcode, 1);
    switch (opcode) {
    case Opcodes.BIPUSH:
        checkSignedByte(operand, "Invalid operand");
        break;
    case Opcodes.SIPUSH:
        checkSignedShort(operand, "Invalid operand");
        break;
    // case Constants.NEWARRAY:
    default:
        if (operand < Opcodes.T_BOOLEAN || operand > Opcodes.T_LONG) {
            throw new IllegalArgumentException(
                    "Invalid operand (must be an array type code T_...): "
                            + operand);
        }
    }
    super.visitIntInsn(opcode, operand);
    ++insnCount;
}
 
Example 3
Source File: CheckMethodAdapter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    checkStartCode();
    checkEndCode();
    checkOpcode(opcode, 1);
    switch (opcode) {
    case Opcodes.BIPUSH:
        checkSignedByte(operand, "Invalid operand");
        break;
    case Opcodes.SIPUSH:
        checkSignedShort(operand, "Invalid operand");
        break;
    // case Constants.NEWARRAY:
    default:
        if (operand < Opcodes.T_BOOLEAN || operand > Opcodes.T_LONG) {
            throw new IllegalArgumentException(
                    "Invalid operand (must be an array type code T_...): "
                            + operand);
        }
    }
    super.visitIntInsn(opcode, operand);
    ++insnCount;
}
 
Example 4
Source File: CheckMethodAdapter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    checkStartCode();
    checkEndCode();
    checkOpcode(opcode, 1);
    switch (opcode) {
    case Opcodes.BIPUSH:
        checkSignedByte(operand, "Invalid operand");
        break;
    case Opcodes.SIPUSH:
        checkSignedShort(operand, "Invalid operand");
        break;
    // case Constants.NEWARRAY:
    default:
        if (operand < Opcodes.T_BOOLEAN || operand > Opcodes.T_LONG) {
            throw new IllegalArgumentException(
                    "Invalid operand (must be an array type code T_...): "
                            + operand);
        }
    }
    super.visitIntInsn(opcode, operand);
    ++insnCount;
}
 
Example 5
Source File: GeneratorAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instruction to create a new array.
 *
 * @param type
 *            the type of the array elements.
 */
public void newArray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        typeInsn(Opcodes.ANEWARRAY, type);
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 6
Source File: InstructionAdapter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void newarray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName());
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 7
Source File: GeneratorAdapter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instruction to create a new array.
 *
 * @param type
 *            the type of the array elements.
 */
public void newArray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        typeInsn(Opcodes.ANEWARRAY, type);
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 8
Source File: GeneratorAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instruction to create a new array.
 *
 * @param type
 *            the type of the array elements.
 */
public void newArray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        typeInsn(Opcodes.ANEWARRAY, type);
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 9
Source File: GeneratorAdapter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instruction to create a new array.
 *
 * @param type
 *            the type of the array elements.
 */
public void newArray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        typeInsn(Opcodes.ANEWARRAY, type);
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 10
Source File: GeneratorAdapter.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instruction to create a new array.
 *
 * @param type
 *            the type of the array elements.
 */
public void newArray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        typeInsn(Opcodes.ANEWARRAY, type);
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 11
Source File: GeneratorAdapter.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
  * Generates the instruction to create a new array.
  *
  * @param type the type of the array elements.
  */
public void newArray(final Type type) {
    int arrayType;
    switch (type.getSort()) {
        case Type.BOOLEAN:
            arrayType = Opcodes.T_BOOLEAN;
            break;
        case Type.CHAR:
            arrayType = Opcodes.T_CHAR;
            break;
        case Type.BYTE:
            arrayType = Opcodes.T_BYTE;
            break;
        case Type.SHORT:
            arrayType = Opcodes.T_SHORT;
            break;
        case Type.INT:
            arrayType = Opcodes.T_INT;
            break;
        case Type.FLOAT:
            arrayType = Opcodes.T_FLOAT;
            break;
        case Type.LONG:
            arrayType = Opcodes.T_LONG;
            break;
        case Type.DOUBLE:
            arrayType = Opcodes.T_DOUBLE;
            break;
        default:
            typeInsn(Opcodes.ANEWARRAY, type);
            return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, arrayType);
}
 
Example 12
Source File: GeneratorAdapter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instruction to create a new array.
 *
 * @param type
 *            the type of the array elements.
 */
public void newArray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        typeInsn(Opcodes.ANEWARRAY, type);
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 13
Source File: InstructionAdapter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void newarray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName());
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 14
Source File: InstructionAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void newarray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName());
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 15
Source File: GeneratorAdapter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates the instruction to create a new array.
 *
 * @param type
 *            the type of the array elements.
 */
public void newArray(final Type type) {
    int typ;
    switch (type.getSort()) {
    case Type.BOOLEAN:
        typ = Opcodes.T_BOOLEAN;
        break;
    case Type.CHAR:
        typ = Opcodes.T_CHAR;
        break;
    case Type.BYTE:
        typ = Opcodes.T_BYTE;
        break;
    case Type.SHORT:
        typ = Opcodes.T_SHORT;
        break;
    case Type.INT:
        typ = Opcodes.T_INT;
        break;
    case Type.FLOAT:
        typ = Opcodes.T_FLOAT;
        break;
    case Type.LONG:
        typ = Opcodes.T_LONG;
        break;
    case Type.DOUBLE:
        typ = Opcodes.T_DOUBLE;
        break;
    default:
        typeInsn(Opcodes.ANEWARRAY, type);
        return;
    }
    mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
 
Example 16
Source File: InstructionAdapter.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    switch (opcode) {
    case Opcodes.BIPUSH:
        iconst(operand);
        break;
    case Opcodes.SIPUSH:
        iconst(operand);
        break;
    case Opcodes.NEWARRAY:
        switch (operand) {
        case Opcodes.T_BOOLEAN:
            newarray(Type.BOOLEAN_TYPE);
            break;
        case Opcodes.T_CHAR:
            newarray(Type.CHAR_TYPE);
            break;
        case Opcodes.T_BYTE:
            newarray(Type.BYTE_TYPE);
            break;
        case Opcodes.T_SHORT:
            newarray(Type.SHORT_TYPE);
            break;
        case Opcodes.T_INT:
            newarray(Type.INT_TYPE);
            break;
        case Opcodes.T_FLOAT:
            newarray(Type.FLOAT_TYPE);
            break;
        case Opcodes.T_LONG:
            newarray(Type.LONG_TYPE);
            break;
        case Opcodes.T_DOUBLE:
            newarray(Type.DOUBLE_TYPE);
            break;
        default:
            throw new IllegalArgumentException();
        }
        break;
    default:
        throw new IllegalArgumentException();
    }
}
 
Example 17
Source File: InstructionAdapter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    switch (opcode) {
    case Opcodes.BIPUSH:
        iconst(operand);
        break;
    case Opcodes.SIPUSH:
        iconst(operand);
        break;
    case Opcodes.NEWARRAY:
        switch (operand) {
        case Opcodes.T_BOOLEAN:
            newarray(Type.BOOLEAN_TYPE);
            break;
        case Opcodes.T_CHAR:
            newarray(Type.CHAR_TYPE);
            break;
        case Opcodes.T_BYTE:
            newarray(Type.BYTE_TYPE);
            break;
        case Opcodes.T_SHORT:
            newarray(Type.SHORT_TYPE);
            break;
        case Opcodes.T_INT:
            newarray(Type.INT_TYPE);
            break;
        case Opcodes.T_FLOAT:
            newarray(Type.FLOAT_TYPE);
            break;
        case Opcodes.T_LONG:
            newarray(Type.LONG_TYPE);
            break;
        case Opcodes.T_DOUBLE:
            newarray(Type.DOUBLE_TYPE);
            break;
        default:
            throw new IllegalArgumentException();
        }
        break;
    default:
        throw new IllegalArgumentException();
    }
}
 
Example 18
Source File: InstructionAdapter.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    switch (opcode) {
    case Opcodes.BIPUSH:
        iconst(operand);
        break;
    case Opcodes.SIPUSH:
        iconst(operand);
        break;
    case Opcodes.NEWARRAY:
        switch (operand) {
        case Opcodes.T_BOOLEAN:
            newarray(Type.BOOLEAN_TYPE);
            break;
        case Opcodes.T_CHAR:
            newarray(Type.CHAR_TYPE);
            break;
        case Opcodes.T_BYTE:
            newarray(Type.BYTE_TYPE);
            break;
        case Opcodes.T_SHORT:
            newarray(Type.SHORT_TYPE);
            break;
        case Opcodes.T_INT:
            newarray(Type.INT_TYPE);
            break;
        case Opcodes.T_FLOAT:
            newarray(Type.FLOAT_TYPE);
            break;
        case Opcodes.T_LONG:
            newarray(Type.LONG_TYPE);
            break;
        case Opcodes.T_DOUBLE:
            newarray(Type.DOUBLE_TYPE);
            break;
        default:
            throw new IllegalArgumentException();
        }
        break;
    default:
        throw new IllegalArgumentException();
    }
}
 
Example 19
Source File: InstructionAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    switch (opcode) {
    case Opcodes.BIPUSH:
        iconst(operand);
        break;
    case Opcodes.SIPUSH:
        iconst(operand);
        break;
    case Opcodes.NEWARRAY:
        switch (operand) {
        case Opcodes.T_BOOLEAN:
            newarray(Type.BOOLEAN_TYPE);
            break;
        case Opcodes.T_CHAR:
            newarray(Type.CHAR_TYPE);
            break;
        case Opcodes.T_BYTE:
            newarray(Type.BYTE_TYPE);
            break;
        case Opcodes.T_SHORT:
            newarray(Type.SHORT_TYPE);
            break;
        case Opcodes.T_INT:
            newarray(Type.INT_TYPE);
            break;
        case Opcodes.T_FLOAT:
            newarray(Type.FLOAT_TYPE);
            break;
        case Opcodes.T_LONG:
            newarray(Type.LONG_TYPE);
            break;
        case Opcodes.T_DOUBLE:
            newarray(Type.DOUBLE_TYPE);
            break;
        default:
            throw new IllegalArgumentException();
        }
        break;
    default:
        throw new IllegalArgumentException();
    }
}
 
Example 20
Source File: InstructionAdapter.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void visitIntInsn(final int opcode, final int operand) {
    switch (opcode) {
        case Opcodes.BIPUSH:
            iconst(operand);
            break;
        case Opcodes.SIPUSH:
            iconst(operand);
            break;
        case Opcodes.NEWARRAY:
            switch (operand) {
                case Opcodes.T_BOOLEAN:
                    newarray(Type.BOOLEAN_TYPE);
                    break;
                case Opcodes.T_CHAR:
                    newarray(Type.CHAR_TYPE);
                    break;
                case Opcodes.T_BYTE:
                    newarray(Type.BYTE_TYPE);
                    break;
                case Opcodes.T_SHORT:
                    newarray(Type.SHORT_TYPE);
                    break;
                case Opcodes.T_INT:
                    newarray(Type.INT_TYPE);
                    break;
                case Opcodes.T_FLOAT:
                    newarray(Type.FLOAT_TYPE);
                    break;
                case Opcodes.T_LONG:
                    newarray(Type.LONG_TYPE);
                    break;
                case Opcodes.T_DOUBLE:
                    newarray(Type.DOUBLE_TYPE);
                    break;
                default:
                    throw new IllegalArgumentException();
            }
            break;
        default:
            throw new IllegalArgumentException();
    }
}