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

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

Issue 2377513007: [heap] Decouple SpaceIterator from ObjectIterator. (Closed)
Patch Set: Created 4 years, 3 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
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index 9499546850e55f5133daecb1286a52faadcdcb96..4cda545881209d7556de127f6bd36b028910f1e0 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -146,30 +146,12 @@ ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR
PagedSpace* Heap::paged_space(int idx) {
- switch (idx) {
- case OLD_SPACE:
- return old_space();
- case MAP_SPACE:
- return map_space();
- case CODE_SPACE:
- return code_space();
- case NEW_SPACE:
- case LO_SPACE:
- UNREACHABLE();
- }
- return NULL;
+ DCHECK_NE(idx, LO_SPACE);
+ DCHECK_NE(idx, NEW_SPACE);
+ return static_cast<PagedSpace*>(space_[idx]);
}
-Space* Heap::space(int idx) {
- switch (idx) {
- case NEW_SPACE:
- return new_space();
- case LO_SPACE:
- return lo_space();
- default:
- return paged_space(idx);
- }
-}
+Space* Heap::space(int idx) { return space_[idx]; }
Address* Heap::NewSpaceAllocationTopAddress() {
return new_space_->allocation_top_address();

Powered by Google App Engine
This is Rietveld 408576698