| 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_BIT_VECTOR_H_ | 5 #ifndef VM_BIT_VECTOR_H_ |
| 6 #define VM_BIT_VECTOR_H_ | 6 #define VM_BIT_VECTOR_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 24 matching lines...) Expand all Loading... |
| 35 return bit_index_; | 35 return bit_index_; |
| 36 } | 36 } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 BitVector* target_; | 39 BitVector* target_; |
| 40 intptr_t bit_index_; | 40 intptr_t bit_index_; |
| 41 intptr_t word_index_; | 41 intptr_t word_index_; |
| 42 uword current_word_; | 42 uword current_word_; |
| 43 | 43 |
| 44 friend class BitVector; | 44 friend class BitVector; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(Iterator); |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 explicit BitVector(intptr_t length) | 49 explicit BitVector(intptr_t length) |
| 48 : length_(length), | 50 : length_(length), |
| 49 data_length_(SizeFor(length)), | 51 data_length_(SizeFor(length)), |
| 50 data_(Isolate::Current()->current_zone()->Alloc<uword>(data_length_)) { | 52 data_(Isolate::Current()->current_zone()->Alloc<uword>(data_length_)) { |
| 51 ASSERT(length > 0); | 53 ASSERT(length > 0); |
| 52 Clear(); | 54 Clear(); |
| 53 } | 55 } |
| 54 | 56 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 intptr_t length_; | 113 intptr_t length_; |
| 112 intptr_t data_length_; | 114 intptr_t data_length_; |
| 113 uword* data_; | 115 uword* data_; |
| 114 | 116 |
| 115 DISALLOW_COPY_AND_ASSIGN(BitVector); | 117 DISALLOW_COPY_AND_ASSIGN(BitVector); |
| 116 }; | 118 }; |
| 117 | 119 |
| 118 } // namespace dart | 120 } // namespace dart |
| 119 | 121 |
| 120 #endif // VM_BIT_VECTOR_H_ | 122 #endif // VM_BIT_VECTOR_H_ |
| OLD | NEW |