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

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


      return false;
    }

    private boolean isVolatileField(JExpression x) {
      if (x instanceof JFieldRef) {
        JFieldRef xFieldRef = (JFieldRef) x;
        if (xFieldRef.getField().isVolatile()) {
          return true;
        }
      }

      return false;
View Full Code Here


  }

  @Override
  public boolean visit(JFieldRef x, Context ctx) {
    expression =
        new JFieldRef(x.getSourceInfo(), cloneExpression(x.getInstance()), x.getField(), x
            .getEnclosingType());
    return false;
  }
View Full Code Here

      @Override
      public boolean visit(JFieldRef x, Context ctx) {
        if (x.getInstance() != null) {
          JExpression newInstance = possiblyReplace(x.getInstance());
          if (newInstance != x.getInstance()) {
            JFieldRef newExpr =
                new JFieldRef(x.getSourceInfo(), newInstance, x.getField(), x.getEnclosingType());
            ctx.replaceMe(newExpr);
          }
        }
        return false;
      }
View Full Code Here

        return;
      }
      // replace overridden getClass() with reference to Object.clazz field
      if (x.getTarget() == getClassMethod ||
          x.getTarget().getOverriddenMethods().contains(getClassMethod)) {
        ctx.replaceMe(new JFieldRef(x.getSourceInfo(), x.getInstance(),
            clazzField, clazzField.getEnclosingType()));
      }
    }
View Full Code Here

          // parameters are ok to skip
          doSkip = true;
        } else if (lhs instanceof JFieldRef) {
          // fields must rescue the qualifier
          doSkip = true;
          JFieldRef fieldRef = (JFieldRef) lhs;
          JExpression instance = fieldRef.getInstance();
          if (instance != null) {
            accept(instance);
          }
        }
View Full Code Here

      }

      // If the lhs is a field ref, we have to visit its qualifier.
      JVariableRef variableRef = x.getVariableRef();
      if (variableRef instanceof JFieldRef) {
        JFieldRef fieldRef = (JFieldRef) variableRef;
        JExpression instance = fieldRef.getInstance();
        if (instance != null) {
          accept(instance);
        }
      }
      return false;
View Full Code Here

    private boolean isVolatileField(JExpression x) {
      if (!(x instanceof JFieldRef)) {
        return false;
      }

      JFieldRef xFieldRef = (JFieldRef) x;
      return xFieldRef.getField().isVolatile();
    }
View Full Code Here

    assert instance != null;
    if (!instance.hasSideEffects()) {
      instance = program.getLiteralNull();
    }

    JFieldRef fieldRef = new JFieldRef(program, x.getSourceInfo(), instance,
        program.getNullField(), x.getEnclosingType(), primitiveTypeOrNullType(
            program, x.getType()));
    return fieldRef;
  }
View Full Code Here

         * We assert that field must be non-static if it's an rvalue, otherwise
         * it would have been rescued.
         */
        assert !x.getField().isStatic();
        // The field is gone; replace x by a null field reference.
        JFieldRef fieldRef = transformToNullFieldRef(x, program);
        ctx.replaceMe(fieldRef);
      }
    }
View Full Code Here

      // Replace with a multi, which may wind up empty.
      JMultiExpression multi = new JMultiExpression(program, info);

      // If the lhs is a field ref, evaluate it first.
      if (variableRef instanceof JFieldRef) {
        JFieldRef fieldRef = (JFieldRef) variableRef;
        JExpression instance = fieldRef.getInstance();
        if (instance != null) {
          multi.exprs.add(instance);
        }
      }
View Full Code Here

TOP

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

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.