Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.FieldBinding.canBeSeenBy()


      if (field.isSynthetic()) continue next;

      if (onlyStaticFields && !field.isStatic()) continue next;

      if (!field.canBeSeenBy(receiverType, invocationSite, scope)) continue next;

      for (int i = fieldsFound.size; --i >= 0;) {
        FieldBinding otherField = (FieldBinding) fieldsFound.elementAt(i);
        if (CharOperation.equals(field.name, otherField.name, true)) {
          continue next;
View Full Code Here


    }
  }
  switch (this.bits & RestrictiveFlagMASK) {
    case Binding.FIELD : // assigning to a field
      FieldBinding codegenField = ((FieldBinding) this.binding).original();
      if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
        if (!codegenField.isStatic()) { // need a receiver?
          if ((this.bits & DepthMASK) != 0) {
            ReferenceBinding targetType = currentScope.enclosingSourceType().enclosingTypeAt((this.bits & DepthMASK) >> DepthSHIFT);
            Object[] emulationPath = currentScope.getEmulationPath(targetType, true /*only exact match*/, false/*consider enclosing arg*/);
            codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope);
View Full Code Here

        if (!valueRequired)
          break;
        FieldBinding codegenField = ((FieldBinding) this.binding).original();
        Constant fieldConstant = codegenField.constant();
        if (fieldConstant == Constant.NotAConstant) { // directly use inlined value for constant fields
          if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
            TypeBinding someReceiverType = this.delegateThis != null ? this.delegateThis.type : this.actualReceiverType;
            TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, someReceiverType, true /* implicit this */);
            if (codegenField.isStatic()) {
              codeStream.fieldAccess(Opcodes.OPC_getstatic, codegenField, constantPoolDeclaringClass);
            } else {
View Full Code Here

public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, MethodBinding writeAccessor, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired) {
  switch (this.bits & RestrictiveFlagMASK) {
    case Binding.FIELD : // assigning to a field
      FieldBinding codegenField = ((FieldBinding) this.binding).original();
      if (codegenField.isStatic()) {
        if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
          TypeBinding someReceiverType = this.delegateThis != null ? this.delegateThis.type : this.actualReceiverType;
          TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, someReceiverType, true /* implicit this */);
          codeStream.fieldAccess(Opcodes.OPC_getstatic, codegenField, constantPoolDeclaringClass);
        } else {
          // used to store the value
View Full Code Here

          // used to retrieve the actual value
          codeStream.aconst_null();
          codeStream.generateEmulatedReadAccessForField(codegenField);
        }
      } else {
        if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
          if ((this.bits & DepthMASK) != 0) {
            ReferenceBinding targetType = currentScope.enclosingSourceType().enclosingTypeAt((this.bits & DepthMASK) >> DepthSHIFT);
            Object[] emulationPath = currentScope.getEmulationPath(targetType, true /*only exact match*/, false/*consider enclosing arg*/);
            codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope);
          } else {
View Full Code Here

  }
  // store the result back into the variable
  switch (this.bits & RestrictiveFlagMASK) {
    case Binding.FIELD : // assigning to a field
      FieldBinding codegenField = ((FieldBinding) this.binding).original();
      if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
        fieldStore(currentScope, codeStream, codegenField, writeAccessor, this.actualReceiverType, this.delegateThis == null /* implicit this */, valueRequired);
      } else {
        // current stack is:
        // field receiver value
        if (valueRequired) {
View Full Code Here

}
public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {
  switch (this.bits & RestrictiveFlagMASK) {
    case Binding.FIELD : // assigning to a field
      FieldBinding codegenField = ((FieldBinding) this.binding).original();
      if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
        super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired);
      } else {
        if (codegenField.isStatic()) {
          codeStream.aconst_null();
        } else {
View Full Code Here

  super(source, pos);
  this.evaluationContext = evaluationContext;
}
public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
  FieldBinding codegenBinding = this.binding.original();
  if (codegenBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {
    this.receiver.generateCode(currentScope, codeStream, !codegenBinding.isStatic());
    assignment.expression.generateCode(currentScope, codeStream, true);
    fieldStore(currentScope, codeStream, codegenBinding, null, this.actualReceiverType, this.receiver.isImplicitThis(), valueRequired);
  } else {
    codeStream.generateEmulationForField(codegenBinding);
View Full Code Here

      Constant fieldConstant = codegenBinding.constant();
      if (fieldConstant == Constant.NotAConstant) {
        if (codegenBinding.declaringClass == null) { // array length
          codeStream.arraylength();
        } else {
          if (codegenBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {
            TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenBinding, this.actualReceiverType, this.receiver.isImplicitThis());
            if (isStatic) {
              codeStream.fieldAccess(Opcodes.OPC_getstatic , codegenBinding, constantPoolDeclaringClass);
            } else {
              codeStream.fieldAccess(Opcodes.OPC_getfield, codegenBinding, constantPoolDeclaringClass);
View Full Code Here

}

public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired) {
  boolean isStatic;
  FieldBinding codegenBinding = this.binding.original();
  if (codegenBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {
    this.receiver.generateCode(currentScope, codeStream, !(isStatic = codegenBinding.isStatic()));
    TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenBinding, this.actualReceiverType, this.receiver.isImplicitThis());
    if (isStatic) {
      codeStream.fieldAccess(Opcodes.OPC_getstatic, codegenBinding, constantPoolDeclaringClass);
    } else {
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.