| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 top_frame_type(StackFrame::NONE) {} | 62 top_frame_type(StackFrame::NONE) {} |
| 63 void Init(Isolate* isolate, const RegisterState& state); | 63 void Init(Isolate* isolate, const RegisterState& state); |
| 64 StateTag state; // The state of the VM. | 64 StateTag state; // The state of the VM. |
| 65 Address pc; // Instruction pointer. | 65 Address pc; // Instruction pointer. |
| 66 union { | 66 union { |
| 67 Address tos; // Top stack value (*sp). | 67 Address tos; // Top stack value (*sp). |
| 68 Address external_callback; | 68 Address external_callback; |
| 69 }; | 69 }; |
| 70 static const int kMaxFramesCount = 64; | 70 static const int kMaxFramesCount = 64; |
| 71 Address stack[kMaxFramesCount]; // Call stack. | 71 Address stack[kMaxFramesCount]; // Call stack. |
| 72 TimeTicks timestamp; |
| 72 int frames_count : 8; // Number of captured frames. | 73 int frames_count : 8; // Number of captured frames. |
| 73 bool has_external_callback : 1; | 74 bool has_external_callback : 1; |
| 74 StackFrame::Type top_frame_type : 4; | 75 StackFrame::Type top_frame_type : 4; |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 class Sampler { | 78 class Sampler { |
| 78 public: | 79 public: |
| 79 // Initializes the Sampler support. Called once at VM startup. | 80 // Initializes the Sampler support. Called once at VM startup. |
| 80 static void SetUp(); | 81 static void SetUp(); |
| 81 static void TearDown(); | 82 static void TearDown(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 bool is_counting_samples_; | 142 bool is_counting_samples_; |
| 142 // Counts stack samples taken in JS VM state. | 143 // Counts stack samples taken in JS VM state. |
| 143 unsigned js_and_external_sample_count_; | 144 unsigned js_and_external_sample_count_; |
| 144 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 145 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 | 148 |
| 148 } } // namespace v8::internal | 149 } } // namespace v8::internal |
| 149 | 150 |
| 150 #endif // V8_SAMPLER_H_ | 151 #endif // V8_SAMPLER_H_ |
| OLD | NEW |