Package com.google.gwt.dev.jjs.ast

Examples of com.google.gwt.dev.jjs.ast.JBinaryOperation


      JMethod method = program.getIndexedMethod(methodName);
      JMethodCall rhs = new JMethodCall(x.getSourceInfo(), null, method);
      if (x.getArg() != null) {
        rhs.addArg(x.getArg());
      }
      JBinaryOperation binOp = new JBinaryOperation(x.getSourceInfo(), program.getTypePrimitiveBoolean(),
          JBinaryOperator.OR, lhs, rhs);
      ctx.replaceMe(binOp.makeStatement());
    }
View Full Code Here


      if ((USE_TRIPLE_EQUALS[lhsStatus.getIndex()][rhsStatus.getIndex()] == 1)) {
        // Mask each side to prevent null === undefined.
        lhs = maskUndefined(lhs);
        rhs = maskUndefined(rhs);
        JBinaryOperation binOp = new JBinaryOperation(x.getSourceInfo(),
            x.getType(), x.getOp(), lhs, rhs);
        ctx.replaceMe(binOp);
      } else {
        boolean lhsNullLit = lhs == program.getLiteralNull();
        boolean rhsNullLit = rhs == program.getLiteralNull();
View Full Code Here

      // Create a temp local
      JLocal tempLocal = getTempLocal(x.getType());

      // Create an assignment for this temp and add it to multi.
      JLocalRef tempRef = new JLocalRef(x.getSourceInfo(), tempLocal);
      JBinaryOperation asg = new JBinaryOperation(x.getSourceInfo(), x.getType(),
          JBinaryOperator.ASG, tempRef, x);
      multi.exprs.add(asg);
      // Update me with the temp
      return cloner.cloneExpression(tempRef);
    }
View Full Code Here

      ReplaceSideEffectsInLvalue replacer = new ReplaceSideEffectsInLvalue(
          new JMultiExpression(x.getSourceInfo()));
      JExpression newLhs = replacer.accept(x.getLhs());
      exitTempUsageScope();

      JBinaryOperation operation = new JBinaryOperation(x.getSourceInfo(),
          newLhs.getType(), op.getNonAssignmentOf(), newLhs, x.getRhs());
      // newLhs is cloned below because it was used in operation
      JBinaryOperation asg = new JBinaryOperation(x.getSourceInfo(), newLhs.getType(),
          JBinaryOperator.ASG, cloner.cloneExpression(newLhs),
          operation);

      JMultiExpression multiExpr = replacer.getMultiExpr();
      if (multiExpr.exprs.isEmpty()) {
View Full Code Here

      // Now generate the appropriate expressions.
      JLocal tempLocal = getTempLocal(expressionReturn.getType());

      // t = x
      JLocalRef tempRef = new JLocalRef(x.getSourceInfo(), tempLocal);
      JBinaryOperation asg = new JBinaryOperation(x.getSourceInfo(), x.getType(),
          JBinaryOperator.ASG, tempRef, expressionReturn);
      multi.exprs.add(asg);

      // x += 1
      asg = createAsgOpFromUnary(newArg, op);
View Full Code Here

        return;
      }

      // Convert into the equivalent binary assignment operation, such as:
      // x += 1
      JBinaryOperation asg = createAsgOpFromUnary(x.getArg(), op);

      // Visit the result to break it up even more.
      ctx.replaceMe(accept(asg));
    }
View Full Code Here

      } else {
        // int is safe to add to all other types
        one = program.getLiteralInt(1);
      }
      // arg is cloned below because the caller is allowed to use it somewhere
      JBinaryOperation asg = new JBinaryOperation(arg.getSourceInfo(), arg.getType(),
          newOp, cloner.cloneExpression(arg), one);
      return asg;
    }
View Full Code Here

          if (x.getLhs() instanceof JArrayRef) {
            newRhs = checkAndReplaceJsoArrayStore(newRhs, lhsType);
          }
        }
        if (newRhs != x.getRhs()) {
          JBinaryOperation asg = new JBinaryOperation(program,
              x.getSourceInfo(), lhsType, x.getOp(), x.getLhs(), newRhs);
          ctx.replaceMe(asg);
        }
      }
    }
View Full Code Here

            multi);
        JExpression newLhs = replacer.accept(x.getLhs());
        localIndex = pushUsedLocals;

        JNullLiteral litNull = program.getLiteralNull();
        JBinaryOperation operation = new JBinaryOperation(program,
            x.getSourceInfo(), newLhs.getType(), JBinaryOperator.DIV, newLhs,
            x.getRhs());
        JBinaryOperation asg = new JBinaryOperation(program, x.getSourceInfo(),
            newLhs.getType(), JBinaryOperator.ASG, newLhs, operation);

        JMultiExpression multiExpr = replacer.getMultiExpr();
        if (multiExpr.exprs.isEmpty()) {
          // just use the split assignment expression
View Full Code Here

      // Create a temp local
      JLocal tempLocal = getTempLocal();

      // Create an assignment for this temp and add it to multi.
      JLocalRef tempRef = new JLocalRef(program, x.getSourceInfo(), tempLocal);
      JBinaryOperation asg = new JBinaryOperation(program, x.getSourceInfo(),
          x.getType(), JBinaryOperator.ASG, tempRef, x);
      multi.exprs.add(asg);
      // Update me with the temp
      return tempRef;
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.ast.JBinaryOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.