Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: src/heap/mark-compact.h

Issue 2186863005: [heap] Reland "Remove black pages and use black areas instead." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: filter out live fillers Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MARK_COMPACT_H_ 5 #ifndef V8_HEAP_MARK_COMPACT_H_
6 #define V8_HEAP_MARK_COMPACT_H_ 6 #define V8_HEAP_MARK_COMPACT_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 inline Address CurrentCellBase() { 213 inline Address CurrentCellBase() {
214 DCHECK(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex( 214 DCHECK(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex(
215 chunk_->AddressToMarkbitIndex(cell_base_)))); 215 chunk_->AddressToMarkbitIndex(cell_base_))));
216 return cell_base_; 216 return cell_base_;
217 } 217 }
218 218
219 inline void Advance() { 219 inline void Advance() {
220 cell_index_++; 220 cell_index_++;
221 cell_base_ += 32 * kPointerSize; 221 cell_base_ += Bitmap::kBitsPerCell * kPointerSize;
222 }
223
224 inline bool Advance(unsigned int new_cell_index) {
225 if (new_cell_index != cell_index_) {
226 DCHECK_GT(new_cell_index, cell_index_);
227 DCHECK_LE(new_cell_index, last_cell_index_);
228 unsigned int diff = new_cell_index - cell_index_;
229 cell_index_ = new_cell_index;
230 cell_base_ += diff * (Bitmap::kBitsPerCell * kPointerSize);
231 return true;
232 }
233 return false;
222 } 234 }
223 235
224 // Return the next mark bit cell. If there is no next it returns 0; 236 // Return the next mark bit cell. If there is no next it returns 0;
225 inline MarkBit::CellType PeekNext() { 237 inline MarkBit::CellType PeekNext() {
226 if (HasNext()) { 238 if (HasNext()) {
227 return cells_[cell_index_ + 1]; 239 return cells_[cell_index_ + 1];
228 } 240 }
229 return 0; 241 return 0;
230 } 242 }
231 243
(...skipping 14 matching lines...) Expand all
246 }; 258 };
247 259
248 template <LiveObjectIterationMode T> 260 template <LiveObjectIterationMode T>
249 class LiveObjectIterator BASE_EMBEDDED { 261 class LiveObjectIterator BASE_EMBEDDED {
250 public: 262 public:
251 explicit LiveObjectIterator(MemoryChunk* chunk) 263 explicit LiveObjectIterator(MemoryChunk* chunk)
252 : chunk_(chunk), 264 : chunk_(chunk),
253 it_(chunk_), 265 it_(chunk_),
254 cell_base_(it_.CurrentCellBase()), 266 cell_base_(it_.CurrentCellBase()),
255 current_cell_(*it_.CurrentCell()) { 267 current_cell_(*it_.CurrentCell()) {
256 // Black pages can not be iterated.
257 DCHECK(!chunk->IsFlagSet(Page::BLACK_PAGE));
258 } 268 }
259 269
260 HeapObject* Next(); 270 HeapObject* Next();
261 271
262 private: 272 private:
263 MemoryChunk* chunk_; 273 MemoryChunk* chunk_;
264 MarkBitCellIterator it_; 274 MarkBitCellIterator it_;
265 Address cell_base_; 275 Address cell_base_;
266 MarkBit::CellType current_cell_; 276 MarkBit::CellType current_cell_;
267 }; 277 };
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 private: 771 private:
762 MarkCompactCollector* collector_; 772 MarkCompactCollector* collector_;
763 }; 773 };
764 774
765 775
766 const char* AllocationSpaceName(AllocationSpace space); 776 const char* AllocationSpaceName(AllocationSpace space);
767 } // namespace internal 777 } // namespace internal
768 } // namespace v8 778 } // namespace v8
769 779
770 #endif // V8_HEAP_MARK_COMPACT_H_ 780 #endif // V8_HEAP_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698