diff options
author | 2015-04-22 13:56:20 -0700 | |
---|---|---|
committer | 2015-05-29 18:45:49 -0700 | |
commit | e401d146407d61eeb99f8d6176b2ac13c4df1e33 (patch) | |
tree | 17927f9bfe7d2041b5942c89832d55f9dedb24c5 /runtime/entrypoints/entrypoint_utils.h | |
parent | 2006b7b9b8e32722bd0d640c62549d8a0ac624b6 (diff) |
Move mirror::ArtMethod to native
Optimizing + quick tests are passing, devices boot.
TODO: Test and fix bugs in mips64.
Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.
Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.h')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.h | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index 8d419f8a7b..47865a2a80 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -31,19 +31,19 @@ namespace art { namespace mirror { class Array; - class ArtMethod; class Class; class Object; class String; } // namespace mirror class ArtField; +class ArtMethod; class ScopedObjectAccessAlreadyRunnable; class Thread; template <const bool kAccessCheck> ALWAYS_INLINE inline mirror::Class* CheckObjectAlloc(uint32_t type_idx, - mirror::ArtMethod* method, + ArtMethod* method, Thread* self, bool* slow_path) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -58,7 +58,7 @@ ALWAYS_INLINE inline mirror::Class* CheckClassInitializedForObjectAlloc(mirror:: // check. template <bool kAccessCheck, bool kInstrumented> ALWAYS_INLINE inline mirror::Object* AllocObjectFromCode(uint32_t type_idx, - mirror::ArtMethod* method, + ArtMethod* method, Thread* self, gc::AllocatorType allocator_type) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -81,7 +81,7 @@ ALWAYS_INLINE inline mirror::Object* AllocObjectFromCodeInitialized(mirror::Clas template <bool kAccessCheck> ALWAYS_INLINE inline mirror::Class* CheckArrayAlloc(uint32_t type_idx, int32_t component_count, - mirror::ArtMethod* method, + ArtMethod* method, bool* slow_path) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -92,7 +92,7 @@ ALWAYS_INLINE inline mirror::Class* CheckArrayAlloc(uint32_t type_idx, template <bool kAccessCheck, bool kInstrumented> ALWAYS_INLINE inline mirror::Array* AllocArrayFromCode(uint32_t type_idx, int32_t component_count, - mirror::ArtMethod* method, + ArtMethod* method, Thread* self, gc::AllocatorType allocator_type) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -100,20 +100,20 @@ ALWAYS_INLINE inline mirror::Array* AllocArrayFromCode(uint32_t type_idx, template <bool kAccessCheck, bool kInstrumented> ALWAYS_INLINE inline mirror::Array* AllocArrayFromCodeResolved(mirror::Class* klass, int32_t component_count, - mirror::ArtMethod* method, + ArtMethod* method, Thread* self, gc::AllocatorType allocator_type) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); extern mirror::Array* CheckAndAllocArrayFromCode(uint32_t type_idx, int32_t component_count, - mirror::ArtMethod* method, Thread* self, + ArtMethod* method, Thread* self, bool access_check, gc::AllocatorType allocator_type) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); extern mirror::Array* CheckAndAllocArrayFromCodeInstrumented(uint32_t type_idx, int32_t component_count, - mirror::ArtMethod* method, + ArtMethod* method, Thread* self, bool access_check, gc::AllocatorType allocator_type) @@ -132,38 +132,33 @@ enum FindFieldType { }; template<FindFieldType type, bool access_check> -inline ArtField* FindFieldFromCode(uint32_t field_idx, mirror::ArtMethod* referrer, - Thread* self, size_t expected_size) +inline ArtField* FindFieldFromCode( + uint32_t field_idx, ArtMethod* referrer, Thread* self, size_t expected_size) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); template<InvokeType type, bool access_check> -inline mirror::ArtMethod* FindMethodFromCode(uint32_t method_idx, - mirror::Object** this_object, - mirror::ArtMethod** referrer, Thread* self) +inline ArtMethod* FindMethodFromCode( + uint32_t method_idx, mirror::Object** this_object, ArtMethod** referrer, Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); // Fast path field resolution that can't initialize classes or throw exceptions. -inline ArtField* FindFieldFast(uint32_t field_idx, - mirror::ArtMethod* referrer, - FindFieldType type, size_t expected_size) +inline ArtField* FindFieldFast( + uint32_t field_idx, ArtMethod* referrer, FindFieldType type, size_t expected_size) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); // Fast path method resolution that can't throw exceptions. -inline mirror::ArtMethod* FindMethodFast(uint32_t method_idx, - mirror::Object* this_object, - mirror::ArtMethod* referrer, - bool access_check, InvokeType type) +inline ArtMethod* FindMethodFast( + uint32_t method_idx, mirror::Object* this_object, ArtMethod* referrer, bool access_check, + InvokeType type) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); -inline mirror::Class* ResolveVerifyAndClinit(uint32_t type_idx, - mirror::ArtMethod* referrer, - Thread* self, bool can_run_clinit, - bool verify_access) +inline mirror::Class* ResolveVerifyAndClinit( + uint32_t type_idx, ArtMethod* referrer, Thread* self, bool can_run_clinit, bool verify_access) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); extern void ThrowStackOverflowError(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); -inline mirror::String* ResolveStringFromCode(mirror::ArtMethod* referrer, uint32_t string_idx) +inline mirror::String* ResolveStringFromCode(ArtMethod* referrer, uint32_t string_idx) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); // TODO: annotalysis disabled as monitor semantics are maintained in Java code. |