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

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

Issue 26345002: Last cleanup int -> intptr_t. Also removed a hack. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/bit_vector.h ('k') | runtime/vm/block_scheduler.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/bitmap.h" 5 #include "vm/bitmap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ASSERT(data_ != NULL); 83 ASSERT(data_ != NULL);
84 return ((data_[byte_offset] & mask) != 0); 84 return ((data_[byte_offset] & mask) != 0);
85 } 85 }
86 86
87 87
88 void BitmapBuilder::SetBit(intptr_t bit_offset, bool value) { 88 void BitmapBuilder::SetBit(intptr_t bit_offset, bool value) {
89 if (!InRange(bit_offset)) { 89 if (!InRange(bit_offset)) {
90 FATAL1("Fatal error in BitmapBuilder::SetBit :" 90 FATAL1("Fatal error in BitmapBuilder::SetBit :"
91 " invalid bit_offset, %" Pd "\n", bit_offset); 91 " invalid bit_offset, %" Pd "\n", bit_offset);
92 } 92 }
93 int byte_offset = bit_offset >> kBitsPerByteLog2; 93 intptr_t byte_offset = bit_offset >> kBitsPerByteLog2;
94 ASSERT(byte_offset < data_size_in_bytes_); 94 ASSERT(byte_offset < data_size_in_bytes_);
95 int bit_remainder = bit_offset & (kBitsPerByte - 1); 95 intptr_t bit_remainder = bit_offset & (kBitsPerByte - 1);
96 uint8_t mask = 1U << bit_remainder; 96 uint8_t mask = 1U << bit_remainder;
97 ASSERT(data_ != NULL); 97 ASSERT(data_ != NULL);
98 if (value) { 98 if (value) {
99 data_[byte_offset] |= mask; 99 data_[byte_offset] |= mask;
100 } else { 100 } else {
101 data_[byte_offset] &= ~mask; 101 data_[byte_offset] &= ~mask;
102 } 102 }
103 } 103 }
104 104
105 } // namespace dart 105 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bit_vector.h ('k') | runtime/vm/block_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698