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

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

Issue 321943005: Fix bug with range of shift 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after
2928 __ Lsl(result, left, IP); 2928 __ Lsl(result, left, IP);
2929 } 2929 }
2930 return; 2930 return;
2931 } 2931 }
2932 2932
2933 const bool right_needs_check = 2933 const bool right_needs_check =
2934 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); 2934 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1));
2935 if (is_truncating) { 2935 if (is_truncating) {
2936 if (right_needs_check) { 2936 if (right_needs_check) {
2937 const bool right_may_be_negative = 2937 const bool right_may_be_negative =
2938 (right_range == NULL) || right_range->IsNegative(); 2938 (right_range == NULL) || !right_range->IsPositive();
2939 if (right_may_be_negative) { 2939 if (right_may_be_negative) {
2940 ASSERT(shift_left->CanDeoptimize()); 2940 ASSERT(shift_left->CanDeoptimize());
2941 __ cmp(right, Operand(0)); 2941 __ cmp(right, Operand(0));
2942 __ b(deopt, MI); 2942 __ b(deopt, MI);
2943 } 2943 }
2944 2944
2945 __ cmp(right, Operand(reinterpret_cast<int32_t>(Smi::New(Smi::kBits)))); 2945 __ cmp(right, Operand(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
2946 __ mov(result, Operand(0), CS); 2946 __ mov(result, Operand(0), CS);
2947 __ SmiUntag(IP, right, CC); // SmiUntag right into IP if CC. 2947 __ SmiUntag(IP, right, CC); // SmiUntag right into IP if CC.
2948 __ Lsl(result, left, IP, CC); 2948 __ Lsl(result, left, IP, CC);
(...skipping 3404 matching lines...) Expand 10 before | Expand all | Expand 10 after
6353 compiler->GenerateCall(token_pos(), 6353 compiler->GenerateCall(token_pos(),
6354 &label, 6354 &label,
6355 PcDescriptors::kOther, 6355 PcDescriptors::kOther,
6356 locs()); 6356 locs());
6357 __ Drop(ArgumentCount()); // Discard arguments. 6357 __ Drop(ArgumentCount()); // Discard arguments.
6358 } 6358 }
6359 6359
6360 } // namespace dart 6360 } // namespace dart
6361 6361
6362 #endif // defined TARGET_ARCH_ARM 6362 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698