Package org.eclipse.jdt.internal.debug.eval.ast.instructions

Examples of org.eclipse.jdt.internal.debug.eval.ast.instructions.ConditionalJump


    int ifTrueAddress = ifFalseAddress - ifFalse.getSize();
    Instruction ifTrue = fInstructions.get(ifTrueAddress);
    int conditionalAddress = ifTrueAddress - ifTrue.getSize();

    // Insert the conditional jump
    ConditionalJump conditionalJump = new ConditionalJump(false);
    fInstructions.insert(conditionalJump, conditionalAddress + 1);

    // Insert the jump
    int jumpAddress = ifTrueAddress + 2;
    Jump jump = new Jump();
    fInstructions.insert(jump, jumpAddress);

    // Set the jump offsets
    conditionalJump.setOffset(ifTrue.getSize() + 1);
    jump.setOffset(ifFalse.getSize() + 1);

    fCounter += 2;
    storeInstruction();
View Full Code Here


    int bodyAddress = conditionAddress - condition.getSize();
    Instruction body = fInstructions.getInstruction(bodyAddress);
    int bodyStartAddress = bodyAddress - body.getSize();

    // add the conditionnalJump
    ConditionalJump conditionalJump = new ConditionalJump(true);
    fInstructions.add(conditionalJump);
    fCounter++;

    // set jump offsets
    conditionalJump.setOffset(-(condition.getSize() + body.getSize() + 1));

    // for each pending break or continue instruction which are related to
    // this loop, set the offset of the corresponding jump.
    for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
      CompleteInstruction instruction = iter.next();
View Full Code Here

    int conditionAddress = bodyAddress - body.getSize();
    Instruction condition = fInstructions.getInstruction(conditionAddress);
    int initAddress = conditionAddress - condition.getSize();

    // add conditional jump
    ConditionalJump condJump = new ConditionalJump(false);
    fInstructions.insert(condJump, conditionAddress + 1);
    bodyAddress++;
    fCounter++;
    condJump.setOffset(body.getSize() + 1);

    // add jump
    Jump jump = new Jump();
    fInstructions.add(jump);
    fCounter++;
View Full Code Here

    fInstructions.add(jump);
    fCounter++;

    if (hasCondition) {
      // add conditional jump
      ConditionalJump condJump = new ConditionalJump(false);
      fInstructions.insert(condJump, conditionAddress + 1);
      bodyAddress++;
      bodyStartAddress++;
      updatersAddress++;
      fCounter++;
      // set conditional jump offset
      condJump.setOffset(body.getSize() + updaters.getSize() + 1);
    }

    // set jump offset
    jump.setOffset(-((hasCondition && (condition != null) ? condition
        .getSize() : 0) + body.getSize() + updaters.getSize() + 2));
View Full Code Here

    }

    int conditionalAddress = ifTrueAddress - ifTrue.getSize();

    // Insert the conditional jump
    ConditionalJump conditionalJump = new ConditionalJump(false);
    fInstructions.insert(conditionalJump, conditionalAddress + 1);
    // Set the jump offset
    conditionalJump.setOffset(ifTrue.getSize()
        + ((hasElseStatement) ? 1 : 0));
    fCounter++;

    if (hasElseStatement) {
      // Insert the jump
View Full Code Here

    Instruction body = fInstructions.getInstruction(bodyAddress);
    int conditionAddress = bodyAddress - body.getSize();
    Instruction condition = fInstructions.getInstruction(conditionAddress);

    // add the conditionnalJump
    ConditionalJump conditionalJump = new ConditionalJump(false);
    fInstructions.insert(conditionalJump, conditionAddress + 1);

    // add the jump
    Jump jump = new Jump();
    fInstructions.add(jump);

    // set jump offsets
    conditionalJump.setOffset(body.getSize() + 1);
    jump.setOffset(-(condition.getSize() + body.getSize() + 2));

    // for each pending break or continue instruction which are related to
    // this loop, set the offset of the corresponding jump.
    for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
View Full Code Here

      leftOperand.accept(this);
      if (storeRequired) {
        storeInstruction();
      }

      ConditionalJump conditionalJump = new ConditionalJump(isOrOr);
      conditionalJumps[0] = conditionalJump;
      conditionalJumpAddresses[0] = fCounter;
      push(conditionalJump);
      storeInstruction();

      storeRequired = unBoxing(rightBinding);
      rightOperand.accept(this);
      if (storeRequired) {
        storeInstruction();
      }

      for (int i = 1; i < operatorNumber; i++) {
        conditionalJump = new ConditionalJump(isOrOr);
        conditionalJumps[i] = conditionalJump;
        conditionalJumpAddresses[i] = fCounter;
        push(conditionalJump);
        storeInstruction();
        Expression operand = iterator.next();
View Full Code Here

          }
          push(new Dup());
          storeInstruction(); // dupe
          switchCase.getExpression().accept(this);
          storeInstruction(); // equal-equal
          ConditionalJump condJump = new ConditionalJump(true);
          push(condJump);
          storeInstruction(); // conditional jump
          if (currentslot.stmts != null) {
            currentslot = new slot();
            jumpsStatements.add(currentslot);
          }
          currentslot.jumps.add(condJump);
        }
      } else {
        if (statementsDefault != null) {
          statementsDefault.add(statement);
        } else {
          if (currentslot.stmts == null) {
            currentslot.stmts = new ArrayList<Statement>();
          }
          currentslot.stmts.add(statement);
        }
      }
    }

    Jump jumpEnd = null;
    if (jumpDefault == null) {
      push(new Pop(0));
      storeInstruction(); // pop
      jumpEnd = new Jump();
      push(jumpEnd);
      storeInstruction(); // jump
    }

    for (Iterator<slot> iter = jumpsStatements.iterator(); iter.hasNext();) {
      currentslot = iter.next();
      for (Iterator<ConditionalJump> iterator = currentslot.jumps.iterator(); iterator.hasNext();) {
        ConditionalJump condJump = iterator.next();
        condJump.setOffset((fCounter - fInstructions.indexOf(condJump)) - 1);
      }
      if (currentslot.stmts != null) {
        push(new Pop(0));
        storeInstruction(); // pop
        for (Iterator<Statement> iterator = currentslot.stmts.iterator(); iterator.hasNext();) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.debug.eval.ast.instructions.ConditionalJump

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.