Item completeBinop ( JCTree lhs , JCTree rhs , OperatorSymbol operator ) { MethodType optype = ( MethodType ) operator . type ; int opcode = operator . opcode ; if ( opcode >= if_icmpeq && opcode <= if_icmple && rhs . type . constValue ( ) instanceof Number && ( ( Number ) rhs . type . constValue ( ) ) . intValue ( ) == 0 ) { opcode = opcode + ( ifeq - if_icmpeq ) ; } else if ( opcode >= if_acmpeq && opcode <= if_acmpne && TreeInfo . isNull ( rhs ) ) { opcode = opcode + ( if_acmp_null - if_acmpeq ) ; } else { // The expected type of the right operand is // the second parameter type of the operator, except for // shifts with long shiftcount, where we convert the opcode // to a short shift and the expected type to int. Type rtype = operator . erasure ( types ) . getParameterTypes ( ) . tail . head ; if ( opcode >= ishll && opcode <= lushrl ) { opcode = opcode + ( ishl - ishll ) ; rtype = syms . intType ; } // Generate code for right operand and load. genExpr ( rhs , rtype ) . load ( ) ; // If there are two consecutive opcode instructions, // emit the first now. if ( opcode >= ( 1 << preShift ) ) { code . emitop0 ( opcode >> preShift ) ; opcode = opcode & 0xFF ; } } if ( opcode >= ifeq && opcode <= if_acmpne || opcode == if_acmp_null || opcode == if_acmp_nonnull ) { return items . makeCondItem ( opcode ) ; } else { code . emitop0 ( opcode ) ; return items . makeStackItem ( optype . restype ) ; } }
Complete generating code for operation with left operand already on stack .