Examples of JParameterRef


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

      }

      @Override
      public void endVisit(JParameterRef x, Context ctx) {
        JParameter param = varMap.get(x.getTarget());
        JParameterRef paramRef = new JParameterRef(x.getSourceInfo().makeChild(
            RewriteMethodBody.class, "Reference to devirtualized parameter"),
            param);
        ctx.replaceMe(paramRef);
      }
View Full Code Here

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

        ctx.replaceMe(paramRef);
      }

      @Override
      public void endVisit(JThisRef x, Context ctx) {
        JParameterRef paramRef = new JParameterRef(x.getSourceInfo().makeChild(
            RewriteMethodBody.class, "Reference to devirtualized instance"),
            thisParam);
        ctx.replaceMe(paramRef);
      }
View Full Code Here

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

      // delegate from the instance method to the static method
      JMethodCall newCall = new JMethodCall(program, bodyInfo, null, newMethod);
      newCall.getArgs().add(program.getExprThisRef(bodyInfo, enclosingType));
      for (int i = 0; i < x.params.size(); ++i) {
        JParameter param = (JParameter) x.params.get(i);
        newCall.getArgs().add(new JParameterRef(program, bodyInfo, param));
      }
      JStatement statement;
      if (oldReturnType == program.getTypeVoid()) {
        statement = newCall.makeStatement();
      } else {
View Full Code Here

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

    }

    // @Override
    public void endVisit(JParameterRef x, Context ctx) {
      JParameter param = (JParameter) varMap.get(x.getTarget());
      JParameterRef paramRef = new JParameterRef(program, x.getSourceInfo(),
          param);
      ctx.replaceMe(paramRef);
    }
View Full Code Here

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

      ctx.replaceMe(paramRef);
    }

    // @Override
    public void endVisit(JThisRef x, Context ctx) {
      JParameterRef paramRef = new JParameterRef(program, x.getSourceInfo(),
          thisParam);
      ctx.replaceMe(paramRef);
    }
View Full Code Here

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

        JParameter parameter = (JParameter) variable;
        if (parameter.getEnclosingMethod() != currentMethod) {
          throw new InternalCompilerException(
              "ParameterRef referencing param in a different method.");
        }
        return new JParameterRef(program, info, parameter);
      } else if (variable instanceof JField) {
        JField field = (JField) variable;
        JExpression instance = null;
        if (!field.isStatic()) {
          JClassType fieldEnclosingType = (JClassType) field.getEnclosingType();
View Full Code Here

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

      JMethod method = x.getTarget();

      for (int i = 0; i < method.params.size(); ++i) {
        JParameter param = (JParameter) method.params.get(i);
        addAssignment(param, new JParameterRef(program, null, param));
      }
    }
View Full Code Here

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

    newMethod.freezeParamTypes();

    // Build from bottom up.
    JMethodCall condition = new JMethodCall(program, sourceInfo, null,
        isJavaObjectMethod);
    condition.getArgs().add(new JParameterRef(program, sourceInfo, thisParam));

    JMethodCall thenValue = new JMethodCall(program, sourceInfo,
        new JParameterRef(program, sourceInfo, thisParam), objectMethod);
    for (JParameter param : newMethod.params) {
      if (param != thisParam) {
        thenValue.getArgs().add(new JParameterRef(program, sourceInfo, param));
      }
    }

    JMethodCall elseValue = new JMethodCall(program, sourceInfo, null, jsoImpl);
    for (JParameter param : newMethod.params) {
      elseValue.getArgs().add(new JParameterRef(program, sourceInfo, param));
    }

    JConditional conditional = new JConditional(program, sourceInfo,
        objectMethod.getType(), condition, thenValue, elseValue);
View Full Code Here

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

        /*
         * This supports x.new Inner() by passing the enclosing instance
         * implicitly as the last argument to the constructor.
         */
        if (enclosingInstance != null && !i.hasNext()) {
          args.add(new JParameterRef(program, null, enclosingInstance));
        } else {
          JParameter syntheticParam = program.createParameter(null,
              param.getName().toCharArray(), param.getType(), true, false,
              synthetic);
          args.add(new JParameterRef(program, null, syntheticParam));
        }
      }

      // Lock the method.
      synthetic.freezeParamTypes();
View Full Code Here

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

    public void endVisit(JsniMethodRef x, Context ctx) {
      // If this happens in JSNI, we can't make any type-tightening assumptions
      // Fake an assignment-to-self on all args to prevent tightening
      JMethod method = x.getTarget();
      for (JParameter param : method.params) {
        addAssignment(param, new JParameterRef(program, null, param));
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.