Package org.aspectj.apache.bcel.generic

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


    {
        InstructionList il = enclosingMethod.getBody();
        InstructionTargeter[] targeters = ih.getTargeters();
        if (targeters != null) {
            for (int i = targeters.length - 1; i >= 0; i--) {
                InstructionTargeter targeter = targeters[i];
                targeter.updateTarget(ih, retargetTo);
            }
            ih.removeAllTargeters();
        }
        try {
            il.delete(ih);
View Full Code Here


      if (ih == null) return -1;
     
          InstructionTargeter[] ts = ih.getTargeters();
          if (ts != null) {
              for (int j = ts.length - 1; j >= 0; j--) {
                  InstructionTargeter t = ts[j];
                  if (t instanceof LineNumberTag) {
                    return ((LineNumberTag)t).getLineNumber();
                  }
              }
          }
View Full Code Here

            // Now the exception range starts just after our new instruction.
            // The next bit of code changes the exception range to point at
            // the store instruction
      InstructionTargeter[] targeters = start.getTargeters();
      for (int i = 0; i < targeters.length; i++) {
        InstructionTargeter t = targeters[i];
        if (t instanceof ExceptionRange) {
          ExceptionRange er = (ExceptionRange) t;
          er.updateTarget(start, insertedInstruction, body);
        }
      }
View Full Code Here

  public static void retargetAllBranches(InstructionHandle from, InstructionHandle to) {
    InstructionTargeter[] sources = from.getTargeters();
    if (sources != null) {
      for (int i = sources.length - 1; i >= 0; i--) {
        InstructionTargeter source = sources[i];
        if (source instanceof BranchInstruction) {
          source.updateTarget(from, to);
        }
      }
    }
  }
View Full Code Here

            int lcounter = 0;
            for (InstructionHandle ih = body.getStart(); ih != null; ih = ih.getNext()) {
                InstructionTargeter[] targeters = ih.getTargeters();
                if (targeters != null) {
                    for (int i = targeters.length - 1; i >= 0; i--) {
                        InstructionTargeter t = targeters[i];
                        if (t instanceof ExceptionRange) {
                            // assert isRangeHandle(h);
                            ExceptionRange r = (ExceptionRange) t;
                            if (r.getStart() == ih) {
                                insertHandler(r, exnTable);
View Full Code Here

        LineNumberTag lr = null;
        for (InstructionHandle ih = body.getStart(); ih != null; ih = ih.getNext()) {
            InstructionTargeter[] targeters = ih.getTargeters();
            if (targeters != null) {
                for (int i = targeters.length - 1; i >= 0; i--) {
                    InstructionTargeter targeter = targeters[i];
                    if (targeter instanceof LineNumberGen) {
                        LineNumberGen lng = (LineNumberGen) targeter;
                        lng.updateTarget(ih, null);
                        int lineNumber = lng.getSourceLine();
                        if (highestLineNumber < lineNumber) highestLineNumber = lineNumber;
View Full Code Here

        for (InstructionHandle ih = body.getStart(); ih != null; ih = ih.getNext()) {
            InstructionTargeter[] targeters = ih.getTargeters();
            List ends = new ArrayList(0);
            if (targeters != null) {
                for (int i = targeters.length - 1; i >= 0; i--) {
                    InstructionTargeter targeter = targeters[i];
                    if (targeter instanceof LocalVariableGen) {
                        LocalVariableGen lng = (LocalVariableGen) targeter;
                        LocalVariableTag lr = new LocalVariableTag(BcelWorld.fromBcel(lng.getType()), lng.getName(), lng.getIndex(), lng.getStart().getPosition());
                        if (lng.getStart() == ih) {
                            locals.add(lr);
View Full Code Here

        int index)
    {
        InstructionTargeter[] targeters = ih.getTargeters();
        if (targeters == null) return null;
        for (int i = targeters.length - 1; i >= 0; i--) {
            InstructionTargeter t = targeters[i];
            if (t instanceof LocalVariableTag) {
                LocalVariableTag lvt = (LocalVariableTag) t;
                if (lvt.getSlot() == index) return lvt;
            }
        }
View Full Code Here

        int prevLine)
    {
        InstructionTargeter[] targeters = ih.getTargeters();
        if (targeters == null) return prevLine;
        for (int i = targeters.length - 1; i >= 0; i--) {
            InstructionTargeter t = targeters[i];
            if (t instanceof LineNumberTag) {
                return ((LineNumberTag)t).getLineNumber();
            }
        }
        return prevLine;
View Full Code Here

                // and store up info for local variables
                InstructionTargeter[] targeters = oldInstructionHandle.getTargeters();
        int lineNumberOffset = (fromFilename == null) ? 0: getEnclosingClass().getSourceDebugExtensionOffset(fromFilename);
                if (targeters != null) {
                    for (int k = targeters.length - 1; k >= 0; k--) {
                        InstructionTargeter targeter = targeters[k];
                        if (targeter instanceof LineNumberTag) {
                            int line = ((LineNumberTag)targeter).getLineNumber();
                            if (line != currLine) {
                                gen.addLineNumber(newInstructionHandle, line + lineNumberOffset);
                                currLine = line;
View Full Code Here

TOP

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

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.