OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
7 | 7 |
8 #include "src/heap/spaces.h" | 8 #include "src/heap/spaces.h" |
9 #include "src/heap-profiler.h" | 9 #include "src/heap-profiler.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 HeapObject* HeapObjectIterator::FromCurrentPage() { | 84 HeapObject* HeapObjectIterator::FromCurrentPage() { |
85 while (cur_addr_ != cur_end_) { | 85 while (cur_addr_ != cur_end_) { |
86 if (cur_addr_ == space_->top() && cur_addr_ != space_->limit()) { | 86 if (cur_addr_ == space_->top() && cur_addr_ != space_->limit()) { |
87 cur_addr_ = space_->limit(); | 87 cur_addr_ = space_->limit(); |
88 continue; | 88 continue; |
89 } | 89 } |
90 HeapObject* obj = HeapObject::FromAddress(cur_addr_); | 90 HeapObject* obj = HeapObject::FromAddress(cur_addr_); |
91 int obj_size = (size_func_ == NULL) ? obj->Size() : size_func_(obj); | 91 int obj_size = (size_func_ == NULL) ? obj->Size() : size_func_(obj); |
92 cur_addr_ += obj_size; | 92 cur_addr_ += obj_size; |
93 DCHECK(cur_addr_ <= cur_end_); | 93 DCHECK(cur_addr_ <= cur_end_); |
| 94 // TODO(hpayer): Remove the debugging code. |
| 95 if (cur_addr_ > cur_end_) { |
| 96 space_->heap()->isolate()->PushStackTraceAndDie(0xaaaaaaaa, obj, NULL, |
| 97 obj_size); |
| 98 } |
| 99 |
94 if (!obj->IsFiller()) { | 100 if (!obj->IsFiller()) { |
95 DCHECK_OBJECT_SIZE(obj_size); | 101 DCHECK_OBJECT_SIZE(obj_size); |
96 return obj; | 102 return obj; |
97 } | 103 } |
98 } | 104 } |
99 return NULL; | 105 return NULL; |
100 } | 106 } |
101 | 107 |
102 | 108 |
103 // ----------------------------------------------------------------------------- | 109 // ----------------------------------------------------------------------------- |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 Map* map = object->map(); | 310 Map* map = object->map(); |
305 Heap* heap = object->GetHeap(); | 311 Heap* heap = object->GetHeap(); |
306 return map == heap->raw_unchecked_free_space_map() || | 312 return map == heap->raw_unchecked_free_space_map() || |
307 map == heap->raw_unchecked_one_pointer_filler_map() || | 313 map == heap->raw_unchecked_one_pointer_filler_map() || |
308 map == heap->raw_unchecked_two_pointer_filler_map(); | 314 map == heap->raw_unchecked_two_pointer_filler_map(); |
309 } | 315 } |
310 } | 316 } |
311 } // namespace v8::internal | 317 } // namespace v8::internal |
312 | 318 |
313 #endif // V8_HEAP_SPACES_INL_H_ | 319 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |