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

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


        condition, thenValue, elseValue);


    multi.exprs.add(conditional);

    JReturnStatement returnStatement = new JReturnStatement(sourceInfo,
        multi);
    ((JMethodBody) newMethod.getBody()).getBlock().addStmt(returnStatement);
    polyMethodToDevirtualMethods.put(polyMethod, newMethod);
   
    return newMethod;
View Full Code Here


      return new JDeclarationStatement(info, localRef, initializer);
    }

    JStatement processStatement(ReturnStatement x) {
      SourceInfo info = makeSourceInfo(x);
      return new JReturnStatement(info, dispProcessExpression(x.expression));
    }
View Full Code Here

      // wrap it in a return if necessary
      JStatement callOrReturn;
      if (bridgeMethod.getType() == program.getTypeVoid()) {
        callOrReturn = call.makeStatement();
      } else {
        callOrReturn = new JReturnStatement(info, call);
      }

      // create a body that is just that call
      JMethodBody body = (JMethodBody) bridgeMethod.getBody();
      body.getBlock().addStmt(callOrReturn);
View Full Code Here

      } else {
        info = method.getSourceInfo();
      }

      block.clear();
      block.addStmt(new JReturnStatement(info, returnValue));
    }
View Full Code Here

        JMethod delegateTo = program.getIndexedMethod("Enum.valueOf");
        JMethodCall call = new JMethodCall(sourceInfo, null, delegateTo);
        call.addArgs(mapRef, nameRef);

        currentMethodBody.getBlock().addStmt(
            new JReturnStatement(sourceInfo, call));
      }
    }
View Full Code Here

      {
        // return $VALUES;
        SourceInfo sourceInfo = currentMethod.getSourceInfo();
        JFieldRef valuesRef = new JFieldRef(sourceInfo, null, valuesField, type);
        currentMethodBody.getBlock().addStmt(
            new JReturnStatement(sourceInfo, valuesRef));
      }
      return valuesField;
    }
View Full Code Here

      }
      JStatement statement;
      if (returnType == program.getTypeVoid()) {
        statement = newCall.makeStatement();
      } else {
        statement = new JReturnStatement(sourceInfo, newCall);
      }
      newBody.getBlock().addStmt(statement);

      /*
       * Rewrite the method body. Update all thisRefs to paramRefs. Update
View Full Code Here

        switchBody.addStmt(new JCaseStatement(info,
            program.getLiteralInt(permutationId)));
      }

      // return new FooImpl();
      JReturnStatement ret = new JReturnStatement(info, instantiation);
      switchBody.addStmt(ret);
    }

    assert switchBody.getStatements().size() > 0 : "No case statement emitted "
        + "for supposedly soft-rebind type " + requestType.getName();

    // switch (CollapsedPropertyHolder.getPermutationId()) { ... }
    JSwitchStatement sw = new JSwitchStatement(info, new JMethodCall(info,
        null, permutationIdMethod), switchBody);

    // return new FallbackImpl(); at the very end.
    assert mostUsedExpression != null : "No most-used expression";
    JReturnStatement fallbackReturn = new JReturnStatement(info,
        mostUsedExpression);

    JMethodBody body = (JMethodBody) toReturn.getBody();
    body.getBlock().addStmt(sw);
    body.getBlock().addStmt(fallbackReturn);
View Full Code Here

          JExpressionStatement exprStmt = (JExpressionStatement) stmt;
          JExpression expr = exprStmt.getExpr();
          JExpression clone = cloner.cloneExpression(expr);
          multi.exprs.add(clone);
        } else if (stmt instanceof JReturnStatement) {
          JReturnStatement returnStatement = (JReturnStatement) stmt;
          JExpression expr = returnStatement.getExpr();
          if (expr != null) {
            if (!ignoringReturnValue || expr.hasSideEffects()) {
              JExpression clone = cloner.cloneExpression(expr);
              clone = maybeCast(clone, body.getMethod().getType());
              multi.exprs.add(clone);
View Full Code Here

    }

    @Override
    public void endVisit(JReturnStatement x, Context ctx) {
      info(x);
      JReturnStatement toReturn = new JReturnStatement(x.getSourceInfo(),
          new JMethodCall(x.getSourceInfo(),
          new JThisRef(x.getSourceInfo(),enumType), enumObfuscatedName));
      ctx.replaceMe(toReturn);
    }
View Full Code Here

TOP

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

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.