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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10830339: Propagate class ids using existing type propagation framework. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « no previous file | runtime/vm/il_printer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 10748)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -672,6 +672,12 @@
if (changed) {
still_changing_ = true;
}
+ // Propagate class ids.
+ intptr_t cid = bind->computation()->ResultCid();
+ changed = bind->SetPropagatedCid(cid);
+ if (changed) {
+ still_changing_ = true;
+ }
}
@@ -686,6 +692,19 @@
if (changed) {
still_changing_ = true;
}
+ if (phi->propagated_cid() == kDynamicCid) {
regis 2012/08/15 22:46:54 So far, I have tried not to depend on the type of
srdjan 2012/08/16 00:34:46 Done.
+ return;
+ }
+ // Merge class ids: if any two inputs have different class ids than result
regis 2012/08/15 22:46:54 s/than/then/
srdjan 2012/08/16 00:34:46 Done.
+ // is kDynamicCid.
+ for (intptr_t i = 0; i < phi->InputCount(); i++) {
+ intptr_t cid = phi->InputAt(i)->ResultCid();
+ ASSERT(cid != kIllegalCid);
+ changed = phi->SetPropagatedCid(cid);
regis 2012/08/15 22:46:54 This does not look right. You are not merging, but
srdjan 2012/08/16 00:34:46 Done.
+ if (changed) {
+ still_changing_ = true;
+ }
+ }
}
« no previous file with comments | « no previous file | runtime/vm/il_printer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698