From 89eeacffd742607074da73fc5a8b267d2e6f3d0f Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 29 May 2024 15:44:49 +0000 Subject: Faster `ArtMethod` fixup in `ImageWriter`. Calculate the access flags in a local variable to avoid unnecessary atomic operations. Clean up the code to avoid some unnecessary branching. Avoid nterp flag recalculation when the target ISA is the same as `kRuntimeISA`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I2486d54f4b4cf73f9b8e94b366ee9db3085e5fa7 --- runtime/class_linker.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'runtime/class_linker.cc') diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 7359056d32..52caa9f1cf 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -4163,9 +4163,13 @@ void ClassLinker::LoadMethod(const DexFile& dex_file, } } - if (Runtime::Current()->IsZygote() && + if ((access_flags & kAccAbstract) == 0u && + Runtime::Current()->IsZygote() && !Runtime::Current()->GetJITOptions()->GetProfileSaverOptions().GetProfileBootClassPath()) { + DCHECK(!ArtMethod::IsAbstract(access_flags)); + DCHECK(!ArtMethod::IsIntrinsic(access_flags)); dst->SetMemorySharedMethod(); + dst->SetHotCounter(); } } -- cgit v1.2.3-59-g8ed1b