Package org.objectweb.asm

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


        mv.visitVarInsn(ALOAD, 0); // Load this
        mv.visitInsn(DUP); // Dup
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V"); // Call  super
        mv.visitVarInsn(ALOAD, 1); // Load the argument
        mv.visitFieldInsn(PUTFIELD, className, DEPENDENCY, DEPENDENCY_DESC); // Assign the dependency field
        mv.visitInsn(RETURN); // Return void

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


            mv.visitFieldInsn(Opcodes.GETFIELD, className.replace('.', '/'), fieldName, type.toString());
            mv.visitVarInsn(Opcodes.ALOAD, 1);
            final Label jmpLabel = new Label();
            mv.visitJumpInsn(Opcodes.IF_ACMPNE, jmpLabel);
            mv.visitVarInsn(Opcodes.ALOAD, 0);
            mv.visitInsn(Opcodes.ACONST_NULL);
            mv.visitFieldInsn(Opcodes.PUTFIELD, className.replace('.', '/'), fieldName, type.toString());
            mv.visitLabel(jmpLabel);
        }
        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(2, 2);
View Full Code Here

            mv.visitVarInsn(Opcodes.ALOAD, 0);
            mv.visitInsn(Opcodes.ACONST_NULL);
            mv.visitFieldInsn(Opcodes.PUTFIELD, className.replace('.', '/'), fieldName, type.toString());
            mv.visitLabel(jmpLabel);
        }
        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(2, 2);
    }
}
View Full Code Here

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

    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);
    mv.visitEnd();
  }
View Full Code Here

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

    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);
    mv.visitEnd();
  }
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);
View Full Code Here

    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);
      mv.visitFieldInsn(Opcodes.PUTFIELD, this_class_name, "elem"+(i+1), EOBJECT_DESC);
    }
   
    mv.visitInsn(Opcodes.ARETURN);
View Full Code Here

      mv.visitInsn(Opcodes.DUP);
      mv.visitVarInsn(Opcodes.ALOAD, i);
      mv.visitFieldInsn(Opcodes.PUTFIELD, this_class_name, "elem"+(i+1), EOBJECT_DESC);
    }
   
    mv.visitInsn(Opcodes.ARETURN);

    mv.visitMaxs(3, arity);
    mv.visitEnd();
  }
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.