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

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

Issue 626223002: Add unboxed Mint for X64 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 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 "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 5898 matching lines...) Expand 10 before | Expand all | Expand 10 after
5909 5909
5910 Label* deopt = NULL; 5910 Label* deopt = NULL;
5911 if (CanDeoptimize()) { 5911 if (CanDeoptimize()) {
5912 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp); 5912 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp);
5913 } 5913 }
5914 if (locs()->in(1).IsConstant()) { 5914 if (locs()->in(1).IsConstant()) {
5915 // Code for a constant shift amount. 5915 // Code for a constant shift amount.
5916 ASSERT(locs()->in(1).constant().IsSmi()); 5916 ASSERT(locs()->in(1).constant().IsSmi());
5917 const int32_t shift = 5917 const int32_t shift =
5918 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1; 5918 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1;
5919 if ((shift < 0) || (shift > kMintShiftCountLimit)) {
5920 __ jmp(deopt);
5921 return;
5922 } else if (shift == 0) {
5923 // Nothing to do for zero shift amount.
5924 return;
5925 }
5926 switch (op_kind()) { 5919 switch (op_kind()) {
5927 case Token::kSHR: { 5920 case Token::kSHR: {
5928 if (shift > 31) { 5921 if (shift > 31) {
5929 __ movl(left_lo, left_hi); // Shift by 32. 5922 __ movl(left_lo, left_hi); // Shift by 32.
5930 __ sarl(left_hi, Immediate(31)); // Sign extend left hi. 5923 __ sarl(left_hi, Immediate(31)); // Sign extend left hi.
5931 if (shift > 32) { 5924 if (shift > 32) {
5932 __ sarl(left_lo, Immediate(shift - 32)); 5925 __ sarl(left_lo, Immediate(shift - 32));
5933 } 5926 }
5934 } else { 5927 } else {
5935 __ shrdl(left_lo, left_hi, Immediate(shift)); 5928 __ shrdl(left_lo, left_hi, Immediate(shift));
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
6143 6136
6144 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp); 6137 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp);
6145 6138
6146 if (locs()->in(1).IsConstant()) { 6139 if (locs()->in(1).IsConstant()) {
6147 // Shifter is constant. 6140 // Shifter is constant.
6148 6141
6149 const Object& constant = locs()->in(1).constant(); 6142 const Object& constant = locs()->in(1).constant();
6150 ASSERT(constant.IsSmi()); 6143 ASSERT(constant.IsSmi());
6151 const intptr_t shift_value = Smi::Cast(constant).Value(); 6144 const intptr_t shift_value = Smi::Cast(constant).Value();
6152 6145
6153 // Check constant shift value. 6146
6154 if (shift_value == 0) { 6147 // Do the shift: (shift_value > 0) && (shift_value <= kShifterLimit).
6155 // Nothing to do. 6148 switch (op_kind()) {
6156 } else if (shift_value < 0) { 6149 case Token::kSHR:
6157 // Invalid shift value. 6150 __ shrl(left, Immediate(shift_value));
6158 __ jmp(deopt); 6151 break;
6159 } else if (shift_value > kShifterLimit) { 6152 case Token::kSHL:
6160 // Result is 0. 6153 __ shll(left, Immediate(shift_value));
6161 __ xorl(left, left); 6154 break;
6162 } else { 6155 default:
6163 // Do the shift: (shift_value > 0) && (shift_value <= kShifterLimit). 6156 UNREACHABLE();
6164 switch (op_kind()) {
6165 case Token::kSHR:
6166 __ shrl(left, Immediate(shift_value));
6167 break;
6168 case Token::kSHL:
6169 __ shll(left, Immediate(shift_value));
6170 break;
6171 default:
6172 UNREACHABLE();
6173 }
6174 } 6157 }
6175 return; 6158 return;
6176 } 6159 }
6177 6160
6178 // Non constant shift value. 6161 // Non constant shift value.
6179 6162
6180 Register shifter = locs()->in(1).reg(); 6163 Register shifter = locs()->in(1).reg();
6181 ASSERT(shifter == ECX); 6164 ASSERT(shifter == ECX);
6182 6165
6183 Label done; 6166 Label done;
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
6784 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6767 __ movl(EDX, Immediate(kInvalidObjectPointer));
6785 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6768 __ movl(EDX, Immediate(kInvalidObjectPointer));
6786 #endif 6769 #endif
6787 } 6770 }
6788 6771
6789 } // namespace dart 6772 } // namespace dart
6790 6773
6791 #undef __ 6774 #undef __
6792 6775
6793 #endif // defined TARGET_ARCH_IA32 6776 #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