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

Side by Side Diff: src/heap/spaces-inl.h

Issue 2139133003: [heap] Untangle Marking and friends from heap dependencies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix comment formatting Created 4 years, 5 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/spaces.cc ('k') | src/v8.gyp » ('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 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_INL_H_ 5 #ifndef V8_HEAP_SPACES_INL_H_
6 #define V8_HEAP_SPACES_INL_H_ 6 #define V8_HEAP_SPACES_INL_H_
7 7
8 #include "src/heap/incremental-marking.h" 8 #include "src/heap/incremental-marking.h"
9 #include "src/heap/spaces.h" 9 #include "src/heap/spaces.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 16 matching lines...) Expand all
27 operator++(); 27 operator++();
28 return tmp; 28 return tmp;
29 } 29 }
30 30
31 NewSpacePageRange::NewSpacePageRange(Address start, Address limit) 31 NewSpacePageRange::NewSpacePageRange(Address start, Address limit)
32 : range_(Page::FromAddress(start), 32 : range_(Page::FromAddress(start),
33 Page::FromAllocationAreaAddress(limit)->next_page()) { 33 Page::FromAllocationAreaAddress(limit)->next_page()) {
34 SemiSpace::AssertValidRange(start, limit); 34 SemiSpace::AssertValidRange(start, limit);
35 } 35 }
36 36
37 // -----------------------------------------------------------------------------
38 // Bitmap
39
40 void Bitmap::Clear(MemoryChunk* chunk) {
41 Bitmap* bitmap = chunk->markbits();
42 for (int i = 0; i < bitmap->CellsCount(); i++) bitmap->cells()[i] = 0;
43 chunk->ResetLiveBytes();
44 }
45
46 void Bitmap::SetAllBits(MemoryChunk* chunk) {
47 Bitmap* bitmap = chunk->markbits();
48 for (int i = 0; i < bitmap->CellsCount(); i++)
49 bitmap->cells()[i] = 0xffffffff;
50 }
51
52 37
53 // ----------------------------------------------------------------------------- 38 // -----------------------------------------------------------------------------
54 // SemiSpaceIterator 39 // SemiSpaceIterator
55 40
56 HeapObject* SemiSpaceIterator::Next() { 41 HeapObject* SemiSpaceIterator::Next() {
57 while (current_ != limit_) { 42 while (current_ != limit_) {
58 if (Page::IsAlignedToPageSize(current_)) { 43 if (Page::IsAlignedToPageSize(current_)) {
59 Page* page = Page::FromAllocationAreaAddress(current_); 44 Page* page = Page::FromAllocationAreaAddress(current_);
60 page = page->next_page(); 45 page = page->next_page();
61 DCHECK(!page->is_anchor()); 46 DCHECK(!page->is_anchor());
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 other->allocation_info_.Reset(nullptr, nullptr); 631 other->allocation_info_.Reset(nullptr, nullptr);
647 return true; 632 return true;
648 } 633 }
649 return false; 634 return false;
650 } 635 }
651 636
652 } // namespace internal 637 } // namespace internal
653 } // namespace v8 638 } // namespace v8
654 639
655 #endif // V8_HEAP_SPACES_INL_H_ 640 #endif // V8_HEAP_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698