Skip to content

Commit 99e7850

Browse files
sstricklcommit-bot@chromium.org
authored andcommitted
[vm/compiler] Update outdated comment.
Also outline a possible optimization here, with an corresponding issue filed to later do that work. Change-Id: I353cab8842cbbc0e2e15e127e45e736884d3c51e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106343 Commit-Queue: Teagan Strickland <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
1 parent b9e005f commit 99e7850

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • runtime/vm/compiler/backend

runtime/vm/compiler/backend/il.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4569,10 +4569,15 @@ RawType* PolymorphicInstanceCallInstr::ComputeRuntimeType(
45694569
Definition* 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 =

0 commit comments

Comments
 (0)