summaryrefslogtreecommitdiffstats
path: root/runtime/entrypoints/quick
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-01-15 11:46:48 -0800
committerHiroshi Yamauchi <yamauchi@google.com>2014-01-23 15:29:12 -0800
commitbe1ca55db3362f5b100c4c65da5342fd299520bb (patch)
treeb9df6f5562d884698ed15f21764a704bb51e359e /runtime/entrypoints/quick
parent9d8918fe97c235fdc6eb2c7f2d50a6673ab50329 (diff)
downloadart-be1ca55db3362f5b100c4c65da5342fd299520bb.zip
art-be1ca55db3362f5b100c4c65da5342fd299520bb.tar.gz
art-be1ca55db3362f5b100c4c65da5342fd299520bb.tar.bz2
Use direct class pointers at allocation sites in the compiled code.
- Rather than looking up a class from its type ID (and checking if it's resolved/initialized, resolving/initializing if not), use direct class pointers, if possible (boot-code-to-boot-class pointers and app-code-to-boot-class pointers.) - This results in a 1-2% speedup in Ritz MemAllocTest on Nexus 4. - Embedding the object size (along with class pointers) caused a 1-2% slowdown in MemAllocTest and isn't implemented in this change. - TODO: do the same for array allocations. - TODO: when/if an application gets its own image, implement app-code-to-app-class pointers. - Fix a -XX:gc bug. cf. https://android-review.googlesource.com/79460/ - Add /tmp/android-data/dalvik-cache to the list of locations to remove oat files in clean-oat-host. cf. https://android-review.googlesource.com/79550 - Add back a dropped UNLIKELY in FindMethodFromCode(). cf. https://android-review.googlesource.com/74205 Bug: 9986565 Change-Id: I590b96bd21f7a7472f88e36752e675547559a5b1
Diffstat (limited to 'runtime/entrypoints/quick')
-rw-r--r--runtime/entrypoints/quick/quick_alloc_entrypoints.cc12
-rw-r--r--runtime/entrypoints/quick/quick_entrypoints.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
index b1dca77..5657092 100644
--- a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
@@ -30,6 +30,18 @@ extern "C" mirror::Object* artAllocObjectFromCode ##suffix##suffix2( \
FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); \
return AllocObjectFromCode<false, instrumented_bool>(type_idx, method, self, allocator_type); \
} \
+extern "C" mirror::Object* artAllocObjectFromCodeResolved##suffix##suffix2( \
+ mirror::Class* klass, mirror::ArtMethod* method, Thread* self, mirror::ArtMethod** sp) \
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
+ FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); \
+ return AllocObjectFromCodeResolved<instrumented_bool>(klass, method, self, allocator_type); \
+} \
+extern "C" mirror::Object* artAllocObjectFromCodeInitialized##suffix##suffix2( \
+ mirror::Class* klass, mirror::ArtMethod* method, Thread* self, mirror::ArtMethod** sp) \
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
+ FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); \
+ return AllocObjectFromCodeInitialized<instrumented_bool>(klass, method, self, allocator_type); \
+} \
extern "C" mirror::Object* artAllocObjectFromCodeWithAccessCheck##suffix##suffix2( \
uint32_t type_idx, mirror::ArtMethod* method, Thread* self, mirror::ArtMethod** sp) \
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h
index 1ba2066..bbbc8f2 100644
--- a/runtime/entrypoints/quick/quick_entrypoints.h
+++ b/runtime/entrypoints/quick/quick_entrypoints.h
@@ -42,6 +42,8 @@ struct PACKED(4) QuickEntryPoints {
void* (*pAllocArray)(uint32_t, void*, int32_t);
void* (*pAllocArrayWithAccessCheck)(uint32_t, void*, int32_t);
void* (*pAllocObject)(uint32_t, void*);
+ void* (*pAllocObjectResolved)(void*, void*);
+ void* (*pAllocObjectInitialized)(void*, void*);
void* (*pAllocObjectWithAccessCheck)(uint32_t, void*);
void* (*pCheckAndAllocArray)(uint32_t, void*, int32_t);
void* (*pCheckAndAllocArrayWithAccessCheck)(uint32_t, void*, int32_t);