Lines Matching refs:invoke_instruction

468 ArtMethod* HInliner::FindActualCallTarget(HInvoke* invoke_instruction, bool* cha_devirtualize) {  in FindActualCallTarget()  argument
469 ArtMethod* resolved_method = invoke_instruction->GetResolvedMethod(); in FindActualCallTarget()
473 if (invoke_instruction->IsInvokeStaticOrDirect()) { in FindActualCallTarget()
477 actual_method = FindVirtualOrInterfaceTarget(invoke_instruction, resolved_method); in FindActualCallTarget()
492 bool HInliner::TryInline(HInvoke* invoke_instruction) { in TryInline() argument
493 if (invoke_instruction->IsInvokeUnresolved() || in TryInline()
494 invoke_instruction->IsInvokePolymorphic() || in TryInline()
495 invoke_instruction->IsInvokeCustom()) { in TryInline()
501 uint32_t method_index = invoke_instruction->GetDexMethodIndex(); in TryInline()
505 ArtMethod* resolved_method = invoke_instruction->GetResolvedMethod(); in TryInline()
507 DCHECK(invoke_instruction->IsInvokeStaticOrDirect()); in TryInline()
508 DCHECK(invoke_instruction->AsInvokeStaticOrDirect()->IsStringInit()); in TryInline()
514 ArtMethod* actual_method = FindActualCallTarget(invoke_instruction, &cha_devirtualize); in TryInline()
518 DCHECK(!invoke_instruction->IsInvokeStaticOrDirect()); in TryInline()
520 return TryInlineFromInlineCache(caller_dex_file, invoke_instruction, resolved_method); in TryInline()
524 bool result = TryInlineAndReplace(invoke_instruction, in TryInline()
531 if (!invoke_instruction->IsInvokeStaticOrDirect()) { in TryInline()
545 invoke_instruction->SetAlwaysThrows(true); in TryInline()
598 HInvoke* invoke_instruction, in TryInlineFromInlineCache() argument
611 ? GetInlineCacheAOT(caller_dex_file, invoke_instruction, &hs, &inline_cache) in TryInlineFromInlineCache()
612 : GetInlineCacheJIT(invoke_instruction, &hs, &inline_cache); in TryInlineFromInlineCache()
618 << caller_dex_file.PrettyMethod(invoke_instruction->GetDexMethodIndex()); in TryInlineFromInlineCache()
625 << caller_dex_file.PrettyMethod(invoke_instruction->GetDexMethodIndex()) in TryInlineFromInlineCache()
633 return TryInlinePolymorphicCall(invoke_instruction, resolved_method, inline_cache); in TryInlineFromInlineCache()
635 return TryInlineMonomorphicCall(invoke_instruction, resolved_method, inline_cache); in TryInlineFromInlineCache()
641 return TryInlinePolymorphicCall(invoke_instruction, resolved_method, inline_cache); in TryInlineFromInlineCache()
647 << caller_dex_file.PrettyMethod(invoke_instruction->GetDexMethodIndex()) in TryInlineFromInlineCache()
656 << caller_dex_file.PrettyMethod(invoke_instruction->GetDexMethodIndex()) in TryInlineFromInlineCache()
665 HInvoke* invoke_instruction, in GetInlineCacheJIT() argument
687 *profiling_info->GetInlineCache(invoke_instruction->GetDexPc()), in GetInlineCacheJIT()
695 HInvoke* invoke_instruction, in GetInlineCacheAOT() argument
716 return ExtractClassesFromOfflineProfile(invoke_instruction, in GetInlineCacheAOT()
723 const HInvoke* invoke_instruction, in ExtractClassesFromOfflineProfile() argument
727 const auto it = offline_profile.inline_caches->find(invoke_instruction->GetDexPc()); in ExtractClassesFromOfflineProfile()
786 invoke_instruction->GetDexMethodIndex()) << " : " in ExtractClassesFromOfflineProfile()
817 HInstruction* invoke_instruction, in ResolveMethodFromInlineCache() argument
831 if (invoke_instruction->IsInvokeInterface()) { in ResolveMethodFromInlineCache()
834 DCHECK(invoke_instruction->IsInvokeVirtual()); in ResolveMethodFromInlineCache()
841 bool HInliner::TryInlineMonomorphicCall(HInvoke* invoke_instruction, in TryInlineMonomorphicCall() argument
844 DCHECK(invoke_instruction->IsInvokeVirtual() || invoke_instruction->IsInvokeInterface()) in TryInlineMonomorphicCall()
845 << invoke_instruction->DebugName(); in TryInlineMonomorphicCall()
861 monomorphic_type, resolved_method, invoke_instruction, pointer_size); in TryInlineMonomorphicCall()
870 HInstruction* receiver = invoke_instruction->InputAt(0); in TryInlineMonomorphicCall()
871 HInstruction* cursor = invoke_instruction->GetPrevious(); in TryInlineMonomorphicCall()
872 HBasicBlock* bb_cursor = invoke_instruction->GetBlock(); in TryInlineMonomorphicCall()
873 if (!TryInlineAndReplace(invoke_instruction, in TryInlineMonomorphicCall()
887 invoke_instruction, in TryInlineMonomorphicCall()
903 void HInliner::AddCHAGuard(HInstruction* invoke_instruction, in AddCHAGuard() argument
923 deopt_flag->AddInput(invoke_instruction->InputAt(0)); in AddCHAGuard()
925 deopt->CopyEnvironmentFrom(invoke_instruction->GetEnvironment()); in AddCHAGuard()
934 HInstruction* invoke_instruction, in AddTypeGuard() argument
938 class_linker, receiver, invoke_instruction->GetDexPc()); in AddTypeGuard()
965 invoke_instruction->GetDexPc(), in AddTypeGuard()
979 load_class->CopyEnvironmentFrom(invoke_instruction->GetEnvironment()); in AddTypeGuard()
992 invoke_instruction->GetDexPc()); in AddTypeGuard()
994 deoptimize->CopyEnvironmentFrom(invoke_instruction->GetEnvironment()); in AddTypeGuard()
995 DCHECK_EQ(invoke_instruction->InputAt(0), receiver); in AddTypeGuard()
1002 bool HInliner::TryInlinePolymorphicCall(HInvoke* invoke_instruction, in TryInlinePolymorphicCall() argument
1005 DCHECK(invoke_instruction->IsInvokeVirtual() || invoke_instruction->IsInvokeInterface()) in TryInlinePolymorphicCall()
1006 << invoke_instruction->DebugName(); in TryInlinePolymorphicCall()
1008 if (TryInlinePolymorphicCallToSameTarget(invoke_instruction, resolved_method, classes)) { in TryInlinePolymorphicCall()
1025 handle, resolved_method, invoke_instruction, pointer_size); in TryInlinePolymorphicCall()
1034 HInstruction* receiver = invoke_instruction->InputAt(0); in TryInlinePolymorphicCall()
1035 HInstruction* cursor = invoke_instruction->GetPrevious(); in TryInlinePolymorphicCall()
1036 HBasicBlock* bb_cursor = invoke_instruction->GetBlock(); in TryInlinePolymorphicCall()
1042 !TryBuildAndInline(invoke_instruction, in TryInlinePolymorphicCall()
1065 invoke_instruction, in TryInlinePolymorphicCall()
1069 invoke_instruction->ReplaceWith(return_replacement); in TryInlinePolymorphicCall()
1071 invoke_instruction->GetBlock()->RemoveInstruction(invoke_instruction); in TryInlinePolymorphicCall()
1076 CreateDiamondPatternForPolymorphicInline(compare, return_replacement, invoke_instruction); in TryInlinePolymorphicCall()
1103 HInstruction* invoke_instruction) { in CreateDiamondPatternForPolymorphicInline() argument
1104 uint32_t dex_pc = invoke_instruction->GetDexPc(); in CreateDiamondPatternForPolymorphicInline()
1106 HBasicBlock* original_invoke_block = invoke_instruction->GetBlock(); in CreateDiamondPatternForPolymorphicInline()
1117 HBasicBlock* end_then = invoke_instruction->GetBlock(); in CreateDiamondPatternForPolymorphicInline()
1118 HBasicBlock* otherwise = end_then->SplitBeforeForInlining(invoke_instruction); in CreateDiamondPatternForPolymorphicInline()
1119 HBasicBlock* merge = otherwise->SplitAfterForInlining(invoke_instruction); in CreateDiamondPatternForPolymorphicInline()
1125 allocator, kNoRegNumber, 0, HPhi::ToPhiType(invoke_instruction->GetType()), dex_pc); in CreateDiamondPatternForPolymorphicInline()
1127 invoke_instruction->ReplaceWith(phi); in CreateDiamondPatternForPolymorphicInline()
1129 phi->AddInput(invoke_instruction); in CreateDiamondPatternForPolymorphicInline()
1178 HInvoke* invoke_instruction, in TryInlinePolymorphicCallToSameTarget() argument
1191 size_t method_index = invoke_instruction->IsInvokeVirtual() in TryInlinePolymorphicCallToSameTarget()
1192 ? invoke_instruction->AsInvokeVirtual()->GetVTableIndex() in TryInlinePolymorphicCallToSameTarget()
1193 : invoke_instruction->AsInvokeInterface()->GetImtIndex(); in TryInlinePolymorphicCallToSameTarget()
1202 if (invoke_instruction->IsInvokeInterface()) { in TryInlinePolymorphicCallToSameTarget()
1211 DCHECK(invoke_instruction->IsInvokeVirtual()); in TryInlinePolymorphicCallToSameTarget()
1223 HInstruction* receiver = invoke_instruction->InputAt(0); in TryInlinePolymorphicCallToSameTarget()
1224 HInstruction* cursor = invoke_instruction->GetPrevious(); in TryInlinePolymorphicCallToSameTarget()
1225 HBasicBlock* bb_cursor = invoke_instruction->GetBlock(); in TryInlinePolymorphicCallToSameTarget()
1228 if (!TryBuildAndInline(invoke_instruction, in TryInlinePolymorphicCallToSameTarget()
1237 class_linker, receiver, invoke_instruction->GetDexPc()); in TryInlinePolymorphicCallToSameTarget()
1245 invoke_instruction->IsInvokeVirtual() ? HClassTableGet::TableKind::kVTable in TryInlinePolymorphicCallToSameTarget()
1248 invoke_instruction->GetDexPc()); in TryInlinePolymorphicCallToSameTarget()
1253 reinterpret_cast<intptr_t>(actual_method), invoke_instruction->GetDexPc()); in TryInlinePolymorphicCallToSameTarget()
1256 reinterpret_cast<intptr_t>(actual_method), invoke_instruction->GetDexPc()); in TryInlinePolymorphicCallToSameTarget()
1269 CreateDiamondPatternForPolymorphicInline(compare, return_replacement, invoke_instruction); in TryInlinePolymorphicCallToSameTarget()
1276 invoke_instruction->GetDexPc()); in TryInlinePolymorphicCallToSameTarget()
1278 deoptimize->CopyEnvironmentFrom(invoke_instruction->GetEnvironment()); in TryInlinePolymorphicCallToSameTarget()
1280 invoke_instruction->ReplaceWith(return_replacement); in TryInlinePolymorphicCallToSameTarget()
1283 invoke_instruction->GetBlock()->RemoveInstruction(invoke_instruction); in TryInlinePolymorphicCallToSameTarget()
1301 bool HInliner::TryInlineAndReplace(HInvoke* invoke_instruction, in TryInlineAndReplace() argument
1306 DCHECK(!invoke_instruction->IsIntrinsic()); in TryInlineAndReplace()
1308 uint32_t dex_pc = invoke_instruction->GetDexPc(); in TryInlineAndReplace()
1309 HInstruction* cursor = invoke_instruction->GetPrevious(); in TryInlineAndReplace()
1310 HBasicBlock* bb_cursor = invoke_instruction->GetBlock(); in TryInlineAndReplace()
1315 if (invoke_instruction->GetResolvedMethod() != method && method->IsIntrinsic()) { in TryInlineAndReplace()
1317 if (invoke_instruction->IsInvokeInterface()) { in TryInlineAndReplace()
1322 invoke_instruction->GetNumberOfArguments(), in TryInlineAndReplace()
1323 invoke_instruction->GetType(), in TryInlineAndReplace()
1324 invoke_instruction->GetDexPc(), in TryInlineAndReplace()
1325 invoke_instruction->GetDexMethodIndex(), // Use interface method's dex method index. in TryInlineAndReplace()
1329 HInputsRef inputs = invoke_instruction->GetInputs(); in TryInlineAndReplace()
1333 invoke_instruction->GetBlock()->InsertInstructionBefore(new_invoke, invoke_instruction); in TryInlineAndReplace()
1334 new_invoke->CopyEnvironmentFrom(invoke_instruction->GetEnvironment()); in TryInlineAndReplace()
1335 if (invoke_instruction->GetType() == DataType::Type::kReference) { in TryInlineAndReplace()
1336 new_invoke->SetReferenceTypeInfo(invoke_instruction->GetReferenceTypeInfo()); in TryInlineAndReplace()
1342 invoke_instruction->SetResolvedMethod(method); in TryInlineAndReplace()
1344 } else if (!TryBuildAndInline(invoke_instruction, method, receiver_type, &return_replacement)) { in TryInlineAndReplace()
1345 if (invoke_instruction->IsInvokeInterface()) { in TryInlineAndReplace()
1365 method, caller_dex_file, invoke_instruction->GetDexMethodIndex()); in TryInlineAndReplace()
1371 invoke_instruction->GetNumberOfArguments(), in TryInlineAndReplace()
1372 invoke_instruction->GetType(), in TryInlineAndReplace()
1373 invoke_instruction->GetDexPc(), in TryInlineAndReplace()
1377 HInputsRef inputs = invoke_instruction->GetInputs(); in TryInlineAndReplace()
1381 invoke_instruction->GetBlock()->InsertInstructionBefore(new_invoke, invoke_instruction); in TryInlineAndReplace()
1382 new_invoke->CopyEnvironmentFrom(invoke_instruction->GetEnvironment()); in TryInlineAndReplace()
1383 if (invoke_instruction->GetType() == DataType::Type::kReference) { in TryInlineAndReplace()
1384 new_invoke->SetReferenceTypeInfo(invoke_instruction->GetReferenceTypeInfo()); in TryInlineAndReplace()
1400 AddCHAGuard(invoke_instruction, dex_pc, cursor, bb_cursor); in TryInlineAndReplace()
1403 invoke_instruction->ReplaceWith(return_replacement); in TryInlineAndReplace()
1406 invoke_instruction->GetBlock()->RemoveInstruction(invoke_instruction); in TryInlineAndReplace()
1409 if (do_rtp && ReturnTypeMoreSpecific(invoke_instruction, return_replacement)) { in TryInlineAndReplace()
1475 bool HInliner::IsInliningSupported(const HInvoke* invoke_instruction, in IsInliningSupported() argument
1491 if (invoke_instruction->IsInvokeStaticOrDirect() && in IsInliningSupported()
1492 invoke_instruction->AsInvokeStaticOrDirect()->IsStaticWithImplicitClinitCheck()) { in IsInliningSupported()
1530 bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, in TryBuildAndInline() argument
1539 if (TryPatternSubstitution(invoke_instruction, method, return_replacement)) { in TryBuildAndInline()
1559 if (!IsInliningSupported(invoke_instruction, method, accessor)) { in TryBuildAndInline()
1568 invoke_instruction, method, receiver_type, return_replacement)) { in TryBuildAndInline()
1577 static HInstruction* GetInvokeInputForArgVRegIndex(HInvoke* invoke_instruction, in GetInvokeInputForArgVRegIndex() argument
1582 DCHECK_LT(input_index, invoke_instruction->GetNumberOfArguments()); in GetInvokeInputForArgVRegIndex()
1583 if (DataType::Is64BitType(invoke_instruction->InputAt(input_index)->GetType())) { in GetInvokeInputForArgVRegIndex()
1588 DCHECK_LT(input_index, invoke_instruction->GetNumberOfArguments()); in GetInvokeInputForArgVRegIndex()
1589 return invoke_instruction->InputAt(input_index); in GetInvokeInputForArgVRegIndex()
1593 bool HInliner::TryPatternSubstitution(HInvoke* invoke_instruction, in TryPatternSubstitution() argument
1603 DCHECK_EQ(invoke_instruction->GetType(), DataType::Type::kVoid); in TryPatternSubstitution()
1607 *return_replacement = GetInvokeInputForArgVRegIndex(invoke_instruction, in TryPatternSubstitution()
1624 HInstruction* obj = GetInvokeInputForArgVRegIndex(invoke_instruction, data.object_arg); in TryPatternSubstitution()
1628 invoke_instruction->GetBlock()->InsertInstructionBefore(iget, invoke_instruction); in TryPatternSubstitution()
1638 HInstruction* obj = GetInvokeInputForArgVRegIndex(invoke_instruction, data.object_arg); in TryPatternSubstitution()
1639 HInstruction* value = GetInvokeInputForArgVRegIndex(invoke_instruction, data.src_arg); in TryPatternSubstitution()
1643 invoke_instruction->GetBlock()->InsertInstructionBefore(iput, invoke_instruction); in TryPatternSubstitution()
1646 *return_replacement = GetInvokeInputForArgVRegIndex(invoke_instruction, return_arg); in TryPatternSubstitution()
1674 HInstruction* obj = GetInvokeInputForArgVRegIndex(invoke_instruction, in TryPatternSubstitution()
1678 HInstruction* value = GetInvokeInputForArgVRegIndex(invoke_instruction, iput_args[i]); in TryPatternSubstitution()
1684 invoke_instruction->GetBlock()->InsertInstructionBefore(iput, invoke_instruction); in TryPatternSubstitution()
1698 invoke_instruction->GetBlock()->InsertInstructionBefore(constructor_fence, in TryPatternSubstitution()
1699 invoke_instruction); in TryPatternSubstitution()
1800 HInvoke* invoke_instruction, in SubstituteArguments() argument
1811 HInstruction* argument = invoke_instruction->InputAt(parameter_index); in SubstituteArguments()
1839 if (run_rtp || ArgumentTypesMoreSpecific(invoke_instruction, resolved_method)) { in SubstituteArguments()
1989 bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, in TryBuildAndInlineHelper() argument
2020 InvokeType invoke_type = invoke_instruction->GetInvokeType(); in TryBuildAndInlineHelper()
2080 SubstituteArguments(callee_graph, invoke_instruction, receiver_type, dex_compilation_unit); in TryBuildAndInlineHelper()
2085 if (!CanInlineBody(callee_graph, invoke_instruction->GetBlock(), &number_of_instructions)) { in TryBuildAndInlineHelper()
2095 *return_replacement = callee_graph->InlineInto(graph_, invoke_instruction); in TryBuildAndInlineHelper()
2190 bool HInliner::ArgumentTypesMoreSpecific(HInvoke* invoke_instruction, ArtMethod* resolved_method) { in ArgumentTypesMoreSpecific() argument
2196 invoke_instruction->InputAt(0u))) { in ArgumentTypesMoreSpecific()
2210 HInstruction* input = invoke_instruction->InputAt(input_idx); in ArgumentTypesMoreSpecific()
2225 bool HInliner::ReturnTypeMoreSpecific(HInvoke* invoke_instruction, in ReturnTypeMoreSpecific() argument
2231 if (IsReferenceTypeRefinement(invoke_instruction->GetReferenceTypeInfo(), in ReturnTypeMoreSpecific()