Commit c2797a43 authored by Ian Wells's avatar Ian Wells Committed by Commit Bot

Remove ConcurrentHashMap from desugar list

When enable_jdk_library_desugaring=true, this change allows shrinking of
the generated "j$" dex from ~400 KB to 36 KB.

ConcurrentHashMap is available before before Java 8 but with a bug:
crbug.com/905903

Bug: 1056751
Change-Id: Ibaaeba2f714c0e8b17295cbe48098786ad173448
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446989Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Ian Wells <iwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814363}
parent f1c22acf
......@@ -21,6 +21,7 @@ R8 is a proguard-like optimizer that also has the ability to dex.
Local Modifications:
* Refer to commit descriptions within "patches" directory.
* Added "playground" directory for quick "how does this optimize" tests.
* Removed references to ConcurrentHashMap in desugar_jdk_libs.json.
Update Instructions:
# Download R8:
......@@ -57,3 +58,7 @@ java -cp third_party/r8/lib/r8.jar com.android.tools.r8.BackportedMethodList --m
# Manually update:
* README.chromium (version number via "java -cp lib/r8.jar com.android.tools.r8.R8 --version")
* //DEPS (instance ID output by cipd create)
Update instructions for desugar_jdk_libs.json:
* Find desugar.json as described above and copy to desugar_jdk_libs.json.
* Remove all mentions of ConcurrentHashMap (and remove any trailing commas if necessary).
......@@ -118,8 +118,7 @@
"java.util.Tripwire": "j$.util.Tripwire",
"java.util.concurrent.DesugarUnsafe": "j$.util.concurrent.DesugarUnsafe",
"java.util.concurrent.ThreadLocalRandom": "j$.util.concurrent.ThreadLocalRandom",
"java.util.concurrent.atomic.DesugarAtomic": "j$.util.concurrent.atomic.DesugarAtomic",
"java.util.concurrent.ConcurrentHashMap": "j$.util.concurrent.ConcurrentHashMap"
"java.util.concurrent.atomic.DesugarAtomic": "j$.util.concurrent.atomic.DesugarAtomic"
},
"retarget_lib_member": {
"java.util.Arrays#stream": "java.util.DesugarArrays",
......@@ -190,8 +189,7 @@
"java.util.Spliterator": "j$.util.Spliterator",
"java.util.StringJoiner": "j$.util.StringJoiner",
"java.util.concurrent.ThreadLocalRandom": "j$.util.concurrent.ThreadLocalRandom",
"java.util.concurrent.atomic.DesugarAtomic": "j$.util.concurrent.atomic.DesugarAtomic",
"java.util.concurrent.ConcurrentHashMap": "j$.util.concurrent.ConcurrentHashMap"
"java.util.concurrent.atomic.DesugarAtomic": "j$.util.concurrent.atomic.DesugarAtomic"
},
"retarget_lib_member": {
"java.util.Arrays#stream": "java.util.DesugarArrays",
......@@ -239,9 +237,6 @@
}
],
"shrinker_config": [
"-keepclassmembers class j$.util.concurrent.ConcurrentHashMap$TreeBin { int lockState; }",
"-keepclassmembers class j$.util.concurrent.ConcurrentHashMap { int sizeCtl; int transferIndex; long baseCount; int cellsBusy; }",
"-keepclassmembers class j$.util.concurrent.ConcurrentHashMap$CounterCell { long value; }",
"-keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); }",
"-keeppackagenames j$",
"-keepclassmembers class j$.util.IntSummaryStatistics { long count; long sum; int min; int max; }",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment