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

Side by Side Diff: src/heap/heap.cc

Issue 2088223002: [heap] Modernize all *Page iterators to be proper C++ iterators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unify w/ LargePageIterator Created 4 years, 6 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/array-buffer-tracker.cc ('k') | src/heap/incremental-marking.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 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 4641 matching lines...) Expand 10 before | Expand all | Expand 10 after
4652 mark_compact_collector()->VerifyWeakEmbeddedObjectsInCode(); 4652 mark_compact_collector()->VerifyWeakEmbeddedObjectsInCode();
4653 if (FLAG_omit_map_checks_for_leaf_maps) { 4653 if (FLAG_omit_map_checks_for_leaf_maps) {
4654 mark_compact_collector()->VerifyOmittedMapChecks(); 4654 mark_compact_collector()->VerifyOmittedMapChecks();
4655 } 4655 }
4656 } 4656 }
4657 #endif 4657 #endif
4658 4658
4659 4659
4660 void Heap::ZapFromSpace() { 4660 void Heap::ZapFromSpace() {
4661 if (!new_space_.IsFromSpaceCommitted()) return; 4661 if (!new_space_.IsFromSpaceCommitted()) return;
4662 NewSpacePageIterator it(new_space_.FromSpaceStart(), 4662 for (Page* page : NewSpacePageRange(new_space_.FromSpaceStart(),
4663 new_space_.FromSpaceEnd()); 4663 new_space_.FromSpaceEnd())) {
4664 while (it.has_next()) {
4665 Page* page = it.next();
4666 for (Address cursor = page->area_start(), limit = page->area_end(); 4664 for (Address cursor = page->area_start(), limit = page->area_end();
4667 cursor < limit; cursor += kPointerSize) { 4665 cursor < limit; cursor += kPointerSize) {
4668 Memory::Address_at(cursor) = kFromSpaceZapValue; 4666 Memory::Address_at(cursor) = kFromSpaceZapValue;
4669 } 4667 }
4670 } 4668 }
4671 } 4669 }
4672 4670
4673 void Heap::IteratePromotedObjectPointers(HeapObject* object, Address start, 4671 void Heap::IteratePromotedObjectPointers(HeapObject* object, Address start,
4674 Address end, bool record_slots, 4672 Address end, bool record_slots,
4675 ObjectSlotCallback callback) { 4673 ObjectSlotCallback callback) {
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
5372 PrintF("\n### Allocations = %u, hash = 0x%08x\n", allocations_count(), hash); 5370 PrintF("\n### Allocations = %u, hash = 0x%08x\n", allocations_count(), hash);
5373 } 5371 }
5374 5372
5375 5373
5376 void Heap::NotifyDeserializationComplete() { 5374 void Heap::NotifyDeserializationComplete() {
5377 deserialization_complete_ = true; 5375 deserialization_complete_ = true;
5378 #ifdef DEBUG 5376 #ifdef DEBUG
5379 // All pages right after bootstrapping must be marked as never-evacuate. 5377 // All pages right after bootstrapping must be marked as never-evacuate.
5380 PagedSpaces spaces(this); 5378 PagedSpaces spaces(this);
5381 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) { 5379 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) {
5382 PageIterator it(s); 5380 for (Page* p : *s) {
5383 while (it.has_next()) CHECK(it.next()->NeverEvacuate()); 5381 CHECK(p->NeverEvacuate());
5382 }
5384 } 5383 }
5385 #endif // DEBUG 5384 #endif // DEBUG
5386 } 5385 }
5387 5386
5388 void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { 5387 void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
5389 mark_compact_collector()->SetEmbedderHeapTracer(tracer); 5388 mark_compact_collector()->SetEmbedderHeapTracer(tracer);
5390 } 5389 }
5391 5390
5392 bool Heap::UsingEmbedderHeapTracer() { 5391 bool Heap::UsingEmbedderHeapTracer() {
5393 return mark_compact_collector()->UsingEmbedderHeapTracer(); 5392 return mark_compact_collector()->UsingEmbedderHeapTracer();
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
6380 } 6379 }
6381 6380
6382 6381
6383 // static 6382 // static
6384 int Heap::GetStaticVisitorIdForMap(Map* map) { 6383 int Heap::GetStaticVisitorIdForMap(Map* map) {
6385 return StaticVisitorBase::GetVisitorId(map); 6384 return StaticVisitorBase::GetVisitorId(map);
6386 } 6385 }
6387 6386
6388 } // namespace internal 6387 } // namespace internal
6389 } // namespace v8 6388 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/array-buffer-tracker.cc ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698