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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 13469013: Use range analysis to improve constant propagation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 20842)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -608,7 +608,8 @@
BranchInstr::BranchInstr(ComparisonInstr* comparison, bool is_checked)
: comparison_(comparison),
is_checked_(is_checked),
- constrained_type_(NULL) {
+ constrained_type_(NULL),
+ constant_target_(NULL) {
for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) {
comparison->InputAt(i)->set_instruction(this);
}
@@ -2192,6 +2193,19 @@
}
+bool Range::IsUnsatisfiable() const {
+ // Constant case: For example [0, -1].
+ if (Range::ConstantMin(this).value() > Range::ConstantMax(this).value()) {
+ return true;
+ }
+ // Symbol case: For example [v+1, v].
+ if (DependOnSameSymbol(min(), max()) && min().offset() > max().offset()) {
+ return true;
+ }
+ return false;
+}
+
+
bool CheckArrayBoundInstr::IsFixedLengthArrayType(intptr_t cid) {
return LoadFieldInstr::IsFixedLengthArrayCid(cid);
}
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698