From cbb2d20bea2861f244da2e2318d8c088300a3710 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 14 Nov 2013 17:45:16 -0800 Subject: 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 --- runtime/mirror/array.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'runtime/mirror/array.cc') 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& dimensions) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { int32_t array_length = dimensions->Get(current_dimension); - SirtRef new_array(self, Array::Alloc(self, array_class, - array_length)); + SirtRef new_array(self, Array::Alloc(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 PrimitiveArray* PrimitiveArray::Alloc(Thread* self, size_t length) { DCHECK(array_class_ != NULL); - Array* raw_array = Array::Alloc(self, array_class_, length, sizeof(T)); + Array* raw_array = Array::Alloc(self, array_class_, length, sizeof(T)); return down_cast*>(raw_array); } -- cgit v1.2.3