Examples of JLocal


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

      JBlock tryBlock = (JBlock) dispProcessStatement(x.tryBlock);
      List<JLocalRef> catchArgs = new ArrayList<JLocalRef>();
      List<JBlock> catchBlocks = new ArrayList<JBlock>();
      if (x.catchBlocks != null) {
        for (int i = 0, c = x.catchArguments.length; i < c; ++i) {
          JLocal local = (JLocal) typeMap.get(x.catchArguments[i].binding);
          catchArgs.add((JLocalRef) createVariableRef(info, local));
        }
        for (int i = 0, c = x.catchBlocks.length; i < c; ++i) {
          catchBlocks.add((JBlock) dispProcessStatement(x.catchBlocks[i]));
        }
View Full Code Here

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

     * Creates an appropriate JVariableRef for the polymorphic type of the
     * requested JVariable.
     */
    private JVariableRef createVariableRef(SourceInfo info, JVariable variable) {
      if (variable instanceof JLocal) {
        JLocal local = (JLocal) variable;
        if (local.getEnclosingMethod() != currentMethod) {
          throw new InternalCompilerException(
              "LocalRef referencing local in a different method.");
        }
        return new JLocalRef(info, local);
      } else if (variable instanceof JParameter) {
View Full Code Here

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

      return false;
    }

    @Override
    public boolean visit(JLocalRef ref, Context ctx) {
      JLocal target = ref.getLocal();
      rescue(target);
      return true;
    }
View Full Code Here

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

         * multi-expression is used for this purpose.
         */
        SourceInfo info = instance.getSourceInfo().makeChild(
            JavaScriptObjectNormalizer.class,
            "Temporary assignment for instance with side-effects");
        JLocal local = program.createLocal(info,
            "maybeJsoInvocation".toCharArray(), instance.getType(), true,
            currentMethodBody.peek());
        multi.exprs.add(program.createAssignmentStmt(info,
            new JLocalRef(info, local), instance).getExpr());

View Full Code Here

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

      if (!x.hasSideEffects()) {
        return x;
      }

      // Create a temp local
      JLocal tempLocal = getTempLocal(x.getType());

      // Create an assignment for this temp and add it to multi.
      JLocalRef tempRef = new JLocalRef(x.getSourceInfo(), tempLocal);
      JBinaryOperation asg = new JBinaryOperation(x.getSourceInfo(), x.getType(),
          JBinaryOperator.ASG, tempRef, x);
View Full Code Here

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

    return tempLocals.get(--localIndex);
  }

  private void pushTempLocal(SourceInfo sourceInfo) {
    if (localIndex == tempLocals.size()) {
      JLocal newTemp = program.createLocal(sourceInfo,
          ("$e" + localIndex).toCharArray(), program.getTypeJavaLangObject(),
          false, currentMethodBody);
      tempLocals.add(newTemp);
    }
    ++localIndex;
View Full Code Here

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

      if (x.getCatchBlocks().isEmpty()) {
        return;
      }

      SourceInfo catchInfo = x.getCatchBlocks().get(0).getSourceInfo();
      JLocal exVar = popTempLocal();
      JBlock newCatchBlock = new JBlock(catchInfo);

      {
        // $e = Exceptions.caught($e)
        JMethod caughtMethod = program.getIndexedMethod("Exceptions.caught");
View Full Code Here

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

    if (tracker == null) {
      tracker = new TempLocalTracker();
      localTrackers.put(type, tracker);
    }

    JLocal temp = null;
    if (reuseTemps) {
      /*
       * If the return is non-null, we now "own" the returned JLocal; it's
       * important to call tracker.useLocal() on the returned value (below).
       */
 
View Full Code Here

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

      JExpression newArg = replacer.accept(x.getArg());

      JExpression expressionReturn = expressionToReturn(newArg);

      // Now generate the appropriate expressions.
      JLocal tempLocal = getTempLocal(expressionReturn.getType());

      // t = x
      JLocalRef tempRef = new JLocalRef(x.getSourceInfo(), tempLocal);
      JBinaryOperation asg = new JBinaryOperation(x.getSourceInfo(), x.getType(),
          JBinaryOperator.ASG, tempRef, expressionReturn);
View Full Code Here

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

      return false;
    }

    public boolean visit(JMethod method, Context ctx) {
      for (Iterator it = method.locals.iterator(); it.hasNext();) {
        JLocal local = (JLocal) it.next();
        if (!referencedNonTypes.contains(local)) {
          it.remove();
          didChange = true;
        }
      }
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.