diff options
author | 2021-01-07 15:13:54 +0000 | |
---|---|---|
committer | 2021-01-07 18:19:15 +0000 | |
commit | 4ebb99c2ecdd64b2364a44c4925b76f4bfa5d293 (patch) | |
tree | f3dafd590ba11ef7b08207341c7dead7c866fc67 | |
parent | 755b533082bb84a282f4a76ac3f6364a7c61e6cd (diff) |
Fully honor the "WithChecks" in the alloc entrypoints.
Test: 800-smali
Test: 600-verifier-fails
Change-Id: I80b2c58c5cd9a2fe63475aba15b0645e0503b358
-rw-r--r-- | runtime/entrypoints/quick/quick_alloc_entrypoints.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc index bf8a756036..c5b4be5982 100644 --- a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc @@ -32,7 +32,7 @@ namespace art { static constexpr bool kUseTlabFastPath = true; template <bool kInitialized, - bool kFinalize, + bool kWithChecks, bool kInstrumented, gc::AllocatorType allocator_type> static ALWAYS_INLINE inline mirror::Object* artAllocObjectFromCode( @@ -40,7 +40,10 @@ static ALWAYS_INLINE inline mirror::Object* artAllocObjectFromCode( Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { ScopedQuickEntrypointChecks sqec(self); DCHECK(klass != nullptr); - if (kUseTlabFastPath && !kInstrumented && allocator_type == gc::kAllocatorTypeTLAB) { + if (kUseTlabFastPath && + !kWithChecks && + !kInstrumented && + allocator_type == gc::kAllocatorTypeTLAB) { // The "object size alloc fast path" is set when the class is // visibly initialized, objects are fixed size and non-finalizable. // Otherwise, the value is too large for the size check to succeed. @@ -60,7 +63,7 @@ static ALWAYS_INLINE inline mirror::Object* artAllocObjectFromCode( } if (kInitialized) { return AllocObjectFromCodeInitialized<kInstrumented>(klass, self, allocator_type).Ptr(); - } else if (!kFinalize) { + } else if (!kWithChecks) { return AllocObjectFromCodeResolved<kInstrumented>(klass, self, allocator_type).Ptr(); } else { return AllocObjectFromCode<kInstrumented>(klass, self, allocator_type).Ptr(); |