Package org.objectweb.asm

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


              Method method = methods.get(i);
              Class[] paramTypes = method.getParameterTypes();
              for (int paramIndex = 0; paramIndex < paramTypes.length; paramIndex++) {
                mv.visitVarInsn(ALOAD, 3);
                mv.visitIntInsn(BIPUSH, paramIndex);
                mv.visitInsn(AALOAD);
                Type paramType = Type.getType(paramTypes[paramIndex]);
                switch (paramType.getSort()) {
                case Type.BOOLEAN:
                  mv.visitTypeInsn(CHECKCAST, "java/lang/Boolean");
View Full Code Here


                case 1: mv.visitInsn(DUP);mv.visitInsn(ICONST_1);mv.visitInsn(ICONST_3);break;
                case 2: mv.visitInsn(DUP);mv.visitInsn(ICONST_2);mv.visitInsn(ICONST_3);break;
                case 3: mv.visitInsn(DUP);mv.visitInsn(ICONST_3);mv.visitInsn(ICONST_3);break;
                case 4: mv.visitInsn(DUP);mv.visitInsn(ICONST_4);mv.visitInsn(ICONST_3);break;
                case 5: mv.visitInsn(DUP);mv.visitInsn(ICONST_5);mv.visitInsn(ICONST_3);break;
                default: mv.visitInsn(DUP);mv.visitIntInsn(BIPUSH, index);mv.visitInsn(ICONST_3);break//6 and bigger is DIFFERENT!!!
            } //switch


            mv.visitTypeInsn(ANEWARRAY, "java/lang/String")//inner array
View Full Code Here

                case 1: mv.visitInsn(DUP);mv.visitInsn(ICONST_1);mv.visitInsn(ICONST_3);break;
                case 2: mv.visitInsn(DUP);mv.visitInsn(ICONST_2);mv.visitInsn(ICONST_3);break;
                case 3: mv.visitInsn(DUP);mv.visitInsn(ICONST_3);mv.visitInsn(ICONST_3);break;
                case 4: mv.visitInsn(DUP);mv.visitInsn(ICONST_4);mv.visitInsn(ICONST_3);break;
                case 5: mv.visitInsn(DUP);mv.visitInsn(ICONST_5);mv.visitInsn(ICONST_3);break;
                default: mv.visitInsn(DUP);mv.visitIntInsn(BIPUSH, index);mv.visitInsn(ICONST_3);break//6 and bigger is DIFFERENT!!!
            } //switch


            mv.visitTypeInsn(ANEWARRAY, "java/lang/String")//inner array
View Full Code Here

        for (CommandResourceMetaData metaData : commandMetaData) {
            if (ResourceUtil.commandIsPresent(habitat, metaData.command)){
                size++;
            }
        }
        mv.visitIntInsn(BIPUSH, size);   //11 number of entries
        mv.visitTypeInsn(ANEWARRAY, "[Ljava/lang/String;")//first outer array
        int index= -1;
        for (CommandResourceMetaData metaData : commandMetaData) {
            if (ResourceUtil.commandIsPresent(habitat, metaData.command)){
            index++;
View Full Code Here

        }

        mv.visitVarInsn(ALOAD, 0);
        Class[] params = m.getParameterTypes();
        int i=1;
        mv.visitIntInsn(BIPUSH, params.length);
        mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
        for(Class pType : params) {
            mv.visitInsn(DUP);
            mv.visitIntInsn(BIPUSH, i-1);
            loadParameterWithConversion(mv, pType, i++);
View Full Code Here

        int i=1;
        mv.visitIntInsn(BIPUSH, params.length);
        mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
        for(Class pType : params) {
            mv.visitInsn(DUP);
            mv.visitIntInsn(BIPUSH, i-1);
            loadParameterWithConversion(mv, pType, i++);
            mv.visitInsn(AASTORE);
        }

        mv.visitLdcInsn(m.getName());
View Full Code Here

        for (CommandResourceMetaData metaData : commandMetaData) {
            if (ResourceUtil.commandIsPresent(habitat, metaData.command)){
                size++;
            }
        }
        mv.visitIntInsn(BIPUSH, size);   //11 number of entries
        mv.visitTypeInsn(ANEWARRAY, "[Ljava/lang/String;")//first outer array
        int index= -1;
        for (CommandResourceMetaData metaData : commandMetaData) {
            if (ResourceUtil.commandIsPresent(habitat, metaData.command)){
            index++;
View Full Code Here

                case 1: mv.visitInsn(DUP);mv.visitInsn(ICONST_1);mv.visitInsn(ICONST_3);break;
                case 2: mv.visitInsn(DUP);mv.visitInsn(ICONST_2);mv.visitInsn(ICONST_3);break;
                case 3: mv.visitInsn(DUP);mv.visitInsn(ICONST_3);mv.visitInsn(ICONST_3);break;
                case 4: mv.visitInsn(DUP);mv.visitInsn(ICONST_4);mv.visitInsn(ICONST_3);break;
                case 5: mv.visitInsn(DUP);mv.visitInsn(ICONST_5);mv.visitInsn(ICONST_3);break;
                default: mv.visitInsn(DUP);mv.visitIntInsn(BIPUSH, index);mv.visitInsn(ICONST_3);break//6 and bigger is DIFFERENT!!!
            } //switch


            mv.visitTypeInsn(ANEWARRAY, "java/lang/String")//inner array
View Full Code Here

        for (CommandResourceMetaData metaData : commandMetaData) {
            if (ResourceUtil.commandIsPresent(habitat, metaData.command)){
                size++;
            }
        }
        mv.visitIntInsn(BIPUSH, size);   //11 number of entries
        mv.visitTypeInsn(ANEWARRAY, "[Ljava/lang/String;")//first outer array
        int index= -1;
        for (CommandResourceMetaData metaData : commandMetaData) {
            if (ResourceUtil.commandIsPresent(habitat, metaData.command)){
            index++;
View Full Code Here

                case 1: mv.visitInsn(DUP);mv.visitInsn(ICONST_1);mv.visitInsn(ICONST_3);break;
                case 2: mv.visitInsn(DUP);mv.visitInsn(ICONST_2);mv.visitInsn(ICONST_3);break;
                case 3: mv.visitInsn(DUP);mv.visitInsn(ICONST_3);mv.visitInsn(ICONST_3);break;
                case 4: mv.visitInsn(DUP);mv.visitInsn(ICONST_4);mv.visitInsn(ICONST_3);break;
                case 5: mv.visitInsn(DUP);mv.visitInsn(ICONST_5);mv.visitInsn(ICONST_3);break;
                default: mv.visitInsn(DUP);mv.visitIntInsn(BIPUSH, index);mv.visitInsn(ICONST_3);break//6 and bigger is DIFFERENT!!!
            } //switch


            mv.visitTypeInsn(ANEWARRAY, "java/lang/String")//inner array
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.