Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2716593002: Propagate this-specialization to regular (megamorphic) calls (Closed)
Patch Set: Add new Canonicalize call to make use of type data Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/jit_optimizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 9ca50407861f25d80bfa09e82cf196ef1b1d42c6..1f72d19ea4b4a20e21847bc6eee531e163103485 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3192,6 +3192,28 @@ RawType* PolymorphicInstanceCallInstr::ComputeRuntimeType(
}
+Definition* InstanceCallInstr::Canonicalize(FlowGraph* flow_graph) {
+ const intptr_t receiver_cid = PushArgumentAt(0)->value()->Type()->ToCid();
+
+ if (!HasICData()) return this;
+
+ const ICData& new_ic_data =
+ FlowGraphCompiler::TrySpecializeICDataByReceiverCid(*ic_data(),
+ receiver_cid);
+ if (new_ic_data.raw() == ic_data()->raw()) {
+ // No specialization.
+ return this;
+ }
+
+ const bool with_checks = false;
+ const bool complete = false;
+ PolymorphicInstanceCallInstr* specialized = new PolymorphicInstanceCallInstr(
+ this, new_ic_data, with_checks, complete);
+ flow_graph->InsertBefore(this, specialized, env(), FlowGraph::kValue);
+ return specialized;
+}
+
+
Definition* PolymorphicInstanceCallInstr::Canonicalize(FlowGraph* flow_graph) {
if (!HasSingleRecognizedTarget() || with_checks()) {
return this;
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/jit_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698