Package org.aspectj.apache.bcel.generic

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


                Constants.INVOKESTATIC,
                AjcMemberMaker.perTypeWithinGetInstance(aspectType)
        ));
        il.append(InstructionConstants.ASTORE_1);
        il.append(InstructionConstants.ALOAD_1);
        BranchInstruction ifNonNull = InstructionFactory.createBranchInstruction(Constants.IFNONNULL, null);
        il.append(ifNonNull);
        il.append(factory.createNew(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION.getName()));
        il.append(InstructionConstants.DUP);
        il.append(new PUSH(classGen.getConstantPoolGen(), aspectType.getName()));
        il.append(InstructionConstants.ACONST_NULL);
        il.append(factory.createInvoke(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION.getName(), "<init>", Type.VOID, new Type[] { Type.STRING, new ObjectType("java.lang.Throwable") }, Constants.INVOKESPECIAL));
        il.append(InstructionConstants.ATHROW);
        InstructionHandle ifElse = il.append(InstructionConstants.ALOAD_1);
        ifNonNull.setTarget(ifElse);
        il.append(InstructionFactory.createReturn(Type.OBJECT));

        InstructionHandle handler = il.append(InstructionConstants.ASTORE_1);
        il.append(factory.createNew(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION.getName()));
        il.append(InstructionConstants.DUP);
View Full Code Here


        il.append(Utility.createInvoke(
                factory,
                Constants.INVOKESTATIC,
                AjcMemberMaker.perTypeWithinGetInstance(aspectType)
        ));
        BranchInstruction ifNull = InstructionFactory.createBranchInstruction(Constants.IFNULL, null);
        il.append(ifNull);
        il.append(InstructionConstants.ICONST_1);
        il.append(InstructionConstants.IRETURN);
        InstructionHandle ifElse = il.append(InstructionConstants.ICONST_0);
        ifNull.setTarget(ifElse);
        il.append(InstructionConstants.IRETURN);

        InstructionHandle handler = il.append(InstructionConstants.ASTORE_1);
        il.append(InstructionConstants.ICONST_0);
        il.append(InstructionConstants.IRETURN);
View Full Code Here

                printLabel(null, depth);
                out.print("  ");
                out.print("default: \t");
                out.print(labelMap.get(defaultTarget));
            } else if (inst instanceof BranchInstruction) {
                BranchInstruction brinst = (BranchInstruction) inst;
                out.print(Constants.OPCODE_NAMES[brinst.getOpcode()].toUpperCase());
                out.print(" ");
                out.print(labelMap.get(brinst.getTarget()));
            } else if (inst instanceof LocalVariableInstruction) {
                LocalVariableInstruction lvinst = (LocalVariableInstruction) inst;
                out.print(inst.toString(false).toUpperCase());
                int index = lvinst.getIndex();
                LocalVariableTag tag = getLocalVariableTag(h, index);
View Full Code Here

                : (ObjectType) BcelWorld.makeBcelType(r.getCatchType()));
        }
  }

  private void handleBranchInstruction(Map map, Instruction oldInstruction, Instruction newInstruction) {
      BranchInstruction oldBranchInstruction = (BranchInstruction) oldInstruction;
      BranchInstruction newBranchInstruction = (BranchInstruction) newInstruction;
      InstructionHandle oldTarget = oldBranchInstruction.getTarget(); // old target
  
//            try {
      // New target is in hash map
      newBranchInstruction.setTarget(remap(oldTarget, map));
//            } catch (NullPointerException e) {
//              print();
//              System.out.println("Was trying to remap " + bi);
//              System.out.println("who's target was supposedly " + itarget);
//              throw e;
View Full Code Here

      if (r.getStart() == target || r.getEnd() == target) return;
      if (r instanceof ExceptionRange) {
        if (((ExceptionRange)r).getHandler() == target) return;
      }
    } else if (targeter instanceof BranchInstruction) {
      BranchInstruction bi = (BranchInstruction) targeter;
      if (bi.getTarget() == target) return;
      if (targeter instanceof Select) {
        Select sel = (Select) targeter;
              InstructionHandle[] itargets = sel.getTargets();
              for (int k = itargets.length - 1; k >= 0; k--) {
          if (itargets[k] == target) return;
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.generic.BranchInstruction

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.