Changeset 43395 in webkit for trunk/JavaScriptCore/bytecode
- Timestamp:
- May 8, 2009, 3:18:34 AM (16 years ago)
- Location:
- trunk/JavaScriptCore/bytecode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/SamplingTool.cpp
r43392 r43395 210 210 } 211 211 212 #if ENABLE(CODEBLOCK_SAMPLING) 212 213 void SamplingTool::notifyOfScope(ScopeNode* scope) 213 214 { … … 215 216 m_scopeSampleMap->set(scope, new ScopeSampleRecord(scope)); 216 217 } 218 #endif 217 219 218 220 void SamplingTool::setup() … … 234 236 }; 235 237 238 static int compareOpcodeIndicesSampling(const void* left, const void* right) 239 { 240 const OpcodeSampleInfo* leftSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(left); 241 const OpcodeSampleInfo* rightSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(right); 242 243 return (leftSampleInfo->count < rightSampleInfo->count) ? 1 : (leftSampleInfo->count > rightSampleInfo->count) ? -1 : 0; 244 } 245 246 #if ENABLE(CODEBLOCK_SAMPLING) 236 247 static int compareLineCountInfoSampling(const void* left, const void* right) 237 248 { … … 242 253 } 243 254 244 static int compareOpcodeIndicesSampling(const void* left, const void* right)245 {246 const OpcodeSampleInfo* leftSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(left);247 const OpcodeSampleInfo* rightSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(right);248 249 return (leftSampleInfo->count < rightSampleInfo->count) ? 1 : (leftSampleInfo->count > rightSampleInfo->count) ? -1 : 0;250 }251 252 255 static int compareScopeSampleRecords(const void* left, const void* right) 253 256 { … … 257 260 return (leftValue->m_sampleCount < rightValue->m_sampleCount) ? 1 : (leftValue->m_sampleCount > rightValue->m_sampleCount) ? -1 : 0; 258 261 } 262 #endif 259 263 260 264 void SamplingTool::dump(ExecState* exec) … … 308 312 printf("\tcti %% of self:\tcti count / sample count\n"); 309 313 314 #if ENABLE(CODEBLOCK_SAMPLING) 315 310 316 // (3) Build and sort 'codeBlockSamples' array. 311 317 … … 366 372 } 367 373 } 368 }369 370 374 #else 375 UNUSED_PARAM(exec); 376 #endif 377 } 378 379 #else 371 380 372 381 void SamplingTool::dump(ExecState*) -
trunk/JavaScriptCore/bytecode/SamplingTool.h
r43392 r43395 192 192 , m_sampleCount(0) 193 193 , m_opcodeSampleCount(0) 194 #if ENABLE(CODEBLOCK_SAMPLING) 194 195 , m_scopeSampleMap(new ScopeSampleRecordMap()) 196 #endif 195 197 { 196 198 memset(m_opcodeSamples, 0, sizeof(m_opcodeSamples)); … … 198 200 } 199 201 202 #if ENABLE(CODEBLOCK_SAMPLING) 200 203 ~SamplingTool() 201 204 { 202 205 deleteAllValues(*m_scopeSampleMap); 203 206 } 207 208 void notifyOfScope(ScopeNode* scope); 209 #endif 204 210 205 211 void setup(); 206 212 void dump(ExecState*); 207 208 void notifyOfScope(ScopeNode* scope);209 213 210 214 void sample(CodeBlock* codeBlock, Instruction* vPC) … … 261 265 unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs]; 262 266 267 #if ENABLE(CODEBLOCK_SAMPLING) 263 268 Mutex m_scopeSampleMapMutex; 264 269 OwnPtr<ScopeSampleRecordMap> m_scopeSampleMap; 270 #endif 265 271 }; 266 272
Note:
See TracChangeset
for help on using the changeset viewer.