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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 12218181: Recognize pattern (a << b) & c with c being a positive Smi and allow left shift to truncate the res… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 18705)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -850,6 +850,14 @@
return (right_range == NULL)
|| !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
}
+ case Token::kSHL: {
+ Range* right_range = this->right()->definition()->range();
+ if ((right_range != NULL) && is_truncating()) {
+ // Can deoptimize if right can be negative.
+ return !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
+ }
+ return overflow_;
Vyacheslav Egorov (Google) 2013/02/20 00:37:06 I think this can be just return true;
srdjan 2013/02/21 00:47:17 Done.
+ }
default:
return overflow_;
}

Powered by Google App Engine
This is Rietveld 408576698