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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return allocation; | 206 return allocation; |
207 } | 207 } |
208 | 208 |
209 | 209 |
210 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { | 210 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { |
211 HeapProfiler* profiler = isolate_->heap_profiler(); | 211 HeapProfiler* profiler = isolate_->heap_profiler(); |
212 if (profiler->is_tracking_allocations()) { | 212 if (profiler->is_tracking_allocations()) { |
213 profiler->AllocationEvent(object->address(), size_in_bytes); | 213 profiler->AllocationEvent(object->address(), size_in_bytes); |
214 } | 214 } |
215 | 215 |
| 216 ++allocations_count_; |
| 217 |
216 if (FLAG_verify_predictable) { | 218 if (FLAG_verify_predictable) { |
217 ++allocations_count_; | |
218 | |
219 UpdateAllocationsHash(object); | 219 UpdateAllocationsHash(object); |
220 UpdateAllocationsHash(size_in_bytes); | 220 UpdateAllocationsHash(size_in_bytes); |
221 | 221 |
222 if ((FLAG_dump_allocations_digest_at_alloc > 0) && | 222 if ((FLAG_dump_allocations_digest_at_alloc > 0) && |
223 (--dump_allocations_hash_countdown_ == 0)) { | 223 (--dump_allocations_hash_countdown_ == 0)) { |
224 dump_allocations_hash_countdown_ = FLAG_dump_allocations_digest_at_alloc; | 224 dump_allocations_hash_countdown_ = FLAG_dump_allocations_digest_at_alloc; |
225 PrintAlloctionsHash(); | 225 PrintAlloctionsHash(); |
226 } | 226 } |
227 } | 227 } |
| 228 |
| 229 if (FLAG_trace_allocation_stack_interval > 0) { |
| 230 if (allocations_count_ % FLAG_trace_allocation_stack_interval == 0) { |
| 231 isolate()->PrintStack(stdout, Isolate::kPrintStackConcise); |
| 232 } |
| 233 } |
228 } | 234 } |
229 | 235 |
230 | 236 |
231 void Heap::OnMoveEvent(HeapObject* target, HeapObject* source, | 237 void Heap::OnMoveEvent(HeapObject* target, HeapObject* source, |
232 int size_in_bytes) { | 238 int size_in_bytes) { |
233 HeapProfiler* heap_profiler = isolate_->heap_profiler(); | 239 HeapProfiler* heap_profiler = isolate_->heap_profiler(); |
234 if (heap_profiler->is_tracking_object_moves()) { | 240 if (heap_profiler->is_tracking_object_moves()) { |
235 heap_profiler->ObjectMoveEvent(source->address(), target->address(), | 241 heap_profiler->ObjectMoveEvent(source->address(), target->address(), |
236 size_in_bytes); | 242 size_in_bytes); |
237 } | 243 } |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 687 |
682 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 688 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
683 for (Object** current = start; current < end; current++) { | 689 for (Object** current = start; current < end; current++) { |
684 CHECK((*current)->IsSmi()); | 690 CHECK((*current)->IsSmi()); |
685 } | 691 } |
686 } | 692 } |
687 } | 693 } |
688 } // namespace v8::internal | 694 } // namespace v8::internal |
689 | 695 |
690 #endif // V8_HEAP_HEAP_INL_H_ | 696 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |