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

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


          CreateStaticImplsVisitor.class, "Degelgating to devirtualized method");
      JMethodBody newBody = new JMethodBody(delegateCallSourceInfo);
      x.setBody(newBody);
      JMethodCall newCall = new JMethodCall(delegateCallSourceInfo, null,
          newMethod);
      newCall.addArg(new JThisRef(delegateCallSourceInfo, enclosingType));
      for (int i = 0; i < x.getParams().size(); ++i) {
        JParameter param = x.getParams().get(i);
        newCall.addArg(new JParameterRef(delegateCallSourceInfo, param));
      }
      JStatement statement;
View Full Code Here


      newMethod.setBody(movedBody);

      JMethodBody newBody = new JMethodBody(sourceInfo);
      x.setBody(newBody);
      JMethodCall newCall = new JMethodCall(sourceInfo, null, newMethod);
      newCall.addArg(new JThisRef(sourceInfo, enclosingType));
      for (int i = 0; i < x.getParams().size(); ++i) {
        JParameter param = x.getParams().get(i);
        newCall.addArg(new JParameterRef(sourceInfo, param));
      }
      JStatement statement;
View Full Code Here

    return false;
  }

  @Override
  public boolean visit(JThisRef x, Context ctx) {
    expression = new JThisRef(x.getSourceInfo(), x.getClassType());
    return false;
  }
View Full Code Here

                scope.enclosingSourceType().enclosingTypeAt(
                    (x.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT);
            receiver = makeThisReference(info, targetType, true, scope);
          } else if (x.receiver.sourceStart == 0) {
            // Synthetic this ref with bad source info; fix the info.
            JThisRef oldRef = (JThisRef) receiver;
            receiver = new JThisRef(info, oldRef.getClassType());
          }
        }

        JMethodCall call = new JMethodCall(info, receiver, method);
View Full Code Here

        return new JParameterRef(info, (JParameter) variable);
      }
    }

    private JThisRef makeThisRef(SourceInfo info) {
      return new JThisRef(info, curClass.classType);
    }
View Full Code Here

            if (isScript(program)
                && currentClass == program.getIndexedType("Array")) {
              // Special implementation: return this.arrayClass
              implementMethod(
                  method,
                  new JFieldRef(info, new JThisRef(info,
                      (JClassType) currentClass),
                      program.getIndexedField("Array.arrayClass"), currentClass));
            } else {
              implementMethod(method, new JClassLiteral(info.makeChild(),
                  currentClass));
View Full Code Here

       * Really weird: Sometimes an allocation expression needs both its
       * explicit qualifier AND its implicit enclosing class! We add this second
       * because the explicit qualifier takes precedence.
       */
      if (!currentMethod.isStatic()) {
        JExpression implicitOuter = new JThisRef(info,
            (JClassType) currentClass);
        qualList.add(implicitOuter);
      }

      // Synthetic this args for inner classes
View Full Code Here

      addThrownExceptions(jdtBridgeMethod, bridgeMethod);
      bridgeMethod.freezeParamTypes();
      info.addCorrelation(info.getCorrelator().by(bridgeMethod));

      // create a call
      JMethodCall call = new JMethodCall(info, new JThisRef(info, clazz),
          implmeth);

      for (int i = 0; i < bridgeMethod.getParams().size(); i++) {
        JParameter param = bridgeMethod.getParams().get(i);
        JParameterRef paramRef = new JParameterRef(info, param);
View Full Code Here

     * creating a naked JThisRef or you won't get the synthetic accesses right.
     */
    private JExpression createQualifiedThisRef(SourceInfo info,
        JClassType targetType) {
      assert (currentClass instanceof JClassType);
      JExpression expr = new JThisRef(info, ((JClassType) currentClass));
      List<JExpression> list = new ArrayList<JExpression>();
      addAllOuterThisRefsPlusSuperChain(list, expr, (JClassType) currentClass);
      return createThisRef(targetType, list);
    }
View Full Code Here

     * the appropriate type. Always use this method instead of creating a naked
     * JThisRef or you won't get the synthetic accesses right.
     */
    private JExpression createThisRef(SourceInfo info, JReferenceType targetType) {
      assert (currentClass instanceof JClassType);
      return createThisRef(targetType, new JThisRef(info,
          ((JClassType) currentClass)));
    }
View Full Code Here

TOP

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

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.