Ignore:
Timestamp:
Jun 4, 2008, 11:53:10 AM (17 years ago)
Author:
[email protected]
Message:

2008-06-04 Kevin McCullough <[email protected]>

Reviewed by Geoff.

<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler.

  • This patch removes the use of recursion for the sort functions.
  • JavaScriptCore.exp: Change the signatures of the functions being exported.
  • profiler/Profile.cpp: (KJS::Profile::sort): This generic function will accept any of the static sort functions and apply them to the whole tree.
  • profiler/Profile.h: All of the sorting functions now call the new sort() function. (KJS::Profile::sortTotalTimeDescending): (KJS::Profile::sortTotalTimeAscending): (KJS::Profile::sortSelfTimeDescending): (KJS::Profile::sortSelfTimeAscending): (KJS::Profile::sortCallsDescending): (KJS::Profile::sortCallsAscending): (KJS::Profile::sortFunctionNameDescending): (KJS::Profile::sortFunctionNameAscending):
  • profiler/ProfileNode.cpp: (KJS::ProfileNode::ProfileNode): m_head used to point to the head node if this was the head node. It now points to null to make iteration easy (KJS::ProfileNode::willExecute): Now must check if m_head is null, this check used to happend in the constructor. (KJS::ProfileNode::stopProfiling): Again the check is slightly different to determine if this is the head. (KJS::ProfileNode::traverseNextNode): This function returns the next node in post order. (KJS::ProfileNode::sort): This generic function will sort according to the comparator passed in, then reset the children pointers to macth the new order.
  • profiler/ProfileNode.h: The sorting function were removed from the definition file and instead use the new generic sort() function (KJS::ProfileNode::totalPercent): because the head can now be empty we need to check here too for the head node. (KJS::ProfileNode::selfPercent): Ditto (KJS::ProfileNode::firstChild): This function is necessary for the iterative algorithm in Profile.cpp. (KJS::ProfileNode::sortTotalTimeDescending): (KJS::ProfileNode::sortTotalTimeAscending): (KJS::ProfileNode::sortSelfTimeDescending): (KJS::ProfileNode::sortSelfTimeAscending): (KJS::ProfileNode::sortCallsDescending): (KJS::ProfileNode::sortCallsAscending): (KJS::ProfileNode::sortFunctionNameDescending): (KJS::ProfileNode::sortFunctionNameAscending): (KJS::ProfileNode::childrenBegin): (KJS::ProfileNode::childrenEnd): (KJS::ProfileNode::totalTimeDescendingComparator): (KJS::ProfileNode::totalTimeAscendingComparator): (KJS::ProfileNode::selfTimeDescendingComparator): (KJS::ProfileNode::selfTimeAscendingComparator): (KJS::ProfileNode::callsDescendingComparator): (KJS::ProfileNode::callsAscendingComparator): (KJS::ProfileNode::functionNameDescendingComparator): (KJS::ProfileNode::functionNameAscendingComparator):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r34361 r34362  
    1616__ZN3KJS11JSImmediate8toObjectEPKNS_7JSValueEPNS_9ExecStateE
    1717__ZN3KJS11JSImmediate8toStringEPKNS_7JSValueE
    18 __ZN3KJS11ProfileNode10restoreAllEv
    19 __ZN3KJS11ProfileNode18sortCallsAscendingEv
    20 __ZN3KJS11ProfileNode19sortCallsDescendingEv
    21 __ZN3KJS11ProfileNode21sortSelfTimeAscendingEv
    22 __ZN3KJS11ProfileNode22sortSelfTimeDescendingEv
    23 __ZN3KJS11ProfileNode22sortTotalTimeAscendingEv
    24 __ZN3KJS11ProfileNode23sortTotalTimeDescendingEv
    25 __ZN3KJS11ProfileNode25sortFunctionNameAscendingEv
    26 __ZN3KJS11ProfileNode26sortFunctionNameDescendingEv
     18__ZN3KJS11ProfileNode4sortEPFbRKN3WTF6RefPtrIS0_EES5_E
    2719__ZN3KJS11ProfileNode5focusERKNS_14CallIdentifierEb
    2820__ZN3KJS11ProfileNode7excludeERKNS_14CallIdentifierE
     21__ZN3KJS11ProfileNode10restoreAllEv
    2922__ZN3KJS11ProgramNode6createEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm16EEEPNS4_INS3_6RefPtrINS_12FuncDeclNodeEEELm16EEEbb
    3023__ZN3KJS11PropertyMap11getLocationERKNS_10IdentifierE
     
    9689__ZN3KJS7CStringD1Ev
    9790__ZN3KJS7Machine13dumpCallFrameEPKNS_9CodeBlockEPNS_14ScopeChainNodeEPNS_12RegisterFileEPKNS_8RegisterE
     91__ZN3KJS7Profile4sortEPFvPNS_11ProfileNodeEE
    9892__ZN3KJS7UString3Rep11computeHashEPKti
    9993__ZN3KJS7UString3Rep4nullE
     
    150144__ZN3KJS9ExecStateC1EPNS_14JSGlobalObjectEPNS_8JSObjectEPNS_14ScopeChainNodeE
    151145__ZN3KJSeqERKNS_7UStringEPKc
     146__ZN3KJSgtERKNS_7UStringES2_
     147__ZN3KJSltERKNS_7UStringES2_
    152148__ZN3WTF10fastCallocEmm
    153149__ZN3WTF10fastMallocEm
Note: See TracChangeset for help on using the changeset viewer.