Examples of AbstractInsnNode


Examples of org.enclojure.ide.asm.tree.AbstractInsnNode

            Frame f = frames[insn];
            Subroutine subroutine = subroutines[insn];
            queued[insn] = false;

            try {
                AbstractInsnNode insnNode = m.instructions.get(insn);
                int insnOpcode = insnNode.getOpcode();
                int insnType = insnNode.getType();

                if (insnType == AbstractInsnNode.LABEL
                        || insnType == AbstractInsnNode.LINE
                        || insnType == AbstractInsnNode.FRAME)
                {
View Full Code Here

Examples of org.glassfish.hk2.external.org.objectweb.asm.tree.AbstractInsnNode

     *            part of this subroutine or any previously computed subroutine.
     */
    private void markSubroutineWalkDFS(final BitSet sub, int index,
            final BitSet anyvisited) {
        while (true) {
            AbstractInsnNode node = instructions.get(index);

            // don't visit a node twice
            if (sub.get(index)) {
                return;
            }
            sub.set(index);

            // check for those nodes already visited by another subroutine
            if (anyvisited.get(index)) {
                dualCitizens.set(index);
                if (LOGGING) {
                    log("Instruction #" + index + " is dual citizen.");
                }
            }
            anyvisited.set(index);

            if (node.getType() == AbstractInsnNode.JUMP_INSN
                    && node.getOpcode() != JSR) {
                // we do not follow recursively called subroutines here; but any
                // other sort of branch we do follow
                JumpInsnNode jnode = (JumpInsnNode) node;
                int destidx = instructions.indexOf(jnode.label);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
            }
            if (node.getType() == AbstractInsnNode.TABLESWITCH_INSN) {
                TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
                int destidx = instructions.indexOf(tsnode.dflt);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
                for (int i = tsnode.labels.size() - 1; i >= 0; --i) {
                    LabelNode l = tsnode.labels.get(i);
                    destidx = instructions.indexOf(l);
                    markSubroutineWalkDFS(sub, destidx, anyvisited);
                }
            }
            if (node.getType() == AbstractInsnNode.LOOKUPSWITCH_INSN) {
                LookupSwitchInsnNode lsnode = (LookupSwitchInsnNode) node;
                int destidx = instructions.indexOf(lsnode.dflt);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
                for (int i = lsnode.labels.size() - 1; i >= 0; --i) {
                    LabelNode l = lsnode.labels.get(i);
View Full Code Here

Examples of org.mockito.asm.tree.AbstractInsnNode

            Frame f = frames[insn];
            Subroutine subroutine = subroutines[insn];
            queued[insn] = false;

            try {
                AbstractInsnNode insnNode = m.instructions.get(insn);
                int insnOpcode = insnNode.getOpcode();
                int insnType = insnNode.getType();

                if (insnType == AbstractInsnNode.LABEL
                        || insnType == AbstractInsnNode.LINE
                        || insnType == AbstractInsnNode.FRAME)
                {
View Full Code Here

Examples of org.mvel2.asm.tree.AbstractInsnNode

     *            part of this subroutine or any previously computed subroutine.
     */
    private void markSubroutineWalkDFS(final BitSet sub, int index,
            final BitSet anyvisited) {
        while (true) {
            AbstractInsnNode node = instructions.get(index);

            // don't visit a node twice
            if (sub.get(index)) {
                return;
            }
            sub.set(index);

            // check for those nodes already visited by another subroutine
            if (anyvisited.get(index)) {
                dualCitizens.set(index);
                if (LOGGING) {
                    log("Instruction #" + index + " is dual citizen.");
                }
            }
            anyvisited.set(index);

            if (node.getType() == AbstractInsnNode.JUMP_INSN
                    && node.getOpcode() != JSR) {
                // we do not follow recursively called subroutines here; but any
                // other sort of branch we do follow
                JumpInsnNode jnode = (JumpInsnNode) node;
                int destidx = instructions.indexOf(jnode.label);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
            }
            if (node.getType() == AbstractInsnNode.TABLESWITCH_INSN) {
                TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
                int destidx = instructions.indexOf(tsnode.dflt);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
                for (int i = tsnode.labels.size() - 1; i >= 0; --i) {
                    LabelNode l = tsnode.labels.get(i);
                    destidx = instructions.indexOf(l);
                    markSubroutineWalkDFS(sub, destidx, anyvisited);
                }
            }
            if (node.getType() == AbstractInsnNode.LOOKUPSWITCH_INSN) {
                LookupSwitchInsnNode lsnode = (LookupSwitchInsnNode) node;
                int destidx = instructions.indexOf(lsnode.dflt);
                markSubroutineWalkDFS(sub, destidx, anyvisited);
                for (int i = lsnode.labels.size() - 1; i >= 0; --i) {
                    LabelNode l = lsnode.labels.get(i);
View Full Code Here

Examples of org.objectweb.asm.tree.AbstractInsnNode

    Analyzer a = new Analyzer(new IsNullInterpreter());
    a.analyze(owner, mn);
    Frame[] frames = a.getFrames();
    AbstractInsnNode[] insns = mn.instructions.toArray();
    for (int i = 0; i < insns.length; ++i) {
      AbstractInsnNode insn = insns[i];
      if (frames[i] != null) {
        Value v = getTarget(insn, frames[i]);
        if (v == IsNullInterpreter.NULL
            || v == IsNullInterpreter.MAYBENULL) {
          result.add(insn);
View Full Code Here

Examples of org.objectweb.asm.tree.AbstractInsnNode

    try {
      a.analyze(owner, mn);
      Frame[] frames = a.getFrames();
      AbstractInsnNode[] insns = mn.instructions.toArray();
      for (int i = 0; i < insns.length; ++i) {
        AbstractInsnNode insn = insns[i];
        if (insn.getOpcode() == CHECKCAST) {
          Frame f = frames[i];
          if (f != null && f.getStackSize() > 0) {
            Object operand = f.getStack(f.getStackSize() - 1);
            Class to, from;
            try {
View Full Code Here

Examples of org.objectweb.asm.tree.AbstractInsnNode

  public void transform(MethodNode mn) {
    InsnList insns = mn.instructions;
    Iterator i = insns.iterator();
    while (i.hasNext()) {
      AbstractInsnNode i1 = (AbstractInsnNode) i.next();
      if (i1.getOpcode() == ICONST_0) {
        AbstractInsnNode i2 = getNext(i);
        if (i2 != null && i2.getOpcode() == IADD) {
          insns.remove(i1);
          insns.remove(i2);
        }
      }
    }
View Full Code Here

Examples of org.objectweb.asm.tree.AbstractInsnNode

    super.transform(mn);
  }

  private static AbstractInsnNode getNext(Iterator i) {
    while (i.hasNext()) {
      AbstractInsnNode in = (AbstractInsnNode) i.next();
      if (!(in instanceof LineNumberNode)) {
        return in;
      }
    }
    return null;
View Full Code Here

Examples of org.objectweb.asm.tree.AbstractInsnNode

  public void transform(MethodNode mn) {
    InsnList insns = mn.instructions;
    Iterator i = insns.iterator();
    while (i.hasNext()) {
      AbstractInsnNode i1 = (AbstractInsnNode) i.next();
      if (isALOAD0(i1)) {
        AbstractInsnNode i2 = getNext(i);
        if (i2 != null && isALOAD0(i2)) {
          AbstractInsnNode i3 = getNext(i);
          while (i3 != null && isALOAD0(i3)) {
            i1 = i2;
            i2 = i3;
            i3 = getNext(i);
          }
          if (i3 != null && i3.getOpcode() == GETFIELD) {
            AbstractInsnNode i4 = getNext(i);
            if (i4 != null && i4.getOpcode() == PUTFIELD) {
              if (sameField(i3, i4)) {
                insns.remove(i1);
                insns.remove(i2);
                insns.remove(i3);
                insns.remove(i4);
View Full Code Here

Examples of org.objectweb.asm.tree.AbstractInsnNode

    super.transform(mn);
  }

  private static AbstractInsnNode getNext(Iterator i) {
    while (i.hasNext()) {
      AbstractInsnNode in = (AbstractInsnNode) i.next();
      if (!(in instanceof LineNumberNode)) {
        return in;
      }
    }
    return null;
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.