summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/entrypoint_utils.h
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2017-01-12 02:58:38 +0000
committer Hiroshi Yamauchi <yamauchi@google.com> 2017-01-12 02:58:38 +0000
commitf7aaacd97881c6924b8212c7f8fe4a4c8721ef53 (patch)
tree780209ac8e992fa63307062977f672aa5bb55d9e /runtime/entrypoints/entrypoint_utils.h
parent2b615ba29c4dfcf54aaf44955f2eac60f5080b2e (diff)
Revert "Make object allocation entrypoints only take a class."
960-default-smali64 is failing. This reverts commit 2b615ba29c4dfcf54aaf44955f2eac60f5080b2e. Change-Id: Iebb8ee5a917fa84c5f01660ce432798524d078ef
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.h')
-rw-r--r--runtime/entrypoints/entrypoint_utils.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h
index 4794610ca8..7cc136e227 100644
--- a/runtime/entrypoints/entrypoint_utils.h
+++ b/runtime/entrypoints/entrypoint_utils.h
@@ -45,10 +45,27 @@ class OatQuickMethodHeader;
class ScopedObjectAccessAlreadyRunnable;
class Thread;
+template <const bool kAccessCheck>
+ALWAYS_INLINE inline mirror::Class* CheckObjectAlloc(dex::TypeIndex type_idx,
+ ArtMethod* method,
+ Thread* self,
+ bool* slow_path)
+ REQUIRES_SHARED(Locks::mutator_lock_)
+ REQUIRES(!Roles::uninterruptible_);
+
+ALWAYS_INLINE inline mirror::Class* CheckClassInitializedForObjectAlloc(mirror::Class* klass,
+ Thread* self,
+ bool* slow_path)
+ REQUIRES_SHARED(Locks::mutator_lock_)
+ REQUIRES(!Roles::uninterruptible_);
+
// 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>
-ALWAYS_INLINE inline mirror::Object* AllocObjectFromCode(mirror::Class* klass,
+// When verification/compiler hasn't been able to verify access, optionally perform an access
+// check.
+template <bool kAccessCheck, bool kInstrumented>
+ALWAYS_INLINE inline mirror::Object* AllocObjectFromCode(dex::TypeIndex type_idx,
+ ArtMethod* method,
Thread* self,
gc::AllocatorType allocator_type)
REQUIRES_SHARED(Locks::mutator_lock_)