diff options
| author | 2016-01-25 22:29:54 +0000 | |
|---|---|---|
| committer | 2016-01-25 22:29:54 +0000 | |
| commit | 1af0204dddc1d99dc17a13eca135c1b57023c1c3 (patch) | |
| tree | c728b9039a71db3be9cae888ad5e1afc31f34a13 /runtime/class_table.cc | |
| parent | c7f4e3a5aeaa23342b4e03b0d751f60ac5c5815c (diff) | |
| parent | fbc31087932a65e036a153afab3049dc5298656a (diff) | |
Merge "Revert "Revert "Load app images"""
Diffstat (limited to 'runtime/class_table.cc')
| -rw-r--r-- | runtime/class_table.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc index df2dbf416c..2a4f0e01af 100644 --- a/runtime/class_table.cc +++ b/runtime/class_table.cc @@ -40,6 +40,16 @@ bool ClassTable::Contains(mirror::Class* klass) { return false; } +mirror::Class* ClassTable::LookupByDescriptor(mirror::Class* klass) { + for (ClassSet& class_set : classes_) { + auto it = class_set.Find(GcRoot<mirror::Class>(klass)); + if (it != class_set.end()) { + return it->Read(); + } + } + return nullptr; +} + mirror::Class* ClassTable::UpdateClass(const char* descriptor, mirror::Class* klass, size_t hash) { // Should only be updating latest table. auto existing_it = classes_.back().FindWithHash(descriptor, hash); @@ -173,4 +183,12 @@ size_t ClassTable::ReadFromMemory(uint8_t* ptr) { return read_count; } +void ClassTable::SetClassLoader(mirror::ClassLoader* class_loader) { + for (const ClassSet& class_set : classes_) { + for (const GcRoot<mirror::Class>& root : class_set) { + root.Read()->SetClassLoader(class_loader); + } + } +} + } // namespace art |