From 9b81ac36e161fd993eab17b43b93a96e8c63b5cc Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 16 May 2019 16:47:08 +0100 Subject: Add default argument kIsInstrumented=true. kIsInstrumented=false is reserved for use by specialized entrypoints which are used only when we can ensure that the code is not instrumented. So add the default argument to simplify all other callers. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I3419795794fec9a1733ab3ad698b6415dbac679d --- runtime/entrypoints/entrypoint_utils-inl.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'runtime/entrypoints/entrypoint_utils-inl.h') diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h index 53dea7204c..4d24a8ce87 100644 --- a/runtime/entrypoints/entrypoint_utils-inl.h +++ b/runtime/entrypoints/entrypoint_utils-inl.h @@ -219,10 +219,11 @@ inline ObjPtr AllocObjectFromCodeResolved(ObjPtr // Pass in false since the object cannot be finalizable. // CheckClassInitializedForObjectAlloc can cause thread suspension which means we may now be // instrumented. - return klass->Alloc(self, heap->GetCurrentAllocator()); + return klass->Alloc( + self, heap->GetCurrentAllocator()); } // Pass in false since the object cannot be finalizable. - return klass->Alloc(self, allocator_type); + return klass->Alloc(self, allocator_type); } // Given the context of a calling Method and an initialized class, create an instance. @@ -233,7 +234,7 @@ inline ObjPtr AllocObjectFromCodeInitialized(ObjPtrAlloc(self, allocator_type); + return klass->Alloc(self, allocator_type); } @@ -296,8 +297,11 @@ inline ObjPtr AllocArrayFromCode(dex::TypeIndex type_idx, klass->GetComponentSizeShift(), heap->GetCurrentAllocator()); } - return mirror::Array::Alloc(self, klass, component_count, - klass->GetComponentSizeShift(), allocator_type); + return mirror::Array::Alloc(self, + klass, + component_count, + klass->GetComponentSizeShift(), + allocator_type); } template @@ -313,8 +317,11 @@ inline ObjPtr AllocArrayFromCodeResolved(ObjPtr kl } // No need to retry a slow-path allocation as the above code won't cause a GC or thread // suspension. - return mirror::Array::Alloc(self, klass, component_count, - klass->GetComponentSizeShift(), allocator_type); + return mirror::Array::Alloc(self, + klass, + component_count, + klass->GetComponentSizeShift(), + allocator_type); } template -- cgit v1.2.3-59-g8ed1b