Package com.google.gwt.dev.jjs

Examples of com.google.gwt.dev.jjs.SourceInfo


          x.setExpr(op);
        }
      } else {
        if (x.getExpr() != null && x.getExpr().hasSideEffects()) {
          // temp = expr; pop(); return temp;
          SourceInfo info = x.getSourceInfo().makeChild(JsStackEmulator.class,
              "Flow break with side-effect");
          JsBinaryOperation asg = new JsBinaryOperation(info,
              JsBinaryOperator.ASG, returnTempRef(info), x.getExpr());
          x.setExpr(returnTempRef(info));
          pop(x, asg, ctx);
View Full Code Here


         */
        return;
      }

      // pop()
      SourceInfo info = x.getSourceInfo().makeChild(JsStackEmulator.class,
          "Stack exit");
      JsExpression op = pop(info);

      if (checkEarlyExit) {
        // earlyExit && pop()
View Full Code Here

    private JsCatch makeSyntheticCatchBlock(JsTry x) {
      /*
       * catch (e) { e = caught(e); throw e; }
       */
      SourceInfo info = x.getSourceInfo().makeChild(JsStackEmulator.class,
          "Synthetic catch block to fix stack depth");

      JsCatch c = new JsCatch(info, currentFunction.getScope(), "e");
      JsName paramName = c.getParameter().getName();

View Full Code Here

     * @param ctx the visitor context
     */
    private void pop(JsStatement x, JsExpression expr,
        JsContext<JsStatement> ctx) {
      // $stackDepth = stackIndex - 1
      SourceInfo info = x.getSourceInfo().makeChild(JsStackEmulator.class,
          "Stack exit");

      JsExpression op = pop(info);

      if (ctx.canInsert()) {
View Full Code Here

  public JsBooleanLiteral getTrueLiteral() {
    return trueLiteral;
  }

  public JsNameRef getUndefinedLiteral() {
    SourceInfo info = createSourceInfoSynthetic(JsProgram.class,
        "undefined reference");
    info.addCorrelation(correlator.by(Literal.JS_UNDEFINED));
    return rootScope.findExistingName("undefined").makeRef(info);
  }
View Full Code Here

    /**
     * Create the function-entry code.
     */
    private JsStatement push(HasSourceInfo x) {
      SourceInfo info = x.getSourceInfo().makeChild(JsStackEmulator.class,
          "Stack entry code");

      JsNameRef stackRef = stack.makeRef(info);
      JsNameRef stackDepthRef = stackDepth.makeRef(info);
      JsExpression currentFunctionRef;
View Full Code Here

  private SourceInfo createLiteralSourceInfo(String description) {
    return intrinsic.makeChild(getClass(), description);
  }

  private SourceInfo createLiteralSourceInfo(String description, Literal literal) {
    SourceInfo child = createLiteralSourceInfo(description);
    child.addCorrelation(correlator.by(literal));
    return child;
  }
View Full Code Here

              lastFile))) {
        // Same location; ignore
        return;
      }

      SourceInfo info = x.getSourceInfo().makeChild(JsStackEmulator.class,
          "Synthetic location data");

      // ($locations[stackIndex] = fileName + lineNumber, x)
      JsExpression location = program.getStringLiteral(info,
          String.valueOf(lastLine = info.getStartLine()));
      if (recordFileNames) {
        // 'fileName:' + lineNumber
        JsStringLiteral stringLit = program.getStringLiteral(info,
            baseName(lastFile = info.getFileName()) + ":");
        location = new JsBinaryOperation(info, JsBinaryOperator.ADD, stringLit,
            location);
      }

      JsArrayAccess access = new JsArrayAccess(info, lineNumbers.makeRef(info),
View Full Code Here

     * initializer emulation method - run user code - return this
     */
    void processConstructor(ConstructorDeclaration x) {
      JMethod ctor = (JMethod) typeMap.get(x.binding);
      try {
        SourceInfo info = ctor.getSourceInfo();

        currentMethod = ctor;
        currentMethodBody = (JMethodBody) ctor.getBody();
        currentMethodScope = x.scope;

View Full Code Here

        throw translateException(ctor, e);
      }
    }

    JExpression processExpression(AllocationExpression x) {
      SourceInfo info = makeSourceInfo(x);
      SourceTypeBinding typeBinding = erasure(x.resolvedType);
      if (typeBinding.constantPoolName() == null) {
        /*
         * Weird case: if JDT determines that this local class is totally
         * uninstantiable, it won't bother allocating a local name.
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.SourceInfo

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.