Commit ff57712b authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Remove OldSpaces iterator.

Bug: chromium:796896
Change-Id: I4bfff3595455ff1fe1ca0d83d264ecef140c056e
Reviewed-on: https://chromium-review.googlesource.com/839764
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50279}
parent d2a80528
......@@ -16,8 +16,8 @@ namespace internal {
static size_t CountTotalHolesSize(Heap* heap) {
size_t holes_size = 0;
OldSpaces spaces(heap);
for (OldSpace* space = spaces.next(); space != nullptr;
PagedSpaces spaces(heap);
for (PagedSpace* space = spaces.next(); space != nullptr;
space = spaces.next()) {
DCHECK_GE(holes_size + space->Waste() + space->Available(), holes_size);
holes_size += space->Waste() + space->Available();
......
......@@ -6086,18 +6086,6 @@ PagedSpace* PagedSpaces::next() {
}
}
OldSpace* OldSpaces::next() {
switch (counter_++) {
case OLD_SPACE:
return heap_->old_space();
case CODE_SPACE:
return heap_->code_space();
default:
return nullptr;
}
}
SpaceIterator::SpaceIterator(Heap* heap)
: heap_(heap), current_space_(FIRST_SPACE - 1) {}
......
......@@ -2724,24 +2724,10 @@ class VerifySmisVisitor : public RootVisitor {
void VisitRootPointers(Root root, Object** start, Object** end) override;
};
// Space iterator for iterating over all old spaces of the heap: Old space
// and code space. Returns each space in turn, and null when it is done.
class V8_EXPORT_PRIVATE OldSpaces BASE_EMBEDDED {
public:
explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_SPACE) {}
OldSpace* next();
private:
Heap* heap_;
int counter_;
};
// Space iterator for iterating over all the paged spaces of the heap: Map
// space, old space, code space and cell space. Returns
// each space in turn, and null when it is done.
class PagedSpaces BASE_EMBEDDED {
class V8_EXPORT_PRIVATE PagedSpaces BASE_EMBEDDED {
public:
explicit PagedSpaces(Heap* heap) : heap_(heap), counter_(OLD_SPACE) {}
PagedSpace* next();
......
......@@ -93,12 +93,13 @@ static int DumpHeapConstants(const char* argv0) {
n = #camel_name; \
i = i::Heap::k##camel_name##RootIndex; \
}
i::OldSpaces spit(heap);
i::PagedSpaces spit(heap);
i::PrintF("KNOWN_OBJECTS = {\n");
for (i::PagedSpace* s = spit.next(); s != NULL; s = spit.next()) {
i::HeapObjectIterator it(s);
// Code objects are generally platform-dependent.
if (s->identity() == i::CODE_SPACE) continue;
if (s->identity() == i::CODE_SPACE || s->identity() == i::MAP_SPACE)
continue;
const char* sname = AllocationSpaceName(s->identity());
for (i::Object* o = it.Next(); o != NULL; o = it.Next()) {
const char* n = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment