summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Almaz Mingaleev <mingaleev@google.com> 2024-11-27 16:03:52 +0000
committer Almaz Mingaleev <mingaleev@google.com> 2024-11-28 16:24:16 +0000
commitecee442f6432c727eea77d80d9c20ba037bcbaa9 (patch)
tree5234576c75e94176defe11587ba313fe6d51ca32 /compiler/optimizing
parent12515e8b1fe0970eacb5b6ef313ded874bdd628a (diff)
Add poisoning/unpoisoning to invokeExact intrinsic.
Bug: 297147201 Test: ./art/test/testrunner/testrunner.py -b --host --64 -t 2277 Test: ART_HEAP_POISONING=1 ./art/test/testrunner/testrunner.py -b --host --64 -t 2277 Change-Id: Iad4a86faf84c834a44a2b622fc4eaab7752c2cba
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/intrinsics_x86_64.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc
index cf1bc93129..e5d4dc4cc2 100644
--- a/compiler/optimizing/intrinsics_x86_64.cc
+++ b/compiler/optimizing/intrinsics_x86_64.cc
@@ -4254,6 +4254,7 @@ void IntrinsicCodeGeneratorX86_64::VisitMethodHandleInvokeExact(HInvoke* invoke)
locations->InAt(invoke->GetNumberOfArguments()).AsRegister<CpuRegister>();
// Call site should match with MethodHandle's type.
+ __ MaybePoisonHeapReference(call_site_type);
__ cmpl(call_site_type, Address(method_handle, mirror::MethodHandle::MethodTypeOffset()));
__ j(kNotEqual, slow_path->GetEntryLabel());
@@ -4297,6 +4298,7 @@ void IntrinsicCodeGeneratorX86_64::VisitMethodHandleInvokeExact(HInvoke* invoke)
constexpr uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
// Re-using method register for receiver class.
__ movl(method, Address(receiver, class_offset));
+ __ MaybeUnpoisonHeapReference(method);
constexpr uint32_t vtable_offset =
mirror::Class::EmbeddedVTableOffset(art::PointerSize::k64).Int32Value();
@@ -4338,6 +4340,7 @@ void IntrinsicCodeGeneratorX86_64::VisitMethodHandleInvokeExact(HInvoke* invoke)
__ Bind(&do_imt_dispatch);
// Re-using `method` to store receiver class and ImTableEntry.
__ movl(method, Address(receiver, mirror::Object::ClassOffset()));
+ __ MaybeUnpoisonHeapReference(method);
__ movq(method, Address(method, mirror::Class::ImtPtrOffset(kX86_64PointerSize).Uint32Value()));
// method = receiver->GetClass()->embedded_imtable_->Get(method_offset);