Class KotlinDefaultArgumentsFilter
java.lang.Object
org.jacoco.core.internal.analysis.filter.KotlinDefaultArgumentsFilter
- All Implemented Interfaces:
IFilter
Filters branches that Kotlin compiler generates for default arguments.
For methods and constructors with default arguments Kotlin compiler generates
synthetic method with suffix "$default" or a synthetic constructor with last
argument "kotlin.jvm.internal.DefaultConstructorMarker" respectively. And in
this synthetic method for each default argument Kotlin compiler generates
following bytecode to determine if it should be used or not:
ILOAD maskVar ICONST_x, BIPUSH, SIPUSH, LDC or LDC_W IAND IFEQ label default argument label:If original method has
X arguments, then in synthetic method
maskVar is one of arguments from X+1 to
X+1+(X/32).
At least one of such arguments is not zero - invocation without default
arguments uses original non synthetic method.
This filter marks IFEQ instructions as ignored.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfilter(org.objectweb.asm.tree.MethodNode methodNode, IFilterContext context, IFilterOutput output) This method is called for every method.
-
Constructor Details
-
KotlinDefaultArgumentsFilter
public KotlinDefaultArgumentsFilter()
-
-
Method Details
-
filter
public void filter(org.objectweb.asm.tree.MethodNode methodNode, IFilterContext context, IFilterOutput output) Description copied from interface:IFilterThis method is called for every method. The filter implementation is expected to inspect the provided method and report its result to the givenIFilterOutputinstance.
-