Ignore:
Timestamp:
Sep 2, 2014, 9:58:55 PM (11 years ago)
Author:
Brian Burg
Message:

LegacyProfiler: remove redundant ProfileNode members and other cleanup
https://bugs.webkit.org/show_bug.cgi?id=136380

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

ProfileNode's selfTime and totalTime members are redundant and only used
for dumping profile data from debug-only code. Remove the members and compute
the same data on-demand when necessary using a postorder traversal functor.

Remove ProfileNode.head since it is only used to calculate percentages for
dumped profile data. This can be explicitly passed around when needed.

Rename Profile.head to Profile.rootNode, and other various renamings.

Rearrange some header includes so that touching LegacyProfiler-related headers
will no longer cause a full rebuild.

  • inspector/JSConsoleClient.cpp: Add header include.
  • inspector/agents/InspectorProfilerAgent.cpp:

(Inspector::InspectorProfilerAgent::buildProfileInspectorObject):

  • inspector/protocol/Profiler.json: Remove unused Profile.idleTime member.
  • jit/JIT.h: Remove header include.
  • jit/JITCode.h: Remove header include.
  • jit/JITOperations.cpp: Sort and add header include.
  • llint/LLIntSlowPaths.cpp: Sort and add header include.
  • profiler/Profile.cpp: Rename the debug dumping functions. Move the node

postorder traversal code to ProfileNode so we can traverse any subtree.
(JSC::Profile::Profile):
(JSC::Profile::debugPrint):
(JSC::Profile::debugPrintSampleStyle):
(JSC::Profile::forEach): Deleted.
(JSC::Profile::debugPrintData): Deleted.
(JSC::Profile::debugPrintDataSampleStyle): Deleted.

  • profiler/Profile.h:
  • profiler/ProfileGenerator.cpp:

(JSC::ProfileGenerator::ProfileGenerator):
(JSC::AddParentForConsoleStartFunctor::AddParentForConsoleStartFunctor):
(JSC::AddParentForConsoleStartFunctor::operator()):
(JSC::ProfileGenerator::addParentForConsoleStart):
(JSC::ProfileGenerator::didExecute):
(JSC::StopProfilingFunctor::operator()):
(JSC::ProfileGenerator::stopProfiling):
(JSC::ProfileGenerator::removeProfileStart):
(JSC::ProfileGenerator::removeProfileEnd):

  • profiler/ProfileGenerator.h:
  • profiler/ProfileNode.cpp:

(JSC::ProfileNode::ProfileNode):
(JSC::ProfileNode::willExecute):
(JSC::ProfileNode::removeChild):
(JSC::ProfileNode::stopProfiling):
(JSC::ProfileNode::endAndRecordCall):
(JSC::ProfileNode::debugPrint):
(JSC::ProfileNode::debugPrintSampleStyle):
(JSC::ProfileNode::debugPrintRecursively):
(JSC::ProfileNode::debugPrintSampleStyleRecursively):
(JSC::ProfileNode::debugPrintData): Deleted.
(JSC::ProfileNode::debugPrintDataSampleStyle): Deleted.

  • profiler/ProfileNode.h: Calculate per-node self and total times using a postorder traversal.

The forEachNodePostorder functor traverses the subtree rooted at |this|.
(JSC::ProfileNode::create):
(JSC::ProfileNode::calls):
(JSC::ProfileNode::forEachNodePostorder):
(JSC::CalculateProfileSubtreeDataFunctor::returnValue):
(JSC::CalculateProfileSubtreeDataFunctor::operator()):
(JSC::ProfileNode::head): Deleted.
(JSC::ProfileNode::setHead): Deleted.
(JSC::ProfileNode::totalTime): Deleted.
(JSC::ProfileNode::setTotalTime): Deleted.
(JSC::ProfileNode::selfTime): Deleted.
(JSC::ProfileNode::setSelfTime): Deleted.
(JSC::ProfileNode::totalPercent): Deleted.
(JSC::ProfileNode::selfPercent): Deleted.

  • runtime/ConsoleClient.h: Remove header include.

Source/WebCore:

Remove Profile.idleTime, rename head to rootNode, and remove ProfileNode members.

Covered by existing tests.

  • inspector/ScriptProfile.idl:
  • inspector/ScriptProfileNode.idl:
  • inspector/TimelineRecordFactory.cpp:

Source/WebInspectorUI:

Remove unused Profile.idleTime member.

  • UserInterface/Models/Profile.js:

(WebInspector.Profile.prototype.get idleTime): Deleted.

  • UserInterface/Models/ScriptTimelineRecord.js:

(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload):

LayoutTests:

Renamed Profile.head to Profile.rootNode.

  • fast/profiler/resources/profiler-test-JS-resources.js:

(printHeavyProfilesDataWithoutTime):
(printProfilesDataWithoutTime):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r173198 r173199  
     12014-09-02  Brian J. Burg  <[email protected]>
     2
     3        LegacyProfiler: remove redundant ProfileNode members and other cleanup
     4        https://bugs.webkit.org/show_bug.cgi?id=136380
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        ProfileNode's selfTime and totalTime members are redundant and only used
     9        for dumping profile data from debug-only code. Remove the members and compute
     10        the same data on-demand when necessary using a postorder traversal functor.
     11
     12        Remove ProfileNode.head since it is only used to calculate percentages for
     13        dumped profile data. This can be explicitly passed around when needed.
     14
     15        Rename Profile.head to Profile.rootNode, and other various renamings.
     16
     17        Rearrange some header includes so that touching LegacyProfiler-related headers
     18        will no longer cause a full rebuild.
     19
     20        * inspector/JSConsoleClient.cpp: Add header include.
     21        * inspector/agents/InspectorProfilerAgent.cpp:
     22        (Inspector::InspectorProfilerAgent::buildProfileInspectorObject):
     23        * inspector/protocol/Profiler.json: Remove unused Profile.idleTime member.
     24        * jit/JIT.h: Remove header include.
     25        * jit/JITCode.h: Remove header include.
     26        * jit/JITOperations.cpp: Sort and add header include.
     27        * llint/LLIntSlowPaths.cpp: Sort and add header include.
     28        * profiler/Profile.cpp: Rename the debug dumping functions. Move the node
     29        postorder traversal code to ProfileNode so we can traverse any subtree.
     30        (JSC::Profile::Profile):
     31        (JSC::Profile::debugPrint):
     32        (JSC::Profile::debugPrintSampleStyle):
     33        (JSC::Profile::forEach): Deleted.
     34        (JSC::Profile::debugPrintData): Deleted.
     35        (JSC::Profile::debugPrintDataSampleStyle): Deleted.
     36        * profiler/Profile.h:
     37        * profiler/ProfileGenerator.cpp:
     38        (JSC::ProfileGenerator::ProfileGenerator):
     39        (JSC::AddParentForConsoleStartFunctor::AddParentForConsoleStartFunctor):
     40        (JSC::AddParentForConsoleStartFunctor::operator()):
     41        (JSC::ProfileGenerator::addParentForConsoleStart):
     42        (JSC::ProfileGenerator::didExecute):
     43        (JSC::StopProfilingFunctor::operator()):
     44        (JSC::ProfileGenerator::stopProfiling):
     45        (JSC::ProfileGenerator::removeProfileStart):
     46        (JSC::ProfileGenerator::removeProfileEnd):
     47        * profiler/ProfileGenerator.h:
     48        * profiler/ProfileNode.cpp:
     49        (JSC::ProfileNode::ProfileNode):
     50        (JSC::ProfileNode::willExecute):
     51        (JSC::ProfileNode::removeChild):
     52        (JSC::ProfileNode::stopProfiling):
     53        (JSC::ProfileNode::endAndRecordCall):
     54        (JSC::ProfileNode::debugPrint):
     55        (JSC::ProfileNode::debugPrintSampleStyle):
     56        (JSC::ProfileNode::debugPrintRecursively):
     57        (JSC::ProfileNode::debugPrintSampleStyleRecursively):
     58        (JSC::ProfileNode::debugPrintData): Deleted.
     59        (JSC::ProfileNode::debugPrintDataSampleStyle): Deleted.
     60        * profiler/ProfileNode.h: Calculate per-node self and total times using a postorder traversal.
     61        The forEachNodePostorder functor traverses the subtree rooted at |this|.
     62        (JSC::ProfileNode::create):
     63        (JSC::ProfileNode::calls):
     64        (JSC::ProfileNode::forEachNodePostorder):
     65        (JSC::CalculateProfileSubtreeDataFunctor::returnValue):
     66        (JSC::CalculateProfileSubtreeDataFunctor::operator()):
     67        (JSC::ProfileNode::head): Deleted.
     68        (JSC::ProfileNode::setHead): Deleted.
     69        (JSC::ProfileNode::totalTime): Deleted.
     70        (JSC::ProfileNode::setTotalTime): Deleted.
     71        (JSC::ProfileNode::selfTime): Deleted.
     72        (JSC::ProfileNode::setSelfTime): Deleted.
     73        (JSC::ProfileNode::totalPercent): Deleted.
     74        (JSC::ProfileNode::selfPercent): Deleted.
     75        * runtime/ConsoleClient.h: Remove header include.
     76
    1772014-09-02  Brian J. Burg  <[email protected]>
    278
Note: See TracChangeset for help on using the changeset viewer.