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 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 8263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8274 } | 8274 } |
8275 | 8275 |
8276 | 8276 |
8277 SnapshotObjectId HeapProfiler::GetHeapStats(OutputStream* stream, | 8277 SnapshotObjectId HeapProfiler::GetHeapStats(OutputStream* stream, |
8278 int64_t* timestamp_us) { | 8278 int64_t* timestamp_us) { |
8279 i::HeapProfiler* heap_profiler = reinterpret_cast<i::HeapProfiler*>(this); | 8279 i::HeapProfiler* heap_profiler = reinterpret_cast<i::HeapProfiler*>(this); |
8280 return heap_profiler->PushHeapObjectsStats(stream, timestamp_us); | 8280 return heap_profiler->PushHeapObjectsStats(stream, timestamp_us); |
8281 } | 8281 } |
8282 | 8282 |
8283 | 8283 |
8284 bool HeapProfiler::StartSamplingHeapProfiler(uint64_t sample_interval, | |
8285 int stack_depth) { | |
8286 return reinterpret_cast<i::HeapProfiler*>(this) | |
8287 ->StartSamplingHeapProfiler(sample_interval, stack_depth); | |
8288 } | |
8289 | |
8290 | |
8291 void HeapProfiler::StopSamplingHeapProfiler() { | |
8292 reinterpret_cast<i::HeapProfiler*>(this)->StopSamplingHeapProfiler(); | |
8293 } | |
8294 | |
8295 | |
8296 AllocationProfile* HeapProfiler::GetAllocationProfile() { | |
8297 return reinterpret_cast<i::HeapProfiler*>(this)->GetAllocationProfile(); | |
8298 } | |
8299 | |
8300 | |
8301 void HeapProfiler::DeleteAllHeapSnapshots() { | 8284 void HeapProfiler::DeleteAllHeapSnapshots() { |
8302 reinterpret_cast<i::HeapProfiler*>(this)->DeleteAllSnapshots(); | 8285 reinterpret_cast<i::HeapProfiler*>(this)->DeleteAllSnapshots(); |
8303 } | 8286 } |
8304 | 8287 |
8305 | 8288 |
8306 void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id, | 8289 void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id, |
8307 WrapperInfoCallback callback) { | 8290 WrapperInfoCallback callback) { |
8308 reinterpret_cast<i::HeapProfiler*>(this)->DefineWrapperClass(class_id, | 8291 reinterpret_cast<i::HeapProfiler*>(this)->DefineWrapperClass(class_id, |
8309 callback); | 8292 callback); |
8310 } | 8293 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8554 Address callback_address = | 8537 Address callback_address = |
8555 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8538 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8556 VMState<EXTERNAL> state(isolate); | 8539 VMState<EXTERNAL> state(isolate); |
8557 ExternalCallbackScope call_scope(isolate, callback_address); | 8540 ExternalCallbackScope call_scope(isolate, callback_address); |
8558 callback(info); | 8541 callback(info); |
8559 } | 8542 } |
8560 | 8543 |
8561 | 8544 |
8562 } // namespace internal | 8545 } // namespace internal |
8563 } // namespace v8 | 8546 } // namespace v8 |
OLD | NEW |