OLD | NEW |
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 #ifndef VM_BITMAP_H_ | 5 #ifndef VM_BITMAP_H_ |
6 #define VM_BITMAP_H_ | 6 #define VM_BITMAP_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
10 #include "vm/zone.h" | 10 #include "vm/zone.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Sets min..max (inclusive) to value. | 47 // Sets min..max (inclusive) to value. |
48 void SetRange(intptr_t min, intptr_t max, bool value); | 48 void SetRange(intptr_t min, intptr_t max, bool value); |
49 | 49 |
50 private: | 50 private: |
51 static const intptr_t kInitialSizeInBytes = 16; | 51 static const intptr_t kInitialSizeInBytes = 16; |
52 static const intptr_t kIncrementSizeInBytes = 16; | 52 static const intptr_t kIncrementSizeInBytes = 16; |
53 | 53 |
54 bool InRange(intptr_t offset) const { | 54 bool InRange(intptr_t offset) const { |
55 if (offset < 0) { | 55 if (offset < 0) { |
56 FATAL1("Fatal error in BitmapBuilder::InRange :" | 56 FATAL1("Fatal error in BitmapBuilder::InRange :" |
57 " invalid bit_offset, %"Pd"\n", offset); | 57 " invalid bit_offset, %" Pd "\n", offset); |
58 } | 58 } |
59 return (offset < length_); | 59 return (offset < length_); |
60 } | 60 } |
61 | 61 |
62 // Get/Set a bit that is known to be covered by the backing store. | 62 // Get/Set a bit that is known to be covered by the backing store. |
63 bool GetBit(intptr_t bit_offset) const; | 63 bool GetBit(intptr_t bit_offset) const; |
64 void SetBit(intptr_t bit_offset, bool value); | 64 void SetBit(intptr_t bit_offset, bool value); |
65 | 65 |
66 intptr_t length_; | 66 intptr_t length_; |
67 | 67 |
68 // Backing store for the bitmap. Reading bits beyond the backing store | 68 // Backing store for the bitmap. Reading bits beyond the backing store |
69 // (up to length_) is allowed and they are assumed to be false. | 69 // (up to length_) is allowed and they are assumed to be false. |
70 intptr_t data_size_in_bytes_; | 70 intptr_t data_size_in_bytes_; |
71 uint8_t* data_; | 71 uint8_t* data_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(BitmapBuilder); | 73 DISALLOW_COPY_AND_ASSIGN(BitmapBuilder); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace dart | 76 } // namespace dart |
77 | 77 |
78 #endif // VM_BITMAP_H_ | 78 #endif // VM_BITMAP_H_ |
OLD | NEW |