From 3051a5e03f32ca7aaae6041025ec60f90d41e34c Mon Sep 17 00:00:00 2001 From: Almaz Mingaleev Date: Thu, 7 Nov 2024 10:01:49 +0000 Subject: Remove now unnecessary checks from invokeExact intrinsic. Also rewrote tests to make sure that MethodHandle-s created via const-method-handle and Java API behave identically. They can be slightly different even if lookup is done in the same class for the same method as const-method-handle can target copied methods. Bug: 297147201 Test: ./art/test/testrunner/testrunner.py -b --host --64 Test: ./art/test/testrunner/testrunner.py -b --jvm Change-Id: I69cdf2c44f2838ee0e57eaa2e93a6ed5276c39fb --- compiler/optimizing/intrinsics_x86_64.cc | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc index 85c33d312f..b9d1a9f2c7 100644 --- a/compiler/optimizing/intrinsics_x86_64.cc +++ b/compiler/optimizing/intrinsics_x86_64.cc @@ -4288,17 +4288,6 @@ void IntrinsicCodeGeneratorX86_64::VisitMethodHandleInvokeExact(HInvoke* invoke) // If method is defined in the receiver's class, execute it as it is. __ j(kEqual, &execute_target_method); - __ testl(Address(temp, mirror::Class::AccessFlagsOffset()), Immediate(kAccInterface)); - // If `method`'s declaring class is not an interface, do virtual dispatch. - __ j(kZero, &do_virtual_dispatch); - - __ movl(temp, Address(method, ArtMethod::AccessFlagsOffset())); - // These flags are uint32_t and their signed value doesn't fit into int32_t (see b/377275405). - __ andl(temp, Immediate(bit_cast(kAccIntrinsic | kAccCopied))); - __ cmpl(temp, Immediate(kAccCopied)); - // If method is defined in an interface and is not copied it should be interface dispatched. - __ j(kNotEqual, slow_path->GetEntryLabel()); - __ Bind(&do_virtual_dispatch); // MethodIndex is uint16_t. __ movzxw(temp, Address(method, ArtMethod::MethodIndexOffset())); -- cgit v1.2.3-59-g8ed1b