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.h b/src/class_linker.h
index fd404c1..096d602 100644
--- a/src/class_linker.h
+++ b/src/class_linker.h
@@ -337,9 +337,9 @@
GetClassRoot(kJavaLangReflectMethodArrayClass), length);
}
- ObjectArray<InterfaceEntry>* AllocIfTable(Thread* self, size_t length)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return ObjectArray<InterfaceEntry>::Alloc(self, GetClassRoot(kObjectArrayArrayClass), length);
+ IfTable* AllocIfTable(Thread* self, size_t ifcount) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ return down_cast<IfTable*>(
+ IfTable::Alloc(self, GetClassRoot(kObjectArrayClass), ifcount * IfTable::kMax));
}
ObjectArray<Field>* AllocFieldArray(Thread* self, size_t length)
@@ -412,9 +412,6 @@
Method* AllocMethod(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
Constructor* AllocConstructor(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- InterfaceEntry* AllocInterfaceEntry(Thread* self, Class* interface)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
-
Class* CreatePrimitiveClass(Thread* self, Primitive::Type type)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
return InitializePrimitiveClass(AllocClass(self, sizeof(Class)), type);
@@ -574,7 +571,6 @@
kJavaLangObject,
kClassArrayClass,
kObjectArrayClass,
- kObjectArrayArrayClass,
kJavaLangString,
kJavaLangDexCache,
kJavaLangRefReference,
@@ -637,7 +633,7 @@
return descriptor;
}
- ObjectArray<InterfaceEntry>* array_iftable_;
+ IfTable* array_iftable_;
bool init_done_;