Examples of visitTableSwitchInsn()


Examples of org.objectweb.asm.MethodVisitor.visitTableSwitchInsn()

        final Label tableEnd = new Label();
        final Label[] labels = new Label[size];
        instructions.add(new BytecodeInstruction() {
            public void visit(MethodVisitor mv) {
                mv.visitVarInsn(ILOAD, 1);
                mv.visitTableSwitchInsn(0, size - 1, dflt, labels);
            }
        });

        // visit cases
        for (int i = 0; i < size; i++) {
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitTableSwitchInsn()

            mv.visitVarInsn(ILOAD, 2);
            Label[] labels = new Label[n];
            for (int i = 0; i < n; i++)
              labels[i] = new Label();
            Label defaultLabel = new Label();
            mv.visitTableSwitchInsn(0, labels.length - 1, defaultLabel, labels);

            StringBuilder buffer = new StringBuilder(128);
            for (int i = 0; i < n; i++) {
              mv.visitLabel(labels[i]);
              if (i == 0)
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitTableSwitchInsn()

      maxStack--;
      Label[] labels = new Label[fields.size()];
      for (int i = 0, n = labels.length; i < n; i++)
        labels[i] = new Label();
      Label defaultLabel = new Label();
      mv.visitTableSwitchInsn(0, labels.length - 1, defaultLabel, labels);

      for (int i = 0, n = labels.length; i < n; i++) {
        Field field = fields.get(i);
        Type fieldType = Type.getType(field.getType());
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitTableSwitchInsn()

      maxStack--;
      Label[] labels = new Label[fields.size()];
      for (int i = 0, n = labels.length; i < n; i++)
        labels[i] = new Label();
      Label defaultLabel = new Label();
      mv.visitTableSwitchInsn(0, labels.length - 1, defaultLabel, labels);

      for (int i = 0, n = labels.length; i < n; i++) {
        Field field = fields.get(i);

        mv.visitLabel(labels[i]);
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitTableSwitchInsn()

          labels[i] = labelForInvalidTypes;
          hasAnyBadTypeLabel = true;
        }
      }
      Label defaultLabel = new Label();
      mv.visitTableSwitchInsn(0, labels.length - 1, defaultLabel, labels);

      for (int i = 0, n = labels.length; i < n; i++) {
        if (!labels[i].equals(labelForInvalidTypes)) {
          mv.visitLabel(labels[i]);
          mv.visitFrame(F_SAME, 0, null, 0, null);
View Full Code Here

Examples of org.ow2.asm.MethodVisitor.visitTableSwitchInsn()

        // tableswitch
        Label l1 = new Label();
        Label l2 = new Label();
        Label l3 = new Label();
        mv.visitVarInsn(ILOAD, 1);
        mv.visitTableSwitchInsn(0, 2, l3/*default*/, l1, l2, l3 );
        mv.visitLabel(l1);
        mv.visitInsn(ICONST_1);
        mv.visitVarInsn(ISTORE, 7);
        mv.visitJumpInsn(GOTO, l3);
        mv.visitLabel(l2);
View Full Code Here

Examples of org.ow2.asm.MethodVisitor.visitTableSwitchInsn()

    public void testIllegalTableSwitchParameters1() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(1, 0, new Label(), new Label[0]);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

Examples of org.ow2.asm.MethodVisitor.visitTableSwitchInsn()

    public void testIllegalTableSwitchParameters2() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(0, 1, null, new Label[0]);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

Examples of org.ow2.asm.MethodVisitor.visitTableSwitchInsn()

    public void testIllegalTableSwitchParameters3() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(0, 1, new Label(), (Label[])null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

Examples of org.ow2.asm.MethodVisitor.visitTableSwitchInsn()

    public void testIllegalTableSwitchParameters4() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(0, 1, new Label(), new Label[0]);
            fail();
        } catch (Exception e) {
        }
    }
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.