Example usage for org.objectweb.asm Opcodes NOP

List of usage examples for org.objectweb.asm Opcodes NOP

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes NOP.

Prototype

int NOP

To view the source code for org.objectweb.asm Opcodes NOP.

Click Source Link

Usage

From source file:org.jacoco.core.internal.analysis.filter.SynchronizedFilterTest.java

License:Open Source License

@Test
public void ecj() {
    final Label start = new Label();
    final Label end = new Label();
    final Label handler = new Label();
    final Label handlerEnd = new Label();
    m.visitTryCatchBlock(start, end, handler, null);
    m.visitTryCatchBlock(handler, handlerEnd, handler, null);

    m.visitVarInsn(Opcodes.ALOAD, 0);//from   ww w  .  ja va 2s  . c  o  m
    m.visitFieldInsn(Opcodes.GETFIELD, "Target", "lock", "Ljava/lang/Object;");
    m.visitInsn(Opcodes.DUP);
    m.visitVarInsn(Opcodes.ASTORE, 1);
    m.visitInsn(Opcodes.MONITORENTER);
    m.visitLabel(start);
    m.visitVarInsn(Opcodes.ALOAD, 0);
    m.visitInsn(Opcodes.NOP);
    m.visitVarInsn(Opcodes.ALOAD, 1);
    m.visitInsn(Opcodes.MONITOREXIT);
    m.visitLabel(end);
    final Label exit = new Label();
    m.visitJumpInsn(Opcodes.GOTO, exit);
    m.visitLabel(handler);
    m.visitVarInsn(Opcodes.ALOAD, 1);
    m.visitInsn(Opcodes.MONITOREXIT);
    m.visitLabel(handlerEnd);
    m.visitInsn(Opcodes.ATHROW);
    m.visitLabel(exit);
    m.visitInsn(Opcodes.RETURN);

    filter.filter(m, context, output);

    assertIgnored(new Range((LabelNode) handler.info, ((LabelNode) exit.info).getPrevious()));
}

From source file:org.jacoco.core.internal.analysis.filter.SyntheticFilterTest.java

License:Open Source License

@Test
public void testNonSynthetic() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, 0, "name", "()V", null, null);
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);/*from  w w w.  ja  va  2  s  . c om*/

    assertIgnored();
}

From source file:org.jacoco.core.internal.analysis.filter.SyntheticFilterTest.java

License:Open Source License

@Test
public void testSynthetic() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, Opcodes.ACC_SYNTHETIC, "name", "()V",
            null, null);//from   w  ww .  ja v a  2  s  . co m
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);

    assertMethodIgnored(m);
}

From source file:org.jacoco.core.internal.analysis.filter.SyntheticFilterTest.java

License:Open Source License

@Test
public void testLambda() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, Opcodes.ACC_SYNTHETIC, "lambda$1", "()V",
            null, null);//w ww. j a  v a  2 s.co  m
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);

    assertIgnored();
}

From source file:org.jacoco.core.internal.analysis.filter.SyntheticFilterTest.java

License:Open Source License

@Test
public void should_not_filter_method_with_suffix_default_in_kotlin_classes() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION,
            Opcodes.ACC_SYNTHETIC | Opcodes.ACC_BRIDGE, "example$default",
            "(LTarget;Ljava/lang/String;Ijava/lang/Object;)V", null, null);
    context.classAnnotations.add(KotlinGeneratedFilter.KOTLIN_METADATA_DESC);
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);// w  w w .  j a  v  a2  s. c o  m

    assertIgnored();
}

From source file:org.jacoco.core.internal.analysis.filter.SyntheticFilterTest.java

License:Open Source License

@Test
public void should_filter_synthetic_method_with_suffix_default_in_non_kotlin_classes() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION,
            Opcodes.ACC_SYNTHETIC | Opcodes.ACC_BRIDGE, "example$default",
            "(LTarget;Ljava/lang/String;Ijava/lang/Object;)V", null, null);
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);//from  w  ww  . jav  a  2  s.  c om

    assertMethodIgnored(m);
}

From source file:org.jacoco.core.internal.analysis.filter.SyntheticFilterTest.java

License:Open Source License

@Test
public void should_not_filter_synthetic_constructor_containing_default_arguments_in_kotlin_classes() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, Opcodes.ACC_SYNTHETIC, "<init>",
            "(IILkotlin/jvm/internal/DefaultConstructorMarker;)V", null, null);
    context.classAnnotations.add(KotlinGeneratedFilter.KOTLIN_METADATA_DESC);
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);//from w w  w. ja va  2  s  . c o  m

    assertIgnored();
}

From source file:org.jacoco.core.internal.analysis.filter.SyntheticFilterTest.java

License:Open Source License

@Test
public void should_not_filter_synthetic_methods_whose_last_argument_is_kotlin_coroutine_continuation() {
    final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION,
            Opcodes.ACC_SYNTHETIC | Opcodes.ACC_STATIC, "example",
            "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", null, null);
    context.classAnnotations.add(KotlinGeneratedFilter.KOTLIN_METADATA_DESC);
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);/*from   w  w  w.j  a v a  2 s  .co m*/

    assertIgnored();
}

From source file:org.jacoco.core.internal.analysis.filter.TryWithResourcesEcjFilterTest.java

License:Open Source License

/**
 * ECJ for/*from ww  w  .  ja  va2  s. c  o  m*/
 *
 * <pre>
 *     try (r0 = ...; r1 = ...; r2= ...) {
 *         ...
 *     } finally (...) {
 *         ...
 *     }
 *     ...
 * </pre>
 *
 * generates
 *
 * <pre>
 *     ACONST_NULL
 *     ASTORE primaryExc
 *     ACONST_NULL
 *     ASTORE suppressedExc
 *     ...
 *     ASTORE r1
 *     ...
 *     ASTORE r2
 *     ...
 *     ASTORE r3
 *
 *     ... // body
 *
 *     ALOAD r3
 *     IFNULL r2_close
 *     ALOAD r3
 *     INVOKEVIRTUAL close:()V
 *     GOTO r2_close
 *
 *     ASTORE primaryExc
 *     ALOAD r3
 *     IFNULL n
 *     ALOAD r3
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     r2_close:
 *     ALOAD r2
 *     IFNULL r1_close
 *     ALOAD r2
 *     INVOKEVIRTUAL close:()V
 *     GOTO r1_close
 *
 *     ASTORE suppressedExc
 *     ALOAD primaryExc
 *     IFNONNULL s
 *     ALOAD suppressedExc
 *     ASTORE primaryExc
 *     GOTO e
 *     s:
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     IF_ACMPEQ e
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     INVOKEVIRTUAL java/lang/Throwable.addSuppressed:(Ljava/lang/Throwable;)V
 *     e:
 *
 *     ALOAD r2
 *     IFNULL n
 *     ALOAD r2
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     r1_close:
 *     ALOAD r1
 *     IFNULL after
 *     ALOAD r1
 *     INVOKEVIRTUAL close:()V
 *     GOTO after
 *
 *     ASTORE suppressedExc
 *     ALOAD primaryExc
 *     IFNONNULL s
 *     ALOAD suppressedExc
 *     ASTORE primaryExc
 *     GOTO e
 *     s:
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     IF_ACMPEQ e
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     INVOKEVIRTUAL java/lang/Throwable.addSuppressed:(Ljava/lang/Throwable;)V
 *     e:
 *
 *     ALOAD r1
 *     IFNULL n
 *     ALOAD r1
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     ASTORE suppressedExc
 *     ALOAD primaryExc
 *     IFNONNULL s
 *     ALOAD suppressedExc
 *     ASTORE primaryExc
 *     GOTO e
 *     s:
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     IF_ACMPEQ e
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     INVOKEVIRTUAL java/lang/Throwable.addSuppressed:(Ljava/lang/Throwable;)V
 *     e:
 *
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     ... // additional handlers for catch blocks and finally on exceptional path
 *
 *     after:
 *     ... // finally on normal path
 *     ...
 * </pre>
 */
@Test
public void ecj() {
    final Range range0 = new Range();
    final Range range1 = new Range();

    final Label handler = new Label();
    m.visitTryCatchBlock(handler, handler, handler, null);

    // primaryExc = null
    m.visitInsn(Opcodes.ACONST_NULL);
    m.visitVarInsn(Opcodes.ASTORE, 1);
    // suppressedExc = null
    m.visitInsn(Opcodes.ACONST_NULL);
    m.visitVarInsn(Opcodes.ASTORE, 2);

    // body
    m.visitInsn(Opcodes.NOP);

    final Label l4 = new Label();
    final Label l7 = new Label();
    final Label end = new Label();
    { // nextIsEcjClose("r0")
        m.visitVarInsn(Opcodes.ALOAD, 5);
        range0.fromInclusive = m.instructions.getLast();
        m.visitJumpInsn(Opcodes.IFNULL, l4);
        m.visitVarInsn(Opcodes.ALOAD, 5);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun2$Resource", "close", "()V", false);
    }
    m.visitJumpInsn(Opcodes.GOTO, l4);
    range0.toInclusive = m.instructions.getLast();
    // catch (any primaryExc)
    m.visitLabel(handler);
    range1.fromInclusive = m.instructions.getLast();
    m.visitVarInsn(Opcodes.ASTORE, 1);
    { // nextIsEcjCloseAndThrow("r0")
        m.visitVarInsn(Opcodes.ALOAD, 5);
        Label l11 = new Label();
        m.visitJumpInsn(Opcodes.IFNULL, l11);
        m.visitVarInsn(Opcodes.ALOAD, 5);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun2$Resource", "close", "()V", false);
        m.visitLabel(l11);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitInsn(Opcodes.ATHROW);
    }
    m.visitLabel(l4);
    { // nextIsEcjClose("r1")
        m.visitVarInsn(Opcodes.ALOAD, 4);
        m.visitJumpInsn(Opcodes.IFNULL, l7);
        m.visitVarInsn(Opcodes.ALOAD, 4);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun2$Resource", "close", "()V", false);
    }
    m.visitJumpInsn(Opcodes.GOTO, l7);
    { // nextIsEcjSuppress
        m.visitVarInsn(Opcodes.ASTORE, 2);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        final Label suppressStart = new Label();
        m.visitJumpInsn(Opcodes.IFNONNULL, suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitVarInsn(Opcodes.ASTORE, 1);
        final Label suppressEnd = new Label();
        m.visitJumpInsn(Opcodes.GOTO, suppressEnd);
        m.visitLabel(suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitJumpInsn(Opcodes.IF_ACMPEQ, suppressEnd);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", "addSuppressed",
                "(Ljava/lang/Throwable;)V", false);
        m.visitLabel(suppressEnd);
    }
    { // nextIsEcjCloseAndThrow("r1")
        m.visitVarInsn(Opcodes.ALOAD, 4);
        final Label l14 = new Label();
        m.visitJumpInsn(Opcodes.IFNULL, l14);
        m.visitVarInsn(Opcodes.ALOAD, 4);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun2$Resource", "close", "()V", false);
        m.visitLabel(l14);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitInsn(Opcodes.ATHROW);
    }
    m.visitLabel(l7);
    { // nextIsEcjClose("r2")
        m.visitVarInsn(Opcodes.ALOAD, 3);
        m.visitJumpInsn(Opcodes.IFNULL, end);
        m.visitVarInsn(Opcodes.ALOAD, 3);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun2$Resource", "close", "()V", false);
        m.visitJumpInsn(Opcodes.GOTO, end);
    }
    { // nextIsEcjSuppress
        m.visitVarInsn(Opcodes.ASTORE, 2);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        final Label suppressStart = new Label();
        m.visitJumpInsn(Opcodes.IFNONNULL, suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitVarInsn(Opcodes.ASTORE, 1);
        final Label suppressEnd = new Label();
        m.visitJumpInsn(Opcodes.GOTO, suppressEnd);
        m.visitLabel(suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitJumpInsn(Opcodes.IF_ACMPEQ, suppressEnd);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", "addSuppressed",
                "(Ljava/lang/Throwable;)V", false);
        m.visitLabel(suppressEnd);
    }
    { // nextIsEcjCloseAndThrow("r2")
        m.visitVarInsn(Opcodes.ALOAD, 3);
        final Label l18 = new Label();
        m.visitJumpInsn(Opcodes.IFNULL, l18);
        m.visitVarInsn(Opcodes.ALOAD, 3);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun2$Resource", "close", "()V", false);
        m.visitLabel(l18);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitInsn(Opcodes.ATHROW);
    }
    { // nextIsEcjSuppress
        m.visitVarInsn(Opcodes.ASTORE, 2);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        final Label suppressStart = new Label();
        m.visitJumpInsn(Opcodes.IFNONNULL, suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitVarInsn(Opcodes.ASTORE, 1);
        final Label suppressEnd = new Label();
        m.visitJumpInsn(Opcodes.GOTO, suppressEnd);
        m.visitLabel(suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitJumpInsn(Opcodes.IF_ACMPEQ, suppressEnd);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", "addSuppressed",
                "(Ljava/lang/Throwable;)V", false);
        m.visitLabel(suppressEnd);
    }
    // throw primaryExc
    m.visitVarInsn(Opcodes.ALOAD, 1);
    m.visitInsn(Opcodes.ATHROW);
    range1.toInclusive = m.instructions.getLast();

    // additional handlers
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);

    assertIgnored(range0, range1);
}

From source file:org.jacoco.core.internal.analysis.filter.TryWithResourcesEcjFilterTest.java

License:Open Source License

/**
 * ECJ for//from   ww w. ja  v  a 2  s  . c  o  m
 *
 * <pre>
 *     try (r1 = ...; r2 = ...; r3 = ...) {
 *         return ...
 *     } finally {
 *         ...
 *     }
 * </pre>
 *
 * generates
 *
 * <pre>
 *     ACONST_NULL
 *     astore primaryExc
 *     ACONST_NULL
 *     astore suppressedExc
 *
 *     ...
 *     ASTORE r1
 *     ...
 *     ASTORE r2
 *     ...
 *     ASTORE r3
 *
 *     ... // body
 *
 *     ALOAD r3
 *     IFNULL n
 *     ALOAD r3
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD r2
 *     IFNULL n
 *     ALOAD r2
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD r1
 *     IFNULL n
 *     ALOAD r1
 *     INVOKEVIRTUAL close:()V
 *     n:
 *
 *     ... // finally on normal path
 *     ARETURN
 *
 *     ASTORE primaryExc
 *     ALOAD r3
 *     IFNULL n
 *     ALOAD r3
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     ASTORE suppressedExc
 *     ALOAD primaryExc
 *     IFNONNULL s
 *     ALOAD suppressedExc
 *     ASTORE primaryExc
 *     GOTO  e
 *     s:
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     IF_ACMPEQ  e
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     INVOKEVIRTUAL java/lang/Throwable.addSuppressed:(Ljava/lang/Throwable;)V
 *     e:
 *
 *     ALOAD r2
 *     IFNULL n
 *     ALOAD r2
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     ASTORE suppressedExc
 *     ALOAD primaryExc
 *     IFNONNULL s
 *     ALOAD suppressedExc
 *     ASTORE primaryExc
 *     GOTO e
 *     s:
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     IF_ACMPEQ e
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     INVOKEVIRTUAL java/lang/Throwable.addSuppressed:(Ljava/lang/Throwable;)V
 *     e:
 *
 *     ALOAD r1
 *     IFNULL n
 *     ALOAD r1
 *     INVOKEVIRTUAL close:()V
 *     n:
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     ASTORE suppressedExc
 *     ALOAD primaryExc
 *     IFNONNULL s
 *     ALOAD suppressedExc
 *     ASTORE primaryExc
 *     GOTO e
 *     s:
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     IF_ACMPEQ e
 *     ALOAD primaryExc
 *     ALOAD suppressedExc
 *     INVOKEVIRTUAL java/lang/Throwable.addSuppressed:(Ljava/lang/Throwable;)V
 *     e:
 *
 *     ALOAD primaryExc
 *     ATHROW
 *
 *     ... // additional handlers for catch blocks and finally on exceptional path
 * </pre>
 */
@Test
public void ecj_noFlowOut() {
    final Range range0 = new Range();
    final Range range1 = new Range();

    final Label handler = new Label();
    m.visitTryCatchBlock(handler, handler, handler, null);

    // primaryExc = null
    m.visitInsn(Opcodes.ACONST_NULL);
    m.visitVarInsn(Opcodes.ASTORE, 1);
    // suppressedExc = null
    m.visitInsn(Opcodes.ACONST_NULL);
    m.visitVarInsn(Opcodes.ASTORE, 2);

    // body
    m.visitInsn(Opcodes.NOP);

    { // nextIsEcjClose("r0")
        final Label label = new Label();
        m.visitVarInsn(Opcodes.ALOAD, 5);
        range0.fromInclusive = m.instructions.getLast();
        m.visitJumpInsn(Opcodes.IFNULL, label);
        m.visitVarInsn(Opcodes.ALOAD, 5);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun$Resource", "close", "()V", false);
        m.visitLabel(label);
    }
    { // nextIsEcjClose("r1")
        final Label label = new Label();
        m.visitVarInsn(Opcodes.ALOAD, 4);
        m.visitJumpInsn(Opcodes.IFNULL, label);
        m.visitVarInsn(Opcodes.ALOAD, 4);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun$Resource", "close", "()V", false);
        m.visitLabel(label);
    }
    { // nextIsEcjClose("r2")
        final Label label = new Label();
        m.visitVarInsn(Opcodes.ALOAD, 3);
        m.visitJumpInsn(Opcodes.IFNULL, label);
        m.visitVarInsn(Opcodes.ALOAD, 3);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun$Resource", "close", "()V", false);
        range0.toInclusive = m.instructions.getLast();
        m.visitLabel(label);
    }

    // finally
    m.visitInsn(Opcodes.NOP);
    m.visitInsn(Opcodes.ARETURN);

    // catch (any primaryExc)
    m.visitLabel(handler);
    range1.fromInclusive = m.instructions.getLast();
    m.visitVarInsn(Opcodes.ASTORE, 1);
    { // nextIsEcjCloseAndThrow("r0")
        m.visitVarInsn(Opcodes.ALOAD, 5);
        final Label throwLabel = new Label();
        m.visitJumpInsn(Opcodes.IFNULL, throwLabel);
        m.visitVarInsn(Opcodes.ALOAD, 5);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun$Resource", "close", "()V", false);
        m.visitLabel(throwLabel);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitInsn(Opcodes.ATHROW);
    }
    { // nextIsEcjSuppress
        m.visitVarInsn(Opcodes.ASTORE, 2);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        final Label suppressStart = new Label();
        m.visitJumpInsn(Opcodes.IFNONNULL, suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitVarInsn(Opcodes.ASTORE, 1);
        final Label suppressEnd = new Label();
        m.visitJumpInsn(Opcodes.GOTO, suppressEnd);
        m.visitLabel(suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitJumpInsn(Opcodes.IF_ACMPEQ, suppressEnd);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", "addSuppressed",
                "(Ljava/lang/Throwable;)V", false);
        m.visitLabel(suppressEnd);
    }
    { // nextIsEcjCloseAndThrow("r1")
        m.visitVarInsn(Opcodes.ALOAD, 4);
        final Label throwLabel = new Label();
        m.visitJumpInsn(Opcodes.IFNULL, throwLabel);
        m.visitVarInsn(Opcodes.ALOAD, 4);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun$Resource", "close", "()V", false);
        m.visitLabel(throwLabel);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitInsn(Opcodes.ATHROW);
    }
    { // nextIsEcjSuppress
        m.visitVarInsn(Opcodes.ASTORE, 2);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        final Label suppressStart = new Label();
        m.visitJumpInsn(Opcodes.IFNONNULL, suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitVarInsn(Opcodes.ASTORE, 1);
        final Label suppressEnd = new Label();
        m.visitJumpInsn(Opcodes.GOTO, suppressEnd);
        m.visitLabel(suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitJumpInsn(Opcodes.IF_ACMPEQ, suppressEnd);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", "addSuppressed",
                "(Ljava/lang/Throwable;)V", false);
        m.visitLabel(suppressEnd);
    }
    { // nextIsEcjCloseAndThrow("r2")
        m.visitVarInsn(Opcodes.ALOAD, 3);
        final Label throwLabel = new Label();
        m.visitJumpInsn(Opcodes.IFNULL, throwLabel);
        m.visitVarInsn(Opcodes.ALOAD, 3);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "Fun$Resource", "close", "()V", false);
        m.visitLabel(throwLabel);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitInsn(Opcodes.ATHROW);
    }
    { // nextIsEcjSuppress
        m.visitVarInsn(Opcodes.ASTORE, 2);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        final Label suppressStart = new Label();
        m.visitJumpInsn(Opcodes.IFNONNULL, suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitVarInsn(Opcodes.ASTORE, 1);
        final Label suppressEnd = new Label();
        m.visitJumpInsn(Opcodes.GOTO, suppressEnd);
        m.visitLabel(suppressStart);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitJumpInsn(Opcodes.IF_ACMPEQ, suppressEnd);
        m.visitVarInsn(Opcodes.ALOAD, 1);
        m.visitVarInsn(Opcodes.ALOAD, 2);
        m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", "addSuppressed",
                "(Ljava/lang/Throwable;)V", false);
        m.visitLabel(suppressEnd);
    }
    // throw primaryExc
    m.visitVarInsn(Opcodes.ALOAD, 1);
    m.visitInsn(Opcodes.ATHROW);
    range1.toInclusive = m.instructions.getLast();

    // additional handlers
    m.visitInsn(Opcodes.NOP);

    filter.filter(m, context, output);

    assertIgnored(range0, range1);
}