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

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

Issue 2377513007: [heap] Decouple SpaceIterator from ObjectIterator. (Closed)
Patch Set: rebase 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
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index dda9a89c988b47349b26d07b7920064d76a82c58..b5d785ff8deecce4ecfd0872f6312f29abd2744b 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();
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698