Enable same-file policy for R8 optimizations

While this does increase dex size for optimized targets by limiting the
scope of class merging, it also
  1) improves actionability of unretraced stack frames
  2) improves accountability for size increases
  3) tends to decrease compiled code sizes for impacted targets
  4) marginally (~1%) decreases RSS

Improvements in tooling should mitigate (1) and (2), and more targeted
use of @NeverInline can mitigate (3). Until such time, the pros seem to
outweigh the cons, so we enable the policy as a temporary measure.

Bug: 264916934
Test: m
Change-Id: Id63a17955692b75b16c42d9c85b55bae409c0da4
This commit is contained in:
Jared Duke
2023-01-27 10:45:46 -08:00
parent bb258f4a6d
commit a1b8b9bab9

View File

@@ -98,6 +98,8 @@ func init() {
"-JXmx2048M",
// Disable this optimization as it can impact weak reference semantics. See b/233432839.
"-JDcom.android.tools.r8.disableEnqueuerDeferredTracing=true",
// Disable class merging across different files to improve attribution. See b/242881914.
"-JDcom.android.tools.r8.enableSameFilePolicy=true",
}, dexerJavaVmFlagsList...))
exportedVars.ExportStringListStaticVariable("CommonJdkFlags", []string{