OLD | NEW |
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 Loading... |
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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 | 861 |
880 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 862 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
881 for (Object** current = start; current < end; current++) { | 863 for (Object** current = start; current < end; current++) { |
882 CHECK((*current)->IsSmi()); | 864 CHECK((*current)->IsSmi()); |
883 } | 865 } |
884 } | 866 } |
885 } // namespace internal | 867 } // namespace internal |
886 } // namespace v8 | 868 } // namespace v8 |
887 | 869 |
888 #endif // V8_HEAP_HEAP_INL_H_ | 870 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |