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

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


        outer : for (int j = 0; j < javaLangString.methods.size(); ++j) {
          JMethod method = (JMethod) javaLangString.methods.get(j);
          if (method.getName().equals("_String")
              && method.params.size() == ctorArgc) {
            for (int i = 0; i < ctorArgc; ++i) {
              JParameter mparam = (JParameter) method.params.get(i);
              JParameter cparam = (JParameter) ctor.params.get(i);
              if (mparam.getType() != cparam.getType()) {
                continue outer;
              }
            }
            targetMethod = method;
            break;
View Full Code Here


          for (int j = 0; j < superBinding.outerLocalVariables.length; ++j) {
            SyntheticArgumentBinding arg = superBinding.outerLocalVariables[j];
            // Got to be one of my params
            JType varType = (JType) typeMap.get(arg.type);
            String varName = String.valueOf(arg.name);
            JParameter param = null;
            for (int i = 0; i < currentMethod.params.size(); ++i) {
              JParameter paramIt = (JParameter) currentMethod.params.get(i);
              if (varType == paramIt.getType()
                  && varName.equals(paramIt.getName())) {
                param = paramIt;
              }
            }
            if (param == null) {
              throw new InternalCompilerException(
View Full Code Here

          throw new InternalCompilerException(
              "LocalRef referencing local in a different method.");
        }
        return new JLocalRef(program, info, local);
      } else if (variable instanceof JParameter) {
        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) {
View Full Code Here

          // See if there's an available parameter
          if (varBinding instanceof SyntheticArgumentBinding) {
            JType type = (JType) typeMap.get(varBinding.type);
            String name = String.valueOf(varBinding.name);
            for (int i = 0; i < currentMethod.params.size(); ++i) {
              JParameter param = (JParameter) currentMethod.params.get(i);
              if (type == param.getType() && name.equals(param.getName())) {
                variable = param;
                break;
              }
            }
          }
View Full Code Here

      // All of the params in the target method are considered to be assigned by
      // the arguments from the caller
      Iterator/* <JExpression> */argIt = x.getArgs().iterator();
      ArrayList params = x.getTarget().params;
      for (int i = 0; i < params.size(); ++i) {
        JParameter param = (JParameter) params.get(i);
        JExpression arg = (JExpression) argIt.next();
        if (param.getType() instanceof JReferenceType) {
          addAssignment(param, arg);
        }
      }
    }
View Full Code Here

      // Fake an assignment-to-self on all args to prevent tightening

      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

          && staticImplFor == null) {
        return true;
      }

      for (int j = 0, c = x.params.size(); j < c; ++j) {
        JParameter param = (JParameter) x.params.get(j);
        Set/* <JParameter> */set = (Set) paramUpRefs.get(param);
        if (set == null) {
          set = new HashSet/* <JParameter> */();
          paramUpRefs.put(param, set);
        }
        for (int i = 0; i < overrides.size(); ++i) {
          JMethod baseMethod = (JMethod) overrides.get(i);
          JParameter baseParam = (JParameter) baseMethod.params.get(j);
          set.add(baseParam);
        }
        for (int i = 0; i < virtualOverrides.length; ++i) {
          JMethod baseMethod = virtualOverrides[i];
          JParameter baseParam = (JParameter) baseMethod.params.get(j);
          set.add(baseParam);
        }
        if (staticImplFor != null && j > 1) {
          // static impls have an extra first "this" arg
          JParameter baseParam = (JParameter) staticImplFor.params.get(j - 1);
          set.add(baseParam);
        }
      }

      return true;
View Full Code Here

      if (x instanceof JParameter) {
        Set/* <JParameter> */myParams = (Set) paramUpRefs.get(x);
        if (myParams != null) {
          for (Iterator iter = myParams.iterator(); iter.hasNext();) {
            JParameter param = (JParameter) iter.next();
            typeList.add(param.getType());
          }
        }
      }

      if (typeList.isEmpty()) {
View Full Code Here

    // Find the correct valueOf() method.
    JMethod valueOfMethod = null;
    for (JMethod method : wrapperType.methods) {
      if ("valueOf".equals(method.getName())) {
        if (method.params.size() == 1) {
          JParameter param = method.params.get(0);
          if (param.getType() == primitiveType) {
            // Found it.
            valueOfMethod = method;
            break;
          }
        }
View Full Code Here

    String name = objectMethod.getName() + "__devirtual$";
    JMethod newMethod = program.createMethod(sourceInfo, name.toCharArray(),
        jsoType, objectMethod.getType(), false, true, true, false, false);

    // Setup parameters.
    JParameter thisParam = program.createParameter(null,
        "this$static".toCharArray(), program.getTypeJavaLangObject(), true,
        true, newMethod);
    for (JParameter oldParam : objectMethod.params) {
      program.createParameter(sourceInfo, oldParam.getName().toCharArray(),
          oldParam.getType(), true, false, newMethod);
View Full Code Here

TOP

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

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.