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

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

Issue 859943005: Fix 64-bit bug in optimized class-check instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 | « no previous file | tests/language/vm/optimized_check_class_test.dart » ('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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/constant_propagator.h" 8 #include "vm/constant_propagator.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return true; 210 return true;
211 } 211 }
212 return false; 212 return false;
213 } 213 }
214 214
215 215
216 intptr_t CheckClassInstr::ComputeCidMask() const { 216 intptr_t CheckClassInstr::ComputeCidMask() const {
217 ASSERT(IsDenseSwitch()); 217 ASSERT(IsDenseSwitch());
218 intptr_t mask = 0; 218 intptr_t mask = 0;
219 for (intptr_t i = 0; i < cids_.length(); ++i) { 219 for (intptr_t i = 0; i < cids_.length(); ++i) {
220 mask |= 1 << (cids_[i] - cids_[0]); 220 mask |= static_cast<intptr_t>(1) << (cids_[i] - cids_[0]);
221 } 221 }
222 return mask; 222 return mask;
223 } 223 }
224 224
225 225
226 bool CheckClassInstr::IsDenseMask(intptr_t mask) { 226 bool CheckClassInstr::IsDenseMask(intptr_t mask) {
227 // Returns true if the mask is a continuos sequence of ones in its binary 227 // Returns true if the mask is a continuos sequence of ones in its binary
228 // representation (i.e. no holes) 228 // representation (i.e. no holes)
229 return mask == -1 || Utils::IsPowerOfTwo(mask + 1); 229 return mask == -1 || Utils::IsPowerOfTwo(mask + 1);
230 } 230 }
(...skipping 3259 matching lines...) Expand 10 before | Expand all | Expand 10 after
3490 case Token::kTRUNCDIV: return 0; 3490 case Token::kTRUNCDIV: return 0;
3491 case Token::kMOD: return 1; 3491 case Token::kMOD: return 1;
3492 default: UNIMPLEMENTED(); return -1; 3492 default: UNIMPLEMENTED(); return -1;
3493 } 3493 }
3494 } 3494 }
3495 3495
3496 3496
3497 #undef __ 3497 #undef __
3498 3498
3499 } // namespace dart 3499 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/vm/optimized_check_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698