Examples of LocalVariableBinding


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

    super.removeVariable(localBinding);
}
public void removeNotDefinitelyAssignedVariables(Scope scope, int initStateIndex) {
    int index = this.visibleLocalsCount;
    loop : for (int i = 0; i < index; i++) {
        LocalVariableBinding localBinding = visibleLocals[i];
        if (localBinding != null && localBinding.initializationCount > 0) {
            boolean isDefinitelyAssigned = isDefinitelyAssigned(scope, initStateIndex, localBinding);
            if (!isDefinitelyAssigned) {
                if (this.stateIndexes != null) {
                    for (int j = 0, max = this.stateIndexesCounter; j < max; j++) {
                        if (isDefinitelyAssigned(scope, this.stateIndexes[j], localBinding)) {
                            continue loop;
                        }
                    }
                }
                this.currentFrame.removeLocals(localBinding.resolvedPosition);
                localBinding.recordInitializationEndPC(position);
            }
        }
    }
    Integer newValue = new Integer(this.position);
    if (this.variablesModificationsPositions.size() == 0 || !this.variablesModificationsPositions.get(this.variablesModificationsPositions.size() - 1).equals(newValue)) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

          currentScope.problemReporter().uninitializedBlankFinalField(fieldBinding, this);
        }
      }
      break;
    case Binding.LOCAL : // reading a local variable
      LocalVariableBinding localBinding;
      if (!flowInfo.isDefinitelyAssigned(localBinding = (LocalVariableBinding) this.binding)) {
        currentScope.problemReporter().uninitializedLocalVariable(localBinding, this);
      }
      if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
        localBinding.useFlag = LocalVariableBinding.USED;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

          codeStream.generateImplicitConversion(assignment.implicitConversion);
        }
      }
      return;
    case Binding.LOCAL : // assigning to a local variable
      LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
      if (localBinding.resolvedPosition != -1) {
        assignment.expression.generateCode(currentScope, codeStream, true);
      } else {
        if (assignment.expression.constant != Constant.NotAConstant) {
          // assigning an unused local to a constant value = no actual assignment is necessary
          if (valueRequired) {
            codeStream.generateConstant(assignment.expression.constant, assignment.implicitConversion);
          }
        } else {
          assignment.expression.generateCode(currentScope, codeStream, true);
          /* Even though the value may not be required, we force it to be produced, and discard it later
          on if it was actually not necessary, so as to provide the same behavior as JDK1.2beta3.  */
          if (valueRequired) {
            codeStream.generateImplicitConversion(assignment.implicitConversion); // implicit conversion
          } else {
            if ((localBinding.type == TypeBinding.LONG) || (localBinding.type == TypeBinding.DOUBLE)) {
              codeStream.pop2();
            } else {
              codeStream.pop();
            }
          }
        }
        return;
      }
      // normal local assignment (since cannot store in outer local which are final locations)
      codeStream.store(localBinding, valueRequired);
      if ((this.bits & FirstAssignmentToLocal) != 0) { // for local variable debug attributes
        localBinding.recordInitializationStartPC(codeStream.position);
      }
      // implicit conversion
      if (valueRequired) {
        codeStream.generateImplicitConversion(assignment.implicitConversion);
      }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

        } else { // directly use the inlined value
          codeStream.generateConstant(fieldConstant, this.implicitConversion);
        }
        break;
      case Binding.LOCAL : // reading a local
        LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
        if (!valueRequired)
          break;
        // outer local?
        if ((this.bits & DepthMASK) != 0) {
          // outer local can be reached either through a synthetic arg or a synthetic field
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

          codeStream.generateEmulatedReadAccessForField(fieldBinding);
        }
      }
      break;
    case Binding.LOCAL : // assigning to a local variable (cannot assign to outer local)
      LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
      Constant assignConstant;
      int increment;
      // using incr bytecode if possible
      switch (localBinding.type.id) {
        case T_JavaLangString :
          codeStream.generateStringConcatenationAppend(currentScope, this, expression);
          if (valueRequired) {
            codeStream.dup();
          }
          codeStream.store(localBinding, false);
          return;
        case T_int :
          if (((assignConstant = expression.constant) != Constant.NotAConstant)
            && (assignConstant.typeID() != T_float) // only for integral types
            && (assignConstant.typeID() != T_double)   
            && ((increment = assignConstant.intValue()) == (short) increment)) { // 16 bits value
            switch (operator) {
              case PLUS :
                codeStream.iinc(localBinding.resolvedPosition, increment);
                if (valueRequired) {
                  codeStream.load(localBinding);
                }
                return;
              case MINUS :
                codeStream.iinc(localBinding.resolvedPosition, -increment);
                if (valueRequired) {
                  codeStream.load(localBinding);
                }
                return;
            }
          }
        default :
          codeStream.load(localBinding);
      }
  }
  // perform the actual compound operation
  int operationTypeID;
  switch(operationTypeID = (this.implicitConversion & IMPLICIT_CONVERSION_MASK) >> 4) {
    case T_JavaLangString :
    case T_JavaLangObject :
    case T_undefined :
      codeStream.generateStringConcatenationAppend(currentScope, null, expression);
      break;
    default :
      // promote the array reference to the suitable operation type
      codeStream.generateImplicitConversion(this.implicitConversion);
      // generate the increment value (will by itself  be promoted to the operation value)
      if (expression == IntLiteral.One){ // prefix operation
        codeStream.generateConstant(expression.constant, this.implicitConversion);     
      } else {
        expression.generateCode(currentScope, codeStream, true);
      }   
      // perform the operation
      codeStream.sendOperator(operator, operationTypeID);
      // cast the value back to the array reference type
      codeStream.generateImplicitConversion(assignmentImplicitConversion);
  }
  // store the result back into the variable
  switch (this.bits & RestrictiveFlagMASK) {
    case Binding.FIELD : // assigning to a field
      FieldBinding fieldBinding = (FieldBinding) this.codegenBinding;
      if (fieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
        fieldStore(codeStream, fieldBinding, writeAccessor, valueRequired);
      } else {
        // current stack is:
        // field receiver value
        if (valueRequired) {
          if ((fieldBinding.type == TypeBinding.LONG) || (fieldBinding.type == TypeBinding.DOUBLE)) {
            codeStream.dup2_x2();
          } else {
            codeStream.dup_x2();
          }
        }
        // current stack is:
        // value field receiver value       
        codeStream.generateEmulatedWriteAccessForField(fieldBinding);
      }
      return;
    case Binding.LOCAL : // assigning to a local variable
      LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
      if (valueRequired) {
        if ((localBinding.type == TypeBinding.LONG) || (localBinding.type == TypeBinding.DOUBLE)) {
          codeStream.dup2();
        } else {
          codeStream.dup();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

        codeStream.generateImplicitConversion(postIncrement.preAssignImplicitConversion);
        codeStream.generateEmulatedWriteAccessForField(fieldBinding);
      }
      return;
    case Binding.LOCAL : // assigning to a local variable
      LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
      // using incr bytecode if possible
      if (localBinding.type == TypeBinding.INT) {
        if (valueRequired) {
          codeStream.load(localBinding);
        }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

      BranchLabel endLabel = new BranchLabel(codeStream);
      codeStream.goto_(endLabel);
      handlerLabel.place();
      codeStream.astore_0(); // Bug #52394
      // CHECK THIS...
      codeStream.addVariable(new LocalVariableBinding("caughtException".toCharArray(),initFailureField.type,ClassFileConstants.AccPrivate,false));
        codeStream.aload_0();
      codeStream.putstatic(initFailureField);
      endLabel.place();
    }
   
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

    codeStream.initializeMaxLocals(dispatchBinding);

    Argument[] itdArgs = this.arguments;
    if (itdArgs != null) {
      for (int a = 0; a < itdArgs.length; a++) {
        LocalVariableBinding lvb = itdArgs[a].binding;
        LocalVariableBinding lvbCopy = new LocalVariableBinding(lvb.name, lvb.type, lvb.modifiers, true);
        codeStream.record(lvbCopy);
        lvbCopy.recordInitializationStartPC(0);
        lvbCopy.resolvedPosition = lvb.resolvedPosition;
      }
    }

    MethodBinding methodBinding = introducedMethod;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

      }
      init.expressions[index++] = arg;
    }

    for (int i = 0; i < nParams; i++) {
      LocalVariableBinding binding = pre.arguments[i].binding;
      Expression arg = AstUtil.makeResolvedLocalVariableReference(binding);
      ResolvedMember conversionMethod = AjcMemberMaker.toObjectConversionMethod(world.fromBinding(binding.type));
      if (conversionMethod != null) {
        arg = new KnownMessageSend(world.makeMethodBindingForCall(conversionMethod), new CastExpression(new NullLiteral(0,
            0), AstUtil.makeTypeReference(world.makeTypeBinding(AjcMemberMaker.CONVERSIONS_TYPE))),
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

    typeDec.methods = newMethods;
  }

  public static Argument makeFinalArgument(char[] name, TypeBinding typeBinding) {
    long pos = 0; // XXX encode start and end location
    LocalVariableBinding binding = new LocalVariableBinding(name, typeBinding, Modifier.FINAL, true);
    Argument ret = new Argument(name, pos, makeTypeReference(typeBinding), Modifier.FINAL);
    ret.binding = binding;
    return ret;
  }
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.