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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 11175013: Add range to kBIT_AND with positive constants. Use that range to eliminate compares in left shifts. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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/intermediate_language_ia32.cc ('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_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 14299)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -1719,9 +1719,14 @@
Label call_method, done;
// Check if count too large for handling it inlined.
__ movq(temp, left);
- __ cmpq(right,
- Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))));
- __ j(ABOVE_EQUAL, &call_method, Assembler::kNearJump);
+ Range* right_range = this->right()->definition()->range();
+ const bool right_needs_check =
+ (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1));
+ if (right_needs_check) {
+ __ cmpq(right,
+ Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))));
+ __ j(ABOVE_EQUAL, &call_method, Assembler::kNearJump);
+ }
Register right_temp = locs()->temp(1).reg();
ASSERT(right_temp == RCX); // Count must be in RCX
__ movq(right_temp, right);
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698