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 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Return the bit offset of the highest bit set. | 35 // Return the bit offset of the highest bit set. |
36 intptr_t Maximum() const; | 36 intptr_t Maximum() const; |
37 | 37 |
38 // Return the bit offset of the lowest bit set. | 38 // Return the bit offset of the lowest bit set. |
39 intptr_t Minimum() const; | 39 intptr_t Minimum() const; |
40 | 40 |
41 // Sets min..max (inclusive) to value. | 41 // Sets min..max (inclusive) to value. |
42 void SetRange(intptr_t min, intptr_t max, bool value); | 42 void SetRange(intptr_t min, intptr_t max, bool value); |
43 | 43 |
44 // Replicates the bit map setting of the passed in Stackmap object. | 44 // Replicates the bit map setting of the passed in Stackmap object. |
45 void SetBits(const Stackmap& bitmap); | 45 void SetBits(const Stackmap& stackmap); |
46 | 46 |
47 private: | 47 private: |
48 static const intptr_t kInitialSizeInBytes = 16; | 48 static const intptr_t kInitialSizeInBytes = 16; |
49 static const intptr_t kIncrementSizeInBytes = 16; | 49 static const intptr_t kIncrementSizeInBytes = 16; |
50 | 50 |
51 bool InRange(intptr_t offset) const { | 51 bool InRange(intptr_t offset) const { |
52 return (offset >= 0) && (offset < SizeInBits()); | 52 return (offset >= 0) && (offset < SizeInBits()); |
53 } | 53 } |
54 | 54 |
55 bool GetBit(intptr_t bit_offset) const; | 55 bool GetBit(intptr_t bit_offset) const; |
56 void SetBit(intptr_t bit_offset, bool value); | 56 void SetBit(intptr_t bit_offset, bool value); |
57 | 57 |
58 intptr_t size_in_bytes_; | 58 intptr_t size_in_bytes_; |
59 uint8_t bit_list_data_[kInitialSizeInBytes]; | 59 uint8_t bit_list_data_[kInitialSizeInBytes]; |
60 uint8_t* bit_list_; | 60 uint8_t* bit_list_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(BitmapBuilder); | 62 DISALLOW_COPY_AND_ASSIGN(BitmapBuilder); |
63 }; | 63 }; |
64 | 64 |
65 } // namespace dart | 65 } // namespace dart |
66 | 66 |
67 #endif // VM_BITMAP_H_ | 67 #endif // VM_BITMAP_H_ |
OLD | NEW |