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

Unified Diff: runtime/vm/flow_graph.cc

Issue 2751103003: VM: Propagate non-nullness from instance calls. (Closed)
Patch Set: canonicalize redundant redefinitions Created 3 years, 9 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.h ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index c7bd3e1b754ad52a448e00697362e21b0ba49ab0..c14c18e5e792fec7e25013d395e9060d5b07aab3 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -420,6 +420,7 @@ void FlowGraph::ComputeIsReceiver(PhiInstr* phi) const {
bool FlowGraph::IsReceiver(Definition* def) const {
+ def = def->OriginalDefinition(); // Could be redefined.
if (def->IsParameter()) return (def->AsParameter()->index() == 0);
if (!def->IsPhi() || graph_entry()->catch_entries().is_empty()) return false;
PhiInstr* phi = def->AsPhi();
@@ -1292,20 +1293,20 @@ void FlowGraph::RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis) {
}
-RedefinitionInstr* FlowGraph::EnsureRedefinition(BlockEntryInstr* block,
+RedefinitionInstr* FlowGraph::EnsureRedefinition(Instruction* prev,
Definition* original,
CompileType compile_type) {
- RedefinitionInstr* first = block->next()->AsRedefinition();
- if (first != NULL && (first->type() != NULL)) {
+ RedefinitionInstr* first = prev->next()->AsRedefinition();
+ if (first != NULL && (first->constrained_type() != NULL)) {
if ((first->value()->definition() == original) &&
- first->type()->IsEqualTo(&compile_type)) {
+ first->constrained_type()->IsEqualTo(&compile_type)) {
// Already redefined. Do nothing.
return NULL;
}
}
RedefinitionInstr* redef = new RedefinitionInstr(new Value(original));
- redef->set_type(new CompileType(compile_type));
- InsertAfter(block, redef, NULL, FlowGraph::kValue);
+ redef->set_constrained_type(new CompileType(compile_type));
+ InsertAfter(prev, redef, NULL, FlowGraph::kValue);
RenameDominatedUses(original, redef, redef);
return redef;
}
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698