Package org.objectweb.asm

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


                    case JavaTypeName.LONG_TAG:                
                    case JavaTypeName.DOUBLE_TAG:                   
                    case JavaTypeName.FLOAT_TAG:
                    {                      
                        //push the instruction to create a 1-dimensonal array of primitive values
                        mv.visitIntInsn(Opcodes.NEWARRAY, getNewArrayArgCode(arrayElementType));                          
                        break;
                    }
                                               
                    case JavaTypeName.ARRAY_TAG:                  
                    case JavaTypeName.OBJECT_TAG:
View Full Code Here


            // Use ICONST_n
            mv.visitInsn(Opcodes.ICONST_0 + v);
           
        } else if (v >= Byte.MIN_VALUE && v <= Byte.MAX_VALUE) {         
            // Use BIPUSH
            mv.visitIntInsn(Opcodes.BIPUSH, (byte)v);
           
        } else if (v >= Short.MIN_VALUE && v <= Short.MAX_VALUE) {         
            // Use SIPUSH
            mv.visitIntInsn(Opcodes.SIPUSH, (short)v);
           
View Full Code Here

            // Use BIPUSH
            mv.visitIntInsn(Opcodes.BIPUSH, (byte)v);
           
        } else if (v >= Short.MIN_VALUE && v <= Short.MAX_VALUE) {         
            // Use SIPUSH
            mv.visitIntInsn(Opcodes.SIPUSH, (short)v);
           
        } else {         
            // If everything fails create a Constant pool entry
            mv.visitLdcInsn(value);        
        }
View Full Code Here

            // Use ICONST_n
            mv.visitInsn(Opcodes.ICONST_0 + value);
           
        } else if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) {         
            // Use BIPUSH
            mv.visitIntInsn(Opcodes.BIPUSH, (byte)value);
           
        } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {         
            // Use SIPUSH
            mv.visitIntInsn(Opcodes.SIPUSH, (short)value);
           
View Full Code Here

            // Use BIPUSH
            mv.visitIntInsn(Opcodes.BIPUSH, (byte)value);
           
        } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {         
            // Use SIPUSH
            mv.visitIntInsn(Opcodes.SIPUSH, (short)value);
           
        } else {         
            // If everything fails create a Constant pool entry
            mv.visitLdcInsn(Integer.valueOf(value));        
        }
View Full Code Here

            case JavaTypeName.LONG_TAG:          
            case JavaTypeName.DOUBLE_TAG:            
            case JavaTypeName.FLOAT_TAG:
            {                              
                //push the instruction to create a 1-dimensonal array of primitive values
                mv.visitIntInsn(Opcodes.NEWARRAY, getNewArrayArgCode(arrayElementType));   
                break;
            }
               
            case JavaTypeName.ARRAY_TAG:
            {
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

                    mv.visitFieldInsn(Opcodes.GETFIELD, periodToSlashes(newClassName),
                                      "factory",
                                      "L" + periodToSlashes(objectFactoryClass.getName()) + ";");
                }
                mv.visitVarInsn(Opcodes.ALOAD, 1);
                mv.visitIntInsn(Opcodes.BIPUSH, x);
                mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/List", "get", "(I)Ljava/lang/Object;");
               
                if (tp.isPrimitive()) {
                    mv.visitTypeInsn(Opcodes.CHECKCAST, NONPRIMITIVE_MAP.get(tp));
                    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, NONPRIMITIVE_MAP.get(tp),
View Full Code Here

                    mv.visitFieldInsn(Opcodes.GETFIELD, periodToSlashes(newClassName),
                                      "factory",
                                      "L" + periodToSlashes(objectFactoryClass.getName()) + ";");
                }
                mv.visitVarInsn(Opcodes.ALOAD, 1);
                mv.visitIntInsn(Opcodes.BIPUSH, x);
                mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/List", "get", "(I)Ljava/lang/Object;");
               
                if (tp.isPrimitive()) {
                    mv.visitTypeInsn(Opcodes.CHECKCAST, NONPRIMITIVE_MAP.get(tp));
                    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, NONPRIMITIVE_MAP.get(tp),
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.