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

Unified Diff: runtime/vm/intermediate_language.h

Issue 330263002: Eliminate overflow check for non-overflowing smi << operations. (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 | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 37537)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -2691,6 +2691,15 @@
int64_t shift_count,
const RangeBoundary& overflow);
+ static RangeBoundary Shr(const RangeBoundary& value_boundary,
+ intptr_t shift_count) {
+ ASSERT(value_boundary.IsConstant());
+ ASSERT(shift_count >= 0);
+ int64_t value = static_cast<int64_t>(value_boundary.ConstantValue());
+ int64_t result = value >> shift_count;
+ return RangeBoundary(result);
+ }
+
// Attempts to calculate a + b when:
// a is a symbol and b is a constant OR
// a is a constant and b is a symbol
@@ -2806,6 +2815,10 @@
const Range* right_range,
RangeBoundary* min,
RangeBoundary* max);
+ static void Shr(const Range* left_range,
+ const Range* right_range,
+ RangeBoundary* min,
+ RangeBoundary* max);
static void Shl(const Range* left_range,
const Range* right_range,
@@ -7224,7 +7237,7 @@
void set_overflow(bool overflow) { overflow_ = overflow; }
void set_is_truncating(bool value) { is_truncating_ = value; }
- bool is_truncating() const { return is_truncating_; }
+ bool IsTruncating() const { return is_truncating_ || !overflow_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698