Package org.objectweb.asm

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


            Label l0 = new Label();
            Label l1 = new Label();
            Label l2 = new Label();
            mv.visitTryCatchBlock( l0, l1, l2, "org/qi4j/satisfiedBy/Exception1" );
            Label l3 = new Label();
            mv.visitTryCatchBlock( l0, l1, l3, "org/qi4j/satisfiedBy/Exception2" );
            Label l4 = new Label();
            mv.visitTryCatchBlock( l0, l1, l4, "java/lang/Throwable" );
            mv.visitLabel( l0 );
            mv.visitVarInsn( ALOAD, 0 );
            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
View Full Code Here


            Label l2 = new Label();
            mv.visitTryCatchBlock( l0, l1, l2, "org/qi4j/satisfiedBy/Exception1" );
            Label l3 = new Label();
            mv.visitTryCatchBlock( l0, l1, l3, "org/qi4j/satisfiedBy/Exception2" );
            Label l4 = new Label();
            mv.visitTryCatchBlock( l0, l1, l4, "java/lang/Throwable" );
            mv.visitLabel( l0 );
            mv.visitVarInsn( ALOAD, 0 );
            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
                               "Lorg/qi4j/spi/composite/CompositeInvoker;" );
            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m4", "Ljava/lang/reflect/Method;" );
View Full Code Here

            mv = cw.visitMethod( ACC_PUBLIC, "other", "()Ljava/lang/String;", null, null );
            mv.visitCode();
            Label l0 = new Label();
            Label l1 = new Label();
            Label l2 = new Label();
            mv.visitTryCatchBlock( l0, l1, l2, "java/lang/Throwable" );
            mv.visitLabel( l0 );
            mv.visitVarInsn( ALOAD, 0 );
            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
                               "Lorg/qi4j/spi/composite/CompositeInvoker;" );
            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m1", "Ljava/lang/reflect/Method;" );
View Full Code Here

                                 new String[]{ "java/lang/IllegalArgumentException" } );
            mv.visitCode();
            Label l0 = new Label();
            Label l1 = new Label();
            Label l2 = new Label();
            mv.visitTryCatchBlock( l0, l1, l2, "java/lang/IllegalArgumentException" );
            Label l3 = new Label();
            mv.visitTryCatchBlock( l0, l1, l3, "java/lang/Throwable" );
            mv.visitLabel( l0 );
            mv.visitVarInsn( ALOAD, 0 );
            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
View Full Code Here

            Label l0 = new Label();
            Label l1 = new Label();
            Label l2 = new Label();
            mv.visitTryCatchBlock( l0, l1, l2, "java/lang/IllegalArgumentException" );
            Label l3 = new Label();
            mv.visitTryCatchBlock( l0, l1, l3, "java/lang/Throwable" );
            mv.visitLabel( l0 );
            mv.visitVarInsn( ALOAD, 0 );
            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
                               "Lorg/qi4j/spi/composite/CompositeInvoker;" );
            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m2", "Ljava/lang/reflect/Method;" );
View Full Code Here

            mv = cw.visitMethod( ACC_PUBLIC, "bar", "(DZFCIJSBLjava/lang/Double;[Ljava/lang/Object;[I)V", null, null );
            mv.visitCode();
            Label l0 = new Label();
            Label l1 = new Label();
            Label l2 = new Label();
            mv.visitTryCatchBlock( l0, l1, l2, "java/lang/Throwable" );
            mv.visitLabel( l0 );
            mv.visitVarInsn( ALOAD, 0 );
            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
                               "Lorg/qi4j/spi/composite/CompositeInvoker;" );
            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m3", "Ljava/lang/reflect/Method;" );
View Full Code Here

            int nstart = Math.max(begin, insnMap.get(tcbn.start));
            int nend   = Math.min(end, insnMap.get(tcbn.end));
            int nhndlr = insnMap.get(tcbn.handler);
            if (nstart >= nend) continue;

            v.visitTryCatchBlock(insnLabels[nstart - begin], insnLabels[nend - begin],
                    exitTrampolineLabels.containsKey(nhndlr) ? exitTrampolineLabels.get(nhndlr) : insnLabels[nhndlr - begin],
                    tcbn.type);
        }

        // uncommon entry code
View Full Code Here

            if (exceptionEntryStartLabel.getOffset() != returnContinueLabel.getOffset()) {
                // When there are consecutive instructions which jump/return outside the scope of the try block,
                // after the first iteration of the loop we will have the exception entry start label and the
                // return continue label both pointing to the same offset (ie. the offset of the nth consecutive
                // jump/return instruction on iteration n).
                mv.visitTryCatchBlock(exceptionEntryStartLabel, returnContinueLabel, catchLabel, exceptionType.getJVMInternalName());
            }
           
            // Set the start label for the next table entry to be visited.
            exceptionEntryStartLabel = jumpReturnLabelInfo.getAfterInstructionLabel();    // afterReturnLabel
        }
View Full Code Here

        }
       
        // Check for the case where the last return instruction comes at the end of the try block.
        if (exceptionEntryStartLabel.getOffset() != tryEndLabel.getOffset()) {
            // Add the final entry, which ends at the tryEndLabel.
            mv.visitTryCatchBlock(exceptionEntryStartLabel, tryEndLabel, catchLabel, exceptionType.getJVMInternalName());
        }
    }
   
    private static boolean encodeThrowStatement(JavaStatement.ThrowStatement throwStatement, GenerationContext context) throws JavaGenerationException {
       
View Full Code Here

        // Vist the label to mark the end of the try/catch.
        mv.visitLabel(tryCatchEnd);
       
        // Set up the try/catch block to catch exceptions thrown by the method invocation
        // and handle exiting the monitor.
        mv.visitTryCatchBlock(tryCatchStart, tryEnd, catchStart, null);
       
        // Set up a try catch block so that if an exception is thrown by trying to exit
        // the monitor in the case of an exception from the method invocation we will keep trying to
        // exit the monitor.
        mv.visitTryCatchBlock(catchStart, exceptionMonitorExitEnd, catchStart, null);
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.