Temporarily disable inlining of invokes with nullable receivers
This leads to code size regressions after https://r8-review.googlesource.com/c/r8/+/37005.
Bug: 130202534, 113859358
Change-Id: I5c2a9910e8722a188356dcabdb74dbca10692626
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 15ee862..174753e 100644
--- a/src/main/java/com/android/tools/r8/utils/InternalOptions.java
+++ b/src/main/java/com/android/tools/r8/utils/InternalOptions.java
@@ -143,7 +143,8 @@
public boolean enableNonNullTracking = true;
public boolean enableInlining =
!Version.isDev() || System.getProperty("com.android.tools.r8.disableinlining") == null;
- public boolean enableInliningOfInvokesWithNullableReceivers = true;
+ // TODO(b/130202534): Enable this once code size regressions are fixed.
+ public boolean enableInliningOfInvokesWithNullableReceivers = false;
public boolean enableClassInlining = true;
public boolean enableClassStaticizer = true;
public boolean enableInitializedClassesAnalysis = true;
diff --git a/src/test/java/com/android/tools/r8/ir/optimize/inliner/InlineInvokeWithNullableReceiverTest.java b/src/test/java/com/android/tools/r8/ir/optimize/inliner/InlineInvokeWithNullableReceiverTest.java
index c00b563..bb42f7c 100644
--- a/src/test/java/com/android/tools/r8/ir/optimize/inliner/InlineInvokeWithNullableReceiverTest.java
+++ b/src/test/java/com/android/tools/r8/ir/optimize/inliner/InlineInvokeWithNullableReceiverTest.java
@@ -6,9 +6,8 @@
import static com.android.tools.r8.utils.codeinspector.Matchers.isPresent;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
import com.android.tools.r8.R8TestCompileResult;
import com.android.tools.r8.TestBase;
@@ -67,14 +66,16 @@
assertThat(methodSubject, isPresent());
// A `throw` instruction should have been synthesized into main().
- assertTrue(methodSubject.streamInstructions().anyMatch(InstructionSubject::isThrow));
+ // TODO(b/130202534): Allow inlining.
+ assertFalse(methodSubject.streamInstructions().anyMatch(InstructionSubject::isThrow));
// Class A is still present because the instance flows into a phi that has a null-check.
ClassSubject otherClassSubject = inspector.clazz(A.class);
assertThat(otherClassSubject, isPresent());
// Method A.m() should no longer be present due to inlining.
- assertThat(otherClassSubject.uniqueMethodWithName("m"), not(isPresent()));
+ // TODO(b/130202534): Allow inlining.
+ assertThat(otherClassSubject.uniqueMethodWithName("m"), isPresent());
}
static class TestClass {