Version 1.5.69
Cherry-pick: Don't allow type lookup of null value.
CL: https://r8-review.googlesource.com/c/r8/+/44433
Cherry-pick: Use concurrent hash map instead of synchronized map.
CL: https://r8-review.googlesource.com/c/r8/+/44431
Bug: 141096337
Change-Id: I7dc4d17b4831eafc16ba0155f1b1e69a9bdec2ba
diff --git a/src/main/java/com/android/tools/r8/Version.java b/src/main/java/com/android/tools/r8/Version.java
index 2f166c3..cb24298 100644
--- a/src/main/java/com/android/tools/r8/Version.java
+++ b/src/main/java/com/android/tools/r8/Version.java
@@ -11,7 +11,7 @@
// This field is accessed from release scripts using simple pattern matching.
// Therefore, changing this field could break our release scripts.
- public static final String LABEL = "1.5.68";
+ public static final String LABEL = "1.5.69";
private Version() {
}
diff --git a/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java b/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java
index 6122236..0012fff 100644
--- a/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java
+++ b/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java
@@ -19,6 +19,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -119,7 +120,7 @@
public AppInfoWithSubtyping(DexApplication application) {
super(application);
- typeInfo = Collections.synchronizedMap(new IdentityHashMap<>());
+ typeInfo = new ConcurrentHashMap<>();
// Recompute subtype map if we have modified the graph.
populateSubtypeMap(application.asDirect(), application.dexItemFactory);
}
@@ -128,7 +129,7 @@
super(previous);
missingClasses.addAll(previous.missingClasses);
subtypeMap.putAll(previous.subtypeMap);
- typeInfo = Collections.synchronizedMap(new IdentityHashMap<>(previous.typeInfo));
+ typeInfo = new ConcurrentHashMap<>(previous.typeInfo);
assert app() instanceof DirectMappedDexApplication;
}
@@ -166,6 +167,7 @@
}
private TypeInfo getTypeInfo(DexType type) {
+ assert type != null;
return typeInfo.computeIfAbsent(type, TypeInfo::new);
}
@@ -229,11 +231,11 @@
}
assert !seenTypes.contains(next);
seenTypes.add(next);
- TypeInfo superInfo = getTypeInfo(superType);
TypeInfo nextInfo = getTypeInfo(next);
if (superType == null) {
assert nextInfo.hierarchyLevel == ROOT_LEVEL;
} else {
+ TypeInfo superInfo = getTypeInfo(superType);
assert superInfo.hierarchyLevel == nextInfo.hierarchyLevel - 1
|| (superInfo.hierarchyLevel == ROOT_LEVEL
&& nextInfo.hierarchyLevel == INTERFACE_LEVEL);