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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 278ace0a4fe8962aeda715ee6eecb0dde716f6aa..6faf4913ddfdaa2ba7dae1ecfc57418b2094c62d 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4659,10 +4659,8 @@ void Heap::Verify() {
void Heap::ZapFromSpace() {
if (!new_space_.IsFromSpaceCommitted()) return;
- NewSpacePageIterator it(new_space_.FromSpaceStart(),
- new_space_.FromSpaceEnd());
- while (it.has_next()) {
- Page* page = it.next();
+ for (Page* page : NewSpacePageRange(new_space_.FromSpaceStart(),
+ new_space_.FromSpaceEnd())) {
for (Address cursor = page->area_start(), limit = page->area_end();
cursor < limit; cursor += kPointerSize) {
Memory::Address_at(cursor) = kFromSpaceZapValue;
@@ -5379,8 +5377,9 @@ void Heap::NotifyDeserializationComplete() {
// All pages right after bootstrapping must be marked as never-evacuate.
PagedSpaces spaces(this);
for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) {
- PageIterator it(s);
- while (it.has_next()) CHECK(it.next()->NeverEvacuate());
+ for (Page* p : *s) {
+ CHECK(p->NeverEvacuate());
+ }
}
#endif // DEBUG
}
« 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