From ecee442f6432c727eea77d80d9c20ba037bcbaa9 Mon Sep 17 00:00:00 2001 From: Almaz Mingaleev Date: Wed, 27 Nov 2024 16:03:52 +0000 Subject: 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 --- compiler/optimizing/intrinsics_x86_64.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/optimizing') 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(); // 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); -- cgit v1.2.3-59-g8ed1b