| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 friend class Heap; | 951 friend class Heap; |
| 952 }; | 952 }; |
| 953 | 953 |
| 954 | 954 |
| 955 class MarkBitCellIterator BASE_EMBEDDED { | 955 class MarkBitCellIterator BASE_EMBEDDED { |
| 956 public: | 956 public: |
| 957 explicit MarkBitCellIterator(MemoryChunk* chunk) | 957 explicit MarkBitCellIterator(MemoryChunk* chunk) |
| 958 : chunk_(chunk) { | 958 : chunk_(chunk) { |
| 959 last_cell_index_ = Bitmap::IndexToCell( | 959 last_cell_index_ = Bitmap::IndexToCell( |
| 960 Bitmap::CellAlignIndex( | 960 Bitmap::CellAlignIndex( |
| 961 chunk->AddressToMarkbitIndex(chunk->area_end()))); | 961 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); |
| 962 cell_base_ = chunk->area_start(); | 962 cell_base_ = chunk_->area_start(); |
| 963 cell_index_ = Bitmap::IndexToCell( | 963 cell_index_ = Bitmap::IndexToCell( |
| 964 Bitmap::CellAlignIndex( | 964 Bitmap::CellAlignIndex( |
| 965 chunk->AddressToMarkbitIndex(cell_base_))); | 965 chunk_->AddressToMarkbitIndex(cell_base_))); |
| 966 cells_ = chunk->markbits()->cells(); | 966 cells_ = chunk_->markbits()->cells(); |
| 967 } | 967 } |
| 968 | 968 |
| 969 inline bool Done() { return cell_index_ == last_cell_index_; } | 969 inline bool Done() { return cell_index_ == last_cell_index_; } |
| 970 | 970 |
| 971 inline bool HasNext() { return cell_index_ < last_cell_index_ - 1; } | 971 inline bool HasNext() { return cell_index_ < last_cell_index_ - 1; } |
| 972 | 972 |
| 973 inline MarkBit::CellType* CurrentCell() { | 973 inline MarkBit::CellType* CurrentCell() { |
| 974 ASSERT(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex( | 974 ASSERT(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
| 975 chunk_->AddressToMarkbitIndex(cell_base_)))); | 975 chunk_->AddressToMarkbitIndex(cell_base_)))); |
| 976 return &cells_[cell_index_]; | 976 return &cells_[cell_index_]; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 private: | 1010 private: |
| 1011 MarkCompactCollector* collector_; | 1011 MarkCompactCollector* collector_; |
| 1012 }; | 1012 }; |
| 1013 | 1013 |
| 1014 | 1014 |
| 1015 const char* AllocationSpaceName(AllocationSpace space); | 1015 const char* AllocationSpaceName(AllocationSpace space); |
| 1016 | 1016 |
| 1017 } } // namespace v8::internal | 1017 } } // namespace v8::internal |
| 1018 | 1018 |
| 1019 #endif // V8_MARK_COMPACT_H_ | 1019 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |