| Index: src/sampler.h
|
| diff --git a/src/sampler.h b/src/sampler.h
|
| index c3dce4ed7c2fec7e353cb06d1641f63e82092a84..1a6c358ae9add0bfd0eb6a6284ab8196d5a3ef74 100644
|
| --- a/src/sampler.h
|
| +++ b/src/sampler.h
|
| @@ -32,23 +32,27 @@ struct RegisterState {
|
| struct TickSample {
|
| TickSample()
|
| : state(OTHER),
|
| + frames_count(0),
|
| pc(NULL),
|
| external_callback(NULL),
|
| - frames_count(0),
|
| has_external_callback(false),
|
| top_frame_type(StackFrame::NONE) {}
|
| - void Init(Isolate* isolate, const RegisterState& state);
|
| - StateTag state; // The state of the VM.
|
| + static const unsigned kMaxFramesCountLog2 = 8;
|
| + static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1;
|
| +
|
| + StateTag state; // The state of the VM.
|
| + Address stack[kMaxFramesCount]; // Call stack.
|
| + unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames.
|
| +
|
| + void Init(Isolate* isolate,
|
| + const RegisterState& state,
|
| + unsigned max_frame_count = kMaxFramesCount);
|
| Address pc; // Instruction pointer.
|
| union {
|
| Address tos; // Top stack value (*sp).
|
| Address external_callback;
|
| };
|
| - static const unsigned kMaxFramesCountLog2 = 8;
|
| - static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1;
|
| - Address stack[kMaxFramesCount]; // Call stack.
|
| base::TimeTicks timestamp;
|
| - unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames.
|
| bool has_external_callback : 1;
|
| StackFrame::Type top_frame_type : 4;
|
| };
|
| @@ -85,6 +89,7 @@ class Sampler {
|
| bool IsActive() const { return base::NoBarrier_Load(&active_); }
|
|
|
| void DoSample();
|
| + void GetSample(TickSample* sample, unsigned max_frame_count);
|
| // If true next sample must be initiated on the profiler event processor
|
| // thread right after latest sample is processed.
|
| void SetHasProcessingThread(bool value) {
|
| @@ -120,6 +125,8 @@ class Sampler {
|
| bool is_counting_samples_;
|
| // Counts stack samples taken in JS VM state.
|
| unsigned js_and_external_sample_count_;
|
| + void CaptureRegisterState_();
|
| + void CaptureRegisterState_(RegisterState* state, bool* captured_successfully);
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
|
| };
|
|
|
|
|