diff options
author | 2024-09-23 13:26:27 +0000 | |
---|---|---|
committer | 2024-09-24 07:59:55 +0000 | |
commit | 68df0adae73f0258782986fc9ca1f3f82cf084bd (patch) | |
tree | eab63911e4dcaf8ff2a4bea3090042f1d55f1f7f /compiler/optimizing/instruction_builder.cc | |
parent | 8a5a51adddb5f1055934cd72e47be20fc0be180b (diff) |
x86_64: Handle invoke-static in invokeExact fast path.
Bug: 297147201
Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: ./art/test.py --host -g
Change-Id: Ia49285c116e4abfc3da2d78495f85d9131f111b5
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 55e3267427..a679f88a58 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -1394,14 +1394,9 @@ bool HInstructionBuilder::BuildInvokePolymorphic(uint32_t dex_pc, // MethodHandle.invokeExact intrinsic needs to check whether call-site matches with MethodHandle's // type. To do that, MethodType corresponding to the call-site is passed as an extra input. // Other invoke-polymorphic calls do not need it. - bool is_invoke_exact = + bool can_be_intrinsified = static_cast<Intrinsics>(resolved_method->GetIntrinsic()) == Intrinsics::kMethodHandleInvokeExact; - // Currently intrinsic works for MethodHandle targeting invoke-virtual calls only. - bool can_be_virtual = number_of_arguments >= 2 && - DataType::FromShorty(shorty[1]) == DataType::Type::kReference; - - bool can_be_intrinsified = is_invoke_exact && can_be_virtual; uint32_t number_of_other_inputs = can_be_intrinsified ? 1u : 0u; @@ -1418,7 +1413,7 @@ bool HInstructionBuilder::BuildInvokePolymorphic(uint32_t dex_pc, return false; } - DCHECK_EQ(invoke->AsInvokePolymorphic()->CanHaveFastPath(), can_be_intrinsified); + DCHECK_EQ(invoke->AsInvokePolymorphic()->IsMethodHandleInvokeExact(), can_be_intrinsified); if (invoke->GetIntrinsic() != Intrinsics::kNone && invoke->GetIntrinsic() != Intrinsics::kMethodHandleInvoke && @@ -1902,7 +1897,7 @@ bool HInstructionBuilder::SetupInvokeArguments(HInstruction* invoke, // MethodHandle.invokeExact intrinsic expects MethodType corresponding to the call-site as an // extra input to determine whether to throw WrongMethodTypeException or execute target method. - if (invoke_polymorphic->CanHaveFastPath()) { + if (invoke_polymorphic->IsMethodHandleInvokeExact()) { HLoadMethodType* load_method_type = new (allocator_) HLoadMethodType(graph_->GetCurrentMethod(), invoke_polymorphic->GetProtoIndex(), |