Revert "Revert incorrect refactor." This reverts commit 3b6af16133dc3544069fbfbc6c30ec3bd601dcfe. Reason for revert: test failures Change-Id: Ibfc074ad3172751723e84f1f572ce60f4a5cbdf9
diff --git a/src/main/java/com/android/tools/r8/optimize/bridgehoisting/BridgeHoisting.java b/src/main/java/com/android/tools/r8/optimize/bridgehoisting/BridgeHoisting.java index b6236d8..7c07af0 100644 --- a/src/main/java/com/android/tools/r8/optimize/bridgehoisting/BridgeHoisting.java +++ b/src/main/java/com/android/tools/r8/optimize/bridgehoisting/BridgeHoisting.java
@@ -154,7 +154,8 @@ // If the method is defined on the parent class, we cannot hoist the bridge. // TODO(b/153147967): If the declared method is abstract, we could replace it by the bridge. // Add a test. - if (clazz.lookupProgramMethod(method) != null) { + ProgramMethod programMethod = clazz.lookupProgramMethod(method); + if (programMethod != null) { return; } @@ -278,8 +279,8 @@ representative.getReference()); // Remove all of the bridges in the eligible subclasses. - assert !appView.appInfo().isPinnedWithDefinitionLookup(method); for (DexProgramClass subclass : eligibleSubclasses) { + assert !appView.appInfo().isPinned(programMethod); DexEncodedMethod removed = subclass.removeMethod(method); assert removed != null; }