summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2020-12-16 12:10:03 +0000
committerVladimir Marko <vmarko@google.com>2021-01-08 13:44:10 +0000
commit98873affc25ef6bc96f8c65f828f28530b8f3fcd (patch)
treebe471ad310edb1aa3a7b3df44528905ec7ce9a6c /compiler/optimizing/code_generator.cc
parent771708f3f0a15c1ae50617b4141c5f5dd47bf94f (diff)
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
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc7
1 files changed, 7 insertions, 0 deletions
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<mirror::Class> klass = GetClassRoot<kWithoutReadBarrier>(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 {