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

Unified Diff: src/heap/spaces-inl.h

Issue 1725073003: Revert of Replace slots buffer with remembered set. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/spaces.cc ('k') | src/heap/store-buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index ccfb24f6e546d56b08e2dc6994190026a156ee89..515a2027693c7d46954733df88e552dd225ef0ea 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -147,19 +147,6 @@
return NULL;
}
-// -----------------------------------------------------------------------------
-// LargePageIterator
-
-LargePageIterator::LargePageIterator(LargeObjectSpace* space)
- : next_page_(space->first_page()) {}
-
-LargePage* LargePageIterator::next() {
- LargePage* result = next_page_;
- if (next_page_ != nullptr) {
- next_page_ = next_page_->next_page();
- }
- return result;
-}
// -----------------------------------------------------------------------------
// MemoryAllocator
@@ -321,15 +308,15 @@
return static_cast<Page*>(MemoryChunk::FromAnyPointerAddress(heap, addr));
}
-MemoryChunkIterator::MemoryChunkIterator(Heap* heap, Mode mode)
+
+PointerChunkIterator::PointerChunkIterator(Heap* heap)
: state_(kOldSpaceState),
- mode_(mode),
old_iterator_(heap->old_space()),
- code_iterator_(heap->code_space()),
map_iterator_(heap->map_space()),
lo_iterator_(heap->lo_space()) {}
-MemoryChunk* MemoryChunkIterator::next() {
+
+MemoryChunk* PointerChunkIterator::next() {
switch (state_) {
case kOldSpaceState: {
if (old_iterator_.has_next()) {
@@ -339,34 +326,33 @@
// Fall through.
}
case kMapState: {
- if (mode_ != ALL_BUT_MAP_SPACE && map_iterator_.has_next()) {
+ if (map_iterator_.has_next()) {
return map_iterator_.next();
- }
- state_ = kCodeState;
- // Fall through.
- }
- case kCodeState: {
- if (mode_ != ALL_BUT_CODE_SPACE && code_iterator_.has_next()) {
- return code_iterator_.next();
}
state_ = kLargeObjectState;
// Fall through.
}
case kLargeObjectState: {
- MemoryChunk* answer = lo_iterator_.next();
- if (answer != nullptr) {
- return answer;
- }
- state_ = kFinishedState;
- // Fall through;
+ HeapObject* heap_object;
+ do {
+ heap_object = lo_iterator_.Next();
+ if (heap_object == NULL) {
+ state_ = kFinishedState;
+ return NULL;
+ }
+ // Fixed arrays are the only pointer-containing objects in large
+ // object space.
+ } while (!heap_object->IsFixedArray());
+ MemoryChunk* answer = MemoryChunk::FromAddress(heap_object->address());
+ return answer;
}
case kFinishedState:
- return nullptr;
+ return NULL;
default:
break;
}
UNREACHABLE();
- return nullptr;
+ return NULL;
}
« no previous file with comments | « src/heap/spaces.cc ('k') | src/heap/store-buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698