Package org.objectweb.asm

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


    mv = cw.visitMethod(Opcodes.ACC_PUBLIC|Opcodes.ACC_STATIC, "create", "()L"
        + this_class_name + ";", null, null);
    mv.visitCode();
    mv.visitTypeInsn(Opcodes.NEW, this_class_name);
    mv.visitInsn(Opcodes.DUP);
    mv.visitMethodInsn(Opcodes.INVOKESPECIAL, this_class_name, "<init>",
        "()V");

    mv.visitInsn(Opcodes.ARETURN);

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


    mv = cw.visitMethod(Opcodes.ACC_PUBLIC|Opcodes.ACC_STATIC, "make_tuple", sb.toString(), null, null);

    mv.visitCode();
    mv.visitTypeInsn(Opcodes.NEW, this_class_name);
    mv.visitInsn(Opcodes.DUP);
    mv.visitMethodInsn(Opcodes.INVOKESPECIAL, this_class_name, "<init>",
        "()V");

    for (int i = 0; i < arity; i++) {
      mv.visitInsn(Opcodes.DUP);
      mv.visitVarInsn(Opcodes.ALOAD, i);
View Full Code Here

    mv = cw.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC
        | Opcodes.ACC_BRIDGE, "blank", "()L" + super_class_name + ";",
        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();
  }
View Full Code Here

    mv.visitLabel(dflt);

    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

    mv.visitLabel(dflt);

    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);
View Full Code Here

        | Opcodes.ACC_STATIC, "cast", "(L" + ETUPLE_NAME + ";)L"
        + ETUPLE_NAME + n + ";", null, null);
    mv.visitCode();

    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));
View Full Code Here

      String super_class_name) {
    MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V",
        null, null);
    mv.visitCode();
    mv.visitVarInsn(Opcodes.ALOAD, 0); // load this
    mv.visitMethodInsn(Opcodes.INVOKESPECIAL, super_class_name, "<init>",
        "()V");
    mv.visitInsn(Opcodes.RETURN);
    mv.visitMaxs(1, 1);
    mv.visitEnd();
  }
View Full Code Here

    // make default constructor
    mv = cv.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitMethodInsn(INVOKESPECIAL, ECOMPILEDMODULE_NAME, "<init>", "()V");
    mv.visitInsn(RETURN);
    mv.visitMaxs(1, 1);
    mv.visitEnd();

    mv = cv.visitMethod(ACC_PUBLIC, "registerImportsAndExports", "()V",
View Full Code Here

    mv = cv.visitMethod(ACC_PUBLIC, "registerImportsAndExports", "()V",
        null, null);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitMethodInsn(INVOKESPECIAL, ECOMPILEDMODULE_NAME,
        "registerImportsAndExports", "()V");

    for (Lambda l : lambdas_xx.values()) {

      mv.visitTypeInsn(NEW, Type.getInternalName(LocalFunID.class));
View Full Code Here

      push_int(mv, l.index);
      push_int(mv, l.old_uniq);
      mv.visitFieldInsn(GETSTATIC, self_type.getInternalName(),
          "module_md5", EBINARY_TYPE.getDescriptor());

      mv.visitMethodInsn(
          INVOKESPECIAL,
          Type.getInternalName(LocalFunID.class),
          "<init>",
          "(" + EATOM_DESC + EATOM_DESC + "IIII"
              + EBINARY_TYPE.getDescriptor() + ")V");
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.