Commit d0781232 authored by Eric Stevenson's avatar Eric Stevenson Committed by Commit Bot

Android: Patch R8 to make JNI -checkdiscards work.

Same version, but the local patch now updates the max depth for a
cycle detection search in R8.

This allows -checkdiscard to work for generated JNI wrapper classes.

Bug: 993421
Change-Id: Ib98d3ee31698788d0b0296335ff334dd2c46128f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893987
Auto-Submit: Eric Stevenson <estevenson@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Reviewed-by: default avatarSam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711435}
parent b962e6f4
......@@ -1414,7 +1414,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/r8',
'version': 'IOR6mtzOa3X07B0hIZ5U2prEf0GbTvCdN8no1FjNAtQC',
'version': '7iz_2pdTN2RZRzgoVnxCi1Ro0iUSsEsvXGgmBgXG6z4C',
},
],
'condition': 'checkout_android',
......
......@@ -18,4 +18,6 @@ Turning off outlining because it caused issues when synchronized proguarding
Trichrome due to illegal dex references (crbug.com/956839). Will only be used
for android_apk() targets that set `disable_r8_outlining = true`):
Increase callGraphCycleEliminatorMaxDepthThreshold (b/143685705).
Patch is located at //third_party/r8/local_modifications.diff.
diff --git a/src/main/java/com/android/tools/r8/utils/InternalOptions.java b/src/main/java/com/android/tools/r8/utils/InternalOptions.java
index 89aeb2da4..8ff4f835e 100644
index 89aeb2da4..145f13c05 100644
--- a/src/main/java/com/android/tools/r8/utils/InternalOptions.java
+++ b/src/main/java/com/android/tools/r8/utils/InternalOptions.java
@@ -189,8 +189,8 @@ public class InternalOptions {
......@@ -13,10 +13,19 @@ index 89aeb2da4..8ff4f835e 100644
public boolean enableArgumentRemoval = true;
public boolean enableUnusedArgumentRemoval = true;
public boolean enableUnusedInterfaceRemoval = true;
@@ -217,7 +217,7 @@ public class InternalOptions {
// exceeds the threshold, we treat it as if we have found a cycle. This ensures that we won't run
// into stack overflows when the call graph contains large call chains. This should have a
// negligible impact on code size as long as the threshold is large enough.
- public int callGraphCycleEliminatorMaxDepthThreshold = 256;
+ public int callGraphCycleEliminatorMaxDepthThreshold = Integer.MAX_VALUE;
public int callGraphLikelySpuriousCallEdgeThreshold = 50;
public int classInliningInstructionLimit = 50;
@@ -910,7 +910,7 @@ public class InternalOptions {
public static final String CLASS_NAME = "com.android.tools.r8.GeneratedOutlineSupport";
public static final String METHOD_PREFIX = "outline";
- public boolean enabled = true;
+ public boolean enabled = System.getProperty("com.android.tools.r8.disableOutlining") == null;
public int minSize = 3;
......
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