Package org.objectweb.asm

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


    @Deprecated
    private MethodVisitor startCallS(ClassWriter cw) {
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "call", CALL_SIG, null, null);
       
        mv.visitCode();
        Label line = new Label();
        mv.visitLineNumber(0, line);
        mv.visitVarInsn(ALOAD, 1);
        checkCast(mv, IRubyObject.class);
        return mv;
View Full Code Here


    @Deprecated
    private MethodVisitor startCallFast(ClassWriter cw) {
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "call", FAST_CALL_SIG, null, null);
       
        mv.visitCode();
        Label line = new Label();
        mv.visitLineNumber(0, line);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitTypeInsn(CHECKCAST, typePath);
        return mv;
View Full Code Here

    @Deprecated
    private MethodVisitor startDispatcher(ClassWriter cw) {
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "callMethod", sig(IRubyObject.class, params(ThreadContext.class, IRubyObject.class, RubyClass.class, Integer.TYPE, String.class,
                IRubyObject[].class, CallType.class, Block.class)), null, null);
       
        mv.visitCode();
        Label line = new Label();
        mv.visitLineNumber(0, line);
        mv.visitVarInsn(ALOAD, 2);
        mv.visitTypeInsn(CHECKCAST, typePath);
        return mv;
View Full Code Here

    @Deprecated
    private MethodVisitor startCallSFast(ClassWriter cw) {
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "call", FAST_CALL_SIG, null, null);
       
        mv.visitCode();
        Label line = new Label();
        mv.visitLineNumber(0, line);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitTypeInsn(CHECKCAST, IRUB);
        return mv;
View Full Code Here

            freeRoom = freeRoom + types[t].getSize();
        }

        MethodVisitor mv = cw.visitMethod(modifiers, methodName, desc, null,
                exceptions);
        mv.visitCode();

        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, className, DEPENDENCY, DEPENDENCY_DESC)// The temporal dependency is on the stack.
        mv.visitMethodInsn(INVOKEVIRTUAL, TEMPORAL_DEPENDENCY, "getService", // Call getService
                "()Ljava/lang/Object;"); // The service object is on the stack.
View Full Code Here

     * @param cw the class writer
     * @param className the generated class name.
     */
    private static void generateConstructor(ClassWriter cw, String className) {
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", '(' + DEPENDENCY_DESC + ")V", null, null);
        mv.visitCode();

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

    MethodVisitor mv;
    make_blank_bridge(cw, this_class_name, super_class_name);

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

      String this_class_name, String super_class_name) {
    MethodVisitor mv;

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

    sb.append(this_class_name);
    sb.append(";");
   
    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");
View Full Code Here

      String this_class_name, String super_class_name) {
    MethodVisitor mv;
    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);
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.