Package org.aspectj.apache.bcel.generic

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


    // XXX check that this works correctly for inners/anonymous
    list.append(InstructionFactory.PUSH(getConstantPool(), getClassName()));
    // XXX do we need to worry about the fact the theorectically this could
    // throw
    // a ClassNotFoundException
    list.append(fact.createInvoke("java.lang.Class", "forName", classType, new Type[] { Type.STRING }, Constants.INVOKESTATIC));

    list.append(fact.createInvoke(factoryType.getClassName(), "<init>", Type.VOID, new Type[] { Type.STRING, classType },
        Constants.INVOKESPECIAL));

    list.append(InstructionFactory.createStore(factoryType, 0));
View Full Code Here


    // XXX do we need to worry about the fact the theorectically this could
    // throw
    // a ClassNotFoundException
    list.append(fact.createInvoke("java.lang.Class", "forName", classType, new Type[] { Type.STRING }, Constants.INVOKESTATIC));

    list.append(fact.createInvoke(factoryType.getClassName(), "<init>", Type.VOID, new Type[] { Type.STRING, classType },
        Constants.INVOKESPECIAL));

    list.append(InstructionFactory.createStore(factoryType, 0));

    List<Map.Entry<BcelShadow, Field>> entries = new ArrayList<Map.Entry<BcelShadow, Field>>(tjpFields.entrySet());
View Full Code Here

    InstructionList setup = new InstructionList();
    InstructionFactory fact = clazz.getFactory();

    setup.append(fact.createNew(aspectType));
    setup.append(InstructionFactory.createDup(1));
    setup.append(fact.createInvoke(
      aspectName,
      "<init>",
      Type.VOID,
      new Type[0],
      Constants.INVOKESPECIAL));
View Full Code Here

            BranchInstruction ifNonNull = InstructionFactory.createBranchInstruction(Constants.IFNULL, null);
            body.append(ifNonNull);
            InstructionHandle ifNonNullElse = body.append(InstructionConstants.ALOAD_0);
            body.append(fact.createNew(munger.getImplClassName()));
            body.append(InstructionConstants.DUP);
            body.append(fact.createInvoke(munger.getImplClassName(), "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
            body.append(Utility.createSet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
            ifNonNull.setTarget(ifNonNullElse);
            body.append(InstructionConstants.ALOAD_0);
            body.append(Utility.createGet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
View Full Code Here

    InstructionList setup = new InstructionList();
    InstructionFactory fact = gen.getFactory();

    setup.append(fact.createNew(new ObjectType(NameMangler.CFLOW_STACK_TYPE)));
    setup.append(InstructionFactory.createDup(1));
    setup.append(fact.createInvoke(
      NameMangler.CFLOW_STACK_TYPE,
      "<init>",
      Type.VOID,
      new Type[0],
      Constants.INVOKESPECIAL));
View Full Code Here

      il.append(new ACONST_NULL());
    }
   
    switch(getArgCount()) {
      case 0:
        il.append(fact.createInvoke("org.aspectj.runtime.reflect.Factory",
                  "makeJP", LazyClassGen.tjpType,
                  new Type[] { LazyClassGen.staticTjpType,
                      Type.OBJECT, Type.OBJECT},
                  Constants.INVOKESTATIC));
        break;
View Full Code Here

                      Type.OBJECT, Type.OBJECT},
                  Constants.INVOKESTATIC));
        break;
      case 1:
        ((BcelVar)getArgVar(0)).appendLoadAndConvert(il, fact, world.getCoreType(ResolvedType.OBJECT));
        il.append(fact.createInvoke("org.aspectj.runtime.reflect.Factory",
                  "makeJP", LazyClassGen.tjpType,
                  new Type[] { LazyClassGen.staticTjpType,
                      Type.OBJECT, Type.OBJECT, Type.OBJECT},
                  Constants.INVOKESTATIC));
        break;
View Full Code Here

                  Constants.INVOKESTATIC));
        break;
      case 2:
        ((BcelVar)getArgVar(0)).appendLoadAndConvert(il, fact, world.getCoreType(ResolvedType.OBJECT));
        ((BcelVar)getArgVar(1)).appendLoadAndConvert(il, fact, world.getCoreType(ResolvedType.OBJECT));
        il.append(fact.createInvoke("org.aspectj.runtime.reflect.Factory",
                  "makeJP", LazyClassGen.tjpType,
                  new Type[] { LazyClassGen.staticTjpType,
                      Type.OBJECT, Type.OBJECT, Type.OBJECT, Type.OBJECT},
                  Constants.INVOKESTATIC));
        break;
View Full Code Here

                      Type.OBJECT, Type.OBJECT, Type.OBJECT, Type.OBJECT},
                  Constants.INVOKESTATIC));
        break;
      default:
        il.append(makeArgsObjectArray());
        il.append(fact.createInvoke("org.aspectj.runtime.reflect.Factory",
                  "makeJP", LazyClassGen.tjpType,
                  new Type[] { LazyClassGen.staticTjpType,
                      Type.OBJECT, Type.OBJECT, new ArrayType(Type.OBJECT, 1)},
                  Constants.INVOKESTATIC));
        break;
View Full Code Here

        BcelVar exceptionVar = genTempVar(catchType);
           
    handler.append(fact.createNew(NameMangler.SOFT_EXCEPTION_TYPE));
    handler.append(InstructionFactory.createDup(1));  
        handler.append(exceptionVar.createLoad(fact));
        handler.append(fact.createInvoke(NameMangler.SOFT_EXCEPTION_TYPE, "<init>",
                  Type.VOID, new Type[] { Type.THROWABLE }, Constants.INVOKESPECIAL))//??? special
        handler.append(InstructionConstants.ATHROW);       

    // ENH 42737
        exceptionVar.appendStore(rtExHandler, fact);
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.