Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: src/api.cc

Issue 1555553002: [profiler] Implement POC Sampling Heap Profiler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove commented code Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 AllocationProfile::Node* AllocationProfile::GetRootNode() {
8302 return nodes.size() == 0 ? nullptr : &nodes.front();
8303 }
8304
8305
8284 void HeapProfiler::DeleteAllHeapSnapshots() { 8306 void HeapProfiler::DeleteAllHeapSnapshots() {
8285 reinterpret_cast<i::HeapProfiler*>(this)->DeleteAllSnapshots(); 8307 reinterpret_cast<i::HeapProfiler*>(this)->DeleteAllSnapshots();
8286 } 8308 }
8287 8309
8288 8310
8289 void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id, 8311 void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id,
8290 WrapperInfoCallback callback) { 8312 WrapperInfoCallback callback) {
8291 reinterpret_cast<i::HeapProfiler*>(this)->DefineWrapperClass(class_id, 8313 reinterpret_cast<i::HeapProfiler*>(this)->DefineWrapperClass(class_id,
8292 callback); 8314 callback);
8293 } 8315 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
8537 Address callback_address = 8559 Address callback_address =
8538 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8560 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8539 VMState<EXTERNAL> state(isolate); 8561 VMState<EXTERNAL> state(isolate);
8540 ExternalCallbackScope call_scope(isolate, callback_address); 8562 ExternalCallbackScope call_scope(isolate, callback_address);
8541 callback(info); 8563 callback(info);
8542 } 8564 }
8543 8565
8544 8566
8545 } // namespace internal 8567 } // namespace internal
8546 } // namespace v8 8568 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698