Ignore:
Timestamp:
Apr 16, 2008, 12:08:03 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Sam and Geoff.

-<rdar://problem/5770054> JavaScript profiler (10928)
Inital profiler prototype

  • GNUmakefile.am: Added new files to project
  • JavaScriptCore.pri: Ditto
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto
  • JavaScriptCore.xcodeproj/project.pbxproj: Ditto
  • JavaScriptCoreSources.bkl: Ditto
  • kjs/config.h: Put compiling flag in here.
  • kjs/function.cpp: Instrument calling the function eval(). (KJS::eval):
  • kjs/interpreter.cpp: Instrument evaluating global scopes. (KJS::Interpreter::evaluate):
  • kjs/object.cpp: Instrument JS function calls. (KJS::JSObject::call):
  • profiler: Added.
  • profiler/FunctionCallProfile.cpp: Added. (KJS::FunctionCallProfile::FunctionCallProfile): (KJS::FunctionCallProfile::~FunctionCallProfile): (KJS::FunctionCallProfile::willExecute): Call right before the JS function or executing context is executed to start the profiler's timer. (KJS::FunctionCallProfile::didExecute): Call right after the JS function or executing context is executed to stop the profiler's timer. (KJS::FunctionCallProfile::addChild): Add a child to the current FunctionCallProfile if it isn't already a child of the current FunctionalCallProfile. (KJS::FunctionCallProfile::findChild): Return the child that matches the given name if there is one. (KJS::FunctionCallProfile::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
  • profiler/FunctionCallProfile.h: Added. (KJS::FunctionCallProfile::FunctionCallProfile): (KJS::FunctionCallProfile::~FunctionCallProfile): (KJS::FunctionCallProfile::functionName): (KJS::FunctionCallProfile::microSecs):
  • profiler/Profiler.cpp: Added. (KJS::Profiler::profiler): (KJS::Profiler::sharedProfiler): Return global singleton (may change due to multi-threading concerns) (KJS::Profiler::startProfiling): Don't start collecting profiling information until the user starts the profiler. Also don't clear old prfiled data until the profiler is restarted. (KJS::Profiler::stopProfiling): Stop collecting profile information. (KJS::Profiler::willExecute): Same as above. (KJS::Profiler::didExecute): Same as above. (KJS::Profiler::insertStackNamesInTree): Follow the stack of the given names and if a sub-stack is not in the current tree, add it. (KJS::Profiler::getStackNames): Get the names from the different passed in parameters and order them as a stack. (KJS::Profiler::getFunctionName): Get the function name from the given parameter. (KJS::Profiler::printDataSampleStyle): Print the current profiled information in a format that matches sample's output. (KJS::Profiler::debugLog):
  • profiler/Profiler.h: Added. (KJS::Profiler::Profiler):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj

    r31861 r31949  
    883883                        </File>
    884884                </Filter>
     885                <Filter
     886                        Name="Profiler"
     887                        >
     888                        <File
     889                                RelativePath="..\..\profiler\FunctionCallProfile.cpp"
     890                                >
     891                        </File>
     892                        <File
     893                                RelativePath="..\..\profiler\FunctionCallProfile.h"
     894                                >
     895                        </File>
     896                        <File
     897                                RelativePath="..\..\profiler\Profiler.cpp"
     898                                >
     899                        </File>
     900                        <File
     901                                RelativePath="..\..\profiler\Profiler.h"
     902                                >
     903                        </File>
     904                </Filter>
    885905        </Files>
    886906        <Globals>
Note: See TracChangeset for help on using the changeset viewer.