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

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 15827006: Implement shift left on ARM and re-enable previously disabled test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 // TODO(srdjan): Implement code below for is_truncating(). 2191 // TODO(srdjan): Implement code below for is_truncating().
2192 // If left is constant, we know the maximal allowed size for right. 2192 // If left is constant, we know the maximal allowed size for right.
2193 const Object& obj = shift_left->left()->BoundConstant(); 2193 const Object& obj = shift_left->left()->BoundConstant();
2194 if (obj.IsSmi()) { 2194 if (obj.IsSmi()) {
2195 const intptr_t left_int = Smi::Cast(obj).Value(); 2195 const intptr_t left_int = Smi::Cast(obj).Value();
2196 if (left_int == 0) { 2196 if (left_int == 0) {
2197 __ cmpl(right, Immediate(0)); 2197 __ cmpl(right, Immediate(0));
2198 __ j(NEGATIVE, deopt); 2198 __ j(NEGATIVE, deopt);
2199 return; 2199 return;
2200 } 2200 }
2201 intptr_t tmp = (left_int > 0) ? left_int : ~left_int; 2201 const intptr_t max_right = kSmiBits - Utils::HighestBit(left_int);
2202 intptr_t max_right = kSmiBits;
2203 while ((tmp >>= 1) != 0) {
2204 max_right--;
2205 }
2206 const bool right_needs_check = 2202 const bool right_needs_check =
2207 (right_range == NULL) || 2203 (right_range == NULL) ||
2208 !right_range->IsWithin(0, max_right - 1); 2204 !right_range->IsWithin(0, max_right - 1);
2209 if (right_needs_check) { 2205 if (right_needs_check) {
2210 __ cmpl(right, 2206 __ cmpl(right,
2211 Immediate(reinterpret_cast<int32_t>(Smi::New(max_right)))); 2207 Immediate(reinterpret_cast<int32_t>(Smi::New(max_right))));
2212 __ j(ABOVE_EQUAL, deopt); 2208 __ j(ABOVE_EQUAL, deopt);
2213 } 2209 }
2214 __ SmiUntag(right); 2210 __ SmiUntag(right);
2215 __ shll(left, right); 2211 __ shll(left, right);
(...skipping 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after
4746 PcDescriptors::kOther, 4742 PcDescriptors::kOther,
4747 locs()); 4743 locs());
4748 __ Drop(2); // Discard type arguments and receiver. 4744 __ Drop(2); // Discard type arguments and receiver.
4749 } 4745 }
4750 4746
4751 } // namespace dart 4747 } // namespace dart
4752 4748
4753 #undef __ 4749 #undef __
4754 4750
4755 #endif // defined TARGET_ARCH_IA32 4751 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698