diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-11-14 17:45:16 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-11-20 11:14:11 -0800 |
commit | cbb2d20bea2861f244da2e2318d8c088300a3710 (patch) | |
tree | 9735d496716cf165ea0ee2d7e2f62d723ffc7734 /runtime/entrypoints/portable | |
parent | d31fb9718a6180304cd951619dc36be8e090a641 (diff) | |
download | art-cbb2d20bea2861f244da2e2318d8c088300a3710.zip art-cbb2d20bea2861f244da2e2318d8c088300a3710.tar.gz art-cbb2d20bea2861f244da2e2318d8c088300a3710.tar.bz2 |
Refactor allocation entrypoints.
Adds support for switching entrypoints during runtime. Enables
addition of new allocators with out requiring significant copy
paste. Slight speedup on ritzperf probably due to more inlining.
TODO: Ensuring that the entire allocation path is inlined so
that the switch statement in the allocation code is optimized
out.
Rosalloc measurements:
4583
4453
4439
4434
4751
After change:
4184
4287
4131
4335
4097
Change-Id: I1352a3cbcdf6dae93921582726324d91312df5c9
Diffstat (limited to 'runtime/entrypoints/portable')
-rw-r--r-- | runtime/entrypoints/portable/portable_alloc_entrypoints.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/runtime/entrypoints/portable/portable_alloc_entrypoints.cc b/runtime/entrypoints/portable/portable_alloc_entrypoints.cc index 91b7353..6d23efe 100644 --- a/runtime/entrypoints/portable/portable_alloc_entrypoints.cc +++ b/runtime/entrypoints/portable/portable_alloc_entrypoints.cc @@ -24,14 +24,14 @@ extern "C" mirror::Object* art_portable_alloc_object_from_code(uint32_t type_idx mirror::ArtMethod* referrer, Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return AllocObjectFromCode(type_idx, referrer, thread, false); + return AllocObjectFromCode<false, true>(type_idx, referrer, thread, gc::kAllocatorTypeFreeList); } extern "C" mirror::Object* art_portable_alloc_object_from_code_with_access_check(uint32_t type_idx, mirror::ArtMethod* referrer, Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return AllocObjectFromCode(type_idx, referrer, thread, true); + return AllocObjectFromCode<true, true>(type_idx, referrer, thread, gc::kAllocatorTypeFreeList); } extern "C" mirror::Object* art_portable_alloc_array_from_code(uint32_t type_idx, @@ -39,7 +39,8 @@ extern "C" mirror::Object* art_portable_alloc_array_from_code(uint32_t type_idx, uint32_t length, Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return AllocArrayFromCode(type_idx, referrer, length, self, false); + return AllocArrayFromCode<false, true>(type_idx, referrer, length, self, + gc::kAllocatorTypeFreeList); } extern "C" mirror::Object* art_portable_alloc_array_from_code_with_access_check(uint32_t type_idx, @@ -47,7 +48,8 @@ extern "C" mirror::Object* art_portable_alloc_array_from_code_with_access_check( uint32_t length, Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return AllocArrayFromCode(type_idx, referrer, length, self, true); + return AllocArrayFromCode<true, true>(type_idx, referrer, length, self, + gc::kAllocatorTypeFreeList); } extern "C" mirror::Object* art_portable_check_and_alloc_array_from_code(uint32_t type_idx, @@ -55,7 +57,8 @@ extern "C" mirror::Object* art_portable_check_and_alloc_array_from_code(uint32_t uint32_t length, Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, false); + return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, false, + gc::kAllocatorTypeFreeList); } extern "C" mirror::Object* art_portable_check_and_alloc_array_from_code_with_access_check(uint32_t type_idx, @@ -63,7 +66,8 @@ extern "C" mirror::Object* art_portable_check_and_alloc_array_from_code_with_acc uint32_t length, Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, true); + return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, true, + gc::kAllocatorTypeFreeList); } } // namespace art |