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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 336773003: More precise range analysis for smi multiplication. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | 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 37311)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -3087,7 +3087,9 @@
case Token::kMUL: {
const int64_t left_max = ConstantAbsMax(left_range);
const int64_t right_max = ConstantAbsMax(right_range);
- if ((left_max < 0x7FFFFFFF) && (right_max < 0x7FFFFFFF)) {
+ ASSERT(left_max <= -kSmiMin);
+ ASSERT(right_max <= -kSmiMin);
+ if ((left_max == 0) || (right_max <= kMaxInt64 / left_max)) {
// Product of left and right max values stays in 64 bit range.
const int64_t result_max = left_max * right_max;
if (Smi::IsValid64(result_max) && Smi::IsValid64(-result_max)) {
« 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