summaryrefslogtreecommitdiff
path: root/runtime/entrypoints
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/entrypoints')
-rw-r--r--runtime/entrypoints/entrypoint_utils-inl.h21
-rw-r--r--runtime/entrypoints/entrypoint_utils.h4
2 files changed, 16 insertions, 9 deletions
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<mirror::Object> AllocObjectFromCodeResolved(ObjPtr<mirror::Class>
// Pass in false since the object cannot be finalizable.
// CheckClassInitializedForObjectAlloc can cause thread suspension which means we may now be
// instrumented.
- return klass->Alloc</*kInstrumented=*/true, false>(self, heap->GetCurrentAllocator());
+ return klass->Alloc</*kInstrumented=*/true, /*kCheckAddFinalizer=*/false>(
+ self, heap->GetCurrentAllocator());
}
// Pass in false since the object cannot be finalizable.
- return klass->Alloc<kInstrumented, false>(self, allocator_type);
+ return klass->Alloc<kInstrumented, /*kCheckAddFinalizer=*/false>(self, allocator_type);
}
// Given the context of a calling Method and an initialized class, create an instance.
@@ -233,7 +234,7 @@ inline ObjPtr<mirror::Object> AllocObjectFromCodeInitialized(ObjPtr<mirror::Clas
gc::AllocatorType allocator_type) {
DCHECK(klass != nullptr);
// Pass in false since the object cannot be finalizable.
- return klass->Alloc<kInstrumented, false>(self, allocator_type);
+ return klass->Alloc<kInstrumented, /*kCheckAddFinalizer=*/false>(self, allocator_type);
}
@@ -296,8 +297,11 @@ inline ObjPtr<mirror::Array> AllocArrayFromCode(dex::TypeIndex type_idx,
klass->GetComponentSizeShift(),
heap->GetCurrentAllocator());
}
- return mirror::Array::Alloc<kInstrumented>(self, klass, component_count,
- klass->GetComponentSizeShift(), allocator_type);
+ return mirror::Array::Alloc<kInstrumented>(self,
+ klass,
+ component_count,
+ klass->GetComponentSizeShift(),
+ allocator_type);
}
template <bool kInstrumented>
@@ -313,8 +317,11 @@ inline ObjPtr<mirror::Array> AllocArrayFromCodeResolved(ObjPtr<mirror::Class> 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<kInstrumented>(self, klass, component_count,
- klass->GetComponentSizeShift(), allocator_type);
+ return mirror::Array::Alloc<kInstrumented>(self,
+ klass,
+ component_count,
+ klass->GetComponentSizeShift(),
+ allocator_type);
}
template<FindFieldType type, bool access_check>
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h
index a8618bda58..6e75a1eb63 100644
--- a/runtime/entrypoints/entrypoint_utils.h
+++ b/runtime/entrypoints/entrypoint_utils.h
@@ -49,7 +49,7 @@ class Thread;
// Given the context of a calling Method, use its DexCache to resolve a type to a Class. If it
// cannot be resolved, throw an error. If it can, use it to create an instance.
-template <bool kInstrumented>
+template <bool kInstrumented = true>
ALWAYS_INLINE inline ObjPtr<mirror::Object> AllocObjectFromCode(ObjPtr<mirror::Class> klass,
Thread* self,
gc::AllocatorType allocator_type)
@@ -87,7 +87,7 @@ ALWAYS_INLINE inline ObjPtr<mirror::Class> CheckArrayAlloc(dex::TypeIndex type_i
// it cannot be resolved, throw an error. If it can, use it to create an array.
// When verification/compiler hasn't been able to verify access, optionally perform an access
// check.
-template <bool kAccessCheck, bool kInstrumented>
+template <bool kAccessCheck, bool kInstrumented = true>
ALWAYS_INLINE inline ObjPtr<mirror::Array> AllocArrayFromCode(dex::TypeIndex type_idx,
int32_t component_count,
ArtMethod* method,