ART: Add interface class join heuristic

Do not treat interfaces as regular classes. This will always
lead to a join of java.lang.Object, rejecting semantically
valid programs.

We want to retain IMT dispatch, forcing us to verify interface
assigment. In the absence of set types, the result is ambiguous
and not well defined. In a best effort, attempt to find a joint
interface by walking the interface tables of the join arguments
backwards.

In the case of two non-interface classes, we still prefer the
class hierarchy.

Bug: 69826014
Test: m test-art-host-gtest-reg_type_test
Change-Id: I7e0086f045e5bb2a7c3ee3464de45fc5b02f4d3f
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 5c7ec81..6ec09fc 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -243,6 +243,7 @@
 ART_GTEST_dex_to_dex_decompiler_test_DEX_DEPS := VerifierDeps DexToDexDecompiler
 ART_GTEST_oatdump_app_test_DEX_DEPS := ProfileTestMultiDex
 ART_GTEST_oatdump_test_DEX_DEPS := ProfileTestMultiDex
+ART_GTEST_reg_type_test_DEX_DEPS := Interfaces
 
 # The elf writer test has dependencies on core.oat.
 ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)