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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 2709093003: Fixup redefinitions before doing code motion (Closed)
Patch Set: fix build 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/flow_graph_inliner.cc ('k') | runtime/vm/precompiler.cc » ('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 782ea05234f7166d6e33c85c06cf6d12c7456799..d3cdc8418fb36da18f6e90f63ddd8fb341df80a6 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -232,8 +232,17 @@ void FlowGraphTypePropagator::VisitCheckClass(CheckClassInstr* check) {
void FlowGraphTypePropagator::VisitCheckClassId(CheckClassIdInstr* check) {
- // Can't propagate the type/cid because it may cause illegal code motion and
- // we don't track dependencies in all places via redefinitions.
+ if (!check->Dependencies().IsNone()) {
+ // TODO(vegorov): If check is affected by side-effect we can still propagate
+ // the type further but not the cid.
+ return;
+ }
+
+ LoadClassIdInstr* load_cid =
+ check->value()->definition()->OriginalDefinition()->AsLoadClassId();
+ if (load_cid != NULL) {
+ SetCid(load_cid->object()->definition(), check->cid());
+ }
}
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698