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

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

Issue 2094753002: [heap] Use PageIterator in HeapObjectIterator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | src/heap/spaces.h » ('j') | src/heap/spaces.h » ('J')
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 5918 matching lines...) Expand 10 before | Expand all | Expand 10 after
5929 HeapObject* obj = NextObject(); 5929 HeapObject* obj = NextObject();
5930 while ((obj != nullptr) && (filter_->SkipObject(obj))) obj = NextObject(); 5930 while ((obj != nullptr) && (filter_->SkipObject(obj))) obj = NextObject();
5931 return obj; 5931 return obj;
5932 } 5932 }
5933 5933
5934 5934
5935 HeapObject* HeapIterator::NextObject() { 5935 HeapObject* HeapIterator::NextObject() {
5936 // No iterator means we are done. 5936 // No iterator means we are done.
5937 if (object_iterator_ == nullptr) return nullptr; 5937 if (object_iterator_ == nullptr) return nullptr;
5938 5938
5939 if (HeapObject* obj = object_iterator_->next_object()) { 5939 if (HeapObject* obj = object_iterator_->Next()) {
5940 // If the current iterator has more objects we are fine. 5940 // If the current iterator has more objects we are fine.
5941 return obj; 5941 return obj;
5942 } else { 5942 } else {
5943 // Go though the spaces looking for one that has objects. 5943 // Go though the spaces looking for one that has objects.
5944 while (space_iterator_->has_next()) { 5944 while (space_iterator_->has_next()) {
5945 object_iterator_ = space_iterator_->next(); 5945 object_iterator_ = space_iterator_->next();
5946 if (HeapObject* obj = object_iterator_->next_object()) { 5946 if (HeapObject* obj = object_iterator_->Next()) {
5947 return obj; 5947 return obj;
5948 } 5948 }
5949 } 5949 }
5950 } 5950 }
5951 // Done with the last space. 5951 // Done with the last space.
5952 object_iterator_ = nullptr; 5952 object_iterator_ = nullptr;
5953 return nullptr; 5953 return nullptr;
5954 } 5954 }
5955 5955
5956 5956
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
6380 } 6380 }
6381 6381
6382 6382
6383 // static 6383 // static
6384 int Heap::GetStaticVisitorIdForMap(Map* map) { 6384 int Heap::GetStaticVisitorIdForMap(Map* map) {
6385 return StaticVisitorBase::GetVisitorId(map); 6385 return StaticVisitorBase::GetVisitorId(map);
6386 } 6386 }
6387 6387
6388 } // namespace internal 6388 } // namespace internal
6389 } // namespace v8 6389 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | src/heap/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698