public void ifCmp(final Type type, final int mode, final Label label) {
        switch (type.getSort()) {
        case Type.LONG:
            mv.visitInsn(Opcodes.LCMP);
            break;
        case Type.DOUBLE:
            mv.visitInsn(mode == GE || mode == GT ? Opcodes.DCMPL
                    : Opcodes.DCMPG);
            break;
        case Type.FLOAT:
            mv.visitInsn(mode == GE || mode == GT ? Opcodes.FCMPL
                    : Opcodes.FCMPG);
            break;
        case Type.ARRAY:
        case Type.OBJECT:
            switch (mode) {
            case EQ:
                mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
                return;
            case NE:
                mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
                return;
            }
            throw new IllegalArgumentException("Bad comparison for type "
                    + type);
        default:
            int intOp = -1;
            switch (mode) {
            case EQ:
                intOp = Opcodes.IF_ICMPEQ;
                break;
            case NE:
                intOp = Opcodes.IF_ICMPNE;
                break;
            case GE:
                intOp = Opcodes.IF_ICMPGE;
                break;
            case LT:
                intOp = Opcodes.IF_ICMPLT;
                break;
            case LE:
                intOp = Opcodes.IF_ICMPLE;
                break;
            case GT:
                intOp = Opcodes.IF_ICMPGT;
                break;
            }
            mv.visitJumpInsn(intOp, label);
            return;
        }
        mv.visitJumpInsn(mode, label);
    }
public void ifCmp(final Type type, final int mode, final Label label) {
        switch (type.getSort()) {
        case Type.LONG:
            mv.visitInsn(Opcodes.LCMP);
            break;
        case Type.DOUBLE:
            mv.visitInsn(mode == GE || mode == GT ? Opcodes.DCMPL
                    : Opcodes.DCMPG);
            break;
        case Type.FLOAT:
            mv.visitInsn(mode == GE || mode == GT ? Opcodes.FCMPL
                    : Opcodes.FCMPG);
            break;
        case Type.ARRAY:
        case Type.OBJECT:
            switch (mode) {
            case EQ:
                mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
                return;
            case NE:
                mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
                return;
            }
            throw new IllegalArgumentException("Bad comparison for type "
                    + type);
        default:
            int intOp = -1;
            switch (mode) {
            case EQ:
                intOp = Opcodes.IF_ICMPEQ;
                break;
            case NE:
                intOp = Opcodes.IF_ICMPNE;
                break;
            case GE:
                intOp = Opcodes.IF_ICMPGE;
                break;
            case LT:
                intOp = Opcodes.IF_ICMPLT;
                break;
            case LE:
                intOp = Opcodes.IF_ICMPLE;
                break;
            case GT:
                intOp = Opcodes.IF_ICMPGT;
                break;
            }
            mv.visitJumpInsn(intOp, label);
            return;
        }
        mv.visitJumpInsn(mode, label);
    }
public void ifCmp ( final Type type , final int mode , final Label label ) { switch ( type . getSort ( ) ) { case Type . LONG : mv . visitInsn ( Opcodes . LCMP ) ; break ; case Type . DOUBLE : mv . visitInsn ( mode == GE || mode == GT ? Opcodes . DCMPL : Opcodes . DCMPG ) ; break ; case Type . FLOAT : mv . visitInsn ( mode == GE || mode == GT ? Opcodes . FCMPL : Opcodes . FCMPG ) ; break ; case Type . ARRAY : case Type . OBJECT : switch ( mode ) { case EQ : mv . visitJumpInsn ( Opcodes . IF_ACMPEQ , label ) ; return ; case NE : mv . visitJumpInsn ( Opcodes . IF_ACMPNE , label ) ; return ; } throw new IllegalArgumentException ( "Bad comparison for type " + type ) ; default : int intOp = - 1 ; switch ( mode ) { case EQ : intOp = Opcodes . IF_ICMPEQ ; break ; case NE : intOp = Opcodes . IF_ICMPNE ; break ; case GE : intOp = Opcodes . IF_ICMPGE ; break ; case LT : intOp = Opcodes . IF_ICMPLT ; break ; case LE : intOp = Opcodes . IF_ICMPLE ; break ; case GT : intOp = Opcodes . IF_ICMPGT ; break ; } mv . visitJumpInsn ( intOp , label ) ; return ; } mv . visitJumpInsn ( mode , label ) ; }
Generates the instructions to jump to a label based on the comparison of
the top two stack values.

@param type
the type of the top two stack values.
@param mode
how these values must be compared. One of EQ, NE, LT, GE, GT,
LE.
@param label
where to jump if the comparison result is <tt>true</tt>.
Generates the instructions to jump to a label based on the comparison of the top two stack values .