Package org.objectweb.asm

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


        cv.visitInsn(Constants.ARETURN);

        cv.visitLabel(labels.handlerLabel);
        cv.visitVarInsn(Constants.ASTORE, 2);
        cv.visitLabel(labels.endLabel);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitInsn(Constants.ICONST_M1);
        cv.visitFieldInsn(Constants.PUTFIELD, className, STACKFRAME_FIELD_NAME, I);
        cv.visitVarInsn(Constants.ALOAD, 2);
        cv.visitInsn(Constants.ATHROW);
View Full Code Here


        cv.visitFieldInsn(GETSTATIC, m_className, INSTANCE_CFLOW_FIELD_NAME, ABSTRACT_CFLOW_SIGNATURE);
        cv.visitJumpInsn(IFNULL, isNull);
        cv.visitFieldInsn(GETSTATIC, m_className, INSTANCE_CFLOW_FIELD_NAME, ABSTRACT_CFLOW_SIGNATURE);
        cv.visitMethodInsn(INVOKEVIRTUAL, ABSTRACT_CFLOW_CLASS, IN_CFLOW_METOD_NAME, IN_CFLOW_METOD_SIGNATURE);
        cv.visitInsn(IRETURN);
        cv.visitLabel(isNull);
        cv.visitInsn(ICONST_0);
        cv.visitInsn(IRETURN);
        cv.visitMaxs(0, 0);

        // static isInCflowBelow() delegators
View Full Code Here

        cv.visitFieldInsn(GETSTATIC, m_className, INSTANCE_CFLOW_FIELD_NAME, ABSTRACT_CFLOW_SIGNATURE);
        cv.visitJumpInsn(IFNULL, isNull2);
        cv.visitFieldInsn(GETSTATIC, m_className, INSTANCE_CFLOW_FIELD_NAME, ABSTRACT_CFLOW_SIGNATURE);
        cv.visitMethodInsn(INVOKEVIRTUAL, ABSTRACT_CFLOW_CLASS, IN_CFLOWBELOW_METOD_NAME, IN_CFLOWBELOW_METOD_SIGNATURE);
        cv.visitInsn(IRETURN);
        cv.visitLabel(isNull2);
        cv.visitInsn(ICONST_0);
        cv.visitInsn(IRETURN);
        cv.visitMaxs(0, 0);

        m_cw.visitEnd();
View Full Code Here

        cv.visitFieldInsn(GETFIELD, joinPointClassName, STACK_FRAME_FIELD_NAME, I);
        cv.visitLookupSwitchInsn(defaultCaseLabel, caseNumbers, caseLabels);

        // add one case for each around advice invocation
        for (int i = 0; i < aroundAdvice.length; i++) {
            cv.visitLabel(caseLabels[i]);

            // gather advice info
            AdviceInfo adviceInfo = aroundAdvice[i];
            AspectContainer container = adviceInfo.getAspectManager().getAspectContainer(adviceInfo.getAspectIndex());
            Method adviceMethod = container.getAdvice(adviceInfo.getMethodIndex());
View Full Code Here

                    aspectClassName,
                    adviceMethod.getName(),
                    Type.getMethodDescriptor(adviceMethod));

            cv.visitVarInsn(ASTORE, 1);
            cv.visitLabel(returnLabels[i]);

            decrementStackFrameCounter(cv, joinPointClassName);

            cv.visitVarInsn(ALOAD, 1);
            cv.visitInsn(ARETURN);
View Full Code Here

            cv.visitVarInsn(ALOAD, 1);
            cv.visitInsn(ARETURN);
        }

        // invoke the target join point in the default case
        cv.visitLabel(defaultCaseLabel);
        AsmHelper.prepareWrappingOfPrimitiveType(cv, Type.getReturnType(calleeMemberSignature));

        createJoinPointInvocation(cv,
                joinPointType,
                calleeMemberName,
View Full Code Here

                fieldNames);

        AsmHelper.wrapPrimitiveType(cv, Type.getReturnType(calleeMemberSignature));
        cv.visitVarInsn(ASTORE, 1);

        cv.visitLabel(gotoLabel);

        decrementStackFrameCounter(cv, joinPointClassName);
        cv.visitVarInsn(ALOAD, 1);
        cv.visitInsn(ARETURN);
View Full Code Here

        decrementStackFrameCounter(cv, joinPointClassName);
        cv.visitVarInsn(ALOAD, 1);
        cv.visitInsn(ARETURN);

        // finally clause
        cv.visitLabel(handlerLabel);
        cv.visitVarInsn(ASTORE, 2);
        cv.visitLabel(endLabel);

        decrementStackFrameCounter(cv, joinPointClassName);
        cv.visitVarInsn(ALOAD, 2);
View Full Code Here

        cv.visitInsn(ARETURN);

        // finally clause
        cv.visitLabel(handlerLabel);
        cv.visitVarInsn(ASTORE, 2);
        cv.visitLabel(endLabel);

        decrementStackFrameCounter(cv, joinPointClassName);
        cv.visitVarInsn(ALOAD, 2);
        cv.visitInsn(ATHROW);
View Full Code Here

                                                final AdviceInfo[] afterAdvices) {

        CodeVisitor cv = cw.visitMethod(ACC_STATIC, CLINIT_METHOD_NAME, NO_PARAM_RETURN_VOID_SIGNATURE, null, null);

        Label l0 = new Label();
        cv.visitLabel(l0);
        cv.visitLdcInsn(calleeClassName.replace('/', '.'));
        cv.visitMethodInsn(INVOKESTATIC, CLASS_CLASS, FOR_NAME_METHOD_NAME, FOR_NAME_METHOD_SIGNATURE);
        cv.visitFieldInsn(PUTSTATIC, joinPointClassName, TARGET_CLASS_FIELD_NAME, CLASS_CLASS_SIGNATURE);
        Label l1 = new Label();
        cv.visitLabel(l1);
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.