Flatten interface entries into the iftable.

Avoid an indirection when scanning the iftable by inlining the interface
entry into the iftable.
Copy the iftable for marker interfaces from parents to their children
(for example for exceptions).
Don't allocate method arrays for 0 element interface method tables.

Change-Id: I8402960d4ddbe4b1ffd335ed4ce4b4825210fd0d
diff --git a/src/class_linker_test.cc b/src/class_linker_test.cc
index 02512eb..1c41f3b 100644
--- a/src/class_linker_test.cc
+++ b/src/class_linker_test.cc
@@ -127,7 +127,7 @@
     EXPECT_EQ(2U, kh.NumDirectInterfaces());
     EXPECT_TRUE(array->GetVTable() != NULL);
     EXPECT_EQ(2, array->GetIfTableCount());
-    ObjectArray<InterfaceEntry>* iftable = array->GetIfTable();
+    IfTable* iftable = array->GetIfTable();
     ASSERT_TRUE(iftable != NULL);
     kh.ChangeClass(kh.GetDirectInterface(0));
     EXPECT_STREQ(kh.GetDescriptor(), "Ljava/lang/Cloneable;");
@@ -202,17 +202,14 @@
       }
     }
     EXPECT_EQ(klass->IsInterface(), klass->GetVTable() == NULL);
+    const IfTable* iftable = klass->GetIfTable();
     for (int i = 0; i < klass->GetIfTableCount(); i++) {
-      const InterfaceEntry* interface_entry = klass->GetIfTable()->Get(i);
-      ASSERT_TRUE(interface_entry != NULL);
-      Class* interface = interface_entry->GetInterface();
+      Class* interface = iftable->GetInterface(i);
       ASSERT_TRUE(interface != NULL);
-      EXPECT_TRUE(interface_entry->GetInterface() != NULL);
       if (klass->IsInterface()) {
-        EXPECT_EQ(0U, interface_entry->GetMethodArrayCount());
+        EXPECT_EQ(0U, iftable->GetMethodArrayCount(i));
       } else {
-        CHECK_EQ(interface->NumVirtualMethods(), interface_entry->GetMethodArrayCount());
-        EXPECT_EQ(interface->NumVirtualMethods(), interface_entry->GetMethodArrayCount());
+        EXPECT_EQ(interface->NumVirtualMethods(), iftable->GetMethodArrayCount(i));
       }
     }
     if (klass->IsAbstract()) {