protected boolean writeStdCompare ( int type , boolean simulate ) { type = type - COMPARE_NOT_EQUAL ; // look if really compare if ( type < 0 || type > 7 ) return false ; if ( ! simulate ) { MethodVisitor mv = getController ( ) . getMethodVisitor ( ) ; OperandStack operandStack = getController ( ) . getOperandStack ( ) ; // operands are on the stack already int bytecode = stdCompareCodes [ type ] ; Label l1 = new Label ( ) ; mv . visitJumpInsn ( bytecode , l1 ) ; mv . visitInsn ( ICONST_1 ) ; Label l2 = new Label ( ) ; mv . visitJumpInsn ( GOTO , l2 ) ; mv . visitLabel ( l1 ) ; mv . visitInsn ( ICONST_0 ) ; mv . visitLabel ( l2 ) ; operandStack . replace ( ClassHelper . boolean_TYPE , 2 ) ; } return true ; }
writes a std compare . This involves the tokens IF_ICMPEQ IF_ICMPNE IF_ICMPEQ IF_ICMPNE IF_ICMPGE IF_ICMPGT IF_ICMPLE and IF_ICMPLT