Skip to content

Commit

Permalink
[vm/compiler] Update outdated comment.
Browse files Browse the repository at this point in the history
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 <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
  • Loading branch information
sstrickl authored and commit-bot@chromium.org committed Jun 18, 2019
1 parent b9e005f commit 99e7850
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions runtime/vm/compiler/backend/il.cc
Expand Up @@ -4569,10 +4569,15 @@ RawType* PolymorphicInstanceCallInstr::ComputeRuntimeType(
Definition* InstanceCallInstr::Canonicalize(FlowGraph* flow_graph) {
const intptr_t receiver_cid = Receiver()->Type()->ToCid();

// TODO(erikcorry): Even for cold call sites we could still try to look up
// methods when we know the receiver cid. We don't currently do this because
// it turns the InstanceCall into a PolymorphicInstanceCall which doesn't get
// recognized or inlined when it is cold.
// We could turn cold call sites for known receiver cids into a StaticCall.
// However, that keeps the ICData of the InstanceCall from being updated.
// This is fine if there is no later deoptimization, but if there is, then
// the InstanceCall with the updated ICData for this receiver may then be
// better optimized by the compiler.
//
// TODO(dartbug.com/37291): Allow this optimization, but accumulate affected
// InstanceCallInstrs and the corresponding reciever cids during compilation.
// After compilation, add receiver checks to the ICData for those call sites.
if (ic_data()->NumberOfUsedChecks() == 0) return this;

const CallTargets* new_target =
Expand Down

0 comments on commit 99e7850

Please sign in to comment.