| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 7c484de53ee1e537a8abeefdce1e0cab69e4952e..a0ddd6c635b949f73e01388e317fb0e92d9dd4db 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -11,6 +11,7 @@
|
| #include <cmath> // For isnan.
|
| #include "include/v8-debug.h"
|
| #include "include/v8-profiler.h"
|
| +#include "include/v8-sampler.h"
|
| #include "include/v8-testing.h"
|
| #include "src/assert-scope.h"
|
| #include "src/base/platform/platform.h"
|
| @@ -7425,6 +7426,23 @@ void HeapProfiler::SetRetainedObjectInfo(UniqueId id,
|
| reinterpret_cast<i::HeapProfiler*>(this)->SetRetainedObjectInfo(id, info);
|
| }
|
|
|
| +void Sampler::GetSample(Isolate* isolate,
|
| + unsigned max_frame_count,
|
| + Sample* sample) {
|
| + i::Isolate* isolate_ = reinterpret_cast<i::Isolate*>(isolate);
|
| +
|
| + i::CpuProfiler* profiler_ = isolate_->cpu_profiler();
|
| + if (profiler_ == NULL) return;
|
| +
|
| + i::ProfilerEventsProcessor* processor_ = profiler_->processor();
|
| + if (processor_ == NULL) return;
|
| +
|
| + i::Sampler* sampler_ = processor_->sampler();
|
| + if (sampler_ == NULL) return;
|
| +
|
| + sampler_->GetSample(reinterpret_cast<i::TickSample*>(sample),
|
| + max_frame_count);
|
| +}
|
|
|
| v8::Testing::StressType internal::Testing::stress_type_ =
|
| v8::Testing::kStressTypeOpt;
|
|
|