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" |
11 #include "src/cpu-profiler.h" | |
12 #include "src/heap/heap.h" | 11 #include "src/heap/heap.h" |
13 #include "src/heap/store-buffer.h" | 12 #include "src/heap/store-buffer.h" |
14 #include "src/heap/store-buffer-inl.h" | 13 #include "src/heap/store-buffer-inl.h" |
15 #include "src/heap-profiler.h" | 14 #include "src/heap-profiler.h" |
16 #include "src/isolate.h" | 15 #include "src/isolate.h" |
17 #include "src/list-inl.h" | 16 #include "src/list-inl.h" |
18 #include "src/msan.h" | 17 #include "src/msan.h" |
19 #include "src/objects.h" | 18 #include "src/objects.h" |
20 | 19 |
21 namespace v8 { | 20 namespace v8 { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 234 } |
236 | 235 |
237 | 236 |
238 void Heap::OnMoveEvent(HeapObject* target, HeapObject* source, | 237 void Heap::OnMoveEvent(HeapObject* target, HeapObject* source, |
239 int size_in_bytes) { | 238 int size_in_bytes) { |
240 HeapProfiler* heap_profiler = isolate_->heap_profiler(); | 239 HeapProfiler* heap_profiler = isolate_->heap_profiler(); |
241 if (heap_profiler->is_tracking_object_moves()) { | 240 if (heap_profiler->is_tracking_object_moves()) { |
242 heap_profiler->ObjectMoveEvent(source->address(), target->address(), | 241 heap_profiler->ObjectMoveEvent(source->address(), target->address(), |
243 size_in_bytes); | 242 size_in_bytes); |
244 } | 243 } |
245 | 244 if (target->IsSharedFunctionInfo()) { |
246 if (isolate_->logger()->is_logging_code_events() || | 245 LOG_CODE_EVENT(isolate_, SharedFunctionInfoMoveEvent(source->address(), |
247 isolate_->cpu_profiler()->is_profiling()) { | 246 target->address())); |
248 if (target->IsSharedFunctionInfo()) { | |
249 PROFILE(isolate_, SharedFunctionInfoMoveEvent(source->address(), | |
250 target->address())); | |
251 } | |
252 } | 247 } |
253 | 248 |
254 if (FLAG_verify_predictable) { | 249 if (FLAG_verify_predictable) { |
255 ++allocations_count_; | 250 ++allocations_count_; |
256 | 251 |
257 UpdateAllocationsHash(source); | 252 UpdateAllocationsHash(source); |
258 UpdateAllocationsHash(target); | 253 UpdateAllocationsHash(target); |
259 UpdateAllocationsHash(size_in_bytes); | 254 UpdateAllocationsHash(size_in_bytes); |
260 | 255 |
261 if ((FLAG_dump_allocations_digest_at_alloc > 0) && | 256 if ((FLAG_dump_allocations_digest_at_alloc > 0) && |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 | 743 |
749 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 744 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
750 for (Object** current = start; current < end; current++) { | 745 for (Object** current = start; current < end; current++) { |
751 CHECK((*current)->IsSmi()); | 746 CHECK((*current)->IsSmi()); |
752 } | 747 } |
753 } | 748 } |
754 } | 749 } |
755 } // namespace v8::internal | 750 } // namespace v8::internal |
756 | 751 |
757 #endif // V8_HEAP_HEAP_INL_H_ | 752 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |