aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2021-07-21 19:45:43 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-07-21 19:45:43 +0000
commit94db7dbc179fe45c01cc3eaf4460aae011e2e71a (patch)
treec544807665f60b27e0f3909304f24e8e10b24e45
parent2bc39b8424d00734d38ba5e1ae16c5d8b9374bf6 (diff)
parentf687aed09e60388050112c7688d3e94eb3347b2b (diff)
downloadjacoco-android-s-v2-preview-1.tar.gz
Disable use of 'constant dynamic' bytecode am: 0d5db7bcb6 am: f687aed09eandroid-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-2android-s-v2-preview-1
Original change: https://android-review.googlesource.com/c/platform/external/jacoco/+/1773306 Change-Id: Ib5b2e9beae597566bf24ea269071efd1e49c4644
-rw-r--r--README.android3
-rw-r--r--org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactory.java22
2 files changed, 17 insertions, 8 deletions
diff --git a/README.android b/README.android
index 8fa2b902..aa285834 100644
--- a/README.android
+++ b/README.android
@@ -21,3 +21,6 @@ is the list of the changes:
more lightweight. The Agent is only created when it's actually
needed. This makes it possible to instrument a lot of more core
libraries without creating a circular dependency at runtime.
+4) Disable use of 'constant dynamic' bytecode in
+ org.jacoco.core.internal.instr.ProbeArrayStrategyFactory, because R8/D8 doesn't support it.
+ (https://issuetracker.google.com/178172809)
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactory.java b/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactory.java
index d5756b7f..bc957b91 100644
--- a/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactory.java
+++ b/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactory.java
@@ -50,10 +50,13 @@ public final class ProbeArrayStrategyFactory {
if (counter.getCount() == 0) {
return new NoneProbeArrayStrategy();
}
- if (version >= Opcodes.V11 && counter.hasMethods()) {
- return new CondyProbeArrayStrategy(className, true, classId,
- accessorGenerator);
- }
+// BEGIN android-change
+ // See https://github.com/jacoco/jacoco/issues/1151
+ // if (version >= Opcodes.V11 && counter.hasMethods()) {
+ // return new CondyProbeArrayStrategy(className, true, classId,
+ // accessorGenerator);
+ // }
+// END android-change
if (version >= Opcodes.V1_8 && counter.hasMethods()) {
return new InterfaceFieldProbeArrayStrategy(className, classId,
counter.getCount(), accessorGenerator);
@@ -62,10 +65,13 @@ public final class ProbeArrayStrategyFactory {
counter.getCount(), accessorGenerator);
}
} else {
- if (version >= Opcodes.V11) {
- return new CondyProbeArrayStrategy(className, false, classId,
- accessorGenerator);
- }
+// BEGIN android-change
+ // See https://github.com/jacoco/jacoco/issues/1151
+ // if (version >= Opcodes.V11) {
+ // return new CondyProbeArrayStrategy(className, false, classId,
+ // accessorGenerator);
+ // }
+// END android-change
return new ClassFieldProbeArrayStrategy(className, classId,
InstrSupport.needsFrames(version), accessorGenerator);
}