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

Side by Side Diff: runtime/vm/intermediate_language_mips.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_arm64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2631 __ sllv(result, left, TMP); 2631 __ sllv(result, left, TMP);
2632 } 2632 }
2633 return; 2633 return;
2634 } 2634 }
2635 2635
2636 const bool right_needs_check = 2636 const bool right_needs_check =
2637 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); 2637 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1));
2638 if (is_truncating) { 2638 if (is_truncating) {
2639 if (right_needs_check) { 2639 if (right_needs_check) {
2640 const bool right_may_be_negative = 2640 const bool right_may_be_negative =
2641 (right_range == NULL) || right_range->IsNegative(); 2641 (right_range == NULL) || !right_range->IsPositive();
2642 if (right_may_be_negative) { 2642 if (right_may_be_negative) {
2643 ASSERT(shift_left->CanDeoptimize()); 2643 ASSERT(shift_left->CanDeoptimize());
2644 __ bltz(right, deopt); 2644 __ bltz(right, deopt);
2645 } 2645 }
2646 Label done, is_not_zero; 2646 Label done, is_not_zero;
2647 2647
2648 __ sltiu(CMPRES1, 2648 __ sltiu(CMPRES1,
2649 right, Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits)))); 2649 right, Immediate(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
2650 __ movz(result, ZR, CMPRES1); // result = right >= kBits ? 0 : result. 2650 __ movz(result, ZR, CMPRES1); // result = right >= kBits ? 0 : result.
2651 __ sra(TMP, right, kSmiTagSize); 2651 __ sra(TMP, right, kSmiTagSize);
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after
4681 compiler->GenerateCall(token_pos(), 4681 compiler->GenerateCall(token_pos(),
4682 &label, 4682 &label,
4683 PcDescriptors::kOther, 4683 PcDescriptors::kOther,
4684 locs()); 4684 locs());
4685 __ Drop(ArgumentCount()); // Discard arguments. 4685 __ Drop(ArgumentCount()); // Discard arguments.
4686 } 4686 }
4687 4687
4688 } // namespace dart 4688 } // namespace dart
4689 4689
4690 #endif // defined TARGET_ARCH_MIPS 4690 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698