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

Unified Diff: runtime/vm/flow_graph_range_analysis.cc

Issue 2498073004: AOT: Fix bug in receiver type propagation after unique selector calls. (Closed)
Patch Set: address comments Created 4 years, 1 month 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.cc ('k') | tests/language/vm/optimized_unique_selector_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_range_analysis.cc
diff --git a/runtime/vm/flow_graph_range_analysis.cc b/runtime/vm/flow_graph_range_analysis.cc
index 28ec3251384e953c86ed956720693af7ac164a11..b19b4e63a1778120cd22b7790cfef65e8d6ba73d 100644
--- a/runtime/vm/flow_graph_range_analysis.cc
+++ b/runtime/vm/flow_graph_range_analysis.cc
@@ -271,50 +271,6 @@ void RangeAnalysis::CollectValues() {
}
-// Returns true if use is dominated by the given instruction.
-// Note: uses that occur at instruction itself are not dominated by it.
-static bool IsDominatedUse(Instruction* dom, Value* use) {
- BlockEntryInstr* dom_block = dom->GetBlock();
-
- Instruction* instr = use->instruction();
-
- PhiInstr* phi = instr->AsPhi();
- if (phi != NULL) {
- return dom_block->Dominates(phi->block()->PredecessorAt(use->use_index()));
- }
-
- BlockEntryInstr* use_block = instr->GetBlock();
- if (use_block == dom_block) {
- // Fast path for the case of block entry.
- if (dom_block == dom) return true;
-
- for (Instruction* curr = dom->next(); curr != NULL; curr = curr->next()) {
- if (curr == instr) return true;
- }
-
- return false;
- }
-
- return dom_block->Dominates(use_block);
-}
-
-
-void RangeAnalysis::RenameDominatedUses(Definition* def,
- Instruction* dom,
- Definition* other) {
- for (Value::Iterator it(def->input_use_list()); !it.Done(); it.Advance()) {
- Value* use = it.Current();
-
- // Skip dead phis.
- PhiInstr* phi = use->instruction()->AsPhi();
- ASSERT((phi == NULL) || phi->is_alive());
- if (IsDominatedUse(dom, use)) {
- use->BindTo(other);
- }
- }
-}
-
-
// For a comparison operation return an operation for the equivalent flipped
// comparison: a (op) b === b (op') a.
static Token::Kind FlipComparison(Token::Kind op) {
@@ -390,7 +346,7 @@ ConstraintInstr* RangeAnalysis::InsertConstraintFor(Value* use,
constraint = new (Z) ConstraintInstr(use->CopyWithType(), constraint_range);
flow_graph_->InsertAfter(after, constraint, NULL, FlowGraph::kValue);
- RenameDominatedUses(defn, constraint, constraint);
+ FlowGraph::RenameDominatedUses(defn, constraint, constraint);
constraints_.Add(constraint);
return constraint;
}
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | tests/language/vm/optimized_unique_selector_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698