OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef V8_SAMPLER_H_ | 5 #ifndef V8_SAMPLER_H_ |
6 #define V8_SAMPLER_H_ | 6 #define V8_SAMPLER_H_ |
7 | 7 |
8 #include "src/base/atomicops.h" | 8 #include "src/base/atomicops.h" |
9 #include "src/frames.h" | 9 #include "src/frames.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 void Init(Isolate* isolate, const RegisterState& state); | 40 void Init(Isolate* isolate, const RegisterState& state); |
41 StateTag state; // The state of the VM. | 41 StateTag state; // The state of the VM. |
42 Address pc; // Instruction pointer. | 42 Address pc; // Instruction pointer. |
43 union { | 43 union { |
44 Address tos; // Top stack value (*sp). | 44 Address tos; // Top stack value (*sp). |
45 Address external_callback; | 45 Address external_callback; |
46 }; | 46 }; |
47 static const unsigned kMaxFramesCountLog2 = 8; | 47 static const unsigned kMaxFramesCountLog2 = 8; |
48 static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1; | 48 static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1; |
49 Address stack[kMaxFramesCount]; // Call stack. | 49 Address stack[kMaxFramesCount]; // Call stack. |
50 TimeTicks timestamp; | 50 base::TimeTicks timestamp; |
51 unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames. | 51 unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames. |
52 bool has_external_callback : 1; | 52 bool has_external_callback : 1; |
53 StackFrame::Type top_frame_type : 4; | 53 StackFrame::Type top_frame_type : 4; |
54 }; | 54 }; |
55 | 55 |
56 class Sampler { | 56 class Sampler { |
57 public: | 57 public: |
58 // Initializes the Sampler support. Called once at VM startup. | 58 // Initializes the Sampler support. Called once at VM startup. |
59 static void SetUp(); | 59 static void SetUp(); |
60 static void TearDown(); | 60 static void TearDown(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 bool is_counting_samples_; | 120 bool is_counting_samples_; |
121 // Counts stack samples taken in JS VM state. | 121 // Counts stack samples taken in JS VM state. |
122 unsigned js_and_external_sample_count_; | 122 unsigned js_and_external_sample_count_; |
123 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 123 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
124 }; | 124 }; |
125 | 125 |
126 | 126 |
127 } } // namespace v8::internal | 127 } } // namespace v8::internal |
128 | 128 |
129 #endif // V8_SAMPLER_H_ | 129 #endif // V8_SAMPLER_H_ |
OLD | NEW |