Package org.objectweb.asm

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


            cv.visitInsn(ARETURN);
            Label l2 = new Label();
            cv.visitLabel(l2);
            cv.visitVarInsn(ASTORE, 2);
            cv.visitTypeInsn(NEW, personality.getUserRuntimeExceptionClassNameSlash());
            cv.visitInsn(DUP);
            cv.visitLdcInsn("Impossible to instanciate the class " + gc.classToWriteJCN + ": ");
            cv.visitVarInsn(ALOAD, 2);
            cv.visitMethodInsn(INVOKESPECIAL,
                personality.getUserRuntimeExceptionClassNameSlash(),
                    "<init>", "(Ljava/lang/String;Ljava/lang/Throwable;)V");
View Full Code Here


                mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>",
                        "(" + jvmFieldType + ")V");
            }
        }

        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
    private void generateSpeedoGetPOManagerMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "speedoGetPOManager",
                "()Lorg/objectweb/speedo/pm/api/POManagerItf;", null, null);
View Full Code Here

            cv.visitLdcInsn("Impossible to instanciate the class " + gc.classToWriteJCN + ": ");
            cv.visitVarInsn(ALOAD, 2);
            cv.visitMethodInsn(INVOKESPECIAL,
                personality.getUserRuntimeExceptionClassNameSlash(),
                    "<init>", "(Ljava/lang/String;Ljava/lang/Throwable;)V");
            cv.visitInsn(ATHROW);
            cv.visitTryCatchBlock(l0, l1, l2, "java/lang/Exception");
        }
        cv.visitMaxs(0, 0);
    }
    private void generateGetVersioningStrategy(HomeContext gc) {
View Full Code Here

    }
    private void generateGetVersioningStrategy(HomeContext gc) {
        CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL,
                "getVersioningStrategy", "()B", null, null);
        cv.visitFieldInsn(GETSTATIC, gc.classToWriteJCN, "VERSIONING_STRATEGY", "B");
        cv.visitInsn(IRETURN);
        cv.visitMaxs(1, 1);
    }
    private void generateIsDetachable(HomeContext gc) {
        CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL,
                "isDetachable", "()Z", null, null);
View Full Code Here

                "()" + JT_POMF);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_POMF, "lookup", "()" + JT_POM);
        Label l2 = new Label();
        mv.visitJumpInsn(GOTO, l2);
        mv.visitLabel(l1);
        mv.visitInsn(ACONST_NULL);
        mv.visitLabel(l2);
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
    private String getJavaWrapper(PType pt) {
View Full Code Here

    }
    private void generateIsDetachable(HomeContext gc) {
        CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL,
                "isDetachable", "()Z", null, null);
        cv.visitFieldInsn(GETSTATIC, gc.classToWriteJCN, "DETACHABLE", "Z");
        cv.visitInsn(IRETURN);
        cv.visitMaxs(1, 1);
    }
    private void generateIsAbstract(HomeContext gc) {
        if (gc.sc.isAbstract) {
            CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL,
View Full Code Here

        Label l2 = new Label();
        mv.visitJumpInsn(GOTO, l2);
        mv.visitLabel(l1);
        mv.visitInsn(ACONST_NULL);
        mv.visitLabel(l2);
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
    private String getJavaWrapper(PType pt) {
        switch (pt.getTypeCode()) {
        case PType.TYPECODE_BOOLEAN:
View Full Code Here

    }
    private void generateIsAbstract(HomeContext gc) {
        if (gc.sc.isAbstract) {
            CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL,
                    "isAbstract", "()Z", null, null);
            cv.visitInsn(ICONST_1);
            cv.visitInsn(IRETURN);
            cv.visitMaxs(1, 1);
        }
    }
    private void generateGetClassProperties(HomeContext gc) throws SpeedoException {
View Full Code Here

    private void generateIsAbstract(HomeContext gc) {
        if (gc.sc.isAbstract) {
            CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL,
                    "isAbstract", "()Z", null, null);
            cv.visitInsn(ICONST_1);
            cv.visitInsn(IRETURN);
            cv.visitMaxs(1, 1);
        }
    }
    private void generateGetClassProperties(HomeContext gc) throws SpeedoException {
        CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL, "getClassProperties",
View Full Code Here

    private void generateSpeedoCreateStateMethod() {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, M_SPEEDO_CREATE_STATE, "()" + JT_STATE, null, null);
        //return new $classNameFields(this);
        mv.visitTypeInsn(NEW, xfieldsJCN);
        mv.visitInsn(DUP);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, xfieldsJCN, "<init>", "(" + JT_PO + ")V");
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
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.