Package org.aspectj.apache.bcel.generic

Examples of org.aspectj.apache.bcel.generic.InstructionFactory.createInvoke()


    String aspectname = munger.getConcreteAspect().getName();
   
    String ptwField = NameMangler.perTypeWithinFieldForTarget(munger.getConcreteAspect());
    entrySuccessInstructions.append(new PUSH(fact.getConstantPool(),t.getName()));
   
    entrySuccessInstructions.append(fact.createInvoke(aspectname,"ajc$createAspectInstance",new ObjectType(aspectname),
        new Type[]{new ObjectType("java.lang.String")},Constants.INVOKESTATIC));
    entrySuccessInstructions.append(fact.createPutStatic(t.getName(),ptwField,
        new ObjectType(aspectname)));
   
    entryInstructions.append(entrySuccessInstructions);
View Full Code Here


        testResult.appendStore(entrySuccessInstructions, fact);
      }

      if (isPer) {
            entrySuccessInstructions.append(
              fact.createInvoke(munger.getConcreteAspect().getName(),
                    NameMangler.PERCFLOW_PUSH_METHOD,
                    Type.VOID,
                    new Type[] { },
                    Constants.INVOKESTATIC));
      } else {
View Full Code Here

          if (!cflowField.getType().getName().endsWith("CFlowCounter"))
            throw new RuntimeException("Incorrectly attempting counter operation on stacked cflow");
          entrySuccessInstructions.append(
                  Utility.createGet(fact, cflowField));
          //arrayVar.appendLoad(entrySuccessInstructions, fact);
          entrySuccessInstructions.append(fact.createInvoke(NameMangler.CFLOW_COUNTER_TYPE,"inc",Type.VOID,new Type[] { },Constants.INVOKEVIRTUAL));
        } else {
            BcelVar arrayVar = genTempVar(UnresolvedType.OBJECTARRAY);
 
            int alen = cflowStateVars.length;
            entrySuccessInstructions.append(Utility.createConstant(fact, alen));
View Full Code Here

            entrySuccessInstructions.append(
                Utility.createGet(fact, cflowField));
            arrayVar.appendLoad(entrySuccessInstructions, fact);

            entrySuccessInstructions.append(
                fact.createInvoke(NameMangler.CFLOW_STACK_TYPE, "push", Type.VOID,
                    new Type[] { objectArrayType },
                  Constants.INVOKEVIRTUAL));
        }
      }
View Full Code Here

        if (munger.getKind() != AdviceKind.PerCflowEntry &&
          munger.getKind() != AdviceKind.PerCflowBelowEntry &&
          munger.getExposedStateAsBcelVars(false).length==0) {
          exitInstructions
          .append(
            fact
            .createInvoke(
              NameMangler.CFLOW_COUNTER_TYPE,
              "dec",
              Type.VOID,
              new Type[] {
View Full Code Here

              new Type[] {
        }, Constants.INVOKEVIRTUAL));
        } else {
        exitInstructions
          .append(
            fact
            .createInvoke(
              NameMangler.CFLOW_STACK_TYPE,
              "pop",
              Type.VOID,
              new Type[] {
View Full Code Here

                                                      new String[] {},
                                                      closureClass);       
        InstructionList cbody = constructor.getBody();       
    cbody.append(InstructionFactory.createLoad(Type.OBJECT, 0));
    cbody.append(InstructionFactory.createLoad(objectArrayType, 1));
    cbody.append(fact.createInvoke(superClassName, "<init>", Type.VOID,
      new Type[] {objectArrayType}, Constants.INVOKESPECIAL));
    cbody.append(InstructionFactory.createReturn(Type.VOID));

        closureClass.addMethodGen(constructor);
       
View Full Code Here

        InstructionList il = method.getBody();
        il.append(Utility.createGet(factory, AjcMemberMaker.perCflowField(aspectType)));
        il.append(factory.createNew(aspectType.getName()));
        il.append(InstructionConstants.DUP);
        il.append(factory.createInvoke(aspectType.getName(), "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
        il.append(Utility.createInvoke(factory, Constants.INVOKEVIRTUAL, AjcMemberMaker.cflowStackPushInstance()));
        il.append(InstructionFactory.createReturn(Type.VOID));
    }

    private void generatePerCflowAjcClinitMethod(LazyClassGen classGen) {
View Full Code Here

        classGen.addMethodGen(method);

        InstructionList il = method.getBody();
        il.append(factory.createNew(AjcMemberMaker.CFLOW_STACK_TYPE.getName()));
        il.append(InstructionConstants.DUP);
        il.append(factory.createInvoke(AjcMemberMaker.CFLOW_STACK_TYPE.getName(), "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
        il.append(Utility.createSet(factory,  AjcMemberMaker.perCflowField(aspectType)));
        il.append(InstructionFactory.createReturn(Type.VOID));

        // patch <clinit> to delegate to ajc$preClinit at the beginning
        LazyMethodGen clinit = classGen.getStaticInitializer();
View Full Code Here

        il.append(InstructionFactory.createReturn(Type.VOID));

        // patch <clinit> to delegate to ajc$preClinit at the beginning
        LazyMethodGen clinit = classGen.getStaticInitializer();
        il = new InstructionList();
        il.append(factory.createInvoke(aspectType.getName(), NameMangler.AJC_PRE_CLINIT_NAME, Type.VOID, Type.NO_ARGS, Constants.INVOKESTATIC));
        clinit.getBody().insert(il);
    }

    private void generatePerTWAspectOfMethod(LazyClassGen classGen) {
        InstructionFactory factory = classGen.getFactory();
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.