Package org.objectweb.asm

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


    public void testIllegalShortInsnOperand() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitIntInsn(SIPUSH, Integer.MAX_VALUE);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here


    public void testIllegalIntInsnOperand() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitIntInsn(NEWARRAY, 0);
            fail();
        } catch (Exception e) {
        }
    }
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

      MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
      return new MethodAdapter(mv) {
        @Override
        public void visitCode() {
          super.visitCode();
          mv.visitIntInsn(SIPUSH, 1);
          mv.visitInsn(IRETURN);
        }
      };
    }
    // any other method
View Full Code Here

            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 6 );
            mv.visitFieldInsn( GETSTATIC, "java/lang/Short", "TYPE", "Ljava/lang/Class;" );
            mv.visitInsn( AASTORE );
            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 7 );
            mv.visitFieldInsn( GETSTATIC, "java/lang/Byte", "TYPE", "Ljava/lang/Class;" );
            mv.visitInsn( AASTORE );
            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 8 );
            mv.visitLdcInsn( Type.getType( "Ljava/lang/Double;" ) );
View Full Code Here

            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 7 );
            mv.visitFieldInsn( GETSTATIC, "java/lang/Byte", "TYPE", "Ljava/lang/Class;" );
            mv.visitInsn( AASTORE );
            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 8 );
            mv.visitLdcInsn( Type.getType( "Ljava/lang/Double;" ) );
            mv.visitInsn( AASTORE );
            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 9 );
            mv.visitLdcInsn( Type.getType( "[Ljava/lang/Object;" ) );
View Full Code Here

            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 8 );
            mv.visitLdcInsn( Type.getType( "Ljava/lang/Double;" ) );
            mv.visitInsn( AASTORE );
            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 9 );
            mv.visitLdcInsn( Type.getType( "[Ljava/lang/Object;" ) );
            mv.visitInsn( AASTORE );
            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 10 );
            mv.visitLdcInsn( Type.getType( "[I" ) );
View Full Code Here

            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 9 );
            mv.visitLdcInsn( Type.getType( "[Ljava/lang/Object;" ) );
            mv.visitInsn( AASTORE );
            mv.visitInsn( DUP );
            mv.visitIntInsn( BIPUSH, 10 );
            mv.visitLdcInsn( Type.getType( "[I" ) );
            mv.visitInsn( AASTORE );
            mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/Class", "getMethod",
                                "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;" );
            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m3", "Ljava/lang/reflect/Method;" );
View Full Code Here

            mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/Class", "getMethod",
                                "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;" );
            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m2", "Ljava/lang/reflect/Method;" );
            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/satisfiedBy/Other;" ) );
            mv.visitLdcInsn( "bar" );
            mv.visitIntInsn( BIPUSH, 11 );
            mv.visitTypeInsn( ANEWARRAY, "java/lang/Class" );
            mv.visitInsn( DUP );
            mv.visitInsn( ICONST_0 );
            mv.visitFieldInsn( GETSTATIC, "java/lang/Double", "TYPE", "Ljava/lang/Class;" );
            mv.visitInsn( AASTORE );
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.