Skip to content
  • mark.lam@apple.com's avatar
    Added WTF::StackStats mechanism. · 6df1a804
    mark.lam@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=99805.
    
    Reviewed by Geoffrey Garen.
    
    Source/JavaScriptCore: 
    
    Added StackStats checkpoints and probes.
    
    * bytecompiler/BytecodeGenerator.h:
    (JSC::BytecodeGenerator::emitNode):
    (JSC::BytecodeGenerator::emitNodeInConditionContext):
    * heap/SlotVisitor.cpp:
    (JSC::SlotVisitor::append):
    (JSC::visitChildren):
    (JSC::SlotVisitor::donateKnownParallel):
    (JSC::SlotVisitor::drain):
    (JSC::SlotVisitor::drainFromShared):
    (JSC::SlotVisitor::mergeOpaqueRoots):
    (JSC::SlotVisitor::internalAppend):
    (JSC::SlotVisitor::harvestWeakReferences):
    (JSC::SlotVisitor::finalizeUnconditionalFinalizers):
    * interpreter/Interpreter.cpp:
    (JSC::Interpreter::execute):
    (JSC::Interpreter::executeCall):
    (JSC::Interpreter::executeConstruct):
    (JSC::Interpreter::prepareForRepeatCall):
    * parser/Parser.h:
    (JSC::Parser::canRecurse):
    * runtime/StringRecursionChecker.h:
    (StringRecursionChecker):
    
    Source/WebCore: 
    
    Added StackStats probes in layout methods.
    
    * dom/Document.cpp:
    (WebCore::Document::updateLayout):
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::layout):
    * rendering/RenderBox.cpp:
    (WebCore::RenderBox::layout):
    * rendering/RenderDialog.cpp:
    (WebCore::RenderDialog::layout):
    * rendering/RenderEmbeddedObject.cpp:
    (WebCore::RenderEmbeddedObject::layout):
    * rendering/RenderFlowThread.cpp:
    (WebCore::RenderFlowThread::layout):
    * rendering/RenderFrameSet.cpp:
    (WebCore::RenderFrameSet::layout):
    * rendering/RenderIFrame.cpp:
    (WebCore::RenderIFrame::layout):
    * rendering/RenderImage.cpp:
    (WebCore::RenderImage::layout):
    * rendering/RenderListBox.cpp:
    (WebCore::RenderListBox::layout):
    * rendering/RenderListItem.cpp:
    (WebCore::RenderListItem::layout):
    * rendering/RenderListMarker.cpp:
    (WebCore::RenderListMarker::layout):
    * rendering/RenderMedia.cpp:
    (WebCore::RenderMedia::layout):
    * rendering/RenderObject.cpp:
    (WebCore::RenderObject::layout):
    * rendering/RenderObject.h:
    * rendering/RenderRegion.cpp:
    (WebCore::RenderRegion::layout):
    * rendering/RenderReplaced.cpp:
    (WebCore::RenderReplaced::layout):
    * rendering/RenderReplica.cpp:
    (WebCore::RenderReplica::layout):
    * rendering/RenderRubyRun.cpp:
    (WebCore::RenderRubyRun::layoutSpecialExcludedChild):
    * rendering/RenderScrollbarPart.cpp:
    (WebCore::RenderScrollbarPart::layout):
    * rendering/RenderSlider.cpp:
    (WebCore::RenderSlider::layout):
    * rendering/RenderTable.cpp:
    (WebCore::RenderTable::layout):
    * rendering/RenderTableCell.cpp:
    (WebCore::RenderTableCell::layout):
    * rendering/RenderTableRow.cpp:
    (WebCore::RenderTableRow::layout):
    * rendering/RenderTableSection.cpp:
    (WebCore::RenderTableSection::layout):
    * rendering/RenderTextControlSingleLine.cpp:
    (WebCore::RenderTextControlSingleLine::layout):
    * rendering/RenderTextTrackCue.cpp:
    (WebCore::RenderTextTrackCue::layout):
    * rendering/RenderVideo.cpp:
    (WebCore::RenderVideo::layout):
    * rendering/RenderView.cpp:
    (WebCore::RenderView::layout):
    * rendering/RenderWidget.cpp:
    (WebCore::RenderWidget::layout):
    * rendering/svg/RenderSVGContainer.cpp:
    (WebCore::RenderSVGContainer::layout):
    * rendering/svg/RenderSVGForeignObject.cpp:
    (WebCore::RenderSVGForeignObject::layout):
    * rendering/svg/RenderSVGGradientStop.cpp:
    (WebCore::RenderSVGGradientStop::layout):
    * rendering/svg/RenderSVGHiddenContainer.cpp:
    (WebCore::RenderSVGHiddenContainer::layout):
    * rendering/svg/RenderSVGImage.cpp:
    (WebCore::RenderSVGImage::layout):
    * rendering/svg/RenderSVGResourceContainer.cpp:
    (WebCore::RenderSVGResourceContainer::layout):
    * rendering/svg/RenderSVGResourceMarker.cpp:
    (WebCore::RenderSVGResourceMarker::layout):
    * rendering/svg/RenderSVGRoot.cpp:
    (WebCore::RenderSVGRoot::layout):
    * rendering/svg/RenderSVGShape.cpp:
    (WebCore::RenderSVGShape::layout):
    * rendering/svg/RenderSVGText.cpp:
    (WebCore::RenderSVGText::layout):
    
    Source/WTF: 
    
    Disabled by default. Should have no performance and memory cost when
    disabled. To enable, #define ENABLE_STACK_STATS 1 in StackStats.h.
    The output is currently hardcoded to be dumped in /tmp/stack-stats.log,
    and is in the form of stack sample events. By default, it only logs
    a sample event when a new high watermark value is encountered.
    
    Also renamed StackBounds::recursiveCheck() to isSafeToRecurse().
    
    * WTF.xcodeproj/project.pbxproj:
    * wtf/StackBounds.h:
    (StackBounds):
    (WTF::StackBounds::size):
    (WTF::StackBounds::isSafeToRecurse):
    * wtf/StackStats.cpp: Added.
    (WTF):
    (WTF::StackStats::initialize):
    (WTF::StackStats::PerThreadStats::PerThreadStats):
    (WTF::StackStats::CheckPoint::CheckPoint):
    (WTF::StackStats::CheckPoint::~CheckPoint):
    (WTF::StackStats::probe):
    (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
    (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
    * wtf/StackStats.h: Added.
    (WTF):
    (StackStats):
    (CheckPoint):
    (WTF::StackStats::CheckPoint::CheckPoint):
    (PerThreadStats):
    (WTF::StackStats::PerThreadStats::PerThreadStats):
    (LayoutCheckPoint):
    (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
    (WTF::StackStats::initialize):
    (WTF::StackStats::probe):
    * wtf/ThreadingPthreads.cpp:
    (WTF::initializeThreading):
    * wtf/WTFThreadData.cpp:
    (WTF::WTFThreadData::WTFThreadData):
    * wtf/WTFThreadData.h:
    (WTFThreadData):
    (WTF::WTFThreadData::stackStats):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    6df1a804