Changeset 93466 in webkit for trunk/Source/JavaScriptCore/bytecode
- Timestamp:
- Aug 19, 2011, 7:17:49 PM (14 years ago)
- Location:
- trunk/Source/JavaScriptCore/bytecode
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r93238 r93466 1433 1433 CodeBlock::~CodeBlock() 1434 1434 { 1435 #if ENABLE(VERBOSE_VALUE_PROFILE) 1436 printf("ValueProfile for %p:\n", this); 1437 for (unsigned i = 0; i < numberOfValueProfiles(); ++i) { 1438 ValueProfile* profile = valueProfile(i); 1439 if (profile->bytecodeOffset < 0) { 1440 ASSERT(profile->bytecodeOffset == -1); 1441 printf(" arg = %u: ", i + 1); 1442 } else 1443 printf(" bc = %d: ", profile->bytecodeOffset); 1444 printf("samples = %u, int32 = %u, double = %u, cell = %u\n", 1445 profile->numberOfSamples(), 1446 profile->probabilityOfInt32(), 1447 profile->probabilityOfDouble(), 1448 profile->probabilityOfCell()); 1449 } 1450 #endif 1451 1435 1452 #if ENABLE(JIT) 1436 1453 for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i) -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r93238 r93466 40 40 #include "RegExpObject.h" 41 41 #include "UString.h" 42 #include "ValueProfile.h" 42 43 #include <wtf/FastAllocBase.h> 43 44 #include <wtf/PassOwnPtr.h> 44 45 #include <wtf/RefPtr.h> 46 #include <wtf/SegmentedVector.h> 45 47 #include <wtf/Vector.h> 46 48 … … 382 384 MethodCallLinkInfo& methodCallLinkInfo(int index) { return m_methodCallLinkInfos[index]; } 383 385 #endif 386 387 #if ENABLE(VALUE_PROFILER) 388 ValueProfile* addValueProfile(int bytecodeOffset) 389 { 390 m_valueProfiles.append(ValueProfile(bytecodeOffset)); 391 return &m_valueProfiles.last(); 392 } 393 unsigned numberOfValueProfiles() { return m_valueProfiles.size(); } 394 ValueProfile* valueProfile(int index) { return &m_valueProfiles[index]; } 395 ValueProfile* valueProfileForBytecodeOffset(int bytecodeOffset) 396 { 397 return WTF::genericBinarySearch<ValueProfile, int, getValueProfileBytecodeOffset>(m_valueProfiles, m_valueProfiles.size(), bytecodeOffset); 398 } 399 #endif 400 384 401 unsigned globalResolveInfoCount() const 385 402 { … … 576 593 Vector<CallLinkInfo> m_callLinkInfos; 577 594 Vector<MethodCallLinkInfo> m_methodCallLinkInfos; 595 #endif 596 #if ENABLE(VALUE_PROFILER) 597 SegmentedVector<ValueProfile, 8> m_valueProfiles; 578 598 #endif 579 599
Note:
See TracChangeset
for help on using the changeset viewer.