Changeset 43047 in webkit for trunk/JavaScriptCore/bytecode/SamplingTool.h
- Timestamp:
- Apr 30, 2009, 12:52:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/SamplingTool.h
r39993 r43047 39 39 namespace JSC { 40 40 41 class SamplingFlags { 42 public: 43 static void start(); 44 static void stop(); 45 46 #if ENABLE(SAMPLING_FLAGS) 47 static void setFlag(unsigned flag) 48 { 49 ASSERT(flag >= 1); 50 ASSERT(flag <= 32); 51 s_flags |= 1u << (flag - 1); 52 } 53 54 static void clearFlag(unsigned flag) 55 { 56 ASSERT(flag >= 1); 57 ASSERT(flag <= 32); 58 s_flags &= ~(1u << (flag - 1)); 59 } 60 61 static void sample(); 62 #endif 63 private: 64 static uint32_t s_flags; 65 #if ENABLE(SAMPLING_FLAGS) 66 static uint64_t s_flagCounts[33]; 67 #endif 68 }; 69 41 70 class CodeBlock; 42 71 class ExecState; … … 74 103 typedef WTF::HashMap<ScopeNode*, ScopeSampleRecord*> ScopeSampleRecordMap; 75 104 105 class SamplingThread { 106 public: 107 // Sampling thread state. 108 static bool s_running; 109 static unsigned s_hertz; 110 static ThreadIdentifier s_samplingThread; 111 112 static void start(unsigned hertz=10000); 113 static void stop(); 114 115 static void* threadStartFunc(void*); 116 }; 117 76 118 class SamplingTool { 77 119 public: … … 128 170 SamplingTool(Interpreter* interpreter) 129 171 : m_interpreter(interpreter) 130 , m_running(false)131 172 , m_codeBlock(0) 132 173 , m_sample(0) … … 144 185 } 145 186 146 void start(unsigned hertz=10000); 147 void stop(); 187 void setup(); 148 188 void dump(ExecState*); 149 189 … … 165 205 return reinterpret_cast<void*>(reinterpret_cast<intptr_t>(vPC) | (static_cast<intptr_t>(inCTIFunction) << 1) | static_cast<intptr_t>(inHostFunction)); 166 206 } 207 208 static void sample(); 167 209 168 210 private: … … 185 227 CodeBlock* m_codeBlock; 186 228 }; 187 188 static void* threadStartFunc(void*);189 void run();229 230 void doRun(); 231 static SamplingTool* s_samplingTool; 190 232 191 233 Interpreter* m_interpreter; 192 234 193 // Sampling thread state.194 bool m_running;195 unsigned m_hertz;196 ThreadIdentifier m_samplingThread;197 198 235 // State tracked by the main thread, used by the sampling thread. 199 236 CodeBlock* m_codeBlock;
Note:
See TracChangeset
for help on using the changeset viewer.