Forward AppView to lookupSingleTarget() instead of AppInfo

Change-Id: I19e90d01d1b58bfde296e505556730128da38940
diff --git a/src/main/java/com/android/tools/r8/ir/analysis/ClassInitializationAnalysis.java b/src/main/java/com/android/tools/r8/ir/analysis/ClassInitializationAnalysis.java
index 2567820..83ce19e 100644
--- a/src/main/java/com/android/tools/r8/ir/analysis/ClassInitializationAnalysis.java
+++ b/src/main/java/com/android/tools/r8/ir/analysis/ClassInitializationAnalysis.java
@@ -327,9 +327,8 @@
         return false;
       }
       if (appView.appInfo().hasLiveness()) {
-        AppInfoWithLiveness appInfoWithLiveness = appView.appInfo().withLiveness();
         DexEncodedMethod singleTarget =
-            instruction.lookupSingleTarget(appInfoWithLiveness, context);
+            instruction.lookupSingleTarget(appView.withLiveness(), context);
         if (singleTarget != null) {
           return isTypeInitializedBy(type, singleTarget, appView, mode);
         }
@@ -377,9 +376,8 @@
         return false;
       }
       if (appView.appInfo().hasLiveness()) {
-        AppInfoWithLiveness appInfoWithLiveness = appView.appInfo().withLiveness();
         DexEncodedMethod singleTarget =
-            instruction.lookupSingleTarget(appInfoWithLiveness, context);
+            instruction.lookupSingleTarget(appView.withLiveness(), context);
         if (singleTarget != null) {
           return isTypeInitializedBy(type, singleTarget, appView, mode);
         }
@@ -421,9 +419,8 @@
         return false;
       }
       if (appView.appInfo().hasLiveness()) {
-        AppInfoWithLiveness appInfoWithLiveness = appView.appInfo().withLiveness();
         DexEncodedMethod singleTarget =
-            instruction.lookupSingleTarget(appInfoWithLiveness, context);
+            instruction.lookupSingleTarget(appView.withLiveness(), context);
         if (singleTarget != null) {
           return isTypeInitializedBy(type, singleTarget, appView, mode);
         }
diff --git a/src/main/java/com/android/tools/r8/ir/analysis/InitializedClassesOnNormalExitAnalysis.java b/src/main/java/com/android/tools/r8/ir/analysis/InitializedClassesOnNormalExitAnalysis.java
index 295c39d..f5cd48d 100644
--- a/src/main/java/com/android/tools/r8/ir/analysis/InitializedClassesOnNormalExitAnalysis.java
+++ b/src/main/java/com/android/tools/r8/ir/analysis/InitializedClassesOnNormalExitAnalysis.java
@@ -130,7 +130,7 @@
         InvokeMethod invoke = instruction.asInvokeMethod();
         DexMethod method = invoke.getInvokedMethod();
         if (method.holder.isClassType()) {
-          DexEncodedMethod singleTarget = invoke.lookupSingleTarget(appView.appInfo(), context);
+          DexEncodedMethod singleTarget = invoke.lookupSingleTarget(appView, context);
           if (singleTarget != null) {
             markInitializedOnNormalExit(singleTarget.method.holder);
             markInitializedOnNormalExit(
diff --git a/src/main/java/com/android/tools/r8/ir/analysis/type/TypeAnalysis.java b/src/main/java/com/android/tools/r8/ir/analysis/type/TypeAnalysis.java
index 4c76daf..9708b35 100644
--- a/src/main/java/com/android/tools/r8/ir/analysis/type/TypeAnalysis.java
+++ b/src/main/java/com/android/tools/r8/ir/analysis/type/TypeAnalysis.java
@@ -167,12 +167,12 @@
   }
 
   public static DexType getRefinedReceiverType(
-      AppInfoWithSubtyping appInfo, InvokeMethodWithReceiver invoke) {
+      AppView<? extends AppInfoWithSubtyping> appView, InvokeMethodWithReceiver invoke) {
     DexType receiverType = invoke.getInvokedMethod().holder;
     TypeLatticeElement lattice = invoke.getReceiver().getTypeLattice();
     if (lattice.isClassType()) {
       DexType refinedType = lattice.asClassTypeLatticeElement().getClassType();
-      if (appInfo.isSubtype(refinedType, receiverType)) {
+      if (appView.appInfo().isSubtype(refinedType, receiverType)) {
         return refinedType;
       }
     }
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokeDirect.java b/src/main/java/com/android/tools/r8/ir/code/InvokeDirect.java
index c83feae..c1f12a1 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokeDirect.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokeDirect.java
@@ -112,15 +112,15 @@
   }
 
   @Override
-  public DexEncodedMethod lookupSingleTarget(AppInfoWithLiveness appInfo,
-      DexType invocationContext) {
-    return appInfo.lookupDirectTarget(getInvokedMethod());
+  public DexEncodedMethod lookupSingleTarget(
+      AppView<AppInfoWithLiveness> appView, DexType invocationContext) {
+    return appView.appInfo().lookupDirectTarget(getInvokedMethod());
   }
 
   @Override
-  public Collection<DexEncodedMethod> lookupTargets(AppInfoWithSubtyping appInfo,
-      DexType invocationContext) {
-    DexEncodedMethod target = appInfo.lookupDirectTarget(getInvokedMethod());
+  public Collection<DexEncodedMethod> lookupTargets(
+      AppView<? extends AppInfoWithSubtyping> appView, DexType invocationContext) {
+    DexEncodedMethod target = appView.appInfo().lookupDirectTarget(getInvokedMethod());
     return target == null ? Collections.emptyList() : Collections.singletonList(target);
   }
 
@@ -164,8 +164,8 @@
 
     // Find the target and check if the invoke may have side effects.
     if (appView.appInfo().hasLiveness()) {
-      AppInfoWithLiveness appInfoWithLiveness = appView.appInfo().withLiveness();
-      DexEncodedMethod target = lookupSingleTarget(appInfoWithLiveness, context);
+      AppView<AppInfoWithLiveness> appViewWithLiveness = appView.withLiveness();
+      DexEncodedMethod target = lookupSingleTarget(appViewWithLiveness, context);
       if (target == null) {
         return true;
       }
@@ -188,7 +188,7 @@
       if (clazz.isProgramClass()) {
         targetMayHaveSideEffects =
             target.getOptimizationInfo().mayHaveSideEffects()
-                && !appInfoWithLiveness.noSideEffects.containsKey(target.method);
+                && !appViewWithLiveness.appInfo().noSideEffects.containsKey(target.method);
       } else {
         targetMayHaveSideEffects =
             !appView.dexItemFactory().libraryMethodsWithoutSideEffects.contains(target.method);
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokeInterface.java b/src/main/java/com/android/tools/r8/ir/code/InvokeInterface.java
index e3a50ee..7c4b0aa 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokeInterface.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokeInterface.java
@@ -84,17 +84,17 @@
   }
 
   @Override
-  public DexEncodedMethod lookupSingleTarget(AppInfoWithLiveness appInfo,
-      DexType invocationContext) {
-    DexType refinedReceiverType = TypeAnalysis.getRefinedReceiverType(appInfo, this);
+  public DexEncodedMethod lookupSingleTarget(
+      AppView<AppInfoWithLiveness> appView, DexType invocationContext) {
+    DexType refinedReceiverType = TypeAnalysis.getRefinedReceiverType(appView, this);
     DexMethod method = getInvokedMethod();
-    return appInfo.lookupSingleInterfaceTarget(method, refinedReceiverType);
+    return appView.appInfo().lookupSingleInterfaceTarget(method, refinedReceiverType);
   }
 
   @Override
-  public Collection<DexEncodedMethod> lookupTargets(AppInfoWithSubtyping appInfo,
-      DexType invocationContext) {
-    return appInfo.lookupInterfaceTargets(getInvokedMethod());
+  public Collection<DexEncodedMethod> lookupTargets(
+      AppView<? extends AppInfoWithSubtyping> appView, DexType invocationContext) {
+    return appView.appInfo().lookupInterfaceTargets(getInvokedMethod());
   }
 
   @Override
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokeMethod.java b/src/main/java/com/android/tools/r8/ir/code/InvokeMethod.java
index e5cb4ff..a0aa95f 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokeMethod.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokeMethod.java
@@ -59,10 +59,10 @@
   // In subclasses, e.g., invoke-virtual or invoke-super, use a narrower receiver type by using
   // receiver type and calling context---the holder of the method where the current invocation is.
   public abstract DexEncodedMethod lookupSingleTarget(
-      AppInfoWithLiveness appInfo, DexType invocationContext);
+      AppView<AppInfoWithLiveness> appView, DexType invocationContext);
 
   public abstract Collection<DexEncodedMethod> lookupTargets(
-      AppInfoWithSubtyping appInfo, DexType invocationContext);
+      AppView<? extends AppInfoWithSubtyping> appView, DexType invocationContext);
 
   public abstract InlineAction computeInlining(
       InliningOracle decider,
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokePolymorphic.java b/src/main/java/com/android/tools/r8/ir/code/InvokePolymorphic.java
index 2a57198..b907b81 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokePolymorphic.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokePolymorphic.java
@@ -6,6 +6,7 @@
 import com.android.tools.r8.cf.code.CfInvoke;
 import com.android.tools.r8.code.InvokePolymorphicRange;
 import com.android.tools.r8.graph.AppInfoWithSubtyping;
+import com.android.tools.r8.graph.AppView;
 import com.android.tools.r8.graph.DexEncodedMethod;
 import com.android.tools.r8.graph.DexItemFactory;
 import com.android.tools.r8.graph.DexMethod;
@@ -112,15 +113,15 @@
   }
 
   @Override
-  public DexEncodedMethod lookupSingleTarget(AppInfoWithLiveness appInfo,
-      DexType invocationContext) {
+  public DexEncodedMethod lookupSingleTarget(
+      AppView<AppInfoWithLiveness> appView, DexType invocationContext) {
     // TODO(herhut): Implement lookup target for invokePolymorphic.
     return null;
   }
 
   @Override
-  public Collection<DexEncodedMethod> lookupTargets(AppInfoWithSubtyping appInfo,
-      DexType invocationContext) {
+  public Collection<DexEncodedMethod> lookupTargets(
+      AppView<? extends AppInfoWithSubtyping> appView, DexType invocationContext) {
     // TODO(herhut): Implement lookup target for invokePolymorphic.
     return null;
   }
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java b/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java
index f61f2ee..ed1ba571 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java
@@ -96,16 +96,16 @@
   }
 
   @Override
-  public DexEncodedMethod lookupSingleTarget(AppInfoWithLiveness appInfo,
-      DexType invocationContext) {
+  public DexEncodedMethod lookupSingleTarget(
+      AppView<AppInfoWithLiveness> appView, DexType invocationContext) {
     DexMethod method = getInvokedMethod();
-    return appInfo.lookupStaticTarget(method);
+    return appView.appInfo().lookupStaticTarget(method);
   }
 
   @Override
-  public Collection<DexEncodedMethod> lookupTargets(AppInfoWithSubtyping appInfo,
-      DexType invocationContext) {
-    DexEncodedMethod target = appInfo.lookupStaticTarget(getInvokedMethod());
+  public Collection<DexEncodedMethod> lookupTargets(
+      AppView<? extends AppInfoWithSubtyping> appView, DexType invocationContext) {
+    DexEncodedMethod target = appView.appInfo().lookupStaticTarget(getInvokedMethod());
     return target == null ? Collections.emptyList() : Collections.singletonList(target);
   }
 
@@ -151,8 +151,8 @@
 
     // Find the target and check if the invoke may have side effects.
     if (appView.appInfo().hasLiveness()) {
-      AppInfoWithLiveness appInfoWithLiveness = appView.appInfo().withLiveness();
-      DexEncodedMethod target = lookupSingleTarget(appInfoWithLiveness, context);
+      AppView<AppInfoWithLiveness> appViewWithLiveness = appView.withLiveness();
+      DexEncodedMethod target = lookupSingleTarget(appViewWithLiveness, context);
       if (target == null) {
         return true;
       }
@@ -166,7 +166,7 @@
       // Verify that the target method does not have side-effects.
       boolean targetMayHaveSideEffects =
           target.getOptimizationInfo().mayHaveSideEffects()
-              && !appInfoWithLiveness.noSideEffects.containsKey(target.method);
+              && !appViewWithLiveness.appInfo().noSideEffects.containsKey(target.method);
       if (targetMayHaveSideEffects) {
         return true;
       }
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokeSuper.java b/src/main/java/com/android/tools/r8/ir/code/InvokeSuper.java
index a670e56..594b59d 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokeSuper.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokeSuper.java
@@ -92,22 +92,23 @@
   }
 
   @Override
-  public DexEncodedMethod lookupSingleTarget(AppInfoWithLiveness appInfo,
-      DexType invocationContext) {
+  public DexEncodedMethod lookupSingleTarget(
+      AppView<AppInfoWithLiveness> appView, DexType invocationContext) {
     if (invocationContext == null) {
       return null;
     }
-    if (!appInfo.isSubtype(invocationContext, getInvokedMethod().holder)) {
+    if (!appView.appInfo().isSubtype(invocationContext, getInvokedMethod().holder)) {
       return null;
     } else {
-      return appInfo.lookupSuperTarget(getInvokedMethod(), invocationContext);
+      return appView.appInfo().lookupSuperTarget(getInvokedMethod(), invocationContext);
     }
   }
 
   @Override
-  public Collection<DexEncodedMethod> lookupTargets(AppInfoWithSubtyping appInfo,
-      DexType invocationContext) {
-    DexEncodedMethod target = appInfo.lookupSuperTarget(getInvokedMethod(), invocationContext);
+  public Collection<DexEncodedMethod> lookupTargets(
+      AppView<? extends AppInfoWithSubtyping> appView, DexType invocationContext) {
+    DexEncodedMethod target =
+        appView.appInfo().lookupSuperTarget(getInvokedMethod(), invocationContext);
     return target == null ? Collections.emptyList() : Collections.singletonList(target);
   }
 
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokeVirtual.java b/src/main/java/com/android/tools/r8/ir/code/InvokeVirtual.java
index 7caf823..04453b9 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokeVirtual.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokeVirtual.java
@@ -84,17 +84,17 @@
   }
 
   @Override
-  public DexEncodedMethod lookupSingleTarget(AppInfoWithLiveness appInfo,
-      DexType invocationContext) {
-    DexType refinedReceiverType = TypeAnalysis.getRefinedReceiverType(appInfo, this);
+  public DexEncodedMethod lookupSingleTarget(
+      AppView<AppInfoWithLiveness> appView, DexType invocationContext) {
+    DexType refinedReceiverType = TypeAnalysis.getRefinedReceiverType(appView, this);
     DexMethod method = getInvokedMethod();
-    return appInfo.lookupSingleVirtualTarget(method, refinedReceiverType);
+    return appView.appInfo().lookupSingleVirtualTarget(method, refinedReceiverType);
   }
 
   @Override
-  public Collection<DexEncodedMethod> lookupTargets(AppInfoWithSubtyping appInfo,
-      DexType invocationContext) {
-    return appInfo.lookupVirtualTargets(getInvokedMethod());
+  public Collection<DexEncodedMethod> lookupTargets(
+      AppView<? extends AppInfoWithSubtyping> appView, DexType invocationContext) {
+    return appView.appInfo().lookupVirtualTargets(getInvokedMethod());
   }
 
   @Override
diff --git a/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java b/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java
index c2fee10..3e3a21c 100644
--- a/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java
+++ b/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java
@@ -538,7 +538,7 @@
       GraphLenseLookupResult result = graphLense.lookupMethod(method, source.method, type);
       method = result.getMethod();
       type = result.getType();
-      DexEncodedMethod definition = appInfo.lookup(type, method, source.method.holder);
+      DexEncodedMethod definition = appInfo.lookupSingleTarget(type, method, source.method.holder);
       if (definition != null) {
         assert !source.accessFlags.isBridge() || definition != caller.method;
         DexClass clazz = appInfo.definitionFor(definition.method.holder);
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java b/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java
index 6e195e7..2c88604 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java
@@ -86,7 +86,6 @@
 import com.android.tools.r8.ir.optimize.SwitchUtils.EnumSwitchInfo;
 import com.android.tools.r8.ir.regalloc.LinearScanRegisterAllocator;
 import com.android.tools.r8.kotlin.Kotlin;
-import com.android.tools.r8.shaking.AppInfoWithLiveness;
 import com.android.tools.r8.utils.InternalOptions;
 import com.android.tools.r8.utils.InternalOutputMode;
 import com.android.tools.r8.utils.LongInterval;
@@ -1603,7 +1602,6 @@
     if (options.isGeneratingClassFiles()) {
       return;
     }
-    AppInfoWithLiveness appInfoWithLiveness = appView.appInfo().withLiveness();
     Set<Value> needToWidenValues = Sets.newIdentityHashSet();
     Set<Value> needToNarrowValues = Sets.newIdentityHashSet();
     Set<BasicBlock> blocksToBeRemoved = Sets.newIdentityHashSet();
@@ -1646,9 +1644,9 @@
                 outValue.replaceUsers(invoke.arguments().get(0));
                 invoke.setOutValue(null);
               }
-            } else if (appInfoWithLiveness != null) {
+            } else if (appView.appInfo().hasLiveness()) {
               DexEncodedMethod target =
-                  invoke.lookupSingleTarget(appInfoWithLiveness, code.method.method.holder);
+                  invoke.lookupSingleTarget(appView.withLiveness(), code.method.method.holder);
               if (target != null) {
                 DexMethod invokedMethod = target.method;
                 // Check if the invoked method is known to return one of its arguments.
@@ -3174,8 +3172,7 @@
   // null value (which should result in NPE). Note that this throw is not
   // expected to be ever reached, but is intended to satisfy verifier.
   public void processMethodsNeverReturningNormally(IRCode code) {
-    AppInfoWithLiveness appInfoWithLiveness = appView.appInfo().withLiveness();
-    if (appInfoWithLiveness == null) {
+    if (!appView.appInfo().hasLiveness()) {
       return;
     }
 
@@ -3192,8 +3189,9 @@
           continue;
         }
 
-        DexEncodedMethod singleTarget = insn.asInvokeMethod().lookupSingleTarget(
-            appInfoWithLiveness, code.method.method.holder);
+        InvokeMethod invoke = insn.asInvokeMethod();
+        DexEncodedMethod singleTarget =
+            invoke.lookupSingleTarget(appView.withLiveness(), code.method.method.holder);
         if (singleTarget == null || !singleTarget.getOptimizationInfo().neverReturnsNormally()) {
           continue;
         }
@@ -3221,7 +3219,7 @@
 
         // Insert 'null' constant.
         ConstNumber nullConstant = code.createConstNull(gotoInsn.getLocalInfo());
-        nullConstant.setPosition(insn.getPosition());
+        nullConstant.setPosition(invoke.getPosition());
         throwNullInsnIterator.add(nullConstant);
 
         // Replace Goto with Throw.
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/DefaultInliningOracle.java b/src/main/java/com/android/tools/r8/ir/optimize/DefaultInliningOracle.java
index ec51998..45ca347 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/DefaultInliningOracle.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/DefaultInliningOracle.java
@@ -71,8 +71,7 @@
   }
 
   private DexEncodedMethod validateCandidate(InvokeMethod invoke, DexType invocationContext) {
-    DexEncodedMethod candidate =
-        invoke.lookupSingleTarget(inliner.appView.appInfo(), invocationContext);
+    DexEncodedMethod candidate = invoke.lookupSingleTarget(inliner.appView, invocationContext);
     if ((candidate == null)
         || (candidate.getCode() == null)
         || inliner.appView.definitionFor(candidate.method.holder).isNotProgramClass()) {
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/Devirtualizer.java b/src/main/java/com/android/tools/r8/ir/optimize/Devirtualizer.java
index af2b34e..817e00a 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/Devirtualizer.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/Devirtualizer.java
@@ -109,7 +109,7 @@
           continue;
         }
         InvokeInterface invoke = current.asInvokeInterface();
-        DexEncodedMethod target = invoke.lookupSingleTarget(appView.appInfo(), invocationContext);
+        DexEncodedMethod target = invoke.lookupSingleTarget(appView, invocationContext);
         if (target == null) {
           continue;
         }
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/MemberValuePropagation.java b/src/main/java/com/android/tools/r8/ir/optimize/MemberValuePropagation.java
index 73facc3..f5d6d47 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/MemberValuePropagation.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/MemberValuePropagation.java
@@ -208,7 +208,7 @@
     //   call targets has a matching rule?
     // TODO(b/130804193): using refined receiver type for InvokeMethodWithReceiver?
     DexEncodedMethod definition =
-        appView.appInfo().lookup(current.getType(), invokedMethod, callingContext);
+        appView.appInfo().lookupSingleTarget(current.getType(), invokedMethod, callingContext);
     ProguardMemberRuleLookup lookup = lookupMemberRule(definition);
     boolean invokeReplaced = false;
     if (lookup != null) {
@@ -228,7 +228,7 @@
       return;
     }
     // No Proguard rule could replace the instruction check for knowledge about the return value.
-    DexEncodedMethod target = current.lookupSingleTarget(appView.appInfo(), callingContext);
+    DexEncodedMethod target = current.lookupSingleTarget(appView, callingContext);
     if (target == null || !mayPropagateValueFor(target)) {
       return;
     }
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/NonNullTracker.java b/src/main/java/com/android/tools/r8/ir/optimize/NonNullTracker.java
index 57a1653..856ac33 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/NonNullTracker.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/NonNullTracker.java
@@ -94,8 +94,7 @@
             singleTarget =
                 current
                     .asInvokeMethod()
-                    .lookupSingleTarget(
-                        appView.appInfo().withLiveness(), code.method.method.holder);
+                    .lookupSingleTarget(appView.withLiveness(), code.method.method.holder);
           } else {
             // Even in D8, invoke-{direct|static} can be resolved without liveness.
             // Due to the incremental compilation, though, it is allowed only if the holder of the
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/UninstantiatedTypeOptimization.java b/src/main/java/com/android/tools/r8/ir/optimize/UninstantiatedTypeOptimization.java
index 688fac0..8f2ef40 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/UninstantiatedTypeOptimization.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/UninstantiatedTypeOptimization.java
@@ -514,8 +514,7 @@
       InstructionListIterator instructionIterator,
       IRCode code,
       Set<BasicBlock> blocksToBeRemoved) {
-    DexEncodedMethod target =
-        invoke.lookupSingleTarget(appView.appInfo(), code.method.method.holder);
+    DexEncodedMethod target = invoke.lookupSingleTarget(appView, code.method.method.holder);
     if (target == null) {
       return;
     }
@@ -533,5 +532,4 @@
       }
     }
   }
-
 }
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/classinliner/InlineCandidateProcessor.java b/src/main/java/com/android/tools/r8/ir/optimize/classinliner/InlineCandidateProcessor.java
index 2f2754a..c09a2da 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/classinliner/InlineCandidateProcessor.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/classinliner/InlineCandidateProcessor.java
@@ -879,7 +879,7 @@
   private DexEncodedMethod findSingleTarget(InvokeMethod invoke) {
     if (isExtraMethodCall(invoke)) {
       DexType invocationContext = method.method.holder;
-      return invoke.lookupSingleTarget(appView.appInfo(), invocationContext);
+      return invoke.lookupSingleTarget(appView, invocationContext);
     }
     // We don't use computeSingleTarget(...) on invoke since it sometimes fails to
     // find the single target, while this code may be more successful since we exactly
diff --git a/src/main/java/com/android/tools/r8/shaking/AppInfoWithLiveness.java b/src/main/java/com/android/tools/r8/shaking/AppInfoWithLiveness.java
index 303303e..7d05a19 100644
--- a/src/main/java/com/android/tools/r8/shaking/AppInfoWithLiveness.java
+++ b/src/main/java/com/android/tools/r8/shaking/AppInfoWithLiveness.java
@@ -794,7 +794,8 @@
     return prunedTypes;
   }
 
-  public DexEncodedMethod lookup(Type type, DexMethod target, DexType invocationContext) {
+  public DexEncodedMethod lookupSingleTarget(
+      Type type, DexMethod target, DexType invocationContext) {
     assert checkIfObsolete();
     DexType holder = target.holder;
     if (!holder.isClassType()) {