diff options
author | 2018-12-07 09:25:59 +0000 | |
---|---|---|
committer | 2018-12-07 09:25:59 +0000 | |
commit | 17ed987eeebdebbd1b923c3c2a6887a233cb7517 (patch) | |
tree | 9d137f6e73d2aac0a0403372d4065fd9da0612d6 /runtime/class_loader_utils.h | |
parent | ed8b4ac3d7a78cc4976fa24a34bac92f4fd47a27 (diff) | |
parent | 05909d81d322c0b20445e672c338c626e43f650d (diff) |
Merge "Support class lookup for InMemoryDexClassLoader"
Diffstat (limited to 'runtime/class_loader_utils.h')
-rw-r--r-- | runtime/class_loader_utils.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/class_loader_utils.h b/runtime/class_loader_utils.h index 69476dfb98..562dc47d21 100644 --- a/runtime/class_loader_utils.h +++ b/runtime/class_loader_utils.h @@ -29,7 +29,7 @@ namespace art { // Returns true if the given class loader is either a PathClassLoader or a DexClassLoader. -// (they both have the same behaviour with respect to class lockup order) +// (they both have the same behaviour with respect to class lookup order) inline bool IsPathOrDexClassLoader(ScopedObjectAccessAlreadyRunnable& soa, Handle<mirror::ClassLoader> class_loader) REQUIRES_SHARED(Locks::mutator_lock_) { @@ -41,6 +41,15 @@ inline bool IsPathOrDexClassLoader(ScopedObjectAccessAlreadyRunnable& soa, soa.Decode<mirror::Class>(WellKnownClasses::dalvik_system_DexClassLoader)); } +// Returns true if the given class loader is an InMemoryDexClassLoader. +inline bool IsInMemoryDexClassLoader(ScopedObjectAccessAlreadyRunnable& soa, + Handle<mirror::ClassLoader> class_loader) + REQUIRES_SHARED(Locks::mutator_lock_) { + mirror::Class* class_loader_class = class_loader->GetClass(); + return (class_loader_class == + soa.Decode<mirror::Class>(WellKnownClasses::dalvik_system_InMemoryDexClassLoader)); +} + inline bool IsDelegateLastClassLoader(ScopedObjectAccessAlreadyRunnable& soa, Handle<mirror::ClassLoader> class_loader) REQUIRES_SHARED(Locks::mutator_lock_) { |