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

Unified Diff: runtime/vm/intermediate_language_ia32.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.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 14299)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -1757,9 +1757,14 @@
Label call_method, done;
// Check if count too large for handling it inlined.
__ movl(temp, left);
- __ cmpl(right,
+ 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) {
+ __ cmpl(right,
Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
- __ j(ABOVE_EQUAL, &call_method, Assembler::kNearJump);
+ __ j(ABOVE_EQUAL, &call_method, Assembler::kNearJump);
+ }
Register right_temp = locs()->temp(1).reg();
ASSERT(right_temp == ECX); // Count must be in ECX
__ movl(right_temp, right);
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698