File tree Expand file tree Collapse file tree
runtime/vm/compiler/backend Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4569,10 +4569,15 @@ RawType* PolymorphicInstanceCallInstr::ComputeRuntimeType(
45694569Definition* InstanceCallInstr::Canonicalize (FlowGraph* flow_graph) {
45704570 const intptr_t receiver_cid = Receiver ()->Type ()->ToCid ();
45714571
4572- // TODO(erikcorry): Even for cold call sites we could still try to look up
4573- // methods when we know the receiver cid. We don't currently do this because
4574- // it turns the InstanceCall into a PolymorphicInstanceCall which doesn't get
4575- // recognized or inlined when it is cold.
4572+ // We could turn cold call sites for known receiver cids into a StaticCall.
4573+ // However, that keeps the ICData of the InstanceCall from being updated.
4574+ // This is fine if there is no later deoptimization, but if there is, then
4575+ // the InstanceCall with the updated ICData for this receiver may then be
4576+ // better optimized by the compiler.
4577+ //
4578+ // TODO(dartbug.com/37291): Allow this optimization, but accumulate affected
4579+ // InstanceCallInstrs and the corresponding reciever cids during compilation.
4580+ // After compilation, add receiver checks to the ICData for those call sites.
45764581 if (ic_data ()->NumberOfUsedChecks () == 0 ) return this ;
45774582
45784583 const CallTargets* new_target =
You can’t perform that action at this time.
0 commit comments