Examples of JLocal


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

      }
      newMethod.freezeParamTypes();

      // Copy all locals over to the new method
      for (int i = 0; i < x.locals.size(); ++i) {
        JLocal oldVar = (JLocal) x.locals.get(i);
        JLocal newVar = program.createLocal(oldVar.getSourceInfo(),
            oldVar.getName().toCharArray(), oldVar.getType(), oldVar.isFinal(),
            newMethod);
        varMap.put(oldVar, newVar);
      }
      x.locals.clear();
View Full Code Here

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

      this.varMap = varMap;
    }

    // @Override
    public void endVisit(JLocalRef x, Context ctx) {
      JLocal local = (JLocal) varMap.get(x.getTarget());
      JLocalRef localRef = new JLocalRef(program, x.getSourceInfo(), local);
      ctx.replaceMe(localRef);
    }
View Full Code Here

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

        SourceInfo info = makeSourceInfo(argument);
        LocalVariableBinding b = argument.binding;
        JType localType = (JType) typeMap.get(b.type);
        JMethod enclosingMethod = findEnclosingMethod(scope);
        JLocal newLocal = program.createLocal(info, argument.name, localType,
            b.isFinal(), enclosingMethod);
        typeMap.put(b, newLocal);
        return true;
      } catch (Throwable e) {
        throw translateException(argument, e);
View Full Code Here

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

      try {
        LocalVariableBinding b = localDeclaration.binding;
        JType localType = (JType) typeMap.get(localDeclaration.type.resolvedType);
        JMethod enclosingMethod = findEnclosingMethod(scope);
        SourceInfo info = makeSourceInfo(localDeclaration);
        JLocal newLocal = program.createLocal(info, localDeclaration.name,
            localType, b.isFinal(), enclosingMethod);
        typeMap.put(b, newLocal);
        return true;
      } catch (Throwable e) {
        throw translateException(localDeclaration, e);
View Full Code Here

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

  private JLocal getTempLocal() {
    if (localIndex < tempLocals.size()) {
      return (JLocal) tempLocals.get(localIndex++);
    }
    JLocal newTemp = program.createLocal(null,
        ("$t" + localIndex++).toCharArray(), program.getTypeVoid(), false,
        currentMethod);
    tempLocals.add(newTemp);
    return newTemp;
  }
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();

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

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

    return (JLocal) tempLocals.get(--localIndex);
  }

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

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

        return;
      }

      SourceInfo catchInfo = ((JBlock) x.getCatchBlocks().get(0)).getSourceInfo();

      JLocal exObj = popTempLocal();
      JLocalRef exRef = new JLocalRef(program, catchInfo, exObj);
      JBlock newCatchBlock = new JBlock(program, catchInfo);
      // $e = Exceptions.caught($e)
      JMethod caughtMethod = program.getSpecialMethod("Exceptions.caught");
      JMethodCall call = new JMethodCall(program, catchInfo, null, caughtMethod);
View Full Code Here

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

          currentMethod, x.label), body);
    }

    JStatement processStatement(LocalDeclaration x) {
      SourceInfo info = makeSourceInfo(x);
      JLocal local = (JLocal) typeMap.get(x.binding);
      JLocalRef localRef = new JLocalRef(program, info, local);
      JExpression initializer = dispProcessExpression(x.initialization);
      return new JLocalDeclarationStatement(program, info, localRef,
          initializer);
    }
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.