Chromium Code Reviews| Index: src/profiler/sampler.h |
| diff --git a/src/profiler/sampler.h b/src/profiler/sampler.h |
| index 04c8f0446cb940d1397e33e4247e87ad77759139..5ffce3c10a0c137361cd3226aff2954887871e75 100644 |
| --- a/src/profiler/sampler.h |
| +++ b/src/profiler/sampler.h |
| @@ -8,14 +8,14 @@ |
| #include "include/v8.h" |
| #include "src/base/atomicops.h" |
| -#include "src/base/platform/time.h" |
| -#include "src/frames.h" |
| +#include "src/base/macros.h" |
| #include "src/globals.h" |
| namespace v8 { |
| namespace internal { |
| class Isolate; |
| +struct TickSample; |
| // ---------------------------------------------------------------------------- |
| // Sampler |
| @@ -24,43 +24,6 @@ class Isolate; |
| // (if used for profiling) the program counter and stack pointer for |
| // the thread that created it. |
| -// TickSample captures the information collected for each sample. |
| -struct TickSample { |
| - // Internal profiling (with --prof + tools/$OS-tick-processor) wants to |
| - // include the runtime function we're calling. Externally exposed tick |
| - // samples don't care. |
| - enum RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame }; |
| - |
| - TickSample() |
| - : state(OTHER), |
| - pc(NULL), |
| - external_callback_entry(NULL), |
| - frames_count(0), |
| - has_external_callback(false), |
| - update_stats(true), |
| - top_frame_type(StackFrame::NONE) {} |
| - void Init(Isolate* isolate, const v8::RegisterState& state, |
| - RecordCEntryFrame record_c_entry_frame, bool update_stats); |
| - static void GetStackSample(Isolate* isolate, const v8::RegisterState& state, |
| - RecordCEntryFrame record_c_entry_frame, |
| - void** frames, size_t frames_limit, |
| - v8::SampleInfo* sample_info); |
| - StateTag state; // The state of the VM. |
| - Address pc; // Instruction pointer. |
| - union { |
| - Address tos; // Top stack value (*sp). |
| - Address external_callback_entry; |
| - }; |
| - 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; |
| - bool update_stats : 1; // Whether the sample should update aggregated stats. |
| - StackFrame::Type top_frame_type : 5; |
| -}; |
| - |
| class Sampler { |
| public: |
| // Initializes the Sampler support. Called once at VM startup. |
| @@ -142,7 +105,7 @@ class Sampler { |
| #if defined(USE_SIMULATOR) |
| -class SimulatorHelper : AllStatic { |
|
alph
2016/05/13 00:39:07
This should also stay along with TickSample in v8.
lpy
2016/05/13 21:29:04
Done.
alph
2016/05/13 21:38:40
Thanks. Looks even better now!
|
| +class SimulatorHelper { |
| public: |
| // Returns true if register values were successfully retrieved |
| // from the simulator, otherwise returns false. |