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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // ----------------------------------------------------------------------------- | 82 // ----------------------------------------------------------------------------- |
83 // HeapObjectIterator | 83 // HeapObjectIterator |
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 = obj->Size(); |
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. | 94 // TODO(hpayer): Remove the debugging code. |
95 if (cur_addr_ > cur_end_) { | 95 if (cur_addr_ > cur_end_) { |
96 space_->heap()->isolate()->PushStackTraceAndDie(0xaaaaaaaa, obj, NULL, | 96 space_->heap()->isolate()->PushStackTraceAndDie(0xaaaaaaaa, obj, NULL, |
97 obj_size); | 97 obj_size); |
98 } | 98 } |
99 | 99 |
100 if (!obj->IsFiller()) { | 100 if (!obj->IsFiller()) { |
101 DCHECK_OBJECT_SIZE(obj_size); | 101 DCHECK_OBJECT_SIZE(obj_size); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 414 |
415 | 415 |
416 intptr_t LargeObjectSpace::Available() { | 416 intptr_t LargeObjectSpace::Available() { |
417 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 417 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
418 } | 418 } |
419 | 419 |
420 } | 420 } |
421 } // namespace v8::internal | 421 } // namespace v8::internal |
422 | 422 |
423 #endif // V8_HEAP_SPACES_INL_H_ | 423 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |