Package org.objectweb.asm

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


        null, null);
    mv.visitCode();
    mv.visitVarInsn(Opcodes.ALOAD, 0);
    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, this_class_name, "blank",
        "()L" + this_class_name + ";");
    mv.visitInsn(Opcodes.ARETURN);
    mv.visitMaxs(1, 1);
    mv.visitEnd();
  }

  private static void create_tuple_nth(int n_cells, ClassVisitor cw,
View Full Code Here


      mv.visitVarInsn(Opcodes.ALOAD, 0); // load this
      String field = "elem" + (zbase + 1);

      mv.visitFieldInsn(Opcodes.GETFIELD, this_class_name, field,
          ETERM_TYPE.getDescriptor());
      mv.visitInsn(Opcodes.ARETURN);
    }

    mv.visitLabel(dflt);

    mv.visitVarInsn(Opcodes.ALOAD, 0);
View Full Code Here

    mv.visitVarInsn(Opcodes.ALOAD, 0);
    mv.visitVarInsn(Opcodes.ILOAD, 1);
    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, ETUPLE_NAME, "bad_nth", "(I)"
        + ETERM_TYPE.getDescriptor());
    mv.visitInsn(Opcodes.ARETURN); // make compiler happy

    mv.visitMaxs(3, 2);
    mv.visitEnd();
  }
View Full Code Here

      String field = "elem" + (zbase + 1);

      mv.visitFieldInsn(Opcodes.PUTFIELD, this_class_name, field,
          ETERM_TYPE.getDescriptor());
      mv.visitInsn(Opcodes.RETURN);
    }

    mv.visitLabel(dflt);

    mv.visitVarInsn(Opcodes.ALOAD, 0);
View Full Code Here

    mv.visitVarInsn(Opcodes.ALOAD, 0);
    mv.visitVarInsn(Opcodes.ILOAD, 1);
    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, ETUPLE_NAME, "bad_nth", "(I)"
        + ETERM_TYPE.getDescriptor());
    mv.visitInsn(Opcodes.POP);
    mv.visitInsn(Opcodes.RETURN); // make compiler happy

    mv.visitMaxs(3, 3);
    mv.visitEnd();
  }
View Full Code Here

    mv.visitVarInsn(Opcodes.ALOAD, 0);
    mv.visitVarInsn(Opcodes.ILOAD, 1);
    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, ETUPLE_NAME, "bad_nth", "(I)"
        + ETERM_TYPE.getDescriptor());
    mv.visitInsn(Opcodes.POP);
    mv.visitInsn(Opcodes.RETURN); // make compiler happy

    mv.visitMaxs(3, 3);
    mv.visitEnd();
  }
View Full Code Here

    MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "arity", "()I",
        null, null);
    mv.visitCode();

    if (n <= 5) {
      mv.visitInsn(Opcodes.ICONST_0 + n);
    } else {
      mv.visitLdcInsn(new Integer(n));
    }
    mv.visitInsn(Opcodes.IRETURN);
    mv.visitMaxs(1, 1);
View Full Code Here

    if (n <= 5) {
      mv.visitInsn(Opcodes.ICONST_0 + n);
    } else {
      mv.visitLdcInsn(new Integer(n));
    }
    mv.visitInsn(Opcodes.IRETURN);
    mv.visitMaxs(1, 1);
    mv.visitEnd();
  }

  private static void create_cast(ClassVisitor cw, int n) {
View Full Code Here

    mv.visitVarInsn(Opcodes.ALOAD, 0);
    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, ETUPLE_NAME, "arity", "()I");

    if (n <= 5) {
      mv.visitInsn(Opcodes.ICONST_0 + n);
    } else {
      mv.visitLdcInsn(new Integer(n));
    }

    Label fail = new Label();
View Full Code Here

    Label fail = new Label();

    mv.visitJumpInsn(Opcodes.IF_ICMPNE, fail);
    mv.visitVarInsn(Opcodes.ALOAD, 0);
    mv.visitTypeInsn(Opcodes.CHECKCAST, ETUPLE_NAME + n);
    mv.visitInsn(Opcodes.ARETURN);

    mv.visitLabel(fail);
    mv.visitInsn(Opcodes.ACONST_NULL);
    mv.visitInsn(Opcodes.ARETURN);
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.