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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 2412653002: VM Propagate receiver type from calls to unique selectors in AOT compilation. (Closed)
Patch Set: addressed comments, added test Created 4 years, 2 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/flow_graph_type_propagator.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_type_propagator.cc
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 2162cfed4e9f175bcd6d3796fc75963cf9353261..d0dd61b37f2dd333fc54cb80eecabf9e6c72fb4c 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -216,9 +216,8 @@ void FlowGraphTypePropagator::VisitValue(Value* value) {
value->SetReachingType(type);
if (FLAG_support_il_printer && FLAG_trace_type_propagation) {
- THR_Print("reaching type to v%" Pd " for v%" Pd " is %s\n",
- value->instruction()->IsDefinition() ?
- value->instruction()->AsDefinition()->ssa_temp_index() : -1,
+ THR_Print("reaching type to %s for v%" Pd " is %s\n",
+ value->instruction()->ToCString(),
value->definition()->ssa_temp_index(),
type->ToCString());
}
@@ -263,6 +262,23 @@ void FlowGraphTypePropagator::VisitCheckClassId(CheckClassIdInstr* check) {
}
+void FlowGraphTypePropagator::VisitInstanceCall(InstanceCallInstr* instr) {
+ if (instr->has_unique_selector()) {
+ SetCid(instr->ArgumentAt(0),
+ instr->ic_data()->GetReceiverClassIdAt(0));
+ }
+}
+
+
+void FlowGraphTypePropagator::VisitPolymorphicInstanceCall(
+ PolymorphicInstanceCallInstr* instr) {
+ if (instr->instance_call()->has_unique_selector()) {
+ SetCid(instr->ArgumentAt(0),
+ instr->ic_data().GetReceiverClassIdAt(0));
+ }
+}
+
+
void FlowGraphTypePropagator::VisitGuardFieldClass(
GuardFieldClassInstr* guard) {
const intptr_t cid = guard->field().guarded_cid();
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698