diff options
author | 2015-11-09 11:16:49 -0800 | |
---|---|---|
committer | 2016-01-22 15:01:55 -0800 | |
commit | f7fd970244f143b1abb956e29794c446e4d57f46 (patch) | |
tree | aac1f57ac70747957f609bb46305dfeca87645a1 /runtime/class_table.cc | |
parent | 95005291d8ebdd1d2ac58ffc5181fef4fbbf2383 (diff) |
Load app images
Support in-place patching of the app image based on boot image
location and app oat location. Only loads for art run test so far
since we do not automatically generate app images for app installs.
N5 maps launch time (~200 runs):
Before: 930ms
After: 878.18ms
After + image class table: 864.57ms
TODO:
Oatdump support.
Store class loaders as class roots in image.
Bug: 22858531
Change-Id: I9cbc645645e62ea2ed1ad8e139e91af7d88514c1
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 |