Examples of visitMaxs()


Examples of org.objectweb.asm.CodeVisitor.visitMaxs()

      // visits try catch blocks
      for (i = 0; i < tryCatchBlocks.size(); ++i) {
        ((TryCatchBlockNode)tryCatchBlocks.get(i)).accept(mv);
      }
      // visits maxs
      mv.visitMaxs(maxStack, maxLocals);
      // visits local variables
      for (i = 0; i < localVariables.size(); ++i) {
        ((LocalVariableNode)localVariables.get(i)).accept(mv);
      }
      // visits line numbers
View Full Code Here

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

                helperType.getDescriptor());

        // END helper = new ExceptionHelper(target)

        methodVisitor.visitInsn(Opcodes.RETURN);
        methodVisitor.visitMaxs(0, 0);
        methodVisitor.visitEnd();

        // END <init>(<type> target, ScriptSource source, Integer lineNumber)

        for (Method method : ExceptionHelper.class.getDeclaredMethods()) {
View Full Code Here

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

                    helperType.getDescriptor());
            methodVisitor.visitMethodInsn(Opcodes.INVOKEVIRTUAL, helperType.getInternalName(), method.getName(),
                    methodDescriptor);

            methodVisitor.visitInsn(Opcodes.ARETURN);
            methodVisitor.visitMaxs(0, 0);
            methodVisitor.visitEnd();
            // END public <type> <method>() { return helper.<method>(); }
        }

        visitor.visitEnd();
View Full Code Here

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

        methodVisitor.visitVarInsn(Opcodes.ALOAD, 0);
        methodVisitor.visitMethodInsn(Opcodes.INVOKESPECIAL, superclassType.getInternalName(), "<init>",
                constructorDescriptor);

        methodVisitor.visitInsn(Opcodes.RETURN);
        methodVisitor.visitMaxs(0, 0);
        methodVisitor.visitEnd();

        // run() method

        String runDesciptor = Type.getMethodDescriptor(Type.getType(Object.class), new Type[0]);
View Full Code Here

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

        // return null
        methodVisitor.visitInsn(Opcodes.ACONST_NULL);

        methodVisitor.visitInsn(Opcodes.ARETURN);
        methodVisitor.visitMaxs(0, 0);
        methodVisitor.visitEnd();

        visitor.visitEnd();

        byte[] bytecode = visitor.toByteArray();
View Full Code Here

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

        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, superClass, "<init>", "()V");
        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }

    @Deprecated
    public static void genInvokeXxxWithArray(ClassWriter cw, Method method) {
View Full Code Here

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

        if (method.getReturnType() == void.class) {
            mv.visitInsn(Opcodes.ACONST_NULL);
        }

        mv.visitInsn(Opcodes.ARETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }

    private static void genInvokeWithFixedParams(ClassWriter cw, Method method) {
        MethodVisitor mv;
View Full Code Here

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

            if (method.getReturnType() == void.class) {
                mv.visitInsn(Opcodes.ACONST_NULL);
            }

            mv.visitInsn(Opcodes.ARETURN);
            mv.visitMaxs(0, 0);
            mv.visitEnd();
        }
    }

    private static void genInvokeWithFixedPrimitiveParams(ClassWriter cw, Method method) {
View Full Code Here

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

            if (method.getReturnType() == void.class) {
                mv.visitInsn(Opcodes.ACONST_NULL);
            }

            mv.visitInsn(Opcodes.ARETURN);
            mv.visitMaxs(0, 0);
            mv.visitEnd();
        }
    }

    private static final String[] EXCEPTIONS = new String[] { "java/lang/Throwable" };
View Full Code Here

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

        mv.visitLabel(catchStart);
        mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/codehaus/groovy/runtime/ScriptBytecodeAdapter", "unwrap", "(Lgroovy/lang/GroovyRuntimeException;)Ljava/lang/Throwable;");
        mv.visitInsn(Opcodes.ATHROW);       
        mv.visitTryCatchBlock(tryStart, tryEnd, catchStart, GRE);
       
        mv.visitMaxs(0, 0);
        mv.visitEnd();
        return mv;
    }
   
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.