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

Side by Side Diff: src/heap/heap-inl.h

Issue 2377513007: [heap] Decouple SpaceIterator from ObjectIterator. (Closed)
Patch Set: rebase Created 4 years, 2 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 | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
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 #ifndef V8_HEAP_HEAP_INL_H_ 5 #ifndef V8_HEAP_HEAP_INL_H_
6 #define V8_HEAP_HEAP_INL_H_ 6 #define V8_HEAP_HEAP_INL_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 /* never in new space and never on a page that is being compacted. */ \ 139 /* never in new space and never on a page that is being compacted. */ \
140 DCHECK(!deserialization_complete() || \ 140 DCHECK(!deserialization_complete() || \
141 RootCanBeWrittenAfterInitialization(k##camel_name##RootIndex)); \ 141 RootCanBeWrittenAfterInitialization(k##camel_name##RootIndex)); \
142 DCHECK(k##camel_name##RootIndex >= kOldSpaceRoots || !InNewSpace(value)); \ 142 DCHECK(k##camel_name##RootIndex >= kOldSpaceRoots || !InNewSpace(value)); \
143 roots_[k##camel_name##RootIndex] = value; \ 143 roots_[k##camel_name##RootIndex] = value; \
144 } 144 }
145 ROOT_LIST(ROOT_ACCESSOR) 145 ROOT_LIST(ROOT_ACCESSOR)
146 #undef ROOT_ACCESSOR 146 #undef ROOT_ACCESSOR
147 147
148 PagedSpace* Heap::paged_space(int idx) { 148 PagedSpace* Heap::paged_space(int idx) {
149 switch (idx) { 149 DCHECK_NE(idx, LO_SPACE);
150 case OLD_SPACE: 150 DCHECK_NE(idx, NEW_SPACE);
151 return old_space(); 151 return static_cast<PagedSpace*>(space_[idx]);
152 case MAP_SPACE:
153 return map_space();
154 case CODE_SPACE:
155 return code_space();
156 case NEW_SPACE:
157 case LO_SPACE:
158 UNREACHABLE();
159 }
160 return NULL;
161 } 152 }
162 153
163 Space* Heap::space(int idx) { 154 Space* Heap::space(int idx) { return space_[idx]; }
164 switch (idx) {
165 case NEW_SPACE:
166 return new_space();
167 case LO_SPACE:
168 return lo_space();
169 default:
170 return paged_space(idx);
171 }
172 }
173 155
174 Address* Heap::NewSpaceAllocationTopAddress() { 156 Address* Heap::NewSpaceAllocationTopAddress() {
175 return new_space_->allocation_top_address(); 157 return new_space_->allocation_top_address();
176 } 158 }
177 159
178 Address* Heap::NewSpaceAllocationLimitAddress() { 160 Address* Heap::NewSpaceAllocationLimitAddress() {
179 return new_space_->allocation_limit_address(); 161 return new_space_->allocation_limit_address();
180 } 162 }
181 163
182 Address* Heap::OldSpaceAllocationTopAddress() { 164 Address* Heap::OldSpaceAllocationTopAddress() {
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 849
868 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { 850 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) {
869 for (Object** current = start; current < end; current++) { 851 for (Object** current = start; current < end; current++) {
870 CHECK((*current)->IsSmi()); 852 CHECK((*current)->IsSmi());
871 } 853 }
872 } 854 }
873 } // namespace internal 855 } // namespace internal
874 } // namespace v8 856 } // namespace v8
875 857
876 #endif // V8_HEAP_HEAP_INL_H_ 858 #endif // V8_HEAP_HEAP_INL_H_
OLDNEW
« 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