summaryrefslogtreecommitdiff
path: root/runtime/class_linker.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-12-19 17:32:17 +0000
committer Vladimir Marko <vmarko@google.com> 2017-01-12 11:05:16 +0000
commitafbd71ffbcc7b37067d3a4703648e62fc0e55e6f (patch)
treed2c194d57b794ee7281763cb41c8f52b9b2c7322 /runtime/class_linker.h
parent263cc99a5f7a2cc81094e18b08eaa66ceed3dd1b (diff)
Refactor ClassLinker::LinkInterfaceMethods().
Add a helper class and split LinkInterfaceMethods() into several functions to improve readability. Even with this change, it is still almost 250 lines long. Fix the method array reallocation to use the appropriate linear allocator for the class's defining loader. Given that this is a native reallocation, failure to reallocate would result in an abort, so CHECK() that we get a non-null array instead of expecting a null and asserting a pending OOME. Test: m test-art-host Change-Id: I8ff8257e4271ae8c975ea4b33fd8af36e1a1f77e
Diffstat (limited to 'runtime/class_linker.h')
-rw-r--r--runtime/class_linker.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index 9b25303b65..20fba13058 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -652,6 +652,8 @@ class ClassLinker {
};
private:
+ class LinkInterfaceMethodsHelper;
+
struct ClassLoaderData {
jweak weak_root; // Weak root to enable class unloading.
ClassTable* class_table;
@@ -1089,6 +1091,12 @@ class ClassLinker {
REQUIRES(!Locks::dex_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
+ // Allocate method arrays for interfaces.
+ bool AllocateIfTableMethodArrays(Thread* self,
+ Handle<mirror::Class> klass,
+ Handle<mirror::IfTable> iftable)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
// Sets imt_ref appropriately for LinkInterfaceMethods.
// If there is no method in the imt location of imt_ref it will store the given method there.
// Otherwise it will set the conflict method which will figure out which method to use during