545 {
548 if (depth > inlining_depth_threshold_) {
549 if (FLAG_print_inlining_tree) {
551 }
552 return;
553 }
554
555
556
557 const bool inline_only_profitable_methods =
558 (depth >= inlining_depth_threshold_);
559
560
562 if (is_aot) {
563 graph->GetLoopHierarchy();
564 }
565
566 const intptr_t instance_calls_start_ix = instance_calls_.length();
567 const intptr_t static_calls_start_ix = static_calls_.length();
568 const intptr_t calls_start_ix = calls_->length();
569 for (BlockIterator block_it = graph->postorder_iterator(); !block_it.Done();
570 block_it.Advance()) {
571 BlockEntryInstr* entry = block_it.Current();
572 const intptr_t nesting_depth = entry->NestingDepth();
573 for (auto current : entry->instructions()) {
574 if (auto instance_call = current->AsPolymorphicInstanceCall()) {
575 if (!inline_only_profitable_methods ||
576 instance_call->IsSureToCallSingleRecognizedTarget() ||
577 instance_call->HasOnlyDispatcherOrImplicitAccessorTargets()) {
578
579
580 instance_calls_.Add({graph, instance_call, depth, nesting_depth});
581 } else {
582
583
584 if (FLAG_print_inlining_tree) {
585 const Function* caller = &graph->function();
586 const Function*
target = &instance_call->targets().FirstTarget();
587 inlined_info->Add(InlinedInfo(caller,
target, depth + 1,
588 instance_call, "Too deep"));
589 }
590 }
591 } else if (auto call = current->AsInstanceCall()) {
592 calls_->Add({graph,
call, depth, nesting_depth});
593 } else if (auto static_call = current->AsStaticCall()) {
594 HandleStaticCall(static_call, inline_only_profitable_methods, graph,
595 depth, nesting_depth, inlined_info);
596 } else if (auto closure_call = current->AsClosureCall()) {
597 if (!inline_only_profitable_methods) {
598
599
600 closure_calls_.Add({graph, closure_call, depth, nesting_depth});
601 } else {
602
603 }
604 }
605 }
606 }
608 calls_start_ix);
609 }
void FindCallSites(FlowGraph *graph, intptr_t depth, GrowableArray< InlinedInfo > *inlined_info)
void ComputeCallSiteRatio(intptr_t static_calls_start_ix, intptr_t instance_calls_start_ix, intptr_t calls_start_ix)
static void RecordAllNotInlinedFunction(FlowGraph *graph, intptr_t depth, GrowableArray< InlinedInfo > *inlined_info)
static CompilerState & Current()
#define COMPILER_TIMINGS_TIMER_SCOPE(thread, timer_id)