OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/atomic-utils.h" | 9 #include "src/atomic-utils.h" |
10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 if (cells()[i] != 0) { | 257 if (cells()[i] != 0) { |
258 return false; | 258 return false; |
259 } | 259 } |
260 } | 260 } |
261 return true; | 261 return true; |
262 } | 262 } |
263 | 263 |
264 // Clears all bits starting from {cell_base_index} up to and excluding | 264 // Clears all bits starting from {cell_base_index} up to and excluding |
265 // {index}. Note that {cell_base_index} is required to be cell aligned. | 265 // {index}. Note that {cell_base_index} is required to be cell aligned. |
266 void ClearRange(uint32_t cell_base_index, uint32_t index) { | 266 void ClearRange(uint32_t cell_base_index, uint32_t index) { |
267 DCHECK_EQ(IndexInCell(cell_base_index), 0); | 267 DCHECK_EQ(IndexInCell(cell_base_index), 0u); |
268 DCHECK_GE(index, cell_base_index); | 268 DCHECK_GE(index, cell_base_index); |
269 uint32_t start_cell_index = IndexToCell(cell_base_index); | 269 uint32_t start_cell_index = IndexToCell(cell_base_index); |
270 uint32_t end_cell_index = IndexToCell(index); | 270 uint32_t end_cell_index = IndexToCell(index); |
271 DCHECK_GE(end_cell_index, start_cell_index); | 271 DCHECK_GE(end_cell_index, start_cell_index); |
272 // Clear all cells till the cell containing the last index. | 272 // Clear all cells till the cell containing the last index. |
273 for (uint32_t i = start_cell_index; i < end_cell_index; i++) { | 273 for (uint32_t i = start_cell_index; i < end_cell_index; i++) { |
274 cells()[i] = 0; | 274 cells()[i] = 0; |
275 } | 275 } |
276 // Clear all bits in the last cell till the last bit before index. | 276 // Clear all bits in the last cell till the last bit before index. |
277 uint32_t clear_mask = ~((1u << IndexInCell(index)) - 1); | 277 uint32_t clear_mask = ~((1u << IndexInCell(index)) - 1); |
(...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3009 count = 0; | 3009 count = 0; |
3010 } | 3010 } |
3011 // Must be small, since an iteration is used for lookup. | 3011 // Must be small, since an iteration is used for lookup. |
3012 static const int kMaxComments = 64; | 3012 static const int kMaxComments = 64; |
3013 }; | 3013 }; |
3014 #endif | 3014 #endif |
3015 } // namespace internal | 3015 } // namespace internal |
3016 } // namespace v8 | 3016 } // namespace v8 |
3017 | 3017 |
3018 #endif // V8_HEAP_SPACES_H_ | 3018 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |