diff options
author | Oliver Nguyen <olivernguyen@google.com> | 2020-07-09 15:11:30 -0700 |
---|---|---|
committer | Oliver Nguyen <olivernguyen@google.com> | 2020-08-11 10:58:54 -0700 |
commit | 28558ef2ec7635c0a7e10fbb1fe9b8a80d32b636 (patch) | |
tree | ff121ba8fcc1140f854ff568722192877ffeae6a /org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java | |
parent | bdbfb7047d87e8e790260a0fffb1afdf37ed3dc8 (diff) | |
download | platform_external_jacoco-28558ef2ec7635c0a7e10fbb1fe9b8a80d32b636.tar.gz platform_external_jacoco-28558ef2ec7635c0a7e10fbb1fe9b8a80d32b636.tar.bz2 platform_external_jacoco-28558ef2ec7635c0a7e10fbb1fe9b8a80d32b636.zip |
Add IExecutionData interface and move all usage to the interface.
Abstracts the underlying execution data implementation to allow for more
complex execution data storage mechanisms.
For offline instrumentation, classes store the IExecutionData object and
make calls into it to set probe data. This results in additional
overhead of looking up the vtable for the interface and making the
method call, rather than just directly setting the value in the boolean
array.
Bug: 147904124
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true and verify
Java coverage collection and parsing
Change-Id: I41235626b1040a6a21c6aef300f2dfe064393e1f
Diffstat (limited to 'org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeInserter.java | 17 |
1 files changed, 6 insertions, 11 deletions
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 63fbf765..0cac8f8f 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,25 +67,20 @@ class ProbeInserter extends MethodVisitor implements IProbeInserter { public void insertProbe(final int id) { - // For a probe we set the corresponding position in the boolean[] array - // to true. + // BEGIN android-change + // For a probe we call setProbe on the IExecutionData object. mv.visitVarInsn(Opcodes.ALOAD, variable); - // Stack[0]: [Z + // Stack[0]: Lorg/jacoco/core/data/IExecutionData; InstrSupport.push(mv, id); // Stack[1]: I - // Stack[0]: [Z + // Stack[0]: Lorg/jacoco/core/data/IExecutionData; - mv.visitInsn(Opcodes.ICONST_1); - - // Stack[2]: I - // Stack[1]: I - // Stack[0]: [Z - - mv.visitInsn(Opcodes.BASTORE); + mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "org/jacoco/core/data/IExecutionData", "setProbe", "(I)V", true); + // END android-change } @Override |