diff options
Diffstat (limited to 'org.jacoco.core/src/org/jacoco/core/internal')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java | 8 | ||||
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java | 17 |
2 files changed, 13 insertions, 12 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java b/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java index 4d4e1ba1..85e83a3a 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java @@ -77,9 +77,7 @@ public final class InstrSupport { * Data type of the field that stores coverage information for a class ( * <code>boolean[]</code>). */ - // BEGIN android-change - public static final String DATAFIELD_DESC = "Lorg/jacoco/core/data/IExecutionData;"; - // END android-change + public static final String DATAFIELD_DESC = "[Z"; // === Init Method === @@ -91,9 +89,7 @@ public final class InstrSupport { /** * Descriptor of the initialization method. */ - // BEGIN android-change - public static final String INITMETHOD_DESC = "()Lorg/jacoco/core/data/IExecutionData;"; - // END android-change + public static final String INITMETHOD_DESC = "()[Z"; /** * Access modifiers of the initialization method. diff --git a/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java b/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java index 0cac8f8f..63fbf765 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java @@ -67,20 +67,25 @@ class ProbeInserter extends MethodVisitor implements IProbeInserter { public void insertProbe(final int id) { - // BEGIN android-change - // For a probe we call setProbe on the IExecutionData object. + // For a probe we set the corresponding position in the boolean[] array + // to true. mv.visitVarInsn(Opcodes.ALOAD, variable); - // Stack[0]: Lorg/jacoco/core/data/IExecutionData; + // Stack[0]: [Z InstrSupport.push(mv, id); // Stack[1]: I - // Stack[0]: Lorg/jacoco/core/data/IExecutionData; + // Stack[0]: [Z - mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "org/jacoco/core/data/IExecutionData", "setProbe", "(I)V", true); - // END android-change + mv.visitInsn(Opcodes.ICONST_1); + + // Stack[2]: I + // Stack[1]: I + // Stack[0]: [Z + + mv.visitInsn(Opcodes.BASTORE); } @Override |