From f8537907783fdbba9a880b3261c2601bbad5fddb Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 13 Sep 2022 15:22:29 +0100 Subject: Add a IsInitialized check in AOT code with clinit at entry checks. The investigations behind https://android-review.googlesource.com/c/platform/art/+/2214701 showed that it can take some time for a class to become visibly initialized. To avoid a busy loop between the AOT code and the resolution trampoline, we also add a isInitialized check, which if true will be followed by a memory barrier and the execution of the compiled code. Test: test.py Bug: 162110941 Change-Id: I6c36cde6ebd12b1f81281eb8a684b496f266e3ea --- compiler/optimizing/code_generator.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 6b85aaa880..578a3417ba 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -68,6 +68,8 @@ constexpr uint32_t shifted_visibly_initialized_value = enum_cast(ClassStatus::kVisiblyInitialized) << (status_lsb_position % kBitsPerByte); constexpr uint32_t shifted_initializing_value = enum_cast(ClassStatus::kInitializing) << (status_lsb_position % kBitsPerByte); +constexpr uint32_t shifted_initialized_value = + enum_cast(ClassStatus::kInitialized) << (status_lsb_position % kBitsPerByte); class Assembler; class CodeGenerator; -- cgit v1.2.3-59-g8ed1b