Ignore:
Timestamp:
May 19, 2008, 3:15:30 PM (17 years ago)
Author:
[email protected]
Message:

2008-05-19 Kevin McCullough <[email protected]>

Reviewed by Tim.

<rdar://problem/5770054> JavaScript profiler (10928)
-In an effort to make the profiler as efficient as possible instead of
prepending to a vector we keep the vector in reverse order and operate
over it backwards.

  • profiler/Profile.cpp: (KJS::Profile::willExecute): (KJS::Profile::didExecute):
  • profiler/ProfileNode.cpp: (KJS::ProfileNode::didExecute): (KJS::ProfileNode::endAndRecordCall):
  • profiler/ProfileNode.h:
  • profiler/Profiler.cpp: (KJS::getStackNames):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/profiler/Profiler.cpp

    r33532 r33581  
    122122    for (ExecState* currentState = exec; currentState; currentState = currentState->callingExecState()) {
    123123        if (FunctionImp* functionImp = currentState->function())
    124             names.prepend(getFunctionName(functionImp));
     124            names.append(getFunctionName(functionImp));
    125125        else if (ScopeNode* scopeNode = currentState->scopeNode())
    126             names.prepend(Script + scopeNode->sourceURL() + ": " + UString::from(scopeNode->lineNo() + 1));   // FIXME: Why is the line number always off by one?
     126            names.append(Script + scopeNode->sourceURL() + ": " + UString::from(scopeNode->lineNo() + 1));   // FIXME: Why is the line number always off by one?
    127127    }
    128128}
     
    130130void getStackNames(Vector<UString>& names, ExecState* exec, JSObject* calledFunction)
    131131{
    132     getStackNames(names, exec);
    133132    if (calledFunction->inherits(&FunctionImp::info))
    134133        names.append(getFunctionName(static_cast<FunctionImp*>(calledFunction)));
    135134    else if (calledFunction->inherits(&InternalFunctionImp::info))
    136135        names.append(static_cast<InternalFunctionImp*>(calledFunction)->functionName().ustring());
     136    getStackNames(names, exec);
    137137}
    138138
     
    140140void getStackNames(Vector<UString>& names, ExecState* exec, const UString& sourceURL, int startingLineNumber)
    141141{
     142    names.append(Script + sourceURL + ": " + UString::from(startingLineNumber + 1));
    142143    getStackNames(names, exec);
    143     names.append(Script + sourceURL + ": " + UString::from(startingLineNumber + 1));
    144144}
    145145
Note: See TracChangeset for help on using the changeset viewer.