From 98873affc25ef6bc96f8c65f828f28530b8f3fcd Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 16 Dec 2020 12:10:03 +0000 Subject: arm64: Implement VarHandle intrinsics for byte array views. Using benchmarks provided by https://android-review.googlesource.com/1420959 on blueline little cores with fixed frequency 1420800: before after GetByteArrayViewInt 27.093 0.024 SetByteArrayViewInt 28.067 0.024 GetByteArrayViewBigEndianInt 27.142 0.026 SetByteArrayViewBigEndianInt 28.040 0.025 Test: testrunner.py --target --64 --optimizing Bug: 71781600 Change-Id: I604326675042bd63dce8ec15075714003ca9915d --- compiler/optimizing/code_generator.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 23ac91b024..68120e2dd7 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -38,6 +38,7 @@ #include "base/casts.h" #include "base/leb128.h" #include "class_linker.h" +#include "class_root-inl.h" #include "compiled_method.h" #include "dex/bytecode_utils.h" #include "dex/code_item_accessors-inl.h" @@ -932,6 +933,12 @@ uint32_t CodeGenerator::GetBootImageOffset(HInvoke* invoke) { return GetBootImageOffsetImpl(method, ImageHeader::kSectionArtMethods); } +// NO_THREAD_SAFETY_ANALYSIS: Avoid taking the mutator lock, boot image objects are non-moveable. +uint32_t CodeGenerator::GetBootImageOffset(ClassRoot class_root) NO_THREAD_SAFETY_ANALYSIS { + ObjPtr klass = GetClassRoot(class_root); + return GetBootImageOffsetImpl(klass.Ptr(), ImageHeader::kSectionObjects); +} + // NO_THREAD_SAFETY_ANALYSIS: Avoid taking the mutator lock, boot image classes are non-moveable. uint32_t CodeGenerator::GetBootImageOffsetOfIntrinsicDeclaringClass(HInvoke* invoke) NO_THREAD_SAFETY_ANALYSIS { -- cgit v1.2.3-59-g8ed1b