Examples of FrameNode


Examples of org.objectweb.asm.tree.FrameNode

    il.add(new VarInsnNode(ILOAD, 1));
    il.add(new FieldInsnNode(PUTFIELD, "pkg/Bean", "f", "I"));
    LabelNode end = new LabelNode();
    il.add(new JumpInsnNode(GOTO, end));
    il.add(label);
    il.add(new FrameNode(F_SAME, 0, null, 0, null));
    il.add(new TypeInsnNode(NEW, "java/lang/IllegalArgumentException"));
    il.add(new InsnNode(DUP));
    il.add(new MethodInsnNode(INVOKESPECIAL,
        "java/lang/IllegalArgumentException", "<init>", "()V"));
    il.add(new InsnNode(ATHROW));
    il.add(end);
    il.add(new FrameNode(F_SAME, 0, null, 0, null));
    il.add(new InsnNode(RETURN));
    mn.maxStack = 2;
    mn.maxLocals = 2;
    CyclomaticComplexity cc = new CyclomaticComplexity();
    assert (cc.getCyclomaticComplexity("pkg/Bean", mn) == 1);
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

    il.add(new VarInsnNode(ILOAD, 1));
    il.add(new FieldInsnNode(PUTFIELD, "pkg/Bean", "f", "I"));
    LabelNode end = new LabelNode();
    il.add(new JumpInsnNode(GOTO, end));
    il.add(label);
    il.add(new FrameNode(F_SAME, 0, null, 0, null));
    il.add(new TypeInsnNode(NEW, "java/lang/IllegalArgumentException"));
    il.add(new InsnNode(DUP));
    il.add(new MethodInsnNode(INVOKESPECIAL,
        "java/lang/IllegalArgumentException", "<init>", "()V"));
    il.add(new InsnNode(ATHROW));
    il.add(end);
    il.add(new FrameNode(F_SAME, 0, null, 0, null));
    il.add(new InsnNode(RETURN));
    mn.maxStack = 2;
    mn.maxLocals = 2;
    ClassWriter cw = new ClassWriter(0);
    cn.accept(cw);
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

        }
        labels.add(catchNode.handler.getLabel());
       
        LabelNode labelNode = catchNode.handler;
        AbstractInsnNode lineNumberNode = labelNode.getNext() instanceof LineNumberNode ? labelNode.getNext() : labelNode;
        FrameNode frameNode = (FrameNode) lineNumberNode.getNext();
        VarInsnNode varInsnNode = (VarInsnNode) frameNode.getNext();
        AbstractInsnNode insertPoint = varInsnNode;
       
        if (catchNode.type == null) {
          // this is probably a finally block;
          if (insertPoint.getNext() != null && insertPoint.getNext() instanceof LabelNode) {
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

    @Override
    public void visitFrame(final int type, final int nLocal,
        final Object[] local, final int nStack, final Object[] stack) {
      assertEquals(Opcodes.F_NEW, type);
      this.frame = new FrameNode(type, nLocal, local, nStack, stack);
    }
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

      if (LabelInfo.isMultiTarget(lastLabel)) {
        // Create map instance only if required:
        if (probeFrames == null) {
          probeFrames = new HashMap<Label, FrameNode>();
        }
        probeFrames.put(lastLabel, new FrameNode(type, nLocal + 1,
            newLocal, nStack, stack));
      }
      lastLabel = null;
    }
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

   * @param label
   *            label of the frame to insert
   */
  protected void insertProbeFrame(final Label label) {
    if (probeFrames != null) {
      final FrameNode frame = probeFrames.get(label);
      if (frame != null) {
        frame.accept(mv);
      }
    }
  }
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

      if (LabelInfo.isMultiTarget(lastLabel)) {
        // Create map instance only if required:
        if (probeFrames == null) {
          probeFrames = new HashMap<Label, FrameNode>();
        }
        probeFrames.put(lastLabel, new FrameNode(type, nLocal + 1,
            newLocal, nStack, stack));
      }
      lastLabel = null;
    }
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

   * @param label
   *            label of the frame to insert
   */
  protected void insertProbeFrame(final Label label) {
    if (probeFrames != null) {
      final FrameNode frame = probeFrames.get(label);
      if (frame != null) {
        frame.accept(mv);
      }
    }
  }
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

    @Override
    public void visitFrame(final int type, final int nLocal,
        final Object[] local, final int nStack, final Object[] stack) {
      assertEquals(Opcodes.F_NEW, type);
      this.frame = new FrameNode(type, nLocal, local, nStack, stack);
    }
View Full Code Here

Examples of org.objectweb.asm.tree.FrameNode

       
        MethodInsnNode n4 = (MethodInsnNode) it.next();
        assertEquals("D1", n4.owner);
        assertEquals("([[LB1;LC1;LD1;)LC1;", n4.desc);
       
        FrameNode fn0 = (FrameNode) it.next();
        assertEquals(Collections.EMPTY_LIST, fn0.local);
        assertEquals(Collections.EMPTY_LIST, fn0.stack);
       
        assertEquals(Arrays.asList(new Object[] {"B1", "C1", "D1"}), ((FrameNode) it.next()).local);
        assertEquals(Arrays.asList(new Object[] {Opcodes.INTEGER, "C1", Opcodes.INTEGER, "D1"}), ((FrameNode) it.next()).local);
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.