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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 70133004: Constant propagation support for type asserts. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
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 30195)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -6197,8 +6197,11 @@
} else if (IsConstant(value)) {
// We are ignoring the instantiator and instantiator_type_arguments, but
// still monotonic and safe.
- // TODO(kmillikin): Handle constants.
- SetValue(instr, non_constant_);
+ if (instr->value()->Type()->IsAssignableTo(instr->dst_type())) {
+ SetValue(instr, value);
+ } else {
+ SetValue(instr, non_constant_);
+ }
}
}
@@ -6208,8 +6211,11 @@
if (IsNonConstant(value)) {
SetValue(instr, non_constant_);
} else if (IsConstant(value)) {
- // TODO(kmillikin): Handle assertion.
- SetValue(instr, non_constant_);
+ if (value.IsBool()) {
+ SetValue(instr, value);
+ } else {
+ SetValue(instr, non_constant_);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698