Package org.objectweb.asm

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


                IS_IN_CFLOW_METOD_SIGNATURE,
                EMPTY_STRING_ARRAY,
                null
        );
        Label isNull = new Label();
        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);
View Full Code Here


                null
        );
        Label isNull = new Label();
        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);
View Full Code Here

                IS_IN_CFLOWBELOW_METOD_SIGNATURE,
                EMPTY_STRING_ARRAY,
                null
        );
        Label isNull2 = new Label();
        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);
View Full Code Here

                null
        );
        Label isNull2 = new Label();
        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);
View Full Code Here

            for (int i = 0; i < m_fieldNames.length; i++) {
                String fieldName = m_fieldNames[i];
                cv.visitVarInsn(ALOAD, 0);
                Type type = m_argumentTypes[i];
                argStackIndex = AsmHelper.loadType(cv, argStackIndex, type);
                cv.visitFieldInsn(PUTFIELD, m_joinPointClassName, fieldName, type.getDescriptor());
            }

            cv.visitVarInsn(ALOAD, 0);
            cv.visitMethodInsn(
                    INVOKESPECIAL,
View Full Code Here

        // start try-catch block
        cv.visitLabel(tryLabel);

        // start the switch block and set the stackframe as the param to the switch
        cv.visitVarInsn(ALOAD, 0);
        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]);
View Full Code Here

            String aspectClassName = container.getCrossCuttingInfo().getAspectClass().getName().replace('.', '/');
            String aspectFieldName = AROUND_ADVICE_FIELD_PREFIX + i;
            String aspectClassSignature = L + aspectClassName + SEMICOLON;

            // get the aspect instance
            cv.visitFieldInsn(GETSTATIC, joinPointClassName, AROUND_ADVICE_FIELD_PREFIX + i, aspectClassSignature);

            // load the arguments to the advice from the join point instance plus build up the advice method signature
            int[] argIndexes = adviceInfo.getMethodToArgIndexes();
            // if empty, we consider for now that we have to push JoinPoint for old advice with JoinPoint as sole arg
            if (argIndexes.length <= 0) {
View Full Code Here

            for (int j = 0; j < argIndexes.length; j++) {
                int argIndex = argIndexes[j];
                if (argIndex != -1) {
                    Type argumentType = argumentTypes[argIndex];
                    cv.visitVarInsn(ALOAD, 0);
                    cv.visitFieldInsn(GETFIELD,
                            joinPointClassName,
                            ARGUMENT_FIELD + argIndex,
                            argumentType.getDescriptor());
                } else {
                    cv.visitVarInsn(ALOAD, 0);
View Full Code Here

            cv = cw.visitMethod(ACC_PUBLIC,
                    GET_SIGNATURE_METHOD_NAME,
                    GET_SIGNATURE_METHOD_SIGNATURE,
                    null,
                    null);
            cv.visitFieldInsn(GETSTATIC, joinPointClassName, SIGNATURE_FIELD_NAME, SIGNATURE_CLASS_SIGNATURE);
            cv.visitInsn(ARETURN);
            cv.visitMaxs(0, 0);
        }

        // addMetaData
View Full Code Here

        }

        // addMetaData
        {
            cv = cw.visitMethod(ACC_PUBLIC, ADD_META_DATA_METHOD_NAME, ADD_META_DATA_METHOD_SIGNATURE, null, null);
            cv.visitFieldInsn(GETSTATIC, joinPointClassName, META_DATA_FIELD_NAME, MAP_CLASS_SIGNATURE);
            cv.visitVarInsn(ALOAD, 1);
            cv.visitVarInsn(ALOAD, 2);
            cv.visitMethodInsn(INVOKEINTERFACE,
                    MAP_CLASS_NAME,
                    PUT_METHOD_NAME,
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.