src/share/classes/sun/tools/tree/BitNotExpression.java

Print this page
rev 10195 : 8048267: Replace uses of 'new Long()' with appropriate alternative across core classes
Reviewed-by: chegar, psandoz
Contributed-by: otaviojava@java.net


  66 
  67     /**
  68      * Simplify
  69      */
  70     Expression simplify() {
  71         if (right.op == BITNOT) {
  72             return ((BitNotExpression)right).right;
  73         }
  74         return this;
  75     }
  76 
  77     /**
  78      * Code
  79      */
  80     public void codeValue(Environment env, Context ctx, Assembler asm) {
  81         right.codeValue(env, ctx, asm);
  82         if (type.isType(TC_INT)) {
  83             asm.add(where, opc_ldc, new Integer(-1));
  84             asm.add(where, opc_ixor);
  85         } else {
  86             asm.add(where, opc_ldc2_w, new Long(-1));
  87             asm.add(where, opc_lxor);
  88         }
  89     }
  90 }


  66 
  67     /**
  68      * Simplify
  69      */
  70     Expression simplify() {
  71         if (right.op == BITNOT) {
  72             return ((BitNotExpression)right).right;
  73         }
  74         return this;
  75     }
  76 
  77     /**
  78      * Code
  79      */
  80     public void codeValue(Environment env, Context ctx, Assembler asm) {
  81         right.codeValue(env, ctx, asm);
  82         if (type.isType(TC_INT)) {
  83             asm.add(where, opc_ldc, new Integer(-1));
  84             asm.add(where, opc_ixor);
  85         } else {
  86             asm.add(where, opc_ldc2_w, -1L);
  87             asm.add(where, opc_lxor);
  88         }
  89     }
  90 }