Package org.aspectj.apache.bcel.generic

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


  // call to the constructor. If ANY advice gets put on it, we move
  // the NEW instruction inside the join point, which involves putting
  // all the arguments in temps.
  public static BcelShadow makeConstructorCall(BcelWorld world, LazyMethodGen enclosingMethod, InstructionHandle callHandle,
      BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();

    Member sig = world.makeJoinPointSignatureForMethodInvocation(enclosingMethod.getEnclosingClass(),
        (InvokeInstruction) callHandle.getInstruction());

    BcelShadow s = new BcelShadow(world, ConstructorCall, sig, enclosingMethod, enclosingShadow);
View Full Code Here


    return s;
  }

  public static BcelShadow makeArrayConstructorCall(BcelWorld world, LazyMethodGen enclosingMethod,
      InstructionHandle arrayInstruction, BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    Member sig = world.makeJoinPointSignatureForArrayConstruction(enclosingMethod.getEnclosingClass(), arrayInstruction);
    BcelShadow s = new BcelShadow(world, ConstructorCall, sig, enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
    r.associateWithTargets(Range.genStart(body, arrayInstruction), Range.genEnd(body, arrayInstruction));
View Full Code Here

    return s;
  }

  public static BcelShadow makeMonitorEnter(BcelWorld world, LazyMethodGen enclosingMethod, InstructionHandle monitorInstruction,
      BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    Member sig = world.makeJoinPointSignatureForMonitorEnter(enclosingMethod.getEnclosingClass(), monitorInstruction);
    BcelShadow s = new BcelShadow(world, SynchronizationLock, sig, enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
    r.associateWithTargets(Range.genStart(body, monitorInstruction), Range.genEnd(body, monitorInstruction));
View Full Code Here

    return s;
  }

  public static BcelShadow makeMonitorExit(BcelWorld world, LazyMethodGen enclosingMethod, InstructionHandle monitorInstruction,
      BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    Member sig = world.makeJoinPointSignatureForMonitorExit(enclosingMethod.getEnclosingClass(), monitorInstruction);
    BcelShadow s = new BcelShadow(world, SynchronizationUnlock, sig, enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
    r.associateWithTargets(Range.genStart(body, monitorInstruction), Range.genEnd(body, monitorInstruction));
View Full Code Here

  // return s;
  // }

  public static BcelShadow makeMethodCall(BcelWorld world, LazyMethodGen enclosingMethod, InstructionHandle callHandle,
      BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    BcelShadow s = new BcelShadow(world, MethodCall, world.makeJoinPointSignatureForMethodInvocation(enclosingMethod
        .getEnclosingClass(), (InvokeInstruction) callHandle.getInstruction()), enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
    r.associateWithTargets(Range.genStart(body, callHandle), Range.genEnd(body, callHandle));
View Full Code Here

    return s;
  }

  public static BcelShadow makeShadowForMethodCall(BcelWorld world, LazyMethodGen enclosingMethod, InstructionHandle callHandle,
      BcelShadow enclosingShadow, Kind kind, ResolvedMember sig) {
    final InstructionList body = enclosingMethod.getBody();
    BcelShadow s = new BcelShadow(world, kind, sig, enclosingMethod, enclosingShadow);
    ShadowRange r = new ShadowRange(body);
    r.associateWithShadow(s);
    r.associateWithTargets(Range.genStart(body, callHandle), Range.genEnd(body, callHandle));
    retargetAllBranches(callHandle, r.getStart());
View Full Code Here

    return s;
  }

  public static BcelShadow makeFieldGet(BcelWorld world, ResolvedMember field, LazyMethodGen enclosingMethod,
      InstructionHandle getHandle, BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    BcelShadow s = new BcelShadow(world, FieldGet, field,
    // BcelWorld.makeFieldSignature(
        // enclosingMethod.getEnclosingClass(),
        // (FieldInstruction) getHandle.getInstruction()),
        enclosingMethod, enclosingShadow);
View Full Code Here

    return s;
  }

  public static BcelShadow makeFieldSet(BcelWorld world, ResolvedMember field, LazyMethodGen enclosingMethod,
      InstructionHandle setHandle, BcelShadow enclosingShadow) {
    final InstructionList body = enclosingMethod.getBody();
    BcelShadow s = new BcelShadow(world, FieldSet, field,
    // BcelWorld.makeFieldJoinPointSignature(
        // enclosingMethod.getEnclosingClass(),
        // (FieldInstruction) setHandle.getInstruction()),
        enclosingMethod, enclosingShadow);
View Full Code Here

      if (lazyTjpConsumers == 1) {
        return; // special case only one lazyTjpUser
      }

      InstructionFactory fact = getFactory();
      InstructionList il = new InstructionList();
      il.append(InstructionConstants.ACONST_NULL);
      il.append(thisJoinPointVar.createStore(fact));
      range.insert(il, Range.OutsideBefore);
    } else {
      appliedLazyTjpOptimization = false;
      InstructionFactory fact = getFactory();
      InstructionList il = createThisJoinPoint();
      il.append(thisJoinPointVar.createStore(fact));
      range.insert(il, Range.OutsideBefore);
    }
  }
View Full Code Here

    return true;
  }

  InstructionList loadThisJoinPoint() {
    InstructionFactory fact = getFactory();
    InstructionList il = new InstructionList();

    if (isThisJoinPointLazy) {
      // If we're lazy, build the join point right here.
      il.append(createThisJoinPoint());

      // Does someone else need it? If so, store it for later retrieval
      if (lazyTjpConsumers > 1) {
        il.append(thisJoinPointVar.createStore(fact));

        InstructionHandle end = il.append(thisJoinPointVar.createLoad(fact));

        il.insert(InstructionFactory.createBranchInstruction(Constants.IFNONNULL, end));
        il.insert(thisJoinPointVar.createLoad(fact));
      }
    } else {
      // If not lazy, its already been built and stored, just retrieve it
      thisJoinPointVar.appendLoad(il, fact);
    }
View Full Code Here

TOP

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

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.