Example usage for org.objectweb.asm Opcodes T_DOUBLE

List of usage examples for org.objectweb.asm Opcodes T_DOUBLE

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes T_DOUBLE.

Prototype

int T_DOUBLE

To view the source code for org.objectweb.asm Opcodes T_DOUBLE.

Click Source Link

Usage

From source file:serianalyzer.JVMImpl.java

License:Open Source License

/**
 * @param operand/*from  w  ww .  ja  va2 s .  c  o m*/
 * @return
 */
private static Type makeBasicArrayType(int operand) {

    switch (operand) {
    case Opcodes.T_BOOLEAN:
        return Type.getType("[Z"); //$NON-NLS-1$
    case Opcodes.T_BYTE:
        return Type.getType("[B"); //$NON-NLS-1$
    case Opcodes.T_CHAR:
        return Type.getType("[C"); //$NON-NLS-1$
    case Opcodes.T_DOUBLE:
        return Type.getType("[D"); //$NON-NLS-1$
    case Opcodes.T_FLOAT:
        return Type.getType("[F"); //$NON-NLS-1$
    case Opcodes.T_INT:
        return Type.getType("[I"); //$NON-NLS-1$
    case Opcodes.T_LONG:
        return Type.getType("[J"); //$NON-NLS-1$
    case Opcodes.T_SHORT:
        return Type.getType("[S"); //$NON-NLS-1$

    default:
        log.error("Unknown array type " + operand); //$NON-NLS-1$
    }
    return null;
}

From source file:v6.java.preverifier.PreverifierMethodNode.java

License:Open Source License

/**
 * @see org.objectweb.asm.MethodVisitor#visitIntInsn(int, int)
 *///from   www . j a v  a 2  s.  c  om
public void visitIntInsn(int opcode, int operand) {
    if (opcode == Opcodes.NEWARRAY) {
        if ((operand == Opcodes.T_DOUBLE) || (operand == Opcodes.T_FLOAT)) {
            ClassNodeErrorInformation classInfo = new ClassNodeErrorInformation(classNode);
            MethodNodeErrorInformation methodInfo = new MethodNodeErrorInformation(classInfo, this);

            PreverificationErrorLocation location = new PreverificationErrorLocation(
                    PreverificationErrorLocationType.METHOD_INSTRUCTION, classInfo, methodInfo, null,
                    lineNumber);
            PreverificationError error = new PreverificationError(PreverificationErrorType.FLOATING_POINT,
                    location, null);
            addError(error);
        }
    }

    super.visitIntInsn(opcode, operand);
}