Examples of Instruction


Examples of org.aspectj.apache.bcel.generic.Instruction

    }
    return ret;
  }

  private void match(LazyMethodGen mg, InstructionHandle ih, BcelShadow enclosingShadow, List<BcelShadow> shadowAccumulator) {
    Instruction i = ih.getInstruction();

    // Exception handlers (pr230817)
    if (canMatch(Shadow.ExceptionHandler) && !Range.isRangeHandle(ih)) {
      Set<InstructionTargeter> targeters = ih.getTargetersCopy();
      for (InstructionTargeter t : targeters) {
        if (t instanceof ExceptionRange) {
          // assert t.getHandler() == ih
          ExceptionRange er = (ExceptionRange) t;
          if (er.getCatchType() == null) {
            continue;
          }
          if (isInitFailureHandler(ih)) {
            return;
          }

          if (!ih.getInstruction().isStoreInstruction() && ih.getInstruction().getOpcode() != Constants.NOP) {
            // If using cobertura, the catch block stats with
            // INVOKESTATIC rather than ASTORE, in order that
            // the
            // ranges
            // for the methodcall and exceptionhandler shadows
            // that occur at this same
            // line, we need to modify the instruction list to
            // split them - adding a
            // NOP before the invokestatic that gets all the
            // targeters
            // that were aimed at the INVOKESTATIC
            mg.getBody().insert(ih, InstructionConstants.NOP);
            InstructionHandle newNOP = ih.getPrev();
            // what about a try..catch that starts at the start
            // of the exception handler? need to only include
            // certain targeters really.
            er.updateTarget(ih, newNOP, mg.getBody());
            for (InstructionTargeter t2 : targeters) {
              newNOP.addTargeter(t2);
            }
            ih.removeAllTargeters();
            match(BcelShadow.makeExceptionHandler(world, er, mg, newNOP, enclosingShadow), shadowAccumulator);
          } else {
            match(BcelShadow.makeExceptionHandler(world, er, mg, ih, enclosingShadow), shadowAccumulator);
          }
        }
      }
    }

    if ((i instanceof FieldInstruction) && (canMatch(Shadow.FieldGet) || canMatch(Shadow.FieldSet))) {
      FieldInstruction fi = (FieldInstruction) i;

      if (fi.opcode == Constants.PUTFIELD || fi.opcode == Constants.PUTSTATIC) {
        // check for sets of constant fields. We first check the
        // previous
        // instruction. If the previous instruction is a LD_WHATEVER
        // (push
        // constant on the stack) then we must resolve the field to
        // determine
        // if it's final. If it is final, then we don't generate a
        // shadow.
        InstructionHandle prevHandle = ih.getPrev();
        Instruction prevI = prevHandle.getInstruction();
        if (Utility.isConstantPushInstruction(prevI)) {
          Member field = BcelWorld.makeFieldJoinPointSignature(clazz, (FieldInstruction) i);
          ResolvedMember resolvedField = field.resolve(world);
          if (resolvedField == null) {
            // we can't find the field, so it's not a join point.
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.Instruction

      }
    }
  }

  private static void assertGoodHandle(InstructionHandle ih, Set body, Stack<Range> ranges, String from) {
    Instruction inst = ih.getInstruction();
    if ((inst instanceof InstructionBranch) ^ (ih instanceof BranchHandle)) {
      throw new BCException("bad instruction/handle pair in " + from);
    }
    if (Range.isRangeHandle(ih)) {
      assertGoodRangeHandle(ih, body, ranges, from);
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.Instruction

    void printInstruction(InstructionHandle h, int depth) {
      printDepth(depth);
      printLabel(labelMap.get(h), depth);

      Instruction inst = h.getInstruction();
      if (inst.isConstantPoolInstruction()) {
        out.print(Constants.OPCODE_NAMES[inst.opcode].toUpperCase());
        out.print(" ");
        out.print(pool.constantToString(pool.getConstant(inst.getIndex())));
      } else if (inst instanceof InstructionSelect) {
        InstructionSelect sinst = (InstructionSelect) inst;
        out.println(Constants.OPCODE_NAMES[sinst.opcode].toUpperCase());
        int[] matches = sinst.getMatchs();
        InstructionHandle[] targets = sinst.getTargets();
        InstructionHandle defaultTarget = sinst.getTarget();
        for (int i = 0, len = matches.length; i < len; i++) {
          printDepth(depth);
          printLabel(null, depth);
          out.print("  ");
          out.print(matches[i]);
          out.print(": \t");
          out.println(labelMap.get(targets[i]));
        }
        printDepth(depth);
        printLabel(null, depth);
        out.print("  ");
        out.print("default: \t");
        out.print(labelMap.get(defaultTarget));
      } else if (inst instanceof InstructionBranch) {
        InstructionBranch brinst = (InstructionBranch) inst;
        out.print(Constants.OPCODE_NAMES[brinst.getOpcode()].toUpperCase());
        out.print(" ");
        out.print(labelMap.get(brinst.getTarget()));
      } else if (inst.isLocalVariableInstruction()) {
        // LocalVariableInstruction lvinst = (LocalVariableInstruction)
        // inst;
        out.print(inst.toString(false).toUpperCase());
        int index = inst.getIndex();
        LocalVariableTag tag = getLocalVariableTag(h, index);
        if (tag != null) {
          out.print("     // ");
          out.print(tag.getType());
          out.print(" ");
          out.print(tag.getName());
        }
      } else {
        out.print(inst.toString(false).toUpperCase());
      }
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.instruction.Instruction

  main.run(this, run_parameters);

        Logger logger = Logger.getLogger("Runtime");
  logger.info("Begins execution of function " + function_name);

  Instruction i;
        while (!_contextStack.isEmpty()) {

      if ( _contextStack.currentContext().getCurrentPc().hasNext()) {
    i =_contextStack.currentContext().getCurrentPc().getInstruction();
    _contextStack.currentContext().getCurrentPc().next();
    i.exec(this);
      } else {
    _contextStack.currentContext().popPc();
    if ( _contextStack.currentContext().hasNoMorePc() )
        _contextStack.popContext();
      }
View Full Code Here

Examples of org.eclipse.assemblyformatter.ir.Instruction

      if (section instanceof LineSeparator) {
        if (section.nextIs(WhiteSpace.class, Symbol.class)) {
          Symbol symbolSection = (Symbol) Section
              .getNextIs__staticData(1);
          // Replace SYMBOL with INSTRUCTION.
          Section instructionSection = new Instruction();
          instructionSection.copyPosition(symbolSection);
          instructionSection.setNextSection(symbolSection
              .getNextSection());
          nextSection.setNextSection(instructionSection);

          // Jump.
          nextSection = symbolSection.getNextSection();
View Full Code Here

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

  private Instruction pop() {
    return fStack.pop();
  }

  private void storeInstruction() {
    Instruction instruction = pop();
    fCounter++;
    if (instruction instanceof CompoundInstruction) {
      ((CompoundInstruction) instruction).setEnd(fCounter);
    }
    fInstructions.add(instruction);
    verbose("Add " + instruction.toString()); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.fonteditor.instructions.Instruction

      }
      if (ins == GLYPH_NUMBER) {
        offset++; // Mistakenly *assumes* byte!!!!???? LATER
      } else if (ins != GLYPH_NEXT) {
        // do nothing...
        Instruction instruction = InstructionArray.getIns(ins);

        //Log.log("instruction:" + instruction.name);
        //Log.log("number_of_coordinates:" + instruction.numberOfCoordinates());
        glyph.getInstructionStream().add(ins);
        for (int i = 0; i < instruction.numberOfCoordinates(); i++) {
          int v = getValue(ba);

          if ((i & 1) == 0) {
            last_point_x = (last_point_x + v) & 0xFFFF;
            v = last_point_x;
View Full Code Here

Examples of org.freud.analysed.classbytecode.method.instruction.Instruction

        analysed.findInstruction(new AbstractInstructionVisitor() {
            @Override
            public void methodInvocation(final Instruction instruction, final String owner, final String methodName, final String... args) {
                if (!found[0] && expectedOwnerName.equals(owner) &&
                        expectedMethodName.equals(methodName)) {
                    Instruction prevInstruction = analysed.getInstruction(instruction.getInstructionIndex() - 1);
                    OperandStack operandStack = prevInstruction.getOperandStack();
                    found[0] = true;
                    for (int i = expectedParamTypes.length - 1; i >= 0; i--) {
                        final String expectedType = typeEncoding(expectedParamTypes[i]);
                        if (!expectedType.equals(operandStack.getOperandType())) {
                            found[0] = false;
View Full Code Here

Examples of org.jacoco.core.internal.flow.Instruction

      lastLine = line;
    }
  }

  private void visitInsn() {
    final Instruction insn = new Instruction(currentLine);
    instructions.add(insn);
    if (lastInsn != null) {
      insn.setPredecessor(lastInsn);
    }
    while (!currentLabel.isEmpty()) {
      for (int i = currentLabel.size(); --i >= 0;) {
        LabelInfo.setInstruction(currentLabel.get(i), insn);
      }
View Full Code Here

Examples of org.jakstab.asm.Instruction

    this(code, new X86InstructionFactoryImpl());
  }
 
  @Override
  public final Instruction decodeInstruction(long index) {
    Instruction instr = null;
    InstructionDecoder instrDecoder = null;
    byteIndex = (int)index; // For 64bit systems, this needs to be fixed
    //int len = byteIndex;
    int instrStartIndex = 0;
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.