diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-09-04 18:33:17 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-09-08 18:14:42 -0700 |
commit | 6bcae8fa93684af581d16400f360541d39e5b5e6 (patch) | |
tree | 88f99458a0141805acee3f730a0709542283698e /runtime/mirror | |
parent | 30cbbee37d9fcca1a39b3681434180102ee5251a (diff) | |
download | art-6bcae8fa93684af581d16400f360541d39e5b5e6.zip art-6bcae8fa93684af581d16400f360541d39e5b5e6.tar.gz art-6bcae8fa93684af581d16400f360541d39e5b5e6.tar.bz2 |
Add fast path for FindClass using the type dex file.
If we are using the PathClassLoader with a BootClassLoader
parent, we can handle the common case in the FindClass function
without needing to go back to java code.
Around 10% speedup measured of maps launch, could be noise due to
large variation of app launch times. Eliminates defineClassNative
from being anywhere near the top of sampling profiles.
Bug: 17397179
Bug: 16828525
(cherry picked from commit 8a39e7fe02e9a81853dc7a75cb50d9ece07a9b37)
Change-Id: I1f31de76c1b1a53e32173b1e61a59b0e2f267c98
Diffstat (limited to 'runtime/mirror')
-rw-r--r-- | runtime/mirror/class_loader.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/mirror/class_loader.h b/runtime/mirror/class_loader.h index f3594e4..ff2ad89 100644 --- a/runtime/mirror/class_loader.h +++ b/runtime/mirror/class_loader.h @@ -32,6 +32,9 @@ class MANAGED ClassLoader : public Object { static constexpr uint32_t InstanceSize() { return sizeof(ClassLoader); } + ClassLoader* GetParent() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { + return GetFieldObject<ClassLoader>(OFFSET_OF_OBJECT_MEMBER(ClassLoader, parent_)); + } private: // Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses". |