use of org.objectweb.asm.Opcodes.LXOR in project groovy by apache.
the class StaticTypesUnaryExpressionHelper method writeBitwiseNegate.
@Override
public void writeBitwiseNegate(final BitwiseNegationExpression expression) {
expression.getExpression().visit(controller.getAcg());
ClassNode top = controller.getOperandStack().getTopOperand();
if (isPrimitiveInt(top) || isPrimitiveLong(top) || isPrimitiveShort(top) || isPrimitiveByte(top) || isPrimitiveChar(top)) {
bytecodeX(mv -> {
if (isPrimitiveLong(top)) {
mv.visitLdcInsn(-1L);
mv.visitInsn(LXOR);
} else {
mv.visitInsn(ICONST_M1);
mv.visitInsn(IXOR);
if (isPrimitiveByte(top)) {
mv.visitInsn(I2B);
} else if (isPrimitiveChar(top)) {
mv.visitInsn(I2C);
} else if (isPrimitiveShort(top)) {
mv.visitInsn(I2S);
}
}
}).visit(controller.getAcg());
controller.getOperandStack().remove(1);
} else {
super.writeBitwiseNegate(EMPTY_BITWISE_NEGATE);
}
}
Aggregations