Prevent entering IMT conflict trampoline with j.l.Object methods.
This ensures that only interface methods enter the trampoline.
Test: 725-imt-conflict-object
Change-Id: Id730d921f213ee0f6d927dea5df69d57be431df0
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 95c9ffc..5356637 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -2453,6 +2453,11 @@
}
}
+ // The compiler and interpreter make sure the conflict trampoline is never
+ // called on a method that resolves to j.l.Object.
+ CHECK(!interface_method->GetDeclaringClass()->IsObjectClass());
+ CHECK(interface_method->GetDeclaringClass()->IsInterface());
+
DCHECK(!interface_method->IsRuntimeMethod());
// Look whether we have a match in the ImtConflictTable.
uint32_t imt_index = interface_method->GetImtIndex();