diff options
| author | 2018-01-03 15:47:24 +0000 | |
|---|---|---|
| committer | 2018-01-03 15:47:24 +0000 | |
| commit | b0ddceb337f614dc2600d19b82fb4a6596aa7d4c (patch) | |
| tree | ed9d3cb8668c54b0274653de2bbd7c90b08fa3ea /runtime/class_linker.cc | |
| parent | 00359cd27da40020e0a539515590fac3a46be1e4 (diff) | |
| parent | 38b8b25b7deff92627586405c80182a19e7c18f9 (diff) | |
Merge changes Idd405a2c,I7052da55
* changes:
ART: Faster type check bitstring initialization.
Replace TypeStaticIf<> with std::conditional<> (C++11).
Diffstat (limited to 'runtime/class_linker.cc')
| -rw-r--r-- | runtime/class_linker.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 192517fc5d..727dd14d6a 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -462,10 +462,8 @@ bool ClassLinker::InitWithoutImage(std::vector<std::unique_ptr<const DexFile>> b // // We take the lock here to avoid using NO_THREAD_SAFETY_ANALYSIS. MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_); - mirror::Class* java_lang_Object_ptr = java_lang_Object.Get(); - SubtypeCheck<mirror::Class*>::EnsureInitialized(java_lang_Object_ptr); - mirror::Class* java_lang_Class_ptr = java_lang_Class.Get(); - SubtypeCheck<mirror::Class*>::EnsureInitialized(java_lang_Class_ptr); + SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(java_lang_Object.Get()); + SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(java_lang_Class.Get()); } // Object[] next to hold class roots. @@ -1872,8 +1870,7 @@ bool ClassLinker::AddImageSpace( ScopedTrace trace("Recalculate app image SubtypeCheck bitstrings"); MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_); for (const ClassTable::TableSlot& root : temp_set) { - mirror::Class* root_klass = root.Read(); - SubtypeCheck<mirror::Class*>::EnsureInitialized(root_klass); + SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(root.Read()); } } } @@ -5220,8 +5217,7 @@ bool ClassLinker::EnsureInitialized(Thread* self, // or Overflowed (can be used as a source for IsSubClass check). { MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_); - ObjPtr<mirror::Class> c_ptr(c.Get()); - SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(c_ptr); + SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(c.Get()); // TODO: Avoid taking subtype_check_lock_ if SubtypeCheck is already initialized. } const bool success = InitializeClass(self, c, can_init_fields, can_init_parents); |