summaryrefslogtreecommitdiff
path: root/runtime/mirror/array.cc
diff options
context:
space:
mode:
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
commitcbb2d20bea2861f244da2e2318d8c088300a3710 (patch)
tree9735d496716cf165ea0ee2d7e2f62d723ffc7734 /runtime/mirror/array.cc
parentd31fb9718a6180304cd951619dc36be8e090a641 (diff)
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/mirror/array.cc')
-rw-r--r--runtime/mirror/array.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/mirror/array.cc b/runtime/mirror/array.cc
index f8a283224c..00b88db299 100644
--- a/runtime/mirror/array.cc
+++ b/runtime/mirror/array.cc
@@ -44,8 +44,7 @@ static Array* RecursiveCreateMultiArray(Thread* self, Class* array_class, int cu
SirtRef<mirror::IntArray>& dimensions)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
int32_t array_length = dimensions->Get(current_dimension);
- SirtRef<Array> new_array(self, Array::Alloc<kMovingCollector, true>(self, array_class,
- array_length));
+ SirtRef<Array> new_array(self, Array::Alloc<true>(self, array_class, array_length));
if (UNLIKELY(new_array.get() == NULL)) {
CHECK(self->IsExceptionPending());
return NULL;
@@ -115,7 +114,7 @@ void Array::ThrowArrayStoreException(Object* object) const {
template<typename T>
PrimitiveArray<T>* PrimitiveArray<T>::Alloc(Thread* self, size_t length) {
DCHECK(array_class_ != NULL);
- Array* raw_array = Array::Alloc<kMovingCollector, true>(self, array_class_, length, sizeof(T));
+ Array* raw_array = Array::Alloc<true>(self, array_class_, length, sizeof(T));
return down_cast<PrimitiveArray<T>*>(raw_array);
}